text:
Q: 404 NOT FOUND (error code : 1008) : Unknown message I am making a bot in python using discord.py , i was trying delete the command when it is executed
it is working but giving me a error and the error is

Ignoring exception in on_message
Traceback (most recent call last):
File "C:\Users\Dell\AppData\Local\Programs\Python\Python38\lib\site-packages\discord\client.py",
line 312, in _run_event
await coro(*args, **kwargs)
File "C:/Users/Dell/Desktop/test_bot/add_role.py", line 25, in on_message
msg = await message.channel.fetch_message(761275239346339871)
File "C:\Users\Dell\AppData\Local\Programs\Python\Python38\lib\site-packages\discord\abc.py",
line 956, in fetch_message
data = await self._state.http.get_message(channel.id, id)
File "C:\Users\Dell\AppData\Local\Programs\Python\Python38\lib\site-packages\discord\http.py",
line 243, in request
raise NotFound(r, data)
discord.errors.NotFound: 404 Not Found (error code: 10008): Unknown Message

After giving the error also it works , but i want to know what rises the error
code :
msg = await message.channel.fetch_message(761275239346339871)
await msg.delete()

A: The problem is, The message id that you inputted has already been deleted. If you want to delete the author message just do
await ctx.message.delete()

if you want to delete the inputted message by wait_for you can do this
msg = await client.wait_for('message', check=lambda message: message.author == ctx.author)
await msg.delete()

if on_message.
@client.event
async def on_message(message):
    message = await message.channel.send(message here)
    await message.delete()


text:
Q: How do I specifie pre installation script for debian package with Install4j I will generate an debian package from Install4j. In the GUI we can specify an pre installation script and a post installation script.
The post installation script work fine, but the pre installation script don't work, i.e Install4j don't generate a preinst in the .deb file.
The script I want to use for pre installation script :

    #!/bin/sh
    echo "reading additionnal repository"
    IN=${compiler:SOFT_DEPENDENCIES_DEB_32}
    echo $IN

    OIFS=$IFS
    IFS=';'
    arr2=$IN
    for repo in $arr2
    do
        nbRepoPresent=$(egrep -c $repo /etc/apt/sources.list)
        if [ $nbRepoPresent -lt 1 ]; then
        echo "adding additionnal repository $repo"
        sudo add-apt-repository "deb $repo"
        fi
    done
    IFS=$OIFS

Is it a bug or my code is wrong ?

A: This is a bug in the current version (5.0.9). It will be fixed in 5.0.10. You can download the current build here:
http://download.ej-technologies.com/beta/install4j_windows_5_0_10.exe
http://download.ej-technologies.com/beta/install4j_windows-x64_5_0_10.exe
http://download.ej-technologies.com/beta/install4j_unix_5_0_10.tar.gz
http://download.ej-technologies.com/beta/install4j_macos_5_0_10.dmg

redpajama_set_name: RedPajamaStackExchange


text:
Q: importar texto .txt pra uma celula especifica do excel Sub importar_arquivo()
    Application.ScreenUpdating = False
    importaArquivo End Sub

Private Function importaArquivo()
    Dim arquivo As String
    arquivo = abrirArquivo
    If arquivo <> Empty Then
        Debug.Print "ok"
        ActiveWorkbook.Worksheets.Add 'nova planilha
        With ActiveSheet.QueryTables.Add(Connection:= _
        "TEXT;" & arquivo & "", Destination:=Range("A1"))
            .Name = "teste"
            .FieldNames = True
            .RowNumbers = False
            .FillAdjacentFormulas = False
            .PreserveFormatting = True
            .RefreshOnFileOpen = False
            .RefreshStyle = xlInsertDeleteCells
            .SavePassword = False
            .SaveData = True
            .AdjustColumnWidth = True
            .RefreshPeriod = 0
            .TextFilePromptOnRefresh = False
            .TextFilePlatform = 850
            .TextFileStartRow = 1
            .TextFileParseType = xlDelimited
            .TextFileTextQualifier = xlTextQualifierDoubleQuote
            .TextFileConsecutiveDelimiter = False
            .TextFileTabDelimiter = False
            .TextFileSemicolonDelimiter = False
            .TextFileCommaDelimiter = False
            .TextFileSpaceDelimiter = False
            .TextFileOtherDelimiter = "|"
            .TextFileColumnDataTypes = Array(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1)
            .TextFileTrailingMinusNumbers = True
            .Refresh BackgroundQuery:=False
        End With
    End If
    arquivo = "" End Function

Function abrirArquivo() As String
    Dim arquivo As String
    On Error GoTo sair:
    arquivo = ""
    With Application.FileDialog(msoFileDialogFilePicker)
          'Selecção de apenas um aquivo
          .AllowMultiSelect = False
          'Filtro de extenção
          .Filters.Add "All files", "*.txt; *.csv"
          'Mostra a caixa de dialogo
          .Show
          'Armazena o caminho do arquivo
          arquivo = .SelectedItems.Item(1)
    End With
    abrirArquivo = arquivo sair:
    arquivo = "" End Function

Desculpem, é minha primeira vez aqui, e encontrei esse código que funcionou bem pra mim mas precisava de alguns ajustes, tentei fazer por conta própria mas sempre dá erro

*

*gostaria que esse código abrisse um arquivo .txt especifico (fica na mesma pasta do arquivo excel) e não uma janela pedindo pra solicitar o arquivo, nem abrir o arquivo .txt em paralelo.

*gostaria também que não abrisse numa nova planilha, mas numa célula  de uma planilha especifica, a ideia é ter uma pasta com imagens em .jpg e .txt com a descrição das imagens, e quando a pasta é atualizada as informações no excel tambem atualizem, a questão das imagens eu consegui resolver com imagens vinculadas, mas os textos eu preciso dos codigos VBA que eu não domino.

agradeço desde já

A: Olá, fiz aqui uma nova versão do codigo.
Sub importar_arquivo()
    Application.ScreenUpdating = False
    importaArquivo "C:\caminho\para\arquivo.txt", ThisWorkbook.Worksheets("Nome da Planilha"), "B2"
End Sub

Private Function importaArquivo(caminhoArquivo As String, planilhaDestino As Worksheet, celulaDestino As String)
    If caminhoArquivo <> Empty Then
        Debug.Print "ok"
        With planilhaDestino.QueryTables.Add(Connection:= _
        "TEXT;" & caminhoArquivo & "",Destination:=planilhaDestino.Range(celulaDestino))
            .Name = "teste"
            .FieldNames = True
            .RowNumbers = False
            .FillAdjacentFormulas = False
            .PreserveFormatting = True
            .RefreshOnFileOpen = False
            .RefreshStyle = xlInsertDeleteCells
            .SavePassword = False
            .SaveData = True
            .AdjustColumnWidth = True
            .RefreshPeriod = 0
            .TextFilePromptOnRefresh = False
            .TextFilePlatform = 850
            .TextFileStartRow = 1
            .TextFileParseType = xlDelimited
            .TextFileTextQualifier = xlTextQualifierDoubleQuote
            .TextFileConsecutiveDelimiter = False
            .TextFileTabDelimiter = False
            .TextFileSemicolonDelimiter = False
            .TextFileCommaDelimiter = False
            .TextFileSpaceDelimiter = False
            .TextFileOtherDelimiter = "|"
            .TextFileColumnDataTypes = Array(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1)
            .TextFileTrailingMinusNumbers = True
            .Refresh BackgroundQuery:=False
        End With
    End If
End Function

Só precisa de alterar o caminho do arquivo, o nome da planilha e célula de destino.


text:
Q: Bind or marge or dock the conetnt of sub form into the main form I have system where from the main from will generate some sub forms.
My point, when the user need to merge the child information on the main form, to see the child form as part of main form.
Such like many system, when view sub window, then it is possible to dock or bind this sub window onto the main window.
How to do that? On other hand, I have some space in the main form to Dock the child in it.
I mean such like this:
1- generate stand alone window(sub) from main

2- when user drag this sub from to the main,it will be merge into the main window:

A: From your comment, you're not using non MDI form. Unless I misunderstood you can set TopLevel to false, and add the child to any parent.
MyChildForm child = new MyChildForm();
child.TopLevel = false;//Important
parent.Controls.Add(child);
child.Visible = true;


text:
Q: Getting exception from @JsonTest annotation with spring-boot-starter-test 1.4 snapshot I'm trying to use the new @JsonTest annotation in spring-boot-starter-test 1.4 and I'm getting a weird error. It seems like the @JsonTest annotation depends on a class that doesn't get added to the classpath. Here's my test...
@RunWith(SpringJUnit4ClassRunner.class)
@JsonTest
public class JsonSerializationTest {
...
}

And here's the error:
java.lang.ArrayStoreException: sun.reflect.annotation.TypeNotPresentExceptionProxy

at sun.reflect.annotation.AnnotationParser.parseClassArray(AnnotationParser.java:724)
at sun.reflect.annotation.AnnotationParser.parseArray(AnnotationParser.java:531)
at sun.reflect.annotation.AnnotationParser.parseMemberValue(AnnotationParser.java:355)
at sun.reflect.annotation.AnnotationParser.parseAnnotation2(AnnotationParser.java:286)
at sun.reflect.annotation.AnnotationParser.parseAnnotations2(AnnotationParser.java:120)
at sun.reflect.annotation.AnnotationParser.parseAnnotations(AnnotationParser.java:72)
at java.lang.Class.createAnnotationData(Class.java:3521)
at java.lang.Class.annotationData(Class.java:3510)
at java.lang.Class.getAnnotation(Class.java:3415)

If I remove the @JsonTest annotation I get this error instead, because there's nothing setting up the ApplicationContext:
Caused by: java.lang.IllegalArgumentException: Cannot load an ApplicationContext with a NULL 'contextLoader'.

Anyone know what class @JsonTest is trying to load that spring-boot doesn't include in the dependencies?

A: The two missing classes are new in Spring Boot 1.4 so it looks like you have a mixture of versions on the classpath. You need to update your pom or build.gradle to make sure that the versions are consistent. The easiest way to do this is to remove any version declarations and to allow Spring Boot's dependency management to take care of it for you.


text:
Q: submit button get checkbox input safed in object jquery I'm new to jquery and I have a question about how i can save the input from my checkboxes in an object when clicking on a button.
For now i just want it to see it in the console.
my code looks something like this:

let UserInput = [];

const addUserInput = (ev) => {
  ev.preventDefault();
  let TextInput = {
    Name: document.getElementById('exampleInputName').value, //this is working
    InfoElektronik: $('#Info-Elektronik').click(function() { //this is not?
      console.log("Checkbox1 = " + $('#Info-Elektronik').prop('checked'));
    });
  };
};

  <input class="form-check-input" type="checkbox" name="agree" value="" id="Info-Elektronik">
  Elektronik

A: The issue is that InfoElektronik stores a function, not the actual return value.
Also in your click function, you log the value to the console.
I would do it like this:
const TextInput = {
  Name: document.getElementById('exampleInputName').value
}

$('#Info-Elektronik').click(function() {
  textInput.InfoElektronik = ("Checkbox1 = " + $('#Info-Elektronik').prop('checked')).val();
})


text:
Q: Python module to shellquote/unshellquote? Is there anything in the Python standard library that will properly parse/unparse strings for using in shell commands? I'm looking for the python analog to perl's String::ShellQuote::shell_quote:
$ print String::ShellQuote::shell_quote("hello", "stack", "overflow's", "quite", "cool")
hello stack 'overflow'\''s' quite cool

And, even more importantly, something which will work in the reverse direction (take a string and decompose it into a list).

A: To unquote, try  shlex.split()

A: I'm pretty sure that pipes.quote is broken, and should not be used, because it does not handle zero-length arguments correctly:
>>> from pipes import quote
>>> args = ['arg1', '', 'arg3']
>>> print 'mycommand %s' % (' '.join(quote(arg) for arg in args))
mycommand arg1  arg3

I believe the result should be something like
mycommand arg1 '' arg3

A: For shell quoting, this works:  I've rigorously tested it on Posix.  [I'm assuming that the list2cmdline function supplied by Python works as advertised on Windows]
# shell.py
import os
if os.name == 'nt':
    from subprocess import list2cmdline

    def quote(arg):
        return list2cmdline([arg])[0]
else:
    import re
    _quote_pos = re.compile('(?=[^-0-9a-zA-Z_./\n])')

    def quote(arg):
        r"""
        >>> quote('\t')
        '\\\t'
        >>> quote('foo bar')
        'foo\\ bar'
        """
        # This is the logic emacs uses
        if arg:
            return _quote_pos.sub('\\\\', arg).replace('\n',"'\n'")
        else:
            return "''"

    def list2cmdline(args):
        return ' '.join([ quote(a) for a in args ])

The tests are here, if anyone cares.

A: Looks like
try:  # py3
    from shlex import quote
except ImportError:  # py2
    from pipes import quote

quote("hello stack overflow's quite cool")
>>> '"hello stack overflow\'s quite cool"'

gets me far enough.

A: The standard library module subprocess has the list2cmdline function which does this, albeit according to Microsoft rules so I am not sure how reliable it works in Unix-like environments for more complicated command lines.

A: The quotefunction is available for quite some time (Python 2.7?) -- the major drawback is it moved from pipe module to shlex between 3.2 and 3.3.
You have to be prepared to handle both cases while importing that function:
try:
    from shlex import quote
except ImportError:
    from pipes import quote

A: pipes.quote is now shlex.quote in python 3.
It is easy enough to use that piece of code.
https://github.com/python/cpython/blob/master/Lib/shlex.py#L281
That version handles zero-length argument correctly.

A: You should never have to shell quote. The correct way to do a command is to not do shell quoting and instead use subprocess.call or subprocess.Popen, and pass a list of unquoted arguments. This is immune to shell expansion.
i.e.
subprocess.Popen(['echo', '"', '$foo'], shell=False)

If you want to unquote shell quoted data, you can use shlex.shlex like this:
list(shlex.shlex("hello stack 'overflow'\''s' quite cool"))


text:
Q: How to get Interfaces belongs to IID's, IConnectionPoint, IConnectionPointContainer in ANSI C I've created a Connection between client and COM Object with help from IConnectionPoint & IConnectionPointContainer.
data->pApp->lpVtbl->QueryInterface(data->pApp, &IID_IUnknown, (void**)&data->pUnknown));
data->pUnknown->lpVtbl->QueryInterface(data->pUnknown, &IID_IConnectionPointContainer, (void**)&data->pConnectionPointContainer));
data->pConnectionPointContainer->lpVtbl->FindConnectionPoint(data->pConnectionPointContainer, &DIID__IApplicationEvents, &data->pConnectionPoint));
data->pConnectionPoint->lpVtbl->Advise(data->pConnectionPoint, (IUnknown*)sink, &sink->dwCookie));

I've already implemented QueryInterface, AddRef & Release.
If the COM Object will execute QueryInterface I printf the riid.
IID: 0x3 - 0x0 - 0x0 - 0x764D3E14
This-Objekt: 0030EC4C, ppvObject: 0030E2D4

IID: 0x3 - 0x0 - 0x0 - 0x764D3E14
This-Objekt: 0030EC4C, ppvObject: 0030E294

...

How can I find out which Interfaces belong to the IID's?

EDIT:
I would love to compare the IIDs to something i know using the suggested IsEqualGUID
but i do not know what interfaces are called by my target application.
if(IsEqualGUID(iid, &IID_IThisIsWhatIAmLookingFor))

I try to find out what interface the numbers i get are belonging to, so i try to find the interface IID_IThisIsWhatIAmLookingFor based on the numbers i get. Implementing this is the next step for me.

A:
How can I find out which Interfaces belong to the IID's?

You cannot tell IID from interface pointer you are holding. In code, you typically manage pointers in the variables specific to certain interfaces, and you obtain the values there using respective IIDs.
What you however can is another QueryInterface call with IID of interest. Note that you cannot assume that you get the same pointer every time, unless IID is IID_IUnknown.

A: If you are lucky, the interface is Automation compatible and a Typelib exists. In this case, the registry contains an entry HKEY_CLASSES_ROOT\Interface\{00000000-0000-0000-0000-000000000000}\TypeLib, pointing to an entry below HRCR\Typelib, which references a .tlb file that you can import.
The alternative is entering the IID into Google in the various typical forms:

*

*00000000-0000-0000-0000-000000000000

*00000000-0000-0000-0000-0000-00000000


text:
Q: Border appears around material-ui Chip component inside at normal zoom but not when zoomed in or out, on all browsers Edit
I have found that if I add the line -webkit-appearance: none; to the root div for the Chip, the problem corrects itself. However, that is automatically being added by inline-styler or something, and I really wish it would stop adding vendor prefixes for reasons not just including this one.
Any more insight is appreciated.
I have a really odd problem with the material-ui Chip Component. It's pretty self-explanatory if you look below at the same Chip at different zoom levels:
Zoomed out - 75%

Zoomed out - 90%

Normal zoom - 100%

Zoomed in - 110%

I've never seen anything like this before and I am curious as to what it could be. FYI, it is the same problem whether using Chrome or Safari or Firefox, although on some browsers (notably Safari) it doesn't work at any zoom level. Note that I am testing on OS X.
The code for the Chip is:
        <Chip
          key={`ffeffef`}>
          <Avatar size={32}>B</Avatar>
          Blah blah
        </Chip>

When I do not use the Avatar it sometimes works but I think it only appears like it does when it "hot loads" the component, not after a fresh refresh. It is a very odd problem.
The CSS does not indicate it should have a border as it does.
Any help is appreciated.

A: This happens, because <Chip> component renders a div with type="button" attribute, but in last versions of materialize-css there is set a rule:
[type=reset], [type=submit], button, html [type=button] {
    -webkit-appearance: button;
}

I've fixed it by setting:
[type=button]{
  -webkit-appearance: none
}

In a global css file.
By the way, no only <Chip> component is affected, I've run in this issue with <ListItem>. Searching issues on github, I saw that people complain about other components too. Hope maintainers will fix this soon.


text:
Q: Advanced configuration of Grub2 for RAID5 + Encrypted LVM where /boot needs redundancy I recorded my complete installation until failure in case you have a question about the installation which I did not provide an explanation for below: http://www.youtube.com/watch?v=BVe5vja3keo
During partitioning I created a software RAID 5 volume spanning three identical disks. On that volume I created an encrypted volume, which I created an LVM inside containing two logical volumes inside a volume group. One logical volume for /boot and one for / (the rest):

When it is time to install Grub to the MBR I get the error Executing grub-install /dev/sda failed. This is a fatal error:

After that I completed the installation without installing a boot loader.
I would greatly appreciate it if someone could help me out!

*

*I do want redundancy for /boot so placing it outside the RAID 5 volume is not an option.

*I have tried placing a /boot partition immediately inside the RAID 5 volume and that doesn´t work automatically either.

*If it is possible I´d like the /boot inside the LVM, but if it is not having it inside the RAID volume would be sufficient.

*I know that a software RAID is sub optimal for performance and that a hardware one is preferred. However, my budget does not allow for one and redundancy and encryption are my primary concerns.

A: If you absolutely have to do Software RAID, I'd suggest keeping /boot out of your encrypted/LVM partitions.

A: Create a separate RAID partition on each of your disks for /boot, then RAID1 it (RAID1, not RAID10).
From my similar server:
$ cat /proc/mdstat
Personalities : [raid1] [raid6] [raid5] [raid4]
md1 : active raid6 sdc2[3] sdd2[1] sdb2[0] sda2[2]
      143090816 blocks level 6, 64k chunk, algorithm 2 [4/4] [UUUU]

md0 : active raid1 sdc1[2] sda1[0] sdd1[3] sdb1[1]
      136448 blocks [4/4] [UUUU]

And of course, don't forget about the MBR!


text:
Q: How to eliminate fields with same data from result in elasticsearch?   body: {
         "query": {
           "bool": {
             "filter": [
               {
                 "bool": {
                   "should":[
                     {
                       "bool":{
                         "must":[
                           {
                             "term":{
                               "company_id.keyword":req.token.company_id
                             }
                           }
                         ]
                       }
                     },
                     {"bool":{
                         "must":[
                           {
                             "term":{
                               "company_id.keyword" : -1
                             }
                           }
                         ]
                       }
                     }
                   ]
                 }
               }
             ]
           }
         },
         "aggs": {
           "menu": {
             "terms": {
               "field": "service_menu.keyword"
             }
           }
         }
       }

Hello !
I'm using this query , and as a result I have all the service_menus with id 1 and -1 and thats great.
I realized in my data that one of the "service_menu" with id 1 is the same as "service_menu" for id -1(both of them are named Pasta). In that case I want the service_menu to be showed in my result only once.(Pasta to be showed in my result only once) What should I add in my case ? Thank you all for your time !

A: You can try top_hits sub aggregation here.
Please note I haven't tested query. But this should work:
{
  "query": {
    "bool": {
      "should": [
        {
          "bool": {
            "must": [
              {
                "term": {
                  "id.keyword": 1
                }
              }
            ]
          }
        },
        {
          "bool": {
            "must": [
              {
                "term": {
                  "id.keyword": -1
                }
              }
            ]
          }
        }
      ]
    }
  },
  "size": 0,
  "aggs": {
    "menu": {
      "terms": {
        "field": "service_menu.keyword"
      },
      "aggs": {
        "document": {
          "top_hits": {
            "size": 1
          }
        }
      }
    }
  }
}


text:
Q: Resolve preact Brotli build conflict: same filename current behavior
preact build --brotli prints the following error:
‼ WARN Conflict: Multiple assets emit different content to the same filename .br
other relevant information

*

*My app is a standard preact-cli 'Default' (preact-cli template).

*Not using the --brotli flag builds as desired/expected.

*It's clear the js files are being built to .br but with no filename.

    Environment Info:
    System:
      OS: Windows 10 10.0.19045
      CPU: (8) x64 11th Gen Intel(R) Core(TM) i7-1165G7 @ 2.80GHz
    Binaries:
      Node: 18.12.1
      npm: 8.4.1
    Browsers:
      Edge: Spartan (44.19041.1266.0), Chromium (108.0.1462.54)
    npmPackages:
      preact: ^10.11.2 => 10.11.2
      preact-cli: ^3.4.1 => 3.4.1
      preact-render-to-string: ^5.2.6 => 5.2.6
      preact-router: ^4.1.0 => 4.1.0

Per the preact-cli documentation combined with the only walkthrough I could find on expected behavior I expected to see "... all the generated javascript files also have a .js.br files next to them."
Steps to reproduce the behavior:

*

*preact build --brotli

*See error

error
    preact build --brotli

    ‼ WARN Could not find sw.js in C:\... Using the default service worker.

                           bundle.*****.esm.js ⏤  91.3 kB
                        polyfills.*****.esm.js ⏤  2.18 kB
              route-REDACT.chunk.6bef3.css ⏤  236 B
           route-REDACT.chunk.*****.esm.js ⏤  849 B
            route-REDACT.chunk.*****.esm.js ⏤  1.54 kB
        route-REDACT.chunk.64635.css ⏤  138 B
     route-REDACT.chunk.*****.esm.js ⏤  641 B
       route-REDACT.chunk.*****.esm.js ⏤  294 B
                                         sw.js ⏤  10.9 kB
                                     sw-esm.js ⏤  10.9 kB
                            polyfills.77b1f.js ⏤  2.28 kB
                                    index.html ⏤  1.66 kB (-19 B)
                                      200.html ⏤  1.17 kB
                              bundle.ccccc.css ⏤  5.36 kB
                 route-REDACT.chunk.230c8.css ⏤  139 B
              route-REDACT.chunk.*****.esm.js ⏤  405 B
               route-REDACT.chunk.f85cc.css ⏤  571 B
                               bundle.bbbbb.js ⏤  92.7 kB
                  route-REDACT.chunk.f4a3f.js ⏤  412 B
               route-REDACT.chunk.4a8c5.js ⏤  1.36 kB
                route-REDACT.chunk.56f91.js ⏤  2.14 kB
         route-REDACT.chunk.e7d3e.js ⏤  1.16 kB
           route-REDACT.chunk.68634.js ⏤  293 B

    ‼ WARN Conflict: Multiple assets emit different content to the same filename .br
    ‼ WARN Conflict: Multiple assets emit different content to the same filename .br
    ‼ WARN Conflict: Multiple assets emit different content to the same filename .br
    ‼ WARN Conflict: Multiple assets emit different content to the same filename .br
    ‼ WARN Conflict: Multiple assets emit different content to the same filename .br
    ‼ WARN Conflict: Multiple assets emit different content to the same filename .br
    ‼ WARN asset size limit: The following asset(s) exceed the recommended size limit (195 KiB).
    This can impact web performance.
    Assets:
      bundle.aaaaa.esm.js (376 KiB)
      bundle.bbbbb.js (390 KiB)
    ‼ WARN entrypoint size limit: The following entrypoint(s) combined asset size exceeds the recommended limit (195 KiB). This can impact web performance.
    Entrypoints:
      bundle (785 KiB)
          bundle.ccccc.css
          bundle.bbbbb.js
          bundle.aaaaa.esm.js

    `your text`‼ WARN Conflict: Multiple assets emit different content to the same filename .br
    ‼ WARN Conflict: Multiple assets emit different content to the same filename .br
    ‼ WARN Conflict: Multiple assets emit different content to the same filename .br
    ‼ WARN Conflict: Multiple assets emit different content to the same filename .br
    ‼ WARN Conflict: Multiple assets emit different content to the same filename .br
    ‼ WARN Conflict: Multiple assets emit different content to the same filename .br
    ‼ WARN asset size limit: The following asset(s) exceed the recommended size limit (195 KiB).
    This can impact web performance.
    Assets:
      bundle.aaaaa.esm.js (376 KiB)
      bundle.bbbbb.js (390 KiB)
    ‼ WARN entrypoint size limit: The following entrypoint(s) combined asset size exceeds the recommended limit (195 KiB). This can impact web performance.
    Entrypoints:
      bundle (785 KiB)
          bundle.ccccc.css
          bundle.bbbbb.js
          bundle.aaaaa.esm.js

A: Fix for this issue was release as preact-cli v3.4.3.


text:
Q: jQuery - If screen is less than specified width (responsive) How can I make an alert popup if the width of the page is less than 1200px, and made responsive?
Thanks!

A: You can use something like the breakpoints module. Then you setup a breakpoint to trigger at 1200px and show a dialog and either add a css class that changes the layout, or use straight javascript to make the changes.
breakpoints(1200, function(oldPoint, newPoint) {
  alert('The screen width just changed');
});

if you just wanted native jQuery:
$(window).resize(function() {
  var width = $(window).width();
  if (width < 1200){
    alert('Your screen is too small');
  }
});

For completeness, heres the CSS media query (still doesn't take care of the alert, but can help with making the website "responsive").
/* some normal style */
.myclass {
  font-size: 22pt;
}

/* alter the style when the screen's smaller */
@media screen and (max-width: 1200px) {
  .myclass {
    font-size: 18pt;
  }
}

A: For future Googlers, a 2019 solution is to use JavaScript's window.matchMedia(). It is supported in all major browsers and IE 10 onwards.
You can use it like this:
if (window.matchMedia('(max-width: 1200px)').matches) {
    // functionality for screens smaller than 1200px
}

To make this responsive, you just need to wrap it in a resize function:
$(window).resize(function() {
    if (window.matchMedia('(max-width: 1200px)').matches) {
        // functionality for screens smaller than 1200px
    }
});

This is arguably the most easiest way to check a screen size and it doesn't bloat the code.
Check the Mozilla docs about matchMedia to learn more and this one for more info on Testing media queries programmatically.


text:
Q: Converting javascript object which contains nothing to a string I am writing an extension for the gnome-shell. The javascript extension spawns a sql query and captures the output on standard output. In cases where the sql query evaluates to 0 tuples/records my extension is crashing.
Below is the code snippet.
let [success, out, err, error] = GLib.spawn_sync(null, ["sqlite3", "-line", places, sqlQuery], null, 4, null);
let result = out.toString(); // Crashing here for 0 tuples. I was expecting 'result = ""'

I am a javascript newbie. I am not understanding how the object out should be handled in this scenario. The object is not null; nor is it undefined.
typeof out == null // false
typeof out == undefined // false
typeof out == "object" // true

EDIT
typeof out == "null" // false
typeof out == "undefined" // false
typeof out == "object" // true

A: I found out that I could prevent the crash if I did the following
let [success, out, err, errno] = GLib.spawn_sync(null, ["sqlite3", "-line", places, sqlQuery], null, 4, null);
if (out.length > 0) {
        let records = out.toString().split('\n\n');
}

I don't understand why out.toString() couldn't give me an empty string instead of crashing, yet. Hoping I will as I learn more about javascript and glib.


text:
Q: Other commands don't work. (Python, Discord.py) @bot.event
async def on_message(ctx) :
    file = openpyxl.load_workbook("level.xlsx")
    sheet = file.active
    exp = [100, 200, 400, 700, 1100, 1600, 2200, 2900, 3700, 4600, 5600]
    i = 1
    while True :
        if sheet["A" + str(i)].value == str(ctx.author.id) :
            sheet["B" + str(i)].value = sheet["B" + str(i)].value + 2
            if sheet["B" + str(i)].value >= exp[sheet["C" + str(i)].value - 1] :
                sheet["C" + str(i)].value = sheet["C" + str(i)].value + 1
                await ctx.channel.send("Level UP !!\nLevel : " + str(sheet["C" + str(i)].value) + "\nExp : " + str(sheet["B" + str(i)].value))
            file.save("level.xlsx")
            break
        if sheet["A" + str(i)].value == None :
            sheet["A" + str(i)].value = str(ctx.author.id)
            sheet["B" + str(i)].value = 0
            sheet["C" + str(i)].value = 1
            file.save("level.xlsx")
            break
        i += 1

This code works well, but it prevents other commands from working.
I put this code at the end. But other commands still don't work.
How can I fix the error?

A: Read this.
Use await bot.process_commands(message) at the end of the code, to run the event function along with the other commands.


text:
Q: How to get nokogiri attribute value? My xml contains multiple statements like
<House name="bla"><Room id="bla" name="black" ><blah id="blue" name="brown"></blah></Room></House>

I need to get all the values for the given keyword.
I used nodes = doc.css("[name]") to get the <Room id="bla" name="black" ><blah id="blue" name="brown"></blah></Room>.\
But how do I get the value for a key from this. Is there any easier way to do this?

A: node_names = doc.css("[name]").map { |node| node['name'] }

for all node names; or for just "black",
black = doc.at_css("[name]")['name']


text:
Q: Issue - different WEEK number showing from php WEEK function and mysql WEEK function? I Want to get the current Week and Previous Week.
I used to get the current week using php like below.
$week = date("W");

This will return the week number as 50.
If i use mysql like below
select WEEK('2019-12-13') as this_week

I am getting the current week as 49
If i pass the $week in my sql database i am not getting any value for this week transaction.
Why this is happening and how can i get the current week and previous week accurately?

A: WEEK(date[,mode])

This function returns the week number for date. The two-argument form of WEEK() enables you to specify whether the week starts on Sunday or Monday and whether the return value should be in the range from 0 to 53 or from 1 to 53.

MySQL docs
So your weeks on MySQL are zero-based because the default_week_format is 0.
Use 3 as parameter to get your desired result:
select week(curdate(), 3) as this_week

To get the last week you could do
select week(curdate() - interval 7 day, 3) as last_week

A: There are different rules for establishing week numbers, so check the default rules as they pertain to each of the relevant functions. MySQL's WEEK() function allows you to choose from a variety of 'modes' - rules which establish where weeks are counted from
select WEEK('2019-12-13');
+--------------------+
| WEEK('2019-12-13') |
+--------------------+
|                 49 |
+--------------------+

select WEEK('2019-12-13',1);
+----------------------+
| WEEK('2019-12-13',1) |
+----------------------+
|                   50 |
+----------------------+

A: MySQL and PHP by default use different algorithms to determine the week number.
Supposing you want to replicate in PHP MySQL's algorithm, i.e. get the same number that MySQL would return, then
/** MySQL's WEEK() function ISO8601-2 (European) */
function isodate($date) {
    list($y, $m, $d) = explode('-', $date);
    $timestamp  = mktime(12, 12, 12, $m, $d, $y);
    $doy        = date('z', $timestamp);
    $dow        = date('w', $timestamp);
    return floor((7+$doy-$dow)/7);
}

Always be sure to verify your algorithm:
$db     = new PDO('mysql:host=localhost; dbname=test;', 'user', 'pass');
$stmt   = $db->prepare("SELECT WEEK(?) AS x");
$diff   = 0;
$checks = 0;

print " Anno    |   01   |   02   |   03   |   04   |   05   |   06   |   07   |\n";
// Controllo solo Gennaio e Dicembre, approfittando wilmente del fatto che hanno entrambi 31 giorni
foreach ([ 1, 12 ] as $month) {
    for ($year = 1999; $year <= 2022; $year++) {
        for ($day = 1; $day <= 31; $day++) {
            // Build a timestamp from the date
            $date = mktime(12, 12, 12, $month, $day, $year);
            $intl = date('Y-m-d', $date);
            if ($day === 1) {
                print date('M Y ', $date);
            }
            // Ask the date to MySQL
            $stmt->execute([ $intl ]);
            $data  = $stmt->fetch();
            $mysql = (int)$data['x'];
            // $php   = date('W', $date);
            $php   = (int)isodate($intl);
            $checks ++;
            if ($mysql !== $php) {
                $diff++;
            }
            printf('|%s %02d/%d', date('D', $date), $php, $mysql);
        }
        print("|\n");
    }
}
print("{$checks} checks, {$diff} differences\n");

$ php -q test.php | grep "differences"
1488 checks, 0 differences


text:
Q: Need help implementing multiple Or conditions in Nest query I am attempting to implement the following SQL pseudo-code in Nest ElasticSearch.
I haven't found any similar StackOverflow questions matching this question or in Nest documentation.  Appreciate any direction you can provide.
select *
from curator..published
where accountId = 10
  and (
        (publishStatusId = 3 and scheduledDT > '2015-09-01')
        or
        (publishStatusId = 4 and publishedDT > '2015-09-01')
      )

I've created the following ElasticSearch query but am unable to successfully translate it to Nest syntax.
GET curator/published/_search
{
  "query": {
    "filtered": {
      "filter": {
        "bool": {
          "must": [
            {
              "term": {
                "accountID": 1781
              }
            }
          ],
          "should": [
            {
              "bool": {
                "must": [
                  {
                    "term": {
                      "publishStatusID": 4
                    }
                  },
                  {
                    "range": {
                      "publishedDT": {
                        "gte": "2015-09-01T00:00:00.000"
                      }
                    }
                  }
                ]
              }
            },
            {
              "bool": {
                "must": [
                  {
                    "term": {
                      "publishStatusID": 3
                    }
                  },
                  {
                    "range": {
                      "scheduleDT": {
                        "gte": "2015-09-01T00:00:00.000"
                      }
                    }
                  }
                ]
              }
            }
          ]
        }
      }
    }
  }
}

This Nest query is passes a syntax check but only the last "should" condition appears in the resulting ElasticSearch query.
var results = this.Client.Count<Data>(c => c
    .Query(q => q
        .Filtered(f1 => f1
            .Filter(f2 => f2
                .Bool(b => b
                    .Must(
                        f => f.Term(FieldName.AccountID, "10")
                    )
                    .Should(s => s
                        .Bool(b1 => b1
                            .Must(
                                f => f.Term(FieldName.PublishStatusID, "3"),
                                f => f.Range(m => m.OnField(FieldName.ScheduleDT).GreaterOrEquals("2015-09-01"))
                            )
                        )
                    )
                    .Should(s => s
                        .Bool(b1 => b1
                            .Must(
                                f => f.Term(FieldName.PublishStatusID, "4"),
                                f => f.Range(m => m.OnField(FieldName.PublishedDT).GreaterOrEquals("2015-09-01"))
                            )
                        )
                    )
                )
            )
        )
    )
);

This Nest query better matches the original ElasticSearch query but raises the following error on the 2nd Bool:  Error  51  'Nest.FilterContainer' does not contain a definition for 'Bool' and no extension method 'Bool' accepting a first argument of type 'Nest.FilterContainer' could be found (are you missing a using directive or an assembly reference?)
var results = this.Client.Count<Data>(c => c
    .Query(q => q
        .Filtered(f1 => f1
            .Filter(f2 => f2
                .Bool(b => b
                    .Must(
                        f => f.Term(FieldName.AccountID, AccountID)
                    )
                    .Should(s => s
                        .Bool(b1 => b1
                            .Must(
                                f => f.Term(FieldName.PublishStatusID, "3"),
                                f => f.Range(m => m.OnField(FieldName.ScheduleDT).GreaterOrEquals("2015-09-01"))
                            )
                        )
                        .Bool(b2 => b2
                            .Must(
                                f => f.Term(FieldName.PublishStatusID, "4"),
                                f => f.Range(m => m.OnField(FieldName.PublishedDT).GreaterOrEquals("2015-09-01"))
                            )
                        )
                    )
                )
            )
        )
    )
);

A: Your first query is not far off, just the expression passed to the second Should() needs to be another expression passed to the first Should() (Should() takes a params Func[] filters). Here's the query (I've used dynamic here as the generic type):
void Main()
{
    var settings = new ConnectionSettings(new Uri("http://localhost:9200"));
    var connection = new InMemoryConnection(settings);
    var client = new ElasticClient(connection: connection);

    var docs = client.Count<dynamic>(c => c
        .Query(q => q
            .Filtered(f1 => f1
                .Filter(f2 => f2
                    .Bool(b => b
                        .Must(
                            f => f.Term(FieldName.AccountID, "10")
                        )
                        .Should(s => s
                            .Bool(b1 => b1
                                .Must(
                                    f => f.Term(FieldName.PublishStatusID, "3"),
                                    f => f.Range(m => m.OnField(FieldName.ScheduleDT).GreaterOrEquals("2015-09-01"))
                                )
                            ),
                                s => s
                            .Bool(b1 => b1
                                .Must(
                                    f => f.Term(FieldName.PublishStatusID, "4"),
                                    f => f.Range(m => m.OnField(FieldName.PublishedDT).GreaterOrEquals("2015-09-01"))
                                )
                            )
                        )
                    )
                )
            )
        )
    );

    Console.WriteLine(Encoding.UTF8.GetString(docs.RequestInformation.Request));
}

public static class FieldName
{
    public static string AccountID = "AccountID";
    public static string ScheduleDT = "ScheduleDT";
    public static string PublishedDT = "PublishedDT";
    public static string PublishStatusID = "PublishStatusID";
}

produces
{
  "query": {
    "filtered": {
      "filter": {
        "bool": {
          "must": [
            {
              "term": {
                "AccountID": "10"
              }
            }
          ],
          "should": [
            {
              "bool": {
                "must": [
                  {
                    "term": {
                      "PublishStatusID": "3"
                    }
                  },
                  {
                    "range": {
                      "ScheduleDT": {
                        "gte": "2015-09-01"
                      }
                    }
                  }
                ]
              }
            },
            {
              "bool": {
                "must": [
                  {
                    "term": {
                      "PublishStatusID": "4"
                    }
                  },
                  {
                    "range": {
                      "PublishedDT": {
                        "gte": "2015-09-01"
                      }
                    }
                  }
                ]
              }
            }
          ]
        }
      }
    }
  }
}

This matches your query DSL above


text:
Q: Restricting the number of AJAX Requests to one when user clicks a button multiple times I have a portal having n tabs and whenever the visitor clicks a particular tab, an AJAX request is created. A PHP script at the back end inserts a record into a table which tracks the time of click and the name of the tab clicked.
When the visitor clicks the same tab multiple times, continuously, all the AJAX requests are succeeding. Say I click a tab "Automation" 5 times, then 5 AJAX requests are succeeding and 5 records are getting inserted. I need to limit the request to only one, if the visitor is repeatedly and quickly clicking the tab for an interval of 3s.
How to go about this?
Here's my jQuery AJAX code :
$.ajax({
    url     :   "pushTelemetry.php",
    cache   :   false,
    data    :   ({
                    DshBrdName  : strFullDashBoardName,
                    DshBrdID    : currentDashboard,
                    r           : Math.random()
                }),
    success :   function(data, textStatus, jQxhr){
                    //alert(textStatus);
                },
    error   :   function(jqXHR, textStatus, errorThrown){
                    //alert(textStatus);
                    alert(errorThrown);
                },
    type    :   "POST"
});

A: The idea is to indicate that an AJAX call should only be made if there's not another one already being made. Here I indicate it using an extra class on the button which triggers the ajax call.
Do something like:
$(selector).on("click",function () {
    if ($(this).is(".pendingResult") { return; }
    $(this).addClass("pendingResult");
    var finally = $.proxy(function () { $(this).removeClass("pendingResult"); }, this);

    $.ajax({

        url     :   "pushTelemetry.php",
        cache   :   false,
        data    :   ({
                        DshBrdName  : strFullDashBoardName,
                        DshBrdID    : currentDashboard,
                        r           : Math.random()
                    }),
        success :   function(data, textStatus, jQxhr){
                        //alert(textStatus);
                    },
        error   :   function(jqXHR, textStatus, errorThrown){
                        //alert(textStatus);
                        alert(errorThrown);
                    },
        type    :   "POST",
        complete :  finally
    });
});

Some further detail:
JQuery AJAX calls can terminate in either success or error, however whenever either of these happens, the "complete" function is called if specified, this acts like the finally code in a try-catch-finally block.
However the scope of this "complete" function is the window and not the element which triggered the AJAX call, therefore if you need to somehow pass the clicked element to the "complete" function. Fortunately JQuery has a built-in way to do this using the proxy method. This method accepts a callback and a scope/element and ensures that the "this" object within the callback refers to the specified scoped element.  This is similar to the built-in JavaScript method bind, the reason that I used proxy here is that bind is newer and not supported in IE 8 which some people may still be trying to support (for some reason).

A: You could disable the click on the tab until you get a response from the server.
var clickAllowed = true;
$('#tab').on('click', function() {
    if(clickAllowed) {
        clickAllowed = false;
        $.ajax({
            url     :   "pushTelemetry.php",
            cache   :   false,
            data    :   ({
                            DshBrdName  : strFullDashBoardName,
                            DshBrdID    : currentDashboard,
                            r           : Math.random()
                        }),
            success :   function(data, textStatus, jQxhr){
                            //alert(textStatus);
                            clickAllowed = true;
                        },
            error   :   function(jqXHR, textStatus, errorThrown){
                            //alert(textStatus);
                            alert(errorThrown);
                            clickAllowed = true;
                        },
            type    :   "POST"
        });
    }
});


text:
Q: Print list with variable name in it (as it appears in source code file)? I have a Python list:
L1 = [['Hello', '.', 'My', 'name', 'is', 'Joe'],['Hola', '.', 'Mi', 'nombre', 'es', 'Joe']]

How do I print the list to get this output:
L1 = [['Hello', '.', 'My', 'name', 'is', 'Joe'],['Hola', '.', 'Mi', 'nombre', 'es', 'Joe']]

The same as what is in my .py file?
A similar question appears for Go: Golang: print struct as it would appear in source code
But I do not understand it and if Python has anything similar.
For those wanting to know why, I need to print these lists to an HTML file. Due to limitations of programming interoperability and not wanting to over-engineer, this is easiest for me to use as code.

A: Use an f-string as follows:
L1 = [['Hello', '.', 'My', 'name', 'is', 'Joe'],['Hola', '.', 'Mi', 'nombre', 'es', 'Joe']]

print(f'{L1 = }'.replace(', [', ',['))

Output:
L1 = [['Hello', '.', 'My', 'name', 'is', 'Joe'],['Hola', '.', 'Mi', 'nombre', 'es', 'Joe']]

Without the call to replace() the output will be:
L1 = [['Hello', '.', 'My', 'name', 'is', 'Joe'], ['Hola', '.', 'Mi', 'nombre', 'es', 'Joe']]

A: This is not a method I will not encourage you to use, but if you are really sure you want to do this you can do it like this.
I assume that you have a variable which you want to print.
L1 = [['Hello', '.', 'My', 'name', 'is', 'Joe'],['Hola', '.', 'Mi', 'nombre', 'es', 'Joe']]

# make a copy of the globals
g = globals().copy()

for key, value in g.items():
    if value is L1:
        break

print(f"{key} = {value}")

Again, I do not recommend you to use it.


text:
Q: Checking if an object 'is' of a generic type in Swift And I want to add an extension to SwiftUI's View protocol that changes behaviour based on the actual type of view:
extension View {
    func something() {
        switch self {
            case is Text: // Do stuff.
            case is Button<AnyView>: // Do other stuff
            default: // Do other other stuff
        }
    }
}

However, the is Button<AnyView> case is not met for any Button type. I cannot not specify a generic type, and I also cannot specify Any. How do I check if an object is of a generic type?
(I cannot use additional, more specific extensions to override this function, apparently.)

A: Well, not considering the purpose of this, if you have limited set of buttons something like the following could be used
extension View {
    func something() -> Self {
        switch self {
            case is Text: // Do stuff.
                print("> text")
            case is Button<Text>: // Do other stuff
                    print("> text button")
            case is Button<Image>: // Do other stuff
                    print("> image button")
            default: // Do other other stuff
                print("> other")
        }
        return self
    }
}

A: In Java you would want to use Button<?>, in Swift it's not possible, but you can emulate it.

*

*Create a protocol protocol AnyButton {}

*Now let all buttons implement this protocol: extension Button: AnyButton {}

*Now you can easily do what you intended to do:
switch self {
  case is Text: ...
  case is AnyButton: ...
}


text:
Q: Namespaces and mountpoints There's a way to create hidden mount points if the root user unshares the current namespace and mounts directories without updating mtab. Is there a easy way of listing this without having to filter through the proc file system?

A:
There's a way to create hidden mount points if the root user unshares the current namespace and mounts directories without updating mtab. Is there a easy way of listing this without having to filter through the proc file system?

First of all, /proc is the primary way of accessing current mount information on Linux.
Many modern Linux distributions never update mtab; it is simply a symlink to /proc/self/mounts. (Both the ability to unshare mount namespaces, as well as hiding mounts by "forgetting" to update mtab, are primary reasons for this change. And of course, what's the point of repeating the work that the kernel already does?)
Likewise, the namespace identifiers themselves are only exposed via /proc/$PID/ns/mnt. There is no other way of checking which processes are in separate namespaces from the main one.
So with that said, the quickest way to list all mounts is cat /proc/*/mounts. But if you don't want to do that, util-linux v2.28 introduces the lsns tool which can quickly list all unique namespaces as well as their "first" process:

$ sudo lsns --type=mnt
        NS TYPE NPROCS    PID USER   COMMAND
4026531840 mnt     300      1 root   /sbin/init
4026531860 mnt       1     38 root   kdevtmpfs
4026532247 mnt       1    271 root   /usr/lib/systemd/systemd-udevd
4026532359 mnt       2    524 root   /usr/bin/NetworkManager --no-daemon
4026532369 mnt       2 267304 root   nginx: master process /usr/bin/nginx -g pid /run/nginx.pid
4026532557 mnt       1    892 colord /usr/lib/colord

And once you have the process ID, you can see its mount table using:

$ sudo findmnt --tab=/proc/267304/mountinfo

(You should always use the /proc/$PID/mountinfo file, as it contains a bit more information than mounts or /etc/mtab. For example, it describes the actual hierarchy when mounts overlap in unexpected ways, and it more accurately reports the 'source' of a bind mount when it's a file or subdirectory.)
As for a single tool that would simply show what mounts are "missing" from the main namespace – I don't know of any. (One doesn't come with coreutils or util-linux right now, though it shouldn't be difficult to write one if you allow it to dig through /proc.)


text:
Q: how to clone or mirror a gitosis server I have a working gitosis server someone else setup and I want to replicate that server using a Virtual Box VM setup on Ubuntu so I can experiment with modifying it before changing the live server. I have root access to the live gitosis server so I can tar the /home/git directory and copy it to my VM if needed.
So what exactly do I need to do to replicate or mirror the gitosis server? What exactly needs to be copied or installed from scratch. I'm not talking about packages installed by apt-get I'm talking about stuff the gitosis install would do. For example, can I simply copy /home/git from the server and use that or should I copy /home/git then replace repositories
using "git clone --mirror"?
Also am I missing anything else here? For example, if the server starts git-daemon using a special script I have to copy that also I guess.

A: I would install gitosis on the new server, just like normal, and than copy your repositories directory and the "admin repo" over.  You could also push the repositories and "admin repo" over.
I haven't done this personally, but I don't see why it wouldn't work.


text:
Q: How to make radioButton as SQLite filter in Android Studio? This code filters the SQL query by 6 filters: name, weight, country, power and type. How to make RadioButton element as a separate filter? I have 6 RadioButton elements. Each element for one filter. Weight radioButton to filter by weight, Country radioButton to filter by country etc.
MySQLite
import android.content.ContentValues;
import android.content.Context;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.Locale;
import java.util.StringTokenizer;

public class MySQLite extends SQLiteOpenHelper {
    private static final int DATABASE_VERSION = 4;

    static final String DATABASE_NAME = "phones";

    static final String TABLE_NAME = "emergency_service";
    static final String ID = "id";
    static final String NAME = "name";
    static final String PRICE = "price";
    static final String TYPE = "type";
    static final String POWER = "power";
    static final String WEIGHT = "weight";
    static final String COUNTRY = "country";

    static final String ASSETS_FILE_NAME = "vacuumcleaner.txt";
    static final String DATA_SEPARATOR = "|";

    private Context context;

    public MySQLite(Context context) {
        super(context, DATABASE_NAME, null, DATABASE_VERSION);
        this.context = context;
    }

    @Override
    public void onCreate(SQLiteDatabase db) {
        String CREATE_CONTACTS_TABLE = "CREATE TABLE " + TABLE_NAME + "("
                + ID + " INTEGER PRIMARY KEY,"
                + NAME + " TEXT,"
                + PRICE + " TEXT,"
                + TYPE + " TEXT,"
                + POWER + " TEXT,"
                + WEIGHT + " TEXT,"
                + COUNTRY + " TEXT" + ")";
        db.execSQL(CREATE_CONTACTS_TABLE);
        System.out.println(CREATE_CONTACTS_TABLE);
        loadDataFromAsset(context, ASSETS_FILE_NAME,  db);
    }

    @Override
    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
        db.execSQL("DROP TABLE IF EXISTS " + TABLE_NAME);
        System.out.println("DROP TABLE IF EXISTS " + TABLE_NAME);
        onCreate(db);
    }

    public void addData(SQLiteDatabase db, String name, String price, String type, String power, String weight, String country) {
        ContentValues values = new ContentValues();
        values.put(NAME, name);
        values.put(PRICE, price);
        values.put(TYPE, type);
        values.put(POWER, power);
        values.put(WEIGHT, weight);
        values.put(COUNTRY, country);
        db.insert(TABLE_NAME, null, values);
    }

    public void loadDataFromAsset(Context context, String fileName, SQLiteDatabase db) {
        BufferedReader in = null;

        try {

            InputStream is = context.getAssets().open(fileName);

            in = new BufferedReader(new InputStreamReader(is));

            String str;
            while ((str = in.readLine()) != null) {
                String strTrim = str.trim();
                if (!strTrim.equals("")) {
                    StringTokenizer st = new StringTokenizer(strTrim, DATA_SEPARATOR);
                    String name = st.nextToken().trim();
                    String price = st.nextToken().trim();
                    String type = st.nextToken().trim();
                    String power = st.nextToken().trim();
                    String weight = st.nextToken().trim();
                    String country = st.nextToken().trim();
                    addData(db, name, price, type, power, weight, country);
                }
            }

        } catch (IOException ignored) {
        } finally {
            if (in != null) {
                try {
                    in.close();
                } catch (IOException ignored) {
                }
            }
        }

    }

    public String getData(String filter) {

        String selectQuery;

        if (filter.equals("")) {
            selectQuery = "SELECT  * FROM " + TABLE_NAME + " ORDER BY " + NAME;
        } else {
            selectQuery = "SELECT  * FROM " + TABLE_NAME + " WHERE (" + PRICE + " LIKE '%"  +
                    filter.toLowerCase() + "%'" +
                    " OR " + TYPE + " LIKE '%" + filter + "%'" + " OR " +  POWER + " LIKE '%" + filter + "%'"
                    + " OR " + WEIGHT + " LIKE '%" + filter + "%'" + " OR " + COUNTRY +
                    " LIKE '%" + filter + "%'" + " OR " + NAME + " LIKE '%" + filter + "%'" +") ORDER BY " + NAME;

        }

        System.out.println(selectQuery);
        SQLiteDatabase db = this.getReadableDatabase();
        Cursor cursor = db.rawQuery(selectQuery, null);

        StringBuilder data = new StringBuilder();

        int num = 0;
        if (cursor.moveToFirst()) {
            do {
                int n = cursor.getColumnIndex(NAME);
                int t = cursor.getColumnIndex(PRICE);
                int k = cursor.getColumnIndex(TYPE);
                int s = cursor.getColumnIndex(POWER);
                int a = cursor.getColumnIndex(WEIGHT);
                int d = cursor.getColumnIndex(COUNTRY);
                String name = cursor.getString(n);
                String price = cursor.getString(t);
                String type = cursor.getString(k);
                String power = cursor.getString(s);
                String weight = cursor.getString(a);
                String country = cursor.getString(d);
                data.append(String.valueOf(++num) + ") " + name + ": " + price + ": "+ type + ": " + power + ": " + weight + ": " + country + ": " +"\n");
            } while (cursor.moveToNext());
        }
        return data.toString();
    }

}

This was SQLite class, here is MainActivity.java:
    MainActivity
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.text.Editable;
import android.text.TextWatcher;
import android.util.TypedValue;
import android.view.Menu;
import android.view.MenuItem;
import android.widget.EditText;
import android.widget.RadioButton;
import android.widget.RadioGroup;
import android.widget.TextView;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;
import android.widget.Toast;

public class MainActivity extends AppCompatActivity {

    private final int LARGE_FONT = 16;
    private final int SMALL_FONT = 12;
    private int fontSize = SMALL_FONT;

    MySQLite db = new MySQLite(this);

    EditText editText;
    TextView textView;
    RadioGroup radioGroup;
    RadioButton priceRadioButton;
    RadioButton powerRadioButton;
    RadioButton typeRadioButton;
    RadioButton weightRadioButton;
    RadioButton countryRadioButton;
    RadioButton nameRadioButton;

    static final String FILTER = "FILTER";
    String filter = "";

    SharedPreferences sPref;
    static final String CONFIG_FILE_NAME = "Config";
    static final String FONT_SIZE = "FontSize";

    @Override
    public void onSaveInstanceState(Bundle savedInstanceState) {
        savedInstanceState.putString(FILTER, filter);
        super.onSaveInstanceState(savedInstanceState);
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        setContentView(R.layout.activity_main);

        Toolbar toolbar = findViewById(R.id.toolbar);
        setSupportActionBar(toolbar);

        editText = findViewById(R.id.editText);
        textView = findViewById(R.id.textView);

        textView.setKeyListener(null);

        sPref = getSharedPreferences(CONFIG_FILE_NAME, MODE_PRIVATE);
        fontSize = sPref.getInt(FONT_SIZE, SMALL_FONT);

        textView.setTextSize(TypedValue.COMPLEX_UNIT_SP, fontSize);
        textView.requestFocus();

        if (savedInstanceState != null) {
            editText.setText(savedInstanceState.getString(FILTER));
        }

        textView.setText(R.string.Загрузка_данных);

        editText.addTextChangedListener(new TextWatcher() {
            @Override
            public void beforeTextChanged(CharSequence s, int start, int count, int after) {
            }

            @Override
            public void onTextChanged(CharSequence s, int start, int before, int count) {
            }

            @Override
            public void afterTextChanged(Editable s) {

                new Thread(new Runnable() {
                    public void run() {
                        filter = editText.getText().toString().trim();
                        final String data = db.getData(filter);
                        textView.post(new Runnable() {
                            public void run() {
                                textView.setText(data);
                            }
                        });
                    }
                }).start();

            }

        });

        editText.post(new Runnable() {
            public void run() {
                editText.setText(filter);
            }
        });
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        getMenuInflater().inflate(R.menu.menu_main, menu);

        menu.findItem(R.id.large_font).setChecked(fontSize == LARGE_FONT);
        return true;
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        int id = item.getItemId();

        if (id == R.id.email) {
            Intent i = new Intent(Intent.ACTION_SEND);
            i.setType("message/rfc822");
            i.putExtra(Intent.EXTRA_EMAIL, new String[]{getString(R.string.myemail)});
            i.putExtra(Intent.EXTRA_SUBJECT, getString(R.string.Добавьте_еще_номер));
            i.putExtra(Intent.EXTRA_TEXT, getString(R.string.Предлагаю_такой_номер));
            try {
                startActivity(Intent.createChooser(i, getString(R.string.Посылка_письма)));
            } catch (android.content.ActivityNotFoundException ex) {
                Toast.makeText(MainActivity.this, R.string.Нет_установленного_почтового_клиента, Toast.LENGTH_SHORT).show();
            }
            return true;
        }

        if (id == R.id.large_font) {
            item.setChecked(!item.isChecked());
            int size = item.isChecked() ? LARGE_FONT : SMALL_FONT;
            textView.setTextSize(TypedValue.COMPLEX_UNIT_SP, size);
            fontSize = size;
            return true;
        }

        if (id == R.id.exit) {
            finish();
            return true;
        }
        return super.onOptionsItemSelected(item);
    }

    @Override
    protected void onStop() {
        super.onStop();

        SharedPreferences.Editor ed = sPref.edit();
        ed.putInt(FONT_SIZE, fontSize);
        ed.apply();
    }
}

A: I'd suggest building the WHERE clause based upon the radio buttons and as some would suggest binding the search arguments to protect against SQL injection.
e.g. something along the lines of:-
public Cursor getData(String value, boolean price_rb, boolean type_rb, boolean power_rb, boolean weight_rb, boolean country_rb, boolean name_rb) {

    ArrayList<String> intermediateWhereArgs = new ArrayList<>();

    StringBuilder whereClause = new StringBuilder();
    if (value.length() < 1 || (!price_rb && !type_rb && !power_rb && !weight_rb && !country_rb && !name_rb)) {
        whereClause = null;
    } else {
        if(price_rb) {
            if (whereClause.length() > 0) {
                whereClause.append(" OR ");
            }
            whereClause.append(PRICE_COLUMN + " LIKE ?");
            intermediateWhereArgs.add(value);
        }
        if(type_rb) {
            if (whereClause.length() > 0) {
                whereClause.append(" OR ");
            }
            whereClause.append(TYPE_COLUMN + " LIKE ?");
            intermediateWhereArgs.add(value);
        }
        if(power_rb) {
            if (whereClause.length() > 0) {
                whereClause.append(" OR ");
            }
            whereClause.append(POWER_COLUMN + " LIKE ?");
            intermediateWhereArgs.add(value);
        }
        if(weight_rb) {
            if (whereClause.length() > 0) {
                whereClause.append(" OR ");
            }
            whereClause.append(WEIGHT_COLUMN + " LIKE ?");
            intermediateWhereArgs.add(value);
        }
        if(country_rb) {
            if (whereClause.length() > 0) {
                whereClause.append(" OR ");
            }
            whereClause.append(COUNTRY_COLUMN + " LIKE ?");
            intermediateWhereArgs.add(value);
        }
        if(name_rb) {
            if (whereClause.length() > 0) {
                whereClause.append(" OR ");
            }
            whereClause.append(NAME_COLUMN + " LIKE ?");
            intermediateWhereArgs.add(value);
        }
    }
    String[] whereArgs = null;
    if (intermediateWhereArgs.size() > 0) {
        whereArgs = new String[intermediateWhereArgs.size()];
        for (int i=0; i < intermediateWhereArgs.size(); i++) {
            whereArgs[i] = intermediateWhereArgs.get(i);
        }
    }
    String actualWhereClause = "";
    if (whereClause != null) {
        actualWhereClause = whereClause.toString();
    }
    return this.getWritableDatabase().query(TABLE_NAME,null,actualWhereClause,whereArgs,null,null,NAME_COLUMN);
}

I'm not sure this is exactly what you want do perhaps consider this working example that utilises the above.
First DatabaseHelper (which includes the above) :-
class DatabaseHelper extends SQLiteOpenHelper {

    public static final String DATABASE_NAME = "the_database.db";
    public static final int DATABASE_VERSION = 1;
    public static final String TABLE_NAME = "the_table";
    public static final String ID_COLUMN = BaseColumns._ID;
    public static final String PRICE_COLUMN = "price";
    public static final String TYPE_COLUMN = "type";
    public static final String POWER_COLUMN = "power";
    public static final String WEIGHT_COLUMN = "weight";
    public static final String COUNTRY_COLUMN = "country";
    public static final String NAME_COLUMN = "name";
    public static final String TABLE_CREATE_SQL = "CREATE TABLE IF NOT EXISTS " + TABLE_NAME + "(" +
            ID_COLUMN + " INTEGER PRIMARY KEY" +
            "," + PRICE_COLUMN + " TEXT" +
            "," + TYPE_COLUMN + " TEXT" +
            "," + POWER_COLUMN + " TEXT" +
            "," + WEIGHT_COLUMN + " TEXT" +
            "," + COUNTRY_COLUMN + " TEXT" +
            "," + NAME_COLUMN + " TEXT" +
            ")";

    private SQLiteDatabase db;
    private DatabaseHelper(Context context) {
        super(context,DATABASE_NAME,null,DATABASE_VERSION);
    }

    private static volatile DatabaseHelper instance;
    public static DatabaseHelper getDatabaseHelperInstance(Context context) {
        if (instance==null) {
            instance = new DatabaseHelper(context);
            instance.db = instance.getWritableDatabase();
        }
        return instance;
    }

    @Override
    public void onCreate(SQLiteDatabase db) {
        db.execSQL(TABLE_CREATE_SQL);
    }

    @Override
    public void onUpgrade(SQLiteDatabase db, int i, int i1) {

    }

    public long insert(Long id, String price, String type, String power, String weight, String country, String name) {
        ContentValues cv = new ContentValues();
        if (id !=null) {
            cv.put(ID_COLUMN,id);
        }
        cv.put(PRICE_COLUMN,price);
        cv.put(TYPE_COLUMN,type);
        cv.put(POWER_COLUMN,power);
        cv.put(WEIGHT_COLUMN,weight);
        cv.put(COUNTRY_COLUMN,country);
        cv.put(NAME_COLUMN,name);
        long rv =  db.insert(TABLE_NAME,null,cv);
        return rv;
    }

    public long insert(String price, String type, String power, String weight, String country, String name) {
        return insert(null,price,type,power,weight,country,name);
    }
    public Cursor getData(String value, boolean price_rb, boolean type_rb, boolean power_rb, boolean weight_rb, boolean country_rb, boolean name_rb) {

        ArrayList<String> intermediateWhereArgs = new ArrayList<>();

        StringBuilder whereClause = new StringBuilder();
        if (value.length() < 1 || (!price_rb && !type_rb && !power_rb && !weight_rb && !country_rb && !name_rb)) {
            whereClause = null;
        } else {
            if(price_rb) {
                if (whereClause.length() > 0) {
                    whereClause.append(" OR ");
                }
                whereClause.append(PRICE_COLUMN + " LIKE ?");
                intermediateWhereArgs.add(value);
            }
            if(type_rb) {
                if (whereClause.length() > 0) {
                    whereClause.append(" OR ");
                }
                whereClause.append(TYPE_COLUMN + " LIKE ?");
                intermediateWhereArgs.add(value);
            }
            if(power_rb) {
                if (whereClause.length() > 0) {
                    whereClause.append(" OR ");
                }
                whereClause.append(POWER_COLUMN + " LIKE ?");
                intermediateWhereArgs.add(value);
            }
            if(weight_rb) {
                if (whereClause.length() > 0) {
                    whereClause.append(" OR ");
                }
                whereClause.append(WEIGHT_COLUMN + " LIKE ?");
                intermediateWhereArgs.add(value);
            }
            if(country_rb) {
                if (whereClause.length() > 0) {
                    whereClause.append(" OR ");
                }
                whereClause.append(COUNTRY_COLUMN + " LIKE ?");
                intermediateWhereArgs.add(value);
            }
            if(name_rb) {
                if (whereClause.length() > 0) {
                    whereClause.append(" OR ");
                }
                whereClause.append(NAME_COLUMN + " LIKE ?");
                intermediateWhereArgs.add(value);
            }
        }
        String[] whereArgs = null;
        if (intermediateWhereArgs.size() > 0) {
            whereArgs = new String[intermediateWhereArgs.size()];
            for (int i=0; i < intermediateWhereArgs.size(); i++) {
                whereArgs[i] = intermediateWhereArgs.get(i);
            }
        }
        String actualWhereClause = "";
        if (whereClause != null) {
            actualWhereClause = whereClause.toString();
        }
        return this.getWritableDatabase().query(TABLE_NAME,null,actualWhereClause,whereArgs,null,null,NAME_COLUMN);
    }
}

Some Activity code which utilises the above. The activity has a Radio Button group (so only 1 button can be selected).
The resultant data is listed in a ListView that uses a SimpleCursorAdapater. The data is refreshed every time a button is clicked, the data displayed dependant upon the text in the edit text. If empty, then ALL rows are displayed. Otherwise the respective button determines the filter.

*

*where this may or may differ is that only a single filter is aplied as only 1 button can be checked with a RadioGroup. If multiple radio buttons can be clicked then the filter will be on multiple columns (untested so may need tweaking accordingly).

MainActivity :-
public class MainActivity extends AppCompatActivity {

    EditText inputValue;
    RadioGroup radioGroup;
    RadioButton priceRadioButton;
    RadioButton powerRadioButton;
    RadioButton typeRadioButton;
    RadioButton weightRadioButton;
    RadioButton countryRadioButton;
    RadioButton nameRadioButton;
    ListView listView;
    DatabaseHelper databaseHelper;
    SimpleCursorAdapter sca;
    Cursor csr;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        inputValue = this.findViewById(R.id.value_edittext);
        radioGroup = this.findViewById(R.id.filter_radiogroup);
        priceRadioButton = this.findViewById(R.id.price_radiobutton);
        powerRadioButton = this.findViewById(R.id.power_radiobutton);
        typeRadioButton = this.findViewById(R.id.type_radiobutton);
        weightRadioButton = this.findViewById(R.id.weight_radiobutton);
        countryRadioButton = this.findViewById(R.id.country_radiobutton);
        nameRadioButton = this.findViewById(R.id.name_radiobutton);
        radioGroup.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
            @Override
            public void onCheckedChanged(RadioGroup radioGroup, int i) {
                setupOrRefreshListView();
            }
        });
        listView = this.findViewById(R.id.list);
        databaseHelper = DatabaseHelper.getDatabaseHelperInstance(this);
        addSomeData();
        setupOrRefreshListView();
    }

    private void setupOrRefreshListView() {
        csr = databaseHelper.getData(
                inputValue.getText().toString(),
                priceRadioButton.isChecked(),
                typeRadioButton.isChecked(),
                powerRadioButton.isChecked(),
                weightRadioButton.isChecked(),
                countryRadioButton.isChecked(),
                nameRadioButton.isChecked()
        );
        if (sca==null) {
            sca = new SimpleCursorAdapter(
                    this,
                    android.R.layout.simple_list_item_2,
                    csr,
                    new String[]{
                            DatabaseHelper.ID_COLUMN,
                            DatabaseHelper.NAME_COLUMN
                    },
                    new int[]{
                            android.R.id.text1,
                            android.R.id.text2
                    },
                    0
            );
            listView.setAdapter(sca);
        } else {
            sca.swapCursor(csr);
        }
    }

    private void addSomeData() {
        databaseHelper.insert("10","type1","high","heavy","Australia","Fred");
        databaseHelper.insert("100","type2","medium","medium","France","Mary");
        databaseHelper.insert("1000","type3","normal","normal","England","Sue");
        databaseHelper.insert("10000","type4","low","light","Germany","Tom");
        databaseHelper.insert("100000","type5","none","very light","Spain","Jane");
    }
}

Demo Run

When run (only designed to run once, otherwise it will duplicate the data) the database is loaded with data (as per the addSomeData method):-

And the device shows :-

*

*for brevity just the id and the name are shown (rather than use a custom layout).

*i.e. all of the 5 rows added are displayed as expected.
If a button is clicked/checked then, as there is no text in the edit text, then the same data is displayed (but the button can be seen to be checked)
If text is added let's say 10 and the Price button (first) is checked (sorry for brevity/convenience labels not added) then:-

If 1000 then Sue etc.
If 1000% then Jane, Sue and Tom (1% or 10% would show all).
No data is shown if any of the other buttons are checked.
If %e% (or %E% as LIKE is not case dependant) is input then:-

*

*the Price button shows nothing.

*the Type button (second) shows all 5 ( as per type)

*The Power button (third) shows Jane and Mary (none and medium)

*

*e.g.

*
and so on.
Additional re comment

I updated the code. Could you please check it and help me figuring this out.

Your issue is not with the filter SQL but that you are trying to update the textView from another thread and that isn't happening.
If you add a line to write the result of the filer to the log e.g.:-
                   textView.post(new Runnable() {
                        public void run() {
                            System.out.println(data); //<<<<<<<<<< LINE ADDED FOR DEBUG
                            textView.setText(data);
                        }
                    });

The you will see that the log includes the expected result e.g. (run using your MySQlite code)
2022-11-30 06:47:13.971 13016-13056/a.a.so74607559javasqlitefilterbyradiobuttons I/System.out: SELECT  * FROM emergency_service WHERE (price LIKE '%f%' OR type LIKE '%f%' OR power LIKE '%f%' OR weight LIKE '%f%' OR country LIKE '%f%' OR name LIKE '%f%') ORDER BY name
2022-11-30 06:47:13.986 I/System.out: 1) fred: 100.00: type2: Medium: Medium: Australia:
2022-11-30 06:47:13.986 I/System.out: 2) fred: 100.00: type2: Medium: Medium: Australia:
2022-11-30 06:47:13.986 I/System.out: 3) fred: 100.00: type2: Medium: Medium: Australia:
2022-11-30 06:47:13.986 I/System.out: 4) fred: 100.00: type2: Medium: Medium: Australia:
2022-11-30 06:47:14.132 13016-13057/a.a.so74607559javasqlitefilterbyradiobuttons I/System.out: SELECT  * FROM emergency_service WHERE (price LIKE '%fr%' OR type LIKE '%fr%' OR power LIKE '%fr%' OR weight LIKE '%fr%' OR country LIKE '%fr%' OR name LIKE '%fr%') ORDER BY name
2022-11-30 06:47:14.155 I/System.out: 1) fred: 100.00: type2: Medium: Medium: Australia:
2022-11-30 06:47:14.155 I/System.out: 2) fred: 100.00: type2: Medium: Medium: Australia:
2022-11-30 06:47:14.155 I/System.out: 3) fred: 100.00: type2: Medium: Medium: Australia:
2022-11-30 06:47:14.155 I/System.out: 4) fred: 100.00: type2: Medium: Medium: Australia:
2022-11-30 06:47:18.367 13016-13058/a.a.so74607559javasqlitefilterbyradiobuttons I/System.out: SELECT  * FROM emergency_service WHERE (price LIKE '%fre%' OR type LIKE '%fre%' OR power LIKE '%fre%' OR weight LIKE '%fre%' OR country LIKE '%fre%' OR name LIKE '%fre%') ORDER BY name
2022-11-30 06:47:18.388 I/System.out: 1) fred: 100.00: type2: Medium: Medium: Australia:
2022-11-30 06:47:18.388 I/System.out: 2) fred: 100.00: type2: Medium: Medium: Australia:
2022-11-30 06:47:18.388 I/System.out: 3) fred: 100.00: type2: Medium: Medium: Australia:
2022-11-30 06:47:18.388 I/System.out: 4) fred: 100.00: type2: Medium: Medium: Australia:
2022-11-30 06:47:18.564 13016-13059/a.a.so74607559javasqlitefilterbyradiobuttons I/System.out: SELECT  * FROM emergency_service WHERE (price LIKE '%fred%' OR type LIKE '%fred%' OR power LIKE '%fred%' OR weight LIKE '%fred%' OR country LIKE '%fred%' OR name LIKE '%fred%') ORDER BY name
2022-11-30 06:47:18.583 I/System.out: 1) fred: 100.00: type2: Medium: Medium: Australia:
2022-11-30 06:47:18.583 I/System.out: 2) fred: 100.00: type2: Medium: Medium: Australia:
2022-11-30 06:47:18.583 I/System.out: 3) fred: 100.00: type2: Medium: Medium: Australia:
2022-11-30 06:47:18.583 I/System.out: 4) fred: 100.00: type2: Medium: Medium: Australia:

*

*as can be seen for each character entered in the EditText results in the filter being applied so result after entering f, another result after entering r (so edit text is fr) and so on

BUT the extracted data is not reflected in the textView TextView.
Adding the method to the activity code:-
private void refreshTextView(String filteredDataResult) {
    textView.setText(filteredDataResult);
}

And then using:-
                    textView.post(new Runnable() {
                        public void run() {
                            System.out.println(data); //<<<<<<<<<< REMOVE WHEN HAPPY WITH RESULT
                            //textView.setText(data); //<<<<<<<<<< COMMENTED OUT
                            refreshTextView(data); //<<<<<<<<<< LINE ADDED
                        }
                    });

The result being :-
When first run:-

*

*Hello World being the initial value as per the layout.

Enter f and :-

Change to h and :-

x and :-

*

*i.e. no data matches filter

clear the input and all rows are displayed:-

However
The radio buttons serve no purpose, see the original answer for how you could make use of the radio buttons to effect the filter.


text:
Q: How to access the attached event handler in jquery? I have a simple button in HTML like this:
<input type='button' id='btnPrint' value='Print' onclick="changeStylesheet();" />

This button already contains a onclick event handler. What I m trying to achieve here is to be able compose the onclick event handler for same the button. I would like to add second method that tracks how many times the button was hit.
some approaches:
First: Append another function call in HTML as per inline event registration.
<input type='button' id='btnPrint' value='Print' onclick='changeStylesheet();trackThis();>' />

This is the easiest way to go but not feasible in my situation.
Second: Grab the onclick event and check if it is undefined. Then, recompose the event handler with anonymous function using JavaScript native syntax.
var elem = document.getElementById('btnPrint');
var existingHandler = **elem.onclick ? elem.onclick : function () {};**
elem.onclick = function () {
     trackThis();
     existingHandler();
};

Third: Though above approaches work, I m curious to learn the way to do above #2 approach but with jQuery syntax.
 var elem = $('#btnPrint');
    var existingHandler = **elem.click ? elem.click : function () {};**
    elem.click(function () {
        trackThis();
        existingHandler()
    });

What is happening with #3 solution in mine is that I m getting
Uncaught TypeError: Object [object Window] has no method 'trigger'
error.
Any hints will be very appreciated.

A: If both handlers are to be attached in jQuery then simply set two click handlers. Internally, jQuery implements an "observer pattern" such that it aggregates handlers and will execute them sequentially in the order they were added.
$('#btnPrint').on('click', firstHandler);
$('#btnPrint').on('click', secondHandler);

These statements need not be consecutive or even in the same scope.
The same principle applies if a handler is already specified in the HTML. jQuery will simply execute any additional handlers after the original.
HTML:
<input type='button' id='btnPrint' value='Print' onclick=".....;" />

jQuery:
$('#btnPrint').on('click', secondHandler);

See fiddle
EDIT ...
It is also possible to revere the order such that the original handler executes after a handler attached in jQuery :
var $btnPrint = $('#btnPrint');
var originalHandler = $btnPrint.get(0).onclick;
$btnPrint.get(0).onclick = null;

$btnPrint.on('click', secondHandler);
$btnPrint.on('click', originalHandler);

See fiddle

A: If I understand your question right,
This should work,
$('#btnPrint').off("click", "**" ).on('click',function(){
     trackThis();
     existingHandler();
})

i.e. first off the existing event handlers , then on your custom one.
If this doesnt help you, this may be the one you want,
How to check if an event handler exist using jQuery or JS?
Edit
If you want to override the inline onclick, you can use this dirty approach.
jQuery code:
$(function(){
        var mydiv = $('#mydiv');
        var inlineClick = mydiv.attr('onclick');

        mydiv.removeAttr('onclick').click(function(){
            // your code
            alert('mycode');

            eval(inlineClick);

            // or first do, eval(inlineClick);
            //then your code later

        })
    });
    function inlinefun(){
        alert('I am inline function');
    }

Markup:

Mydiv

Without 'evil' eval
(may not work in every situation, just gave a you direction)
$(function(){
        var mydiv = $('#mydiv');

            // Dirty way to get function name and its args by a string.
    var inlineClick = mydiv.attr('onclick').split('(');
    var funName = inlineClick[0];
            var args = inlineClick[1].replace(')','');

    mydiv.removeAttr('onclick').click(function(){
        // your code
        alert('mycode');

        // The default inline function
        window[funName](args);

        // you can change the order as you want

    })
});
function inlinefun(msg){
            // I know I am passing string, so removing the quotes, you need a generalised approach here
    alert(msg.replace('"',''));
}

Markup:

Mydiv


text:
Q: AES-256 and PKCS7Padding fails in Java I have a couple of library, C#, PHP and Android where they all encrypt/decrypt a string in the same way so they are all compatible with each other, i.e. C# writes and encrypts data to a database and PHP can successfully decrypt it and return the original string.
I now need to do the same thing with a standard Java application, so I've taken the code from my Android library and need libraries but I am getting an exception. As far as I know the code wasn't Android specific so it shouldn't be a problem.
Below is my encryption function
public static String encrypt(String plainPasword)
    {
            String password = "";
            try
            {
                SecretKeySpec key = new SecretKeySpec("hcxilkqbbhczfeultgbskdmaunivmfuo".getBytes("US-ASCII"), "AES");
                IvParameterSpec iv = new IvParameterSpec("ryojvlzmdalyglrj".getBytes("US-ASCII"));

                Cipher cipher = Cipher.getInstance("AES/CBC/PKCS7Padding");

                cipher.init(Cipher.ENCRYPT_MODE, key, iv);

                byte[] encoded = cipher.doFinal(plainPasword.getBytes());
                password = new String(Base64.encodeBase64(encoded));

            }
            catch (Exception ex)
            {
                System.err.println("Encryption Exception: " + ex.toString());
            }
            return password;
    }

When I call Encryption.encrypt("myString") I get the following exception:
Encryption Exception: java.security.NoSuchAlgorithmException: Cannot find any provider supporting AES/CBC/PKCS7Padding

As I said this code is working fine on Android and it shouldn't make any difference where it is running from.
Update
I found that I needed PKCS5Padding instead of 7 thanks to a link on a comment. I am now though getting the following exception:
Encryption Exception: java.security.InvalidKeyException: Illegal key size

A: First, in Java, the standard padding name is PKCS5Padding, not PKCS7Padding. Java is actually performing PKCS #7 padding, but in the JCA specification, PKCS5Padding is the name given.
Next, you are trying to use AES-256, so you'll need to install the Unlimited Strength Jurisdiction policy files.
Hopefully this is just an example and you aren't using the same IV for every message, right?


text:
Q: Deployment of metadata between 2 orgs using ANT I'm deploying custom objects data from OrgA o OrgB using ANT tool which left me in never ending scenario on what to deploy 1st. Here is my scenario:
I got OrgA which contains custom fields in Managed package and some custom objects.In OrgB i have only Managed Package objects and fields.I need to deploy these custom fields of Managed Package object & some custom Objects.
1) I got the custom Object data of Managed Package from OrgA which contains few fields having relation with custom object fields.
2) Custom object fields also have an relationship with Managed Package objects.
If i try to deploy Managed Package objects first, it is giving me errors of the fields which is having relationship with custom objects.
If i do the custom Object first, it is also throwing the error of the fields having an relationship with custom objects.
Is there any better approach available? I'm looking for a sample.xml which gives me all objects(including custom fields) of a managed package and all custom objects of an org?
Note: Above custom or Managed objects includes custom fields, buttons(reference to apex pages)

A: from my site - you can deploy only custom fields from managed packages.
you should add all of standard object to the package.xml
<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
    <types>
        <members>*</members>
        <members>StandardObject</members>
        <members>Object1_ManagePackage</members>
        <members>Object2_ManagePackage</members>
        <name>CustomObject</name>
    </types>
<version>38.0</version>
</Package>

when you deploy only object/fields you must remember that you should add manuly it to the profile/permision set/ field level security
Please mark this answer if it is helpful for you.


text:
Q: Ruby - Share local variable with the obj's eigenclass I am trying to dynamically define methods on an initialized Ruby object MyObject based on a hash my_hash I pass to its initialize method. In the body of the initialize method, I have the following:
my_hash.each do |key|
  class << self
    define_method(key.underscore.to_sym) do
      my_hash[key]
    end
  end
end

This fails with a undefined local variable or method 'key' for #<Class:#<MyObject:0x007fc7abw0cra0>>. Any ideas why?
The my_hash is made out of a json response with a lot of camelized keys, so it's more convenient to have simple ruby methods to get the values I want.

A: Local variables are local to the scope they are defined in. The (lexical) scopes in Ruby are script scope, module/class definition scope, method definition scope and block scope. Only block scopes nest in their outer scopes (aka close over their surrounding scope). So, you have to use a block:
my_hash.each_key do |key|
  singleton_class.class_eval do
    define_method(key.to_sym) do
      my_hash[key]
    end
  end
end

Or even better yet:
my_hash.each_key do |key|
  define_singleton_method(key.underscore.to_sym) do
    my_hash[key]
  end
end

Note: I also fixed a bug, you should be iterating the keys with each_key, not each (which is an alias for each_pair).

A: You can use define_singleton_method rather than class << self. Also note that Hash#each yields a two element array with the key and value.
my_hash.each do |key, val|
  define_singleton_method(key.underscore.to_sym) do
    val
  end
end


text:
Q: What's the best way to associate a number with a method in x86_64 assembly I have a server socket which receives a byte (operation code) from the client.
Depending on what the value of that byte is, I need to decode further data with a specific function.
For example:

*

*if the value is 0x01, I need to call function1 to decode it.

*for 0x02, execute call function2

*and so forth...

I don't want to hardcode it all with compare and jump statements because there are more than 150 possible values and that would result to 400+ lines of code.
What would be the best option to implement this, resulting in the cleanest code? In C language, I would do this with a simple array: array[index] where array stores the function pointers and index is the operation code. This would result in O(1) speeds.
This is just a general question, but I'm working with x86_64 asm with NASM syntax if that helps.

A: Yes, a table of function pointers is the obvious way in asm as well.
call [dispatch_table + rax*8] in non-PIE / non-PIC code where the label address itself can fit in a 32-bit sign-extended value so you can use a label with other registers, otherwise use a RIP-relative LEA to get the table base into another register.  (Look at C compiler output for a function-pointer dispatch if you need an example.)
Don't forget to validate input first, e.g. cmp eax, MAX_FUNC_NUMBER / ja error, after you do a zero-extending byte load into RAX with movzx eax, byte [mem] to zero-extend the index.
Or just a jmp instead of call to make it like a switch within a function if that's more convenient than a call that pushes a return address.


text:
Q: Remove parenthesis if length > max length I have a number of models like
"Dell Inspiron 6 (i7-8550U/8GB/256GB/Radeon 520/FHD/W10)"
"Lenovo V130 (i5-7200U/4GB/128GB/FHD/W10) (2017)"
"Dell XPS 13 Touch (i7-8550U/16GB/512GB/UHD/W10)"

and I want to remove the parenthesis where it mentions the specs.
The final output should be something like this
"Dell Inspiron 6"
"Lenovo V130 (2017)"
"Dell XPS 13 Touch"

I managed to get the parenthesis contents with this regex
\((.+?)\)

However, the regex returns both parentheses.
Is there any way to only get the text that is greater than a number of characters?
Here is a regex example.

A: You may use this regex to match (...) where there are 6+ characters between ( and ):
\s*\(([^)]{6,})\)

Updated RegEx Demo
RegEx Details:

*

*[^)]: matches any character except )

*{6,}: Quantifier to match 6 or more characters

A: Use a regex substitution, and sub in an empty string.  For example, in Python, you could do the following:
import re

name = 'Dell Inspiron 6 (i7-8550U/8GB/256GB/Radeon 520/FHD/W10)'
re.sub("\s\(.{5,}\)", "", name)

Output
'Dell Inspiron 6'

Note that I used {5,} which will match only parathentical strings with 5 or more characteres, which will leave the years (e.g., (2017)) in place.

A: You can exploit some text that is surely there in your first brackets and not in second brackets like a slash / and change your regex from,
\((.+?)\)

to
 \((.*\/[^)]*?)\)

And replace it with empty string.
Live Demo


text:
Q: Newest version of nodejs is not intalling in Linux Mint Tina Environment
Linux Mint 19.2 Tina 84_x64
Installation
$curl -sL https://deb.nodesource.com/setup_10.x | sudo bash -

## Installing the NodeSource Node.js 10.x repo...

## Populating apt-get cache...

+ apt-get update
Hit:1 http://archive.canonical.com/ubuntu bionic InRelease
Hit:2 http://archive.ubuntu.com/ubuntu bionic InRelease
Hit:3 http://security.ubuntu.com/ubuntu bionic-security InRelease
Ign:4 http://packages.linuxmint.com tina InRelease
Hit:5 http://archive.ubuntu.com/ubuntu bionic-updates InRelease
Hit:6 http://archive.ubuntu.com/ubuntu bionic-backports InRelease
Hit:7 http://packages.linuxmint.com tina Release
Reading package lists... Done

## Confirming "tina" is supported...

+ curl -sLf -o /dev/null 'https://deb.nodesource.com/node_10.x/dists/tina/Release'

## Your distribution, identified as "tina", is not currently supported, please contact NodeSource at https://github.com/nodesource/distributions/issues if you think this is incorrect or would like your distribution to be considered for support

Installing Nodejs
$ sudo apt-get install nodejs
$ nodejs --version
v8.10.0

LTS version 10x is not installed?

A: The installation script that you downloaded needs to be adjusted so that it knows about tina being a bionic release.
First, download the script:
wget https://deb.nodesource.com/setup_10.x
Then, open the file in your favorite editor. Scroll down until you find a section that begins with check_alt. Look for a line that looks like this:
check_alt "Linux Mint"    "tessa"    "Ubuntu" "bionic"
Add this line right below it:
check_alt "Linux Mint"    "tina"    "Ubuntu" "bionic"
After saving, run chmod +x setup_10.x. Now you can run this script as normal.


text:
Q: I want to add camera to my emulator but My emulator has not hardware options
*

*Where is hardware choose? I don't find and I don't add camera my  emulator

A:
First connect you webcam with PC and check it is working or not.
Then select back camera option to Webcam and save this configuration
and start your AVD.


text:
Q: Is it possible to create an HTML quine? Per the title, is it possible to create a (non-trivial) quine in HTML?
My definition of an HTML quine:

A non-trivial HTML quine is one that is not null and uses at least one HTML tag, under the assumption that some string in an HTML file is rendered by a browser as plain text. An HTML quine is defined such that the output of the q.html as rendered by a standard browser is the contents of q.html itself.

(I'm open for any comments on this definition, I kind of hacked it up right now)
HTML is not turing-complete, therefore the fixed-point theorem cannot be applied to prove that it is indeed possible.
However, this does not necessarily mean an HTML quine is impossible. Or can it in fact be proven that an HTML quine is impossible?

A: It's certainly not possible with "plain" HTML. Obviously it would be possible to do with JavaScript, but it's also possible with CSS:

<title>This is the title</title>
';}
body:before  {content:'';position:absolute;left:0;}
]]></style>

A: This is not possible. Since every unescaped element will be interpreted as markup by the browser, the browser will attempt to render or handle the contents of those elements or as a control. You cannot display an element that is not escaped in some way, such as with the
 tag. But then such tags will also not be displayed.
Of course, you could serve it as text/plain with appropriate HTTP headers but, then, that's not HTML. Just using the .html extension will make browsers render it as html anyway in most (all?) cases.

A: You can't.
<!DOCTYPE html>

<title></title>

You can cheat though and do
<body onload="document.getElementById("quine").innerHTML = document.documentElement.innerHTML.replace(/\&/g, "&" ).replace(/\</g, "<" ).replace(/\>/g, ">");" >

A: Sure, just like with all HTML "what ifs", the answer is just use JQuery!