text:
Q: How to create template filters that don't change original value I'd like to create filters that don't change the original value of the variable to which they are applied.
Here is a very simple filter:
def increment(mynumber):
    return mynumber + 1

JINJA_ENVIRONMENT.filters['increment'] = increment

If in the template I have something like:
{% set anumber = 10 %}
first: {{ anumber|increment }}
second: {{ anumber|increment }}

I would expect to see displayed:
first: 11
second: 11

and instead I get:
first: 11
second: 12

How can I achieve the first type result?
Can I also do it so that chained filters will pass the new value along?
For example:
first: {{ anumber|increment|increment|increment }}
second: {{ anumber|increment }}

will output
first: 13
second: 11

A: I'm really sorry, I didn't know that in python variables are assigned by reference and not by value. And my example was too simple: I'm actually dealing with dictionaries.
The solution is as simple as:
def myFilter(myDict):
    returnDict = myDict.copy()
    # change returnDict ..
    return returnDict


text:
Q: How to update CRS r object from PROJ4 to PROJ6 I have a script which contains several r objects which are CRSs that I use for transforming spatial objects. After updating R and many packages, there is a warning which wasn't there before.
LCC <- CRS("+proj=lcc +lat_1=49 +lat_2=77 +lat_0=0 +lon_0=-95 +x_0=0 +y_0=0 +ellps=GRS80 +units=m +no_defs")

Warning message:
In showSRID(uprojargs, format = "PROJ", multiline = "NO", prefer_proj = prefer_proj) :
  Discarded datum Unknown based on GRS80 ellipsoid in CRS definition

I understand that this is due to a change in how spatial information is stored... PROJ4 to PROJ6 upgrade and "Discarded datum" warnings
..but beyond that, I don't understand what this error means or if I need to do anything in response.
Any thoughts?

A: Your proj4 string lacks a +datum parameter, and PROJ is warning you.
To remove the warning, add a +datum parameter with the correct datum that the data was defined as.
This is likely to be WGS84 or NAD83, which are very similar, or unlikely to be NAD27 which is old but does give different results from the others.
I replicate your error:
LCC <- CRS("+proj=lcc +lat_1=49 +lat_2=77 +lat_0=0 +lon_0=-95 +x_0=0 +y_0=0 +ellps=GRS80 +units=m +no_defs")
## Warning message:
## In showSRID(uprojargs, format = "PROJ", multiline = "NO", prefer_proj = prefer_proj) :
##  Discarded datum Unknown based on GRS80 ellipsoid in CRS definition

and I can construct three other CRS objects with the three datums and these don't generate the error (if you can't see the difference in these strings, check its not scrolled off the right of your screen...)
LCC84 <- CRS("+proj=lcc +lat_1=49 +lat_2=77 +lat_0=0 +lon_0=-95 +x_0=0 +y_0=0 +ellps=GRS80 +datum=WGS84 +units=m +no_defs")
LCC83 <- CRS("+proj=lcc +lat_1=49 +lat_2=77 +lat_0=0 +lon_0=-95 +x_0=0 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs")
LCC27 <- CRS("+proj=lcc +lat_1=49 +lat_2=77 +lat_0=0 +lon_0=-95 +x_0=0 +y_0=0 +ellps=GRS80 +datum=NAD27 +units=m +no_defs")

As a test (and there's probably better ways of doing this) I'll generate some lat-long points in EPSG:4326 and see where they end up when transformed with these CRS.
> pts = data.frame(x=1:20, y=1:20, z=LETTERS[1:20])
> coordinates(pts) = ~x+y
> proj4string(pts)="+init=epsg:4326"

now transform those points using the four different CRS, and get the x-y points as a matrix:
> xydef = coordinates(spTransform(pts, LCC))
> xy84 = coordinates(spTransform(pts, LCC84))
> xy83 = coordinates(spTransform(pts, LCC83))
> xy27 = coordinates(spTransform(pts, LCC27))

The default datum appears to be NAD83, based on this:
> all(xydef == xy83)
[1] TRUE

The difference between this and the WGS84 datum is small - these are metres:
> xydef - xy84
               x             y
1  -1.375843e-04 -0.0001334306
2  -1.300666e-04 -0.0001359694
3  -1.227129e-04 -0.0001382660
4  -1.155287e-04 -0.0001403205
5  -1.085084e-04 -0.0001421534
6  -1.016594e-04 -0.0001437627

but the NAD27 datum is very different, a few hundred metres:
> xydef - xy27
            x        y
1  191.783605 187.6420
2  176.501677 191.4228
3  161.595454 194.7053
4  147.070099 197.5092
5  132.930356 199.8542
6  119.180556 201.7600
7  105.824604 203.2458
8   92.865987 204.3309

So the answer is: 1. add the +datum= to your projection strings, 2. use the correct datum (probably NAD83 or WGS84, either won't matter much, alternates like NAD27 unlikely, check the source), 3. use the sf package and write your projections as WKT (its the default) instead of proj strings.

redpajama_set_name: RedPajamaStackExchange


text:
Q: Erro ao executar o comando yarn start/ npm start Assim que executo o comando create-react-app e faz criação do projeto. no final quando eu vou executar o comando "yarn start". segue o seguinte erro:
yarn run v1.22.4
warning package.json: No license field
error Command "start" not found.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Ja tentei várias coisas como, deletar a pasta node_modules, deletar o yarn.lock, deletar o package.json, desinstalei e instalei o node de novo. Não sei o que aconteceu, pois um dia atrás eu estava rodando o comando normalmente.

A: Nesses casos, procure incluir o passo a passo executado na sua pergunta. Pela descrição do problema, o mais provável é que vc tenha criado o projeto e não tenha entrado na pasta do dele.
Seguindo a documentação do react:
yarn create react-app my-app
cd my-app
yarn start


text:
Q: Cells are treated as text after input from file I create a script in VBA that copy data from txt to spreadsheet, but cells are treated like a text even after formatting them to percent or number:
Sub PasteTextFileContent()
Dim wbExcel As Workbook, wbText As Workbook
Dim wsExcel As Worksheet
Set wbExcel = ThisWorkbook
Set wsExcel = wbExcel.Sheets("PastData")
Set wbText = Workbooks.Open("C:\Test\test.txt")

wbText.Sheets(1).Cells.Copy wsExcel.Cells

wbText.Close SaveChanges:=False

    Sheets("PastData").Visible = True
    Sheets("PastData").Select
    Columns("A:A").Select
    Selection.TextToColumns Destination:=Range("A1"), DataType:=xlDelimited, _
    TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=False, _
    Semicolon:=False, Comma:=True, Space:=False, Other:=False, FieldInfo _
    :=Array(Array(1, 1), Array(2, 1), Array(3, 1), Array(4, 1), Array(5, 1), Array(6, 1), _
    Array(7, 1), Array(8, 1), Array(9, 1), Array(10, 1), Array(11, 1), Array(12, 1), Array(13, 1 _
    ), Array(14, 1), Array(15, 1), Array(16, 1), Array(17, 1), Array(18, 1)), _
    TrailingMinusNumbers:=True
    Sheets("PastData").Visible = False
End Sub

I input data to text with:
Sub ToTxtFileSimpleButWorkingWell()
Dim strFile_Path As String
strFile_Path = "C:\Test\test.txt"
Open strFile_Path For Append As #1
Write #1, Format(DateTime.Now, "yyyy-MM-dd hh:mm:ss"), Sheets("DASHBOARD").Range("V1").Value, Sheets("DASHBOARD").Range("V2").Value, Sheets("DASHBOARD").Range("V3").Value, Sheets("DASHBOARD").Range("V4").Value, Sheets("DASHBOARD").Range("V5").Value, Sheets("DASHBOARD").Range("V6").Value, Sheets("DASHBOARD").Range("V7").Value
Close #1
End Sub

How can I change that?


text:
Q: Prometheus - many-to-many matching not allowed: matching labels must be unique on one side Hi I am trying to monitor fortigate Firewalls using the dashboard specified in https://grafana.com/grafana/dashboards/7567
This works fine with a single target, however as soon as I add another target in the Prometheus.yml file, my grafana dashboard panels error with
many-to-many matching not allowed: matching labels must be unique on one side

My job in Prometheus.yml config looks like this:
  - job_name: 'snmp-exporter'
    static_configs:
      - targets:
        - XX.XX.XX.XX
        - YY.YY.YY.YY
    scrape_interval: 1m
    scrape_timeout : 1m
    metrics_path: /snmp
    params:
      module: [fortigate_snmp]
    relabel_configs:
      - source_labels: [__address__]
        target_label: __param_target
      - source_labels: [__param_target]
        target_label: instance
      - target_label: __address__
        replacement: localhost:9116


text:
Q: MailChimp API 3.0 batch request returns 400 Invalid Resource error I've been trying to use the batch endpoint of MailChimp API (version 3.0) to subscribe new users to a list, but can't make it work.
Here is the request:
POST /3.0/batches

{
  "operations": [
    {
        "method" : "POST",
        "path" : "lists/c852ce5c86/members",
        "body": "{\"email_address\":\"email@domain.tld\", \"status\":\"subscribed\"}"
    }
  ]
}

The request seems ok cause I get a 200 response:
{
  "id": "49abca6ef3",
  "status": "finished",
  "total_operations": 1,
  "finished_operations": 1,
  "errored_operations": 1,
  "submitted_at": "2015-09-21T18:11:16+00:00",
  "completed_at": "2015-09-21T18:11:23+00:00",
  "response_body_url": "https://mailchimp-api-batch.s3.amazonaws.com/49abca6ef3-response.tar.gz?..."
}

However, as you can see, the only operation in my batch is errored.
Here is the response_body_url for this operation:
[{
    "status_code":400,
    "operation_id":null,
    "response":"{
        \"type\":\"http://kb.mailchimp.com/api/error-docs/400-invalid-resource\",
        \"title\":\"Invalid Resource\",
        \"status\":400,
        \"detail\":\"The resource submitted could not be validated. For field-specific details, see the 'errors' array.\",
        \"instance\":\"\",
        \"errors\":[{
            \"field\":\"\",
            \"message\":\"Schema describes object, NULL found instead\"
        }]
    }"
}]

which is not very helpful :(
Note that if I directly hit POST lists/c852ce5c86/members with {"email_address":"email@domain.tld", "status":"subscribed"} payload, it's working properly.

A: That was actually a bug in the mailchimp API. After reaching them they quickly fixed it.


text:
Q: correct way to update a pandas dataframe with a shifted version of itself? The below code appears to work, however I fail to understand why it's working and if it's correct/safe:
>>> df = pd.DataFrame(np.random.randint(1, 100, 10).reshape(-1, 2), columns = list('ab'))
>>> df
    a   b
0  45  44
1  89  45
2  80  93
3  66  27
4  89  73
>>> df.at[1,'a']=0
>>> df.at[2,'a']=0
>>> df
    a   b
0  45  44
1   0  45
2   0  93
3  66  27
4  89  73
>>> df.loc[df['a']==0,'a'] = df['a'].shift(-2)
>>> df
    a   b
0  45  44
1  66  45
2  89  93
3  66  27
4  89  73
>>>

Why are the values updated as expected? (i.e. in [1,a] the value from [3,a] is copied in [2,a] the value of [4,a] is copied
Left side of the assignement is a subset of a dataframe column (i.e. a Series of 2 elements), right side of the assignment is a full column (a Series of 5 elements), so how does this assignment work?
Is the index of both sides of the assignment the same and is this used for the assignment?
Thx for any feed-back.
br,
Ruben

A: In general I avoid using .loc, .at etc. if only because the code can end up a bit obtuse. You may find an expression involving the where function a tad clearer since by definition the purpose of where is to conditionally replace values.
df['a'] = df['a'].where(df['a'] != 0, df['a'].shift(-2))


text:
Q: Ubuntu 18.04 - Catkin_make -> /usr/bin/ld: cannot find -lX11::X11 My problem is the following:
I am trying to run some ROS packages. I have already did it on a virtual machine so the packages are correct. I want now to do the same on my parition, I installed the libraries I needed but when I run catkin_make I get
/usr/bin/ld: cannot find -lX11::X11
collect2: error: ld returned 1 exit status
acin_reconstruction/CMakeFiles/reconstruction_node.dir/build.make:245: recipe for target '/home/vanessa/catkin_ws/devel/lib/acin_reconstruction/reconstruction_node' failed
make[2]: *** [/home/vanessa/catkin_ws/devel/lib/acin_reconstruction/reconstruction_node] Error 1
CMakeFiles/Makefile2:6388: recipe for target 'acin_reconstruction/CMakeFiles/reconstruction_node.dir/all' failed
make[1]: *** [acin_reconstruction/CMakeFiles/reconstruction_node.dir/all] Error 2
Makefile:140: recipe for target 'all' failed
make: *** [all] Error 2
Invoking "make -j8 -l8" failed"

I didn't find any solution on internet but I read a post in which a guy was using the following commands and so I write here the outputs
ld -lX11 --verbose:
 GNU ld (GNU Binutils for Ubuntu) 2.30
  Supported emulations:
   elf_x86_64
   elf32_x86_64
   elf_i386
   elf_iamcu
   i386linux
   elf_l1om
   elf_k1om
   i386pep
   i386pe
using internal linker script:
==================================================
/* Script for -z combreloc: combine and sort reloc sections */
/* Copyright (C) 2014-2018 Free Software Foundation, Inc.
   Copying and distribution of this script, with or without modification,
   are permitted in any medium without royalty provided the copyright
   notice and this notice are preserved.  */
OUTPUT_FORMAT("elf64-x86-64", "elf64-x86-64",
          "elf64-x86-64")
OUTPUT_ARCH(i386:x86-64)
ENTRY(_start)
SEARCH_DIR("=/usr/local/lib/x86_64-linux-gnu"); SEARCH_DIR("=/lib/x86_64-linux-gnu"); SEARCH_DIR("=/usr/lib/x86_64-linux-gnu"); SEARCH_DIR("=/usr/lib/x86_64-linux-gnu64"); SEARCH_DIR("=/usr/local/lib64"); SEARCH_DIR("=/lib64"); SEARCH_DIR("=/usr/lib64"); SEARCH_DIR("=/usr/local/lib"); SEARCH_DIR("=/lib"); SEARCH_DIR("=/usr/lib"); SEARCH_DIR("=/usr/x86_64-linux-gnu/lib64"); SEARCH_DIR("=/usr/x86_64-linux-gnu/lib");
SECTIONS
{
  /* Read-only sections, merged into text segment: */
  PROVIDE (__executable_start = SEGMENT_START("text-segment", 0x400000)); . = SEGMENT_START("text-segment", 0x400000) + SIZEOF_HEADERS;
  .interp         : { *(.interp) }
  .note.gnu.build-id : { *(.note.gnu.build-id) }
  .hash           : { *(.hash) }
  .gnu.hash       : { *(.gnu.hash) }
  .dynsym         : { *(.dynsym) }
  .dynstr         : { *(.dynstr) }
  .gnu.version    : { *(.gnu.version) }
  .gnu.version_d  : { *(.gnu.version_d) }
  .gnu.version_r  : { *(.gnu.version_r) }
  .rela.dyn       :
    {
      *(.rela.init)
      *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*)
      *(.rela.fini)
      *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*)
      *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*)
      *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*)
      *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*)
      *(.rela.ctors)
      *(.rela.dtors)
      *(.rela.got)
      *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*)
      *(.rela.ldata .rela.ldata.* .rela.gnu.linkonce.l.*)
      *(.rela.lbss .rela.lbss.* .rela.gnu.linkonce.lb.*)
      *(.rela.lrodata .rela.lrodata.* .rela.gnu.linkonce.lr.*)
      *(.rela.ifunc)
    }
  .rela.plt       :
    {
      *(.rela.plt)
      PROVIDE_HIDDEN (__rela_iplt_start = .);
      *(.rela.iplt)
      PROVIDE_HIDDEN (__rela_iplt_end = .);
    }
  .init           :
  {
    KEEP (*(SORT_NONE(.init)))
  }
  .plt            : { *(.plt) *(.iplt) }
.plt.got        : { *(.plt.got) }
.plt.sec        : { *(.plt.sec) }
  .text           :
  {
    *(.text.unlikely .text.*_unlikely .text.unlikely.*)
    *(.text.exit .text.exit.*)
    *(.text.startup .text.startup.*)
    *(.text.hot .text.hot.*)
    *(.text .stub .text.* .gnu.linkonce.t.*)
    /* .gnu.warning sections are handled specially by elf32.em.  */
    *(.gnu.warning)
  }
  .fini           :
  {
    KEEP (*(SORT_NONE(.fini)))
  }
  PROVIDE (__etext = .);
  PROVIDE (_etext = .);
  PROVIDE (etext = .);
  .rodata         : { *(.rodata .rodata.* .gnu.linkonce.r.*) }
  .rodata1        : { *(.rodata1) }
  .eh_frame_hdr : { *(.eh_frame_hdr) *(.eh_frame_entry .eh_frame_entry.*) }
  .eh_frame       : ONLY_IF_RO { KEEP (*(.eh_frame)) *(.eh_frame.*) }
  .gcc_except_table   : ONLY_IF_RO { *(.gcc_except_table
  .gcc_except_table.*) }
  .gnu_extab   : ONLY_IF_RO { *(.gnu_extab*) }
  /* These sections are generated by the Sun/Oracle C++ compiler.  */
  .exception_ranges   : ONLY_IF_RO { *(.exception_ranges
  .exception_ranges*) }
  /* Adjust the address for the data segment.  We want to adjust up to
     the same address within the page on the next page up.  */
  . = DATA_SEGMENT_ALIGN (CONSTANT (MAXPAGESIZE), CONSTANT (COMMONPAGESIZE));
  /* Exception handling  */
  .eh_frame       : ONLY_IF_RW { KEEP (*(.eh_frame)) *(.eh_frame.*) }
  .gnu_extab      : ONLY_IF_RW { *(.gnu_extab) }
  .gcc_except_table   : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) }
  .exception_ranges   : ONLY_IF_RW { *(.exception_ranges .exception_ranges*) }
  /* Thread Local Storage sections  */
  .tdata      : { *(.tdata .tdata.* .gnu.linkonce.td.*) }
  .tbss       : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }
  .preinit_array     :
  {
    PROVIDE_HIDDEN (__preinit_array_start = .);
    KEEP (*(.preinit_array))
    PROVIDE_HIDDEN (__preinit_array_end = .);
  }
  .init_array     :
  {
    PROVIDE_HIDDEN (__init_array_start = .);
    KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*) SORT_BY_INIT_PRIORITY(.ctors.*)))
    KEEP (*(.init_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .ctors))
    PROVIDE_HIDDEN (__init_array_end = .);
  }
  .fini_array     :
  {
    PROVIDE_HIDDEN (__fini_array_start = .);
    KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*) SORT_BY_INIT_PRIORITY(.dtors.*)))
    KEEP (*(.fini_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .dtors))
    PROVIDE_HIDDEN (__fini_array_end = .);
  }
  .ctors          :
  {
    /* gcc uses crtbegin.o to find the start of
       the constructors, so we make sure it is
       first.  Because this is a wildcard, it
       doesn't matter if the user does not
       actually link against crtbegin.o; the
       linker won't look for a file to match a
       wildcard.  The wildcard also means that it
       doesn't matter which directory crtbegin.o
       is in.  */
    KEEP (*crtbegin.o(.ctors))
    KEEP (*crtbegin?.o(.ctors))
    /* We don't want to include the .ctor section from
       the crtend.o file until after the sorted ctors.
       The .ctor section from the crtend file contains the
       end of ctors marker and it must be last */
    KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors))
    KEEP (*(SORT(.ctors.*)))
    KEEP (*(.ctors))
  }
  .dtors          :
  {
    KEEP (*crtbegin.o(.dtors))
    KEEP (*crtbegin?.o(.dtors))
    KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors))
    KEEP (*(SORT(.dtors.*)))
    KEEP (*(.dtors))
  }
  .jcr            : { KEEP (*(.jcr)) }
  .data.rel.ro : { *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*) *(.data.rel.ro .data.rel.ro.* .gnu.linkonce.d.rel.ro.*) }
  .dynamic        : { *(.dynamic) }
  .got            : { *(.got) *(.igot) }
  . = DATA_SEGMENT_RELRO_END (SIZEOF (.got.plt) >= 24 ? 24 : 0, .);
  .got.plt        : { *(.got.plt)  *(.igot.plt) }
  .data           :
  {
    *(.data .data.* .gnu.linkonce.d.*)
    SORT(CONSTRUCTORS)
  }
  .data1          : { *(.data1) }
  _edata = .; PROVIDE (edata = .);
  . = .;
  __bss_start = .;
  .bss            :
  {
   *(.dynbss)
   *(.bss .bss.* .gnu.linkonce.b.*)
   *(COMMON)
   /* Align here to ensure that the .bss section occupies space up to
      _end.  Align after .bss to ensure correct alignment even if the
      .bss section disappears because there are no input sections.
      FIXME: Why do we need it? When there is no .bss section, we don't
      pad the .data section.  */
   . = ALIGN(. != 0 ? 64 / 8 : 1);
  }
  .lbss   :
  {
    *(.dynlbss)
    *(.lbss .lbss.* .gnu.linkonce.lb.*)
    *(LARGE_COMMON)
  }
  . = ALIGN(64 / 8);
  . = SEGMENT_START("ldata-segment", .);
  .lrodata   ALIGN(CONSTANT (MAXPAGESIZE)) + (. & (CONSTANT (MAXPAGESIZE) - 1)) :
  {
    *(.lrodata .lrodata.* .gnu.linkonce.lr.*)
  }
  .ldata   ALIGN(CONSTANT (MAXPAGESIZE)) + (. & (CONSTANT (MAXPAGESIZE) - 1)) :
  {
    *(.ldata .ldata.* .gnu.linkonce.l.*)
    . = ALIGN(. != 0 ? 64 / 8 : 1);
  }
  . = ALIGN(64 / 8);
  _end = .; PROVIDE (end = .);
  . = DATA_SEGMENT_END (.);
  /* Stabs debugging sections.  */
  .stab          0 : { *(.stab) }
  .stabstr       0 : { *(.stabstr) }
  .stab.excl     0 : { *(.stab.excl) }
  .stab.exclstr  0 : { *(.stab.exclstr) }
  .stab.index    0 : { *(.stab.index) }
  .stab.indexstr 0 : { *(.stab.indexstr) }
  .comment       0 : { *(.comment) }
  /* DWARF debug sections.
     Symbols in the DWARF debugging sections are relative to the beginning
     of the section so we begin them at 0.  */
  /* DWARF 1 */
  .debug          0 : { *(.debug) }
  .line           0 : { *(.line) }
  /* GNU DWARF 1 extensions */
  .debug_srcinfo  0 : { *(.debug_srcinfo) }
  .debug_sfnames  0 : { *(.debug_sfnames) }
  /* DWARF 1.1 and DWARF 2 */
  .debug_aranges  0 : { *(.debug_aranges) }
  .debug_pubnames 0 : { *(.debug_pubnames) }
  /* DWARF 2 */
  .debug_info     0 : { *(.debug_info .gnu.linkonce.wi.*) }
  .debug_abbrev   0 : { *(.debug_abbrev) }
  .debug_line     0 : { *(.debug_line .debug_line.* .debug_line_end ) }
  .debug_frame    0 : { *(.debug_frame) }
  .debug_str      0 : { *(.debug_str) }
  .debug_loc      0 : { *(.debug_loc) }
  .debug_macinfo  0 : { *(.debug_macinfo) }
  /* SGI/MIPS DWARF 2 extensions */
  .debug_weaknames 0 : { *(.debug_weaknames) }
  .debug_funcnames 0 : { *(.debug_funcnames) }
  .debug_typenames 0 : { *(.debug_typenames) }
  .debug_varnames  0 : { *(.debug_varnames) }
  /* DWARF 3 */
  .debug_pubtypes 0 : { *(.debug_pubtypes) }
  .debug_ranges   0 : { *(.debug_ranges) }
  /* DWARF Extension.  */
  .debug_macro    0 : { *(.debug_macro) }
  .debug_addr     0 : { *(.debug_addr) }
  .gnu.attributes 0 : { KEEP (*(.gnu.attributes)) }
  /DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) *(.gnu.lto_*) }
}

>==================================================
attempt to open //usr/local/lib/x86_64-linux-gnu/libX11.so failed
attempt to open //usr/local/lib/x86_64-linux-gnu/libX11.a failed
attempt to open //lib/x86_64-linux-gnu/libX11.so failed
attempt to open //lib/x86_64-linux-gnu/libX11.a failed
attempt to open //usr/lib/x86_64-linux-gnu/libX11.so succeeded
-lX11 (//usr/lib/x86_64-linux-gnu/libX11.so)
libxcb.so.1 needed by //usr/lib/x86_64-linux-gnu/libX11.so
attempt to open /opt/ros/melodic/lib/libxcb.so.1 failed
attempt to open //usr/lib/x86_64-linux-gnu/libfakeroot/libxcb.so.1 failed
attempt to open //usr/local/lib/i386-linux-gnu/libxcb.so.1 failed
attempt to open //lib/i386-linux-gnu/libxcb.so.1 failed
attempt to open //usr/local/lib/i686-linux-gnu/libxcb.so.1 failed
attempt to open //lib/i686-linux-gnu/libxcb.so.1 failed
attempt to open //usr/lib/i686-linux-gnu/libxcb.so.1 failed
attempt to open //usr/local/lib/libxcb.so.1 failed
attempt to open //usr/local/lib/x86_64-linux-gnu/libxcb.so.1 failed
attempt to open //lib/x86_64-linux-gnu/libxcb.so.1 failed
found libxcb.so.1 at //usr/lib/x86_64-linux-gnu/libxcb.so.1
libdl.so.2 needed by //usr/lib/x86_64-linux-gnu/libX11.so
attempt to open /opt/ros/melodic/lib/libdl.so.2 failed
attempt to open //usr/lib/x86_64-linux-gnu/libfakeroot/libdl.so.2 failed
attempt to open //usr/local/lib/i386-linux-gnu/libdl.so.2 failed
attempt to open //usr/lib/i386-linux-gnu/libdl.so.2 failed
attempt to open //usr/local/lib/i686-linux-gnu/libdl.so.2 failed
attempt to open //lib/i686-linux-gnu/libdl.so.2 failed
attempt to open //usr/lib/i686-linux-gnu/libdl.so.2 failed
attempt to open //usr/local/lib/libdl.so.2 failed
attempt to open //usr/local/lib/x86_64-linux-gnu/libdl.so.2 failed
found libdl.so.2 at //lib/x86_64-linux-gnu/libdl.so.2
libc.so.6 needed by //usr/lib/x86_64-linux-gnu/libX11.so
attempt to open /opt/ros/melodic/lib/libc.so.6 failed
attempt to open //usr/lib/x86_64-linux-gnu/libfakeroot/libc.so.6 failed
attempt to open //usr/local/lib/i386-linux-gnu/libc.so.6 failed
attempt to open //usr/lib/i386-linux-gnu/libc.so.6 failed
attempt to open //usr/local/lib/i686-linux-gnu/libc.so.6 failed
attempt to open //lib/i686-linux-gnu/libc.so.6 failed
attempt to open //usr/lib/i686-linux-gnu/libc.so.6 failed
attempt to open //usr/local/lib/libc.so.6 failed
attempt to open //usr/local/lib/x86_64-linux-gnu/libc.so.6 failed
attempt to open //usr/lib/x86_64-linux-gnu/libc.so.6 failed
attempt to open //usr/local/lib/x86_64-linux-gnu/libc.so.6 failed
attempt to open //usr/lib/x86_64-linux-gnu/libc.so.6 failed
attempt to open //usr/lib/x86_64-linux-gnu64/libc.so.6 failed
attempt to open //usr/local/lib64/libc.so.6 failed
attempt to open //lib64/libc.so.6 failed
attempt to open //usr/lib64/libc.so.6 failed
attempt to open //usr/local/lib/libc.so.6 failed
attempt to open //lib/libc.so.6 failed
attempt to open //usr/lib/libc.so.6 failed
attempt to open //usr/x86_64-linux-gnu/lib64/libc.so.6 failed
attempt to open //usr/x86_64-linux-gnu/lib/libc.so.6 failed
attempt to open /opt/ros/melodic/lib/libc.so.6 failed
attempt to open //usr/lib/x86_64-linux-gnu/libfakeroot/libc.so.6 failed
attempt to open //usr/local/lib/i386-linux-gnu/libc.so.6 failed
attempt to open //usr/lib/i386-linux-gnu/libc.so.6 failed
attempt to open //usr/local/lib/i686-linux-gnu/libc.so.6 failed
attempt to open //lib/i686-linux-gnu/libc.so.6 failed
attempt to open //usr/lib/i686-linux-gnu/libc.so.6 failed
attempt to open //usr/local/lib/libc.so.6 failed
attempt to open //usr/local/lib/x86_64-linux-gnu/libc.so.6 failed
found libc.so.6 at //lib/x86_64-linux-gnu/libc.so.6
libXau.so.6 needed by //usr/lib/x86_64-linux-gnu/libxcb.so.1
attempt to open /opt/ros/melodic/lib/libXau.so.6 failed
attempt to open //usr/lib/x86_64-linux-gnu/libfakeroot/libXau.so.6 failed
attempt to open //usr/local/lib/i386-linux-gnu/libXau.so.6 failed
attempt to open //lib/i386-linux-gnu/libXau.so.6 failed
attempt to open //usr/local/lib/i686-linux-gnu/libXau.so.6 failed
attempt to open //lib/i686-linux-gnu/libXau.so.6 failed
attempt to open //usr/lib/i686-linux-gnu/libXau.so.6 failed
attempt to open //usr/local/lib/libXau.so.6 failed
attempt to open //usr/local/lib/x86_64-linux-gnu/libXau.so.6 failed
attempt to open //lib/x86_64-linux-gnu/libXau.so.6 failed
found libXau.so.6 at //usr/lib/x86_64-linux-gnu/libXau.so.6
libXdmcp.so.6 needed by //usr/lib/x86_64-linux-gnu/libxcb.so.1
attempt to open /opt/ros/melodic/lib/libXdmcp.so.6 failed
attempt to open //usr/lib/x86_64-linux-gnu/libfakeroot/libXdmcp.so.6 failed
attempt to open //usr/local/lib/i386-linux-gnu/libXdmcp.so.6 failed
attempt to open //lib/i386-linux-gnu/libXdmcp.so.6 failed
attempt to open //usr/local/lib/i686-linux-gnu/libXdmcp.so.6 failed
attempt to open //lib/i686-linux-gnu/libXdmcp.so.6 failed
attempt to open //usr/lib/i686-linux-gnu/libXdmcp.so.6 failed
attempt to open //usr/local/lib/libXdmcp.so.6 failed
attempt to open //usr/local/lib/x86_64-linux-gnu/libXdmcp.so.6 failed
attempt to open //lib/x86_64-linux-gnu/libXdmcp.so.6 failed
found libXdmcp.so.6 at //usr/lib/x86_64-linux-gnu/libXdmcp.so.6
ld-linux-x86-64.so.2 needed by //lib/x86_64-linux-gnu/libdl.so.2
attempt to open /opt/ros/melodic/lib/ld-linux-x86-64.so.2 failed
attempt to open //usr/lib/x86_64-linux-gnu/libfakeroot/ld-linux-x86-64.so.2 failed
attempt to open //usr/local/lib/i386-linux-gnu/ld-linux-x86-64.so.2 failed
attempt to open //lib/i386-linux-gnu/ld-linux-x86-64.so.2 failed
attempt to open //usr/lib/i386-linux-gnu/ld-linux-x86-64.so.2 failed
attempt to open //usr/local/lib/i686-linux-gnu/ld-linux-x86-64.so.2 failed
attempt to open //lib/i686-linux-gnu/ld-linux-x86-64.so.2 failed
attempt to open //usr/lib/i686-linux-gnu/ld-linux-x86-64.so.2 failed
attempt to open //usr/local/lib/ld-linux-x86-64.so.2 failed
attempt to open //usr/local/lib/x86_64-linux-gnu/ld-linux-x86-64.so.2 failed
found ld-linux-x86-64.so.2 at //lib/x86_64-linux-gnu/ld-linux-x86-64.so.2
libbsd.so.0 needed by //usr/lib/x86_64-linux-gnu/libXdmcp.so.6
attempt to open /opt/ros/melodic/lib/libbsd.so.0 failed
attempt to open //usr/lib/x86_64-linux-gnu/libfakeroot/libbsd.so.0 failed
attempt to open //usr/local/lib/i386-linux-gnu/libbsd.so.0 failed
attempt to open //usr/lib/i386-linux-gnu/libbsd.so.0 failed
attempt to open //usr/local/lib/i686-linux-gnu/libbsd.so.0 failed
attempt to open //lib/i686-linux-gnu/libbsd.so.0 failed
attempt to open //usr/lib/i686-linux-gnu/libbsd.so.0 failed
attempt to open //usr/local/lib/libbsd.so.0 failed
attempt to open //usr/local/lib/x86_64-linux-gnu/libbsd.so.0 failed
found libbsd.so.0 at //lib/x86_64-linux-gnu/libbsd.so.0
librt.so.1 needed by //lib/x86_64-linux-gnu/libbsd.so.0
attempt to open /opt/ros/melodic/lib/librt.so.1 failed
attempt to open //usr/lib/x86_64-linux-gnu/libfakeroot/librt.so.1 failed
attempt to open //usr/local/lib/i386-linux-gnu/librt.so.1 failed
attempt to open //usr/lib/i386-linux-gnu/librt.so.1 failed
attempt to open //usr/local/lib/i686-linux-gnu/librt.so.1 failed
attempt to open //lib/i686-linux-gnu/librt.so.1 failed
attempt to open //usr/lib/i686-linux-gnu/librt.so.1 failed
attempt to open //usr/local/lib/librt.so.1 failed
attempt to open //usr/local/lib/x86_64-linux-gnu/librt.so.1 failed
found librt.so.1 at //lib/x86_64-linux-gnu/librt.so.1
libpthread.so.0 needed by //lib/x86_64-linux-gnu/librt.so.1
attempt to open /opt/ros/melodic/lib/libpthread.so.0 failed
attempt to open //usr/lib/x86_64-linux-gnu/libfakeroot/libpthread.so.0 failed
attempt to open //usr/local/lib/i386-linux-gnu/libpthread.so.0 failed
attempt to open //usr/lib/i386-linux-gnu/libpthread.so.0 failed
attempt to open //usr/local/lib/i686-linux-gnu/libpthread.so.0 failed
attempt to open //lib/i686-linux-gnu/libpthread.so.0 failed
attempt to open //usr/lib/i686-linux-gnu/libpthread.so.0 failed
attempt to open //usr/local/lib/libpthread.so.0 failed
attempt to open //usr/local/lib/x86_64-linux-gnu/libpthread.so.0 failed
found libpthread.so.0 at //lib/x86_64-linux-gnu/libpthread.so.0
ld: warning: cannot find entry symbol _start; not setting start address

locate libX11:
/snap/gnome-3-34-1804/72/usr/lib/x86_64-linux-gnu/libX11-xcb.so
/snap/gnome-3-34-1804/72/usr/lib/x86_64-linux-gnu/libX11-xcb.so.1
/snap/gnome-3-34-1804/72/usr/lib/x86_64-linux-gnu/libX11-xcb.so.1.0.0
/snap/gnome-3-34-1804/72/usr/lib/x86_64-linux-gnu/libX11.so
/snap/gnome-3-34-1804/72/usr/lib/x86_64-linux-gnu/libX11.so.6
/snap/gnome-3-34-1804/72/usr/lib/x86_64-linux-gnu/libX11.so.6.3.0
/snap/gnome-3-34-1804/77/usr/lib/x86_64-linux-gnu/libX11-xcb.so
/snap/gnome-3-34-1804/77/usr/lib/x86_64-linux-gnu/libX11-xcb.so.1
/snap/gnome-3-34-1804/77/usr/lib/x86_64-linux-gnu/libX11-xcb.so.1.0.0
/snap/gnome-3-34-1804/77/usr/lib/x86_64-linux-gnu/libX11.so
/snap/gnome-3-34-1804/77/usr/lib/x86_64-linux-gnu/libX11.so.6
/snap/gnome-3-34-1804/77/usr/lib/x86_64-linux-gnu/libX11.so.6.3.0
/snap/gnome-3-38-2004/70/usr/lib/x86_64-linux-gnu/libX11-xcb.so
/snap/gnome-3-38-2004/70/usr/lib/x86_64-linux-gnu/libX11-xcb.so.1
/snap/gnome-3-38-2004/70/usr/lib/x86_64-linux-gnu/libX11-xcb.so.1.0.0
/snap/gnome-3-38-2004/70/usr/lib/x86_64-linux-gnu/libX11.so
/snap/gnome-3-38-2004/70/usr/lib/x86_64-linux-gnu/libX11.so.6
/snap/gnome-3-38-2004/70/usr/lib/x86_64-linux-gnu/libX11.so.6.3.0
/snap/gnome-3-38-2004/99/usr/lib/x86_64-linux-gnu/libX11-xcb.so
/snap/gnome-3-38-2004/99/usr/lib/x86_64-linux-gnu/libX11-xcb.so.1
/snap/gnome-3-38-2004/99/usr/lib/x86_64-linux-gnu/libX11-xcb.so.1.0.0
/snap/gnome-3-38-2004/99/usr/lib/x86_64-linux-gnu/libX11.so
/snap/gnome-3-38-2004/99/usr/lib/x86_64-linux-gnu/libX11.so.6
/snap/gnome-3-38-2004/99/usr/lib/x86_64-linux-gnu/libX11.so.6.3.0
/snap/sublime-text/112/usr/lib/x86_64-linux-gnu/libX11.so.6
/snap/sublime-text/112/usr/lib/x86_64-linux-gnu/libX11.so.6.3.0
/usr/lib/x86_64-linux-gnu/libX11-xcb.a
/usr/lib/x86_64-linux-gnu/libX11-xcb.so
/usr/lib/x86_64-linux-gnu/libX11-xcb.so.1
/usr/lib/x86_64-linux-gnu/libX11-xcb.so.1.0.0
/usr/lib/x86_64-linux-gnu/libX11.a
/usr/lib/x86_64-linux-gnu/libX11.so
/usr/lib/x86_64-linux-gnu/libX11.so.6
/usr/lib/x86_64-linux-gnu/libX11.so.6.3.0
/usr/share/doc/libx11-dev/libX11
/usr/share/doc/libx11-dev/i18n/compose/libX11-keys.html
/usr/share/doc/libx11-dev/i18n/compose/libX11-keys.html.db
/usr/share/doc/libx11-dev/i18n/compose/libX11-keys.pdf.db.gz
/usr/share/doc/libx11-dev/i18n/compose/libX11-keys.txt.gz
/usr/share/doc/libx11-dev/libX11/libX11.html
/usr/share/doc/libx11-dev/libX11/libX11.html.db
/usr/share/doc/libx11-dev/libX11/libX11.pdf.db.gz
/usr/share/doc/libx11-dev/libX11/libX11.txt.gz

I am not an expert of ubuntu and for this reason I don't know what to do. I have alread tried sudo apt-get install lib11-dev or similar commands witouth results.
Do you have any ideas?
Thanks for your time.


text:
Q: How to clean string data rows that contain special characters such as "thereΓÇÖs not" I'm cleaning a dataset for a project. There is a column that is called "Review Text," and I need to clean the data in rows that contain strange characters like "ΓÇÃ."
Using excel, I was able to use the "Substitute" function to create a formula to clean one row. However, I wanted to know how to create a nested "substitute" formula to clean all the rows in my dataset, if even possible. Please feel free to share any other possible solutions to my problem.
Excel Function
=SUBSTITUTE(J7,"IΓÇÖve","I've")

A: In this case, I wouldn't recommend a formulaic solution since it would involve you manually determining what type of replacement is needed for a given row. If there is a great number of types of errors, then you would need to create a unique formula for each unique type of error. In other words, you'd need to manually determine the type of error and the resulting SUBSTITUTE to fix the error.
So, it is much easier to simply Find and Replace each issue to avoid creating a complex formula that does the same task of cleaning. If you select your entire "Review Text" column, each error you fix will apply to the entire column automatically.
To see whether a cell has non-Alphanumeric characters in it, you can use the formula in this related StackOverflow post. You can apply this formula as a column next to the "Review Text" column. Then, you can continually sort for cells that have non-Alpha characters until you Find and Replace every type of error.
NOTE: If you wish to keep the old "Review Text" column, just copy this column into a separate column (e.g., "Review Text_old")


text:
Q: Issue with Re Querying Underlying Data for ComboBox I'm having an issue refreshing the query that underlies a combobox in a form named 'Site'. What I'm attempting to have happen is for a user to be able to enter a staff member in a form called 'Staff'and then on save have 'Staff' quit, the user be taken back to 'Site' and have the recently entered data be available in the combobox that will be informed by a query based partly upon the information received through 'Staff'.
Everything works so far except I have been unable to properly refresh 'Site' or the particular control being affected; Site.OfficeContactId. I'm using a macro but I converted to VBA for the posting.
    Function Macro2()
On Error GoTo Macro2_Err

    With CodeContextObject
        On Error Resume Next
        DoCmd.RunCommand acCmdSaveRecord
        If (.MacroError <> 0) Then
            Beep
            MsgBox .MacroError.Description, vbOKOnly, ""
        End If
        DoCmd.Close acForm, "Staff"
        DoCmd.Requery "Forms!Site.Controls!OfficeContactId"
    End With

Macro2_Exit:
    Exit Function

Macro2_Err:
    MsgBox Error$
    Resume Macro2_Exit

End Function

As I understand Do.CmdRequery "Forms!Site.Controls!OfficeContactId" should do the trick but it's not working for me.
Any suggestions?
Thanks

A: Removed ancillary code that inhibited debugging. Truncated to 3 commands
DoCmd.RunCommand acCmdSave Record
DoCmd.Close acForm "Staff"
DoCmd.Requery "Forms!Site.Controls!OfficeContactId"

Now working to resolve a known issue where the requery command won't run in a non visible form, debugging code to call the form forward prior to the execution of requery.


text:
Q: UITableView: Changing one cell's height constraint after table is constructed? I might be wanting a strange thing, but the task is to stretch last cell in UITableView to fill the rest space. So in case table will only have few cells, then the last one will match it's height to the rest until screen bottom.
To achieve this, I included height constraint in the last cell's xib.
I can calculate proper height and set the constant, but it does not matter what I do afterwards - setNeedsDisplay(), setNeedsLayout(), reloadData(), reloadRowsAtIndexPaths() etc. - the cell height is not changed.
Only when I call the update code second time, layout is adjusted.
Any hints how to force update the cell immediately?

A: You need to have the following implemented (viewDidLoad is fine).
var estimatedRowHeight = 80 (for example)

// Set automatic dimension on row height.
tableView.rowHeight = UITableViewAutomaticDimension

// Set estimated row height.
tableView.estimatedRowHeight = estimatedRowHeight

Remove the height constraint and then call your resize with either the reloadData, or reloadRowsAtIndexPaths().

A: Did you try the following method? Where you check for the last indexPath.row and put a different height that you calculate.
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath;


text:
Q: Incompatible type for argument for sqrt() in C I'm new to threads, and I can't see where my error is. Just started to learn them today. Can anyone see whats the error?
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <pthread.h>
#include <math.h>

double somatorio = 0;

void *raizQuadrada(void *numero)
{
  somatorio+=sqrt(numero);
}

int main()
{
  pthread_t thread1, thread2;

  for(int a = 1;a<=500000; a++)
  {
    pthread_create(&thread1, NULL, raizQuadrada, (double *) &a);
    pthread_create(&thread2, NULL, raizQuadrada, (double *) &a+500000);
    pthread_join(thread1, NULL);
    pthread_join(thread2, NULL);
  }

  printf("Resultado: %f\n", somatorio);

  exit(0);
  return 0;
}

Terminal output:
pth-ex6.c: In function 'raizQuadrada': pth-ex6.c:11:19: error:
incompatible type for argument 1 of 'sqrt'    somatorio+=sqrt(numero);
                   ^~~~~~ In file included from /usr/include/features.h:424:0,
                 from /usr/include/x86_64-linux-gnu/bits/libc-header-start.h:33,
                 from /usr/include/stdio.h:27,
                 from pth-ex6.c:1: /usr/include/x86_64-linux-gnu/bits/mathcalls.h:143:1: note: expected
'double' but argument is of type 'void *'  __MATHCALL (sqrt,,
(_Mdouble_ __x));

A: if you look in math.h documentation, you can see that sqrt takes double as input
double sqrt(double arg);

but you are trying to pass in void *
It so happens that its stated clearly in the error message -
from pth-ex6.c:1: /usr/include/x86_64-linux-gnu/bits/mathcalls.h:143:1: note:
expected
'double' but argument is of type 'void *'  __MATHCALL (sqrt,,
(_Mdouble_ __x));

if you are new to coding - one of the most useful things to learn is to read the error output :-)


text:
Q: Vue Video Embed Asking for a Typescript file I have a Vue application with typescripts used in it.
I want to use Vue Video Embed (https://github.com/nasa8x/v-video-embed) in my Application.
These are the steps I performed:
#1: npm install v-video-embed
#2: import Embed from 'v-video-embed'
#3: Vue.use(Embed);
The Issue I am facing is:
When I use it in my vue component it shows some error messages
Error#1:
in my browser console in shows
(Uncaught (in promise) TypeError: Cannot read properties of undefined (reading '_c'))

error message 1
Error#2:
When I check my root app.ts file it shows up this error
Could not find a declaration file for module 'v-video-embed'. '/home/muhammad/event-
    star/node_modules/v-video-embed/dist/video-embed.min.js' implicitly has an 'any'
    type.

    Try `npm i --save-dev @types/v-video-embed` if it exists or add a new declaration
    (.d.ts) file containing `declare module 'v-video-embed';`ts(7016)

I tried these steps but the issue was not fixed:
I tried to run npm i --save-dev @types/v-video-embed command but the types were not found then I tried  to create (.d.ts) files and declare a module v-video-embed. after creating (.d.ts) file the error#2 was gone but I am still facing the error#1
Thanks


text:
Q: How to control view items in codeigniter I have CI framework and user, group permission control applied in controller,
But how can i apply restriction in some buttons, links, etc in view?
Example, below is code for new, edit, delete buttons, if i want to disble\hide this buttons
<button type="button" class="btn blue" id="new_group_showbtn"> New</button>
                                            <button type="button" class="btn purple" id="edit_group_showbtn"> Edit</button>
                                            <button type="button" class="btn yellow" id="delete_group_btn"> Delete</button>

I used control over controller as below
if($this->mylib->access('testcontrol'))
{
    \\code.....

} //Access control END

How can i put such control over views? I am not echoing views, but loading pure html as view,
Can be done with passing some variables? How?
Thanks,

A: Try like this,
Store the user type in session on ligin(like admin, subadmin,...)
Suppose i want to show a button by name create sub admin only to user, i would do like this,
<?php if($this->session->userdata("user_type") == "admin") { ?>
     <button>Add Sub Admin</button>
<?php } ?>

something like this.

A: Since session variables are global variables you can use them across any pages( even in views).
So while you allowing user to login,
set one session variable to appropriate value according to user type.
may be something like this
$this->session->set_userdata('privilege', 'user');
$this->session->set_userdata('privilege', 'manager');

then in the view,
 you can check them like,

  <?php if($this->session->userdata("privilege") == "manager") { ?>
    <button type="button" class="btn yellow" id="delete_group_btn"> Delete</button>
  <?php } ?>

 .
 .
 .

above code only display the delete button to the user type manager.
like that you can check the condition.


text:
Q: How can I query contact information based on a phone number I am trying to query contact information based on a phone number on android 1.6. This is the code I tried. But I get count equals to 0 in my cursor.
    String selection = "PHONE_NUMBERS_EQUAL(" + People.Phones.NUMBER + " , "   + phoneNumber + ")";
    Cursor cursor = mContext.getContentResolver().query(People.CONTENT_URI,
            new String[] {People._ID, People.NAME, People.Phones.NUMBER},
            selection, null, null);

Do you have any idea why it is not working?
Thank you.

A: You can specify a URI to and use a query to directly get a contact info by phone number..
Uri contactUri = Uri.withAppendedPath(Contacts.Phones.CONTENT_FILTER_URL, Uri.encode(phoneNumber));

Cursor cursor = mContext.getContentResolver().query(contactUri, null, null, null, null);

The cursor returned by the code above should then contain the contact you are looking for and you can get the info out you need...
if(cursor.moveToFirst()){
    int personIDIndex = cursor.getColumnIndex(Contacts.Phones.PERSON_ID);
    //etc
}

A: Phone numbers are stored in their own table and need to be queried separately. To query the phone number table use the URI stored in the SDK variable Contacts.Phones.CONTENT_URI. Use a WHERE conditional to get the phone numbers for the specified contact.
if (Integer.parseInt(cur.getString(
        cur.getColumnIndex(People.PRIMARY_PHONE_ID))) > 0) {
    Cursor pCur = cr.query(
            Contacts.Phones.CONTENT_URI,
            null,
            Contacts.Phones.PERSON_ID +" = ?",
            new String[]{id}, null);
    int i=0;
    int pCount = pCur.getCount();
    String[] phoneNum = new String[pCount];
    String[] phoneType = new String[pCount];
    while (pCur.moveToNext()) {
        phoneNum[i] = pCur.getString(
                           pCur.getColumnIndex(Contacts.Phones.NUMBER));
        phoneType[i] = pCur.getString(
                           pCur.getColumnIndex(Contacts.Phones.TYPE));
        i++;
    }
}

Query the phones table and get a Cursor stored in pCur. Since the Android contacts database can store multiple phone numbers per contact we need to loop through the returned results. In addition to returning the phone number the query also returned the type of number (home, work, mobile, etc).
Also read this tutorial about Working With Android Contacts API For 1.6 and Before


text:
Q: ¿Por qué no salta ninguna excepción cuando está mal escrita la cadena de conexión en la llamada al constructor de la clase PDO? Por ejemplo, si tengo este código en PHP
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

  <meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
  <title>conexion_PDO_I.php</title>
  <link href="./css/dwes.css" rel="stylesheet" type="text/css"/>

<?php
    $usuario = 'dwes';
    $contrasenia = 'dwes';

    try
    {
        // Se pueden usar tanto comillas simples como dobles
        $base = new PDO ('mysql:host=localhost;dbname=dwes', $usuario, $contrasenia);
        echo "Conexión realizada";
    }catch (PDOException $e)
    {
        print "Error " . $e->getMessage ();
        die ();
    }
?>

Esto está bien escrito y no salta excepción alguna. Pero me he equivocado y he puesto "dbMame" en vez de "dbname" y no ha saltado la excepción. He provocado varios fallos adrede, para ver cuándo saltaba la excepción y cuándo no, y sólo salta cuando:

*

*Se pone mal el nombre del driver para mysql

*Se pone mal el nombre del servidor

*Se pone mal el nombre de la base de datos

*Se pone mal el usuario

*Se pone mal la contraseña

No sé si ésto sea un bug del constructor, o si me falte pasar algún parámetro más de los que son opcionales, pero no controla un error en los literales "host" y "dbname" en la cadena de conexión que el constructor recibe como primer parámetro.
¿Hay alguna manera de obligar a PHP para que controle estos errores?

A: Al parecer php no hace ninguna validación en los parámetros del DSN y solo ocupa los que estén bien escritos. por eso no lanza ninguna excepción por que se conecta a mysql pero no a una base de datos en concreto.
<?php
try
{
    // Se pueden usar tanto comillas simples como dobles
    $base = new PDO ('mysql:host=localhost;dbXame=dwes;charset=utf8;cualquiercosa=estonolanzaexcepcion', $usuario, $contrasenia);
    echo "Conexión realizada";//aca estas conectado a mysql
    var_dump($base->query('SHOW DATABASES')->fetchAll());//con esto muestras todas las base de datos que tienes acceso.
    $base->exec('USE dwes');//aca te conectas a la base de datos "dwes"
}catch (PDOException $e)
{
    print "Error " . $e->getMessage ();
    die ();
}
?>

A: Es normal que no se genere una excepción ya que el campo dbname de la DSN de conexión no es obligatorio, no es necesariamente un error:
<?php
try {
    // Se pueden usar tanto comillas simples como dobles
    $base = new PDO (
      'mysql:host=localhost',
      $usuario,
      $contrasenia
    );
    echo "
Conexión realizada
";
    $consulta = $base->query('SELECT * FROM dwes.pruebas');
    if ($consulta !== false) {
        echo "
Consulta hecha
";
    } else {
        echo "
Consulta fallida: ",
          htmlspecialchars($base->errorInfo()[2]),
          "
";
    }
} catch (PDOException $e) {
    die("Error: " . htmlspecialchars($e->getMessage()));
}

Como puedes ver se puede realizar una conexión a un servidor de bases de datos MySQL sin seleccionar una base de datos y posteriormente hacer una consulta en la que se indica de manera explícita la base de datos a la que pertenece la tabla.
Además, para evitar problemas cuando se incluyen nuevos parámetros a la cadena DSN de conexión MySQL (todo aquello que se escribe tras el carácter ;) se ignoran silenciosamente aquellos que no se reconozcan. Esto permite, por ejemplo, que la conexión no falle cuando se use charset antes de PHP 5.3.6 (versión en la que fue incorporado este parámetro).
Si la tabla dwes.pruebas (pruebas dentro de la base de datos dwes) no existe aparecerá el mensaje de error:
Consulta fallida: Table 'dwes.pruebas' doesn't exist

Podrías cambiar de base de datos en cualquier momento haciendo uso de la siguiente consulta SQL:
USE <base de datos>

A: Carmen lo que puedes hacer es gestionar los errores por cuenta propia. Luego de ejecutar tu consulta averigua al $base->errorInfo() por cualquier error generado, por ejemplo que la base de datos no fue seleccionada.

A: I. La causa
Al no establecer ningún modo de manejo de errores cuando creas el objeto conexión, éste adquiere el modo por defecto para PDO que es PDO::ERRMODE_SILENT.
Si revisamos el código fuente de PDO, podemos ver lo siguiente:
#define PDO_ERR_NONE                "00000"

enum pdo_error_mode {
    PDO_ERRMODE_SILENT,     /* just set error codes */
    PDO_ERRMODE_WARNING,    /* raise E_WARNING */
    PDO_ERRMODE_EXCEPTION   /* throw exceptions */
};

Los comentarios a la derecha explican en resumen lo que haría cada estado de reporte de errores. En el modo silencioso dice, just set error codes. O sea, que setea los código de errores, pero no reporta nada.
Dicho en otras palabras, en este modo ciertos errores no son reportados, como ocurre en tu caso y por eso no puedes capturarlos en el bloque try. En la parte III veremos una forma de reportarlos.
El manual documenta de forma más extensa lo que hemos visto más arriba en el código fuente.
PDO ofrece tres estrategias diferentes de manejar errores para adaptarse a cualquier estilo de desarrollo de aplicaciones.

*

*PDO::ERRMODE_SILENT

*PDO::ERRMODE_WARNING

*PDO::ERRMODE_EXCEPTION
El Manual dice que el modo predeterminado es PDO::ERRMODE_SILENT. Cuando este modo está establecido, ocurre lo siguiente:

PDO simplemente establecerá él mismo el código de error para su
  inspección utilizando los métodos PDO::errorCode() y
  PDO::errorInfo() tanto en objetos de sentencias como de bases
  de datos. Si el error resultó de una llamada a un objeto de sentencia,
  se deberá invocar al método PDOStatement::errorCode() o
  PDOStatement::errorInfo() sobre dicho objeto. Si el error
  resultó de una llamada a un objeto de bases de datos, se deberá
  invocar, en su lugar, a los métodos del objeto de bases de datos.
❯ Fuente: Errores y su manejo en el Manual de
  PHP

II. ¿Omitir dbname es un error?
Al menos en MySQL sí lo es. Es el Error: 1046, como se puede ver en en apartado B.3 Server Error Codes and Messages de la documentación.
Es efectivamente un error que se puede capturar, como veremos en el siguiente punto.

III. ¿Qué hacer?
No se recomienda, al menos en la etapa de desarrollo, tener el reporte de errores en silencio.
Para cambiar esto PDO cuenta con el método setAttribute, a través del cual se puede pasar uno o más atributos para terminar de configurar nuestro objeto conexión.
Si tú, después de crear el objeto de conexión activas el reporte de errores mediante este método, podrás ver que sí se captura la excepción.
Hagamos una prueba y de paso vemos con código cómo se usa el método:
/*Escribimos mal dbname a propósito*/
$dsn="mysql:host=localhost;fakedbname=xfiddlec_max;port=3306";
try {
    $pdo = new PDO($dsn, $user_name, $pass_word);
    $pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);

}catch (PDOException $e){
    print "Error " . $e->getMessage();
    die ();
}

En este código la excepción es capturada, y podrás ver este mensaje en pantalla:

Exception: SQLSTATE[3D000]: Invalid catalog name: 1046 No database
  selected

Además, la ventaja de hacer esto al crear el objeto conexión, es que no tendrás que encerrar en bloques try ... catch ninguno de los futuros usos relativos a la conexión. Simplemente, evaluar tus variables adecuadamente y controlar el todo momento el flujo de tu programa.

IV. Otro uso muy importante de setAttribute
Ya que estás iniciando con PDO, me permitiré señalarte algo que también es muy importante de cara a la seguridad.
Cuando creas tu objeto conexión, además de setear el atributo anterior, debes setear imperativamente un atributo llamado PDO::ATTR_EMULATE_PREPARES a FALSE. Esto es debido a que su estado por defecto es TRUE, y cuando este modo está establecido, el objeto conexión permite la emulación de consultas preparadas, lo cual podría inducir a la Inyección SQL en determinados casos. (No quiero abundar más en esto porque no es el tema de esta pregunta, pero si te interesa, puedes leer más sobre esto en la pregunta dedicada específicamente al tema de la Inyección SQL).
Puedes usar setAttribute también para establecer el conjunto de caracteres que deberá usar el objeto conexión. Conviene que sea UTF-8, así quitas la posibilidad de que los datos como acentos, ñ y otros, se muestren como caracteres extraños en algunos escenarios.
Para terminar, dejo un ejemplo de conexión estableciendo los atributos antes mencionados:
/*Cuando se pasan varios atributos es mejor pasarlos juntos en un array*/
$arrOpciones = array(
                        PDO::ATTR_EMULATE_PREPARES => FALSE,
                        PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
                        PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES 'utf8'"
                        );
try {
        $pdo= new PDO($dsn, $usr, $pwd, $arrOpciones);

    }
        catch (PDOException $e) {
            print "Error " . $e->getMessage ();
    }

Eso es todo.
Espero que te sea de utilidad.


text:
Q: Linq: get parents based on value of child property I have parents with multiple children that have a property to check.
I need to get the parents where the child has X property with N value.
Markets have
UserAlerts have
one User
I want all the markets that have UserAlerts with the User Property to be the current user.
var markets = _context.Markets.Include("UserAlerts").AsEnumerable();

markets = from m in markets
          where markets.Any(x => x.UserAlerts == _context.UserAlerts.Where(o => o.User == theUser))
          select m;

this doesn't work. Any ideas?
I can't get .Contains or .Intersect to work either.

A: If I understand your data model correctly, the following query will return all Market with at least one of its UserAlert child has User equals current user :
markets = from m in markets
          where m.UserAlerts.Any(ua => ua.User == theUser)
          select m;

A: You can use the following
var markets = markers.where(m=>m.UserAlerts.Any(alert => alert.User == theUser).select(m);


text:
Q: Fetching data from an api with interpolation to search weather in a certain city I am trying to get weather data from an api, when fetch the data without using interpolation fetch(https://weatherapi-com.p.rapidapi.com/forecast.json?q=London&days=3) it works fine. But when I use the code below and press enter after searching a new city I get the error message "Bad request" Parameter q is missing. Any help would be appreciated! Let me know if I can help clarify in any way.
import React from "react"
// import WeatherDisplay from "./WeatherDisplay";
import { useState, useEffect } from "react"
import { scryRenderedComponentsWithType } from "react-dom/test-utils";
import Item from "./Item"

function SearchBar() {
    const [ defaultWeather, setDefaultWeather ] = useState([])
    const [ searchedCity, setSearchedCity ] = useState('London')
    const [ isLoaded, setIsLoaded ] = useState(false)
    const [didMount, setDidMount] = useState(false);
    const [ input, setInput ] = useState('')

    const searchWeather = () => {
        const options = {
            method: 'GET',
            headers: {
                'X-RapidAPI-Host': 'weatherapi-com.p.rapidapi.com',
                'X-RapidAPI-Key': 'de51889a1fmshe095099b1a97993p13134fjsnc818ad7373cb'
            }
        };

        fetch(`https://weatherapi-com.p.rapidapi.com/forecast.json?q=${searchedCity}&days=3`, options)
            .then(response => response.json())
            .then((data) => {
                console.log(data)
                setDefaultWeather(data)
                setIsLoaded(true)
            })
            .catch(err => console.error(err));

    }

        useEffect(() => {
            searchWeather()

        }, [searchedCity])

        function handleSubmit(e) {
            e.preventDefault()
            setSearchedCity(input)
        }

        if (!isLoaded) return
Loading...
;

        return (

            <form
            className="search-form"
            onSubmit={handleSubmit}
            >
                Search
                    <input
                    text="text"
                    id="search"

                    onChange={e => setSearchedCity(e.target.value)}
                    />
                    {/* <button>Submit</button> */}

            </form>

    )
}

export default SearchBar;

A: I don't understand why you are setting setSearchedCity in both submit and on change but In your useEffect,At least you could add conditional as:
  useEffect(() => {
if (searchedCity) searchWeather()
        }, [SearchedCity])

A: onChange={(e) => setInput(e.target.value)}
instead of
onChange={e => setSearchedCity(e.target.value)}


text:
Q: Reliable and performant cheap (ish) hosting for ASP.NET 3.5 and mysql I'm looking for someone reasonably cheap but better than the majority of budget hosts out there. I'm currently with brinkster.net and I've become increasingly annoyed at the their immense unreliability and low available resources.
Fasthosts business plan is close, but has no mysql, only has ASP.NET 2.0 and is maybe slightly more expensive than I was hoping for.

A: I have had several sites hosted on http://discountasp.net and have had very good results.  They are on year 4 of being voted best ASP.NET host in the asp.netPRO reader's choice survey.

A: I have had great luck with Viux.com - their customer service is top-notch and they were quick to implement asp.net 3.5. I moved all my sites (5) to Viux now and couldn't be happier. Very reliable and I can't say enough about their super fast and friendly service! MySQL comes free with all of their plans and MSSQL is $2/month.
I have tried quite a few hosts, and these guys are my favorite. If you decide on another, just make sure it is not M6.net, their customer service was just horrendous!

A: GoDaddy supports .NET 3.5 and mysql on their basic hosting packages.

A: We've used GoDaddy at my primary employment (day job :-) for several years and have had a positive experience with them (I also recently switched my home business from Yahoo! Small Business to GoDaddy).
Regarding reliability, I haven't had any problems with downtime. As a result, I have no first hand tech support experience with GoDaddy, but from what I read on the boards their tech support is pretty good (comparable to any other tech support I guess). They offer LINUX and Windows hosting (if that matters to you), MySQL and MSSQL database support, and .NET 3.5/AJAX.
And the price was reasonable, as far as I'm concerned.

A: I've been with these guys for quite a bit,
http://www.webhost4life.com/

Cheap and cheerful.

A: Something that might interest you -- ScottGu's latest blog post mentions Amazon's EC2 is going to support ASP.NET.
http://aws.typepad.com/aws/2008/10/coming-soon-ama.html
Depending on what you plan on doing, that could be of interest. It's usually pretty cheap, as well.

A: Dreamhost supports stackoverflow's podcast
http://www.dreamhost.com/
Edit: It looks like they don't support ASP.NET though, that was unexpected.

A: Take a look at ReliableSite.Net
It is cheap and good. They even throw a free MS SQL 2005 database(1 GB- Extra DB costs $1) what other places charge $10/Month and give you less then 500MB of space.
So you can upgrade to mssql 2005(not sure if you where just using mysql because it is cheaper).
If you don't want to bother changing to mssql 2005 then you can save it for another project(you can host unlimited domains on Reliable) and use the mysql database that they also throw in for free.
I find Reliable does not nickle and dim you for every single thing and gives reasonable prices and have great coupons.
Like this coupon for 15% off for life: "aspforum"

A: Planet Small Business http://www.planetsmb.com/ are pretty cheap, and have excellent customer service.
The only hassle I've had with them is over hosting WCF services. I wasn't able to host it as a native ASP.Net service, you have to do a bit of extra plumbing to manually add a service host, but nothing impossible, and their customer support was there ready and waiting.
Highly recommended.

A: I Use SmarterAsp.net to host Multiple Sites  ; they have good control panel and their Price start fro $2.95/Month you can also get 60 days free trial so you can decide if it's suitable for you
http://www.SmarterASP.NET/index?r=100819197


text:
Q: ¿Cómo puedo hacer que la imagen sea responsiva y cambie según el dispositivo? ¿Cómo puedo hacer para que la imagen cambie dependiendo el dispositivo? Para evitar, por ejemplo, que el texto pise sobre ella y no se pueda leer en un celular.
La imagen es esa que aparece ahí: style="background-image: url('img/interior11.jpg');"

Soluciones

Gráficas

Calidad de diseño

 ¿Usted tiene una idea que transmitir o necesita una imagen

y el estilo estético para su empresa? Perfecto: aquí encontrará la respuesta.

            CONTACTAR AHORA


text:
Q: Can the user generate instantly a notification bar on Stack Exchange sites (content is irrelevant) without relying on any other variables? Can the user generate instantly a notification bar on Stack Exchange sites (content is irrelevant) without relying on any other variables? It would ordinarily appear when a certain state is reached; e. g., when state changes to Student: "Asked first question with score of 1 or more".
Can the notifications appearing at the top be checked via a live feed?

A: There are many things you can do that will cause an instant notification. For example, you can delete a downvoted question or answer, causing a positive score increase that you will be instantly notified of. You can take an action that directly leads to a badge (some badges are caused by the actions of others or are awarded by batch jobs that run every so often.) Badges caused by your own actions appear to be more than half the available badges - too many to list here.
There is nothing you can do to turn these on or off, however - all positive rep changes generate notifications, badges generate notifications either always, or for all users under a certain rep (experienced users apparently can't be bothered with some badge notifications), and comments directed at you, new answers to your question etc happen whether you want them to or not. You can't suppress them and you can't trigger them either.
Is this what you're asking? It's not super clear.


text:
Q: How to use concatenate function inside arrayformula function in google sheets I'm currently using the following formula to concatenate a few cells into a single description sort of entry in the same row, as shown here
CONCATENATE("Conducting Person : ",H2,CHAR(10),"Tech Support : ",J2,CHAR(10),"Category : ",F2,CHAR(10),"Room : ",G2,CHAR(10),"Platform : ",K2), "")
This formula is working fine but when I add a new entry in the blank row right below that last filled row, I have to manually add the formula to the required cell.
I tried the following arrayformula :
=ARRAYFORMULA(IF(NOT(ISBLANK(A2:A)),CONCATENATE("Conducting Person : ",H2,CHAR(10),"Tech Support : ",J2,CHAR(10),"Category : ",F2,CHAR(10),"Room : ",G2,CHAR(10),"Platform : ",K2), ""))
That seems to be executing the formula when an entry is made in the first cell of the blank row below the last filled row, but the cell positions are not relatively changing and seem to be fixed to the initial cell reference.
How do I fix it?

A: Try
=arrayformula("Conducting Person : "&H2:H&CHAR(10)&"Tech Support : "&J2:J&CHAR(10)&"Category : "&F2:F&CHAR(10)&"Room : "&G2:G&CHAR(10)&"Platform : "&K2:K)

A: use:
=ARRAYFORMULA(IF(ISBLANK(A2:A),,
 "Conducting Person : "&H2:H&CHAR(10)&
 "Tech Support : "&     J2:J&CHAR(10)&
 "Category : "&         F2:F&CHAR(10)&
 "Room : "&             G2:G&CHAR(10)&
 "Platform : "&         K2:K)))


text:
Q: How can I link linux shell files?   #!/bin/bash
  echo "Please, select your choice (1-4):"
  echo 1- Add Course
  echo 2- Delete Course
  echo 3- Search Course
  echo 4- exit
  read input

  case $input in
    1)
            script1
            ;;
    2)
            script2
            ;;
    3)
            script3
            ;;
    4)
            exit 0
            ;;
    *)
            echo Invalid choice
  esac

1 is associated with the file Add.sh
2 is associated with the file delete.sh
3 is associated with the file seatch.sh
4 is to exit

A: Using the builtin
select
command means you don't need to reinvent menus.
#!/usr/bin/env bash

# assuming all the scripts reside in the same directory as this one
script_path="$(dirname "$0")"

PS3="Please, select your choice: "
select choice in "Add Course" "Delete Course" "Search Course" "exit"; do
    case $input in
        "Add Course")    bash "$script_path/add.sh" ;;
        "Delete Course") bash "$script_path/delete.sh" ;;
        "Search Course") bash "$script_path/search.sh" ;;
        exit)            break ;;
    esac
done

I could get fancier to avoid the duplicated strings, but that's unneeded complexity.
Depending on the contents of those scripts, you might want to source them instead of running them in a different process. It might be simple to even put them in functions in the current script instead of having to maintain several separate files.


text:
Q: Como pegar o estado do toggleButton Android? Como pegar o estado do ToggleButton se esta ligado ou desligado, olhei a documentação do Android só tem o método de mudar o estado, precisava pegar o estado do botão pra fazer a comparação.

A: o método é o isChecked(). Ele é herdado da classe CompoundButton.
Ex:
if(myToggleButton.isChecked())
  // Faça algo se estiver checado
else
  // Faça algo se não estiver checado


text:
Q: Locations and files looked up in an ASP.NET MVC project while searching for a javascript function called from a .cshtml file When a .cshtml file calls up a javascript function using onclick event, which all locations and files does the framework look it up in, apart from the explicit js file reference given using a 'script tag'?
I have a javascript function call being made using an onclick event as following (inside a cshtml file):

                    @ResourceHelper.GetResourceValue(ResourceId.Save)

The javascript file reference that is given in the  tag is as following:-

However the function SaveContract() was not found inside ContractModel.js but inside another file DefaultScripts.js.
The call is happening perfectly and application is working fine.
My doubt is that when i need to look up in my solution for this function, how can i logically look up for this function instead of doing a blind 'Search in entire solution' of the function name.
To put in other words, how does the framework decide that apart from the explicit javascript file mentioned in the 'script tag', which other files does it need to check to call that function?


text:
Q: Exception Unable to parse the date while using parseDateStrictly() method of DateUtils class getting following exception for following code, exception doesn't come if i use parseDate() method, i dont understand what is the reason.

Exception in thread "main" java.text.ParseException: Unable to parse
  the date: 03/22/2012:00:00:00     at
  org.apache.commons.lang3.time.DateUtils.parseDateWithLeniency(DateUtils.java:336)
    at
  org.apache.commons.lang3.time.DateUtils.parseDateStrictly(DateUtils.java:286)

public static void main(String args[]) throws Exception
    {
        String testDate="03/22/2012:00:00:00";
        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
        System.out.println(simpleDateFormat.format(DateUtils.parseDateStrictly(testDate, new String[]{"MM/dd/yyyy:hh:mm:ss","MM-dd-yyyy","MM/dd/yyyy",
               "yyyy-MM-dd hh:mm:ss","yyyy-MM-dd","yyyy-MM-dd HH:mm:ss"})));
    } }

A: Your Format pattern must be "MM/dd/yyyy:HH:mm:ss".
lower case hh if for Hour in am/pm (1-12)
upper case HH is for Hour in day (0-23)
For more Informations see the javadoc of SimpleDateFormat


text:
Q: how do i upgrade my sqlite3 package on debian lenny Short story:
I need the >3.7.3 build of sqlite3, but I currently have 3.5.?. How can I upgrade the package?
Long story:
Trying to install etherpad-lite (node.js implementation of etherpad). Install fails because of sqlite3 package. I tried to install the npm package of sqlite3... again fails. According to this github issue (https://github.com/developmentseed/node-sqlite3/issues/27) it looks as if I need greater than 3.7.3 package. I can't seem to find any docs on how to upgrade the package.
Thanks for any help offered!

A: To compile you probably need build-essentials:
alfred@alfred-laptop:~$ apt-cache search ^build-essential$
build-essential - Informational list of build-essential packages
alfred@alfred-laptop:~$ sudo apt-get install build-essential

Compile SQLite:
alfred@alfred-laptop:~/tmp$ wget http://www.sqlite.org/sqlite-autoconf-3070701.tar.gz
alfred@alfred-laptop:~/tmp/sqlite-autoconf-3070701$ ./configure
alfred@alfred-laptop:~/tmp/sqlite-autoconf-3070701$ make
alfred@alfred-laptop:~/tmp/sqlite-autoconf-3070701$ sudo make install
alfred@alfred-laptop:~/tmp/sqlite-autoconf-3070701$ sudo ldconfig

especially sudo ldconfig is important. When I did not do that I got
alfred@alfred-laptop:~/tmp/sqlite-autoconf-3070701$ sqlite3
SQLite header and source version mismatch
2010-08-23 18:52:01 42537b60566f288167f1b5864a5435986838e3a3
2011-06-28 17:39:05 af0d91adf497f5f36ec3813f04235a6e195a605f

I am running Ubuntu which is based on Debian:
alfred@alfred-laptop:~/linux$ cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=10.10
DISTRIB_CODENAME=maverick
DISTRIB_DESCRIPTION="Ubuntu 10.10"
Finally I ran sqlite3
alfred@alfred-laptop:~$ sqlite3 --version
3.7.7.1 2011-06-28 17:39:05 af0d91adf497f5f36ec3813f04235a6e195a605f

A: I dont have root access so I installed it like this :
  export LD_LIBRARY_PATH=/home/h4ck3rm1k3/perl5/lib
here are the details :
vi ~/.bashrc and add  :
export PATH=$PATH:$HOME/perl5/bin
export LD_LIBRARY_PATH=/home/h4ck3rm1k3/perl5/lib

import the new settings
. ~/.bashrc

wget http://www.sqlite.org/sqlite-autoconf-3071000.tar.gz
tar -xzf sqlite-autoconf-3071000.tar.gz
cd sqlite-autoconf-3071000/
./configure --prefix=/home/h4ck3rm1k3/perl5
make PREFIX=/home/h4ck3rm1k3/perl5
make install  PREFIX=/home/h4ck3rm1k3/perl5
sqlite3

mike


text:
Q: positioning a popover using twitter bootstrap if I have a popover on an  element and call it as follows
$(function () {
    $('#element').popover({
        placement:'top',
        title:'some title',
        content: $('#some-div').html()
    });
});

the popover displays top center of the element, how do I get the popover to display top-right or top left of the element?

A: You can add to the styles of the standard popover layout to move the popover where you want. Here is the standard popover layout taken directly from bootstrap-popover.js:

Therefore to move it say 15px to the right you can add the following to your style:
.popover {margin-left: 15px;}

A: As of now, you can't, you're limited to top | bottom | left | right for the moment, for such  precision you can modify the display of another plugin such as the tipsy jQuery plugin, which was the base for the bootstrap tooltip plugin to begin with.
Bootdtrap Popover Documentation.

A: Use "left" instead of "margin-left". The bootstrap popover is using position absolute. Say .popover{left:15px;}


text:
Q: How do I use Visual Studio Code to build, debug and run existing C++ solution (.sln) from Visual Studio 2019? I have an existing C++ solution which I have been building and running using Visual Studio 2019. I would like to build and run the application on Ubuntu using g++ and Visual Studio Code. What is the best way of achieving this? Most of the samples provided are building single .cpp file but my application consists of many .cpp files built into one application executable.
https://code.visualstudio.com/docs/cpp/config-linux
How do I set up Visual Studio Code to compile C++ code?
I have installed the https://github.com/fernandoescolar/vscode-solution-explorer extension but that only enables me to browse the C++ solution. How to build the solution and being able to debug and run the C++ application?
Any advice and insight is appreciated.

A: Use CMake and generate CMakeLists.txt from .sln and included .vcxproj using https://github.com/pavelliavonau/cmakeconverter
cmake-converter -s MyProject.sln

A: In one of the sections, I provide information on how to build solution files in Visual Studio Code in Windows (I believe it is similar for other systems): https://stackoverflow.com/a/75110946/20707965


text:
Q: Custom CSS edit I am new in building sites and I don't understand a lot of coding but I need to ask this question ( I guess it's simple but for me it's not). I have products on my homepage and they have borders. I need to remove the borders when I click inspect and remove the tick on "border-style: solid;" it's okay. I tried a lot of different codes in Custom CSS but none of them worked. I guess I cannot take the right class. Some examples:
.elementor-52 .elementor-element.elementor-element-c51ed78 .eael-product-grid .woocommerce {
    border-style: none;
}

or
.product .type-product .post-30 .status-publish .first .instock .product_cat-packages
.product_cat-test .has-post-thumbnail .shipping-taxable .purchasable .product-type-simple {
    border-style: none;
}

Thanks for your time.

A: The border is on your list-element with the class product
To get rid of the border you can use this:
li.product{
 border-style: none !important;
}

You could also use border: none;or border-width: 0;
The "!important" overwrites any styles even if they are nested more.
It should be looking like this:

If the li.product-style is not there you made something wrong in your css-file or: the old css-style is still in your cache. In Chrome you can reset the cache and reload by pressing ctrl + F5


text:
Q: Positive function which is harmonic in every compact set in a cone Let $C \subset \mathbb R^3$ be an open unbounded cone with vertex at the origin (I do not care much about the angle of the cone but assume that $C \cap \partial B(0,1) = B((0,0,1), r) \cap \partial B(0,1)$ for some $r>0$).
Assume we have a function $u$ defined in the cone which is (strictly) positive inside $C$ and $0$ in $\partial C$. Moreover, assume that $u$ is harmonic in every compact set $K \subset C$.
Intuitively, there is only one such function up to multiplication by a scalar: the Green function with pole at $\infty$.
How can I prove that $u$ is a multiple of this function?
**Remark:**By Green function with pole at infinity I mean,
$$u(x) = f(|x|) \cdot g(x/|x|)$$
with $g$ being the first Dirichlet eigenfunction of $C \cap \partial B(0,1)$ and $f(|x|) = |x|^a$ for some adequate $a$ that makes it harmonic.

A: This is true, but I am unaware of an elementary proof. A way to reformulate the statement to make it more aligned with the literature is to perform a Kelvin transform on $u$; this leads to a positive harmonic function on $C$ which vanishes uniformly at infinity and on $\partial C \setminus \{0\}$ but  blows up at the origin. The claim is then to show that all functions with these properties are constant multiples of each other.
This claim, reminiscent of Bocher's theorem for isolated singularities of harmonic functions, is common in potential theory. I do not know the exact history and various formulations of it; it is related to the concept of the Martin boundary, and in the works I am familiar with it is often stated as the uniqueness of kernel functions. One reference is this paper of Hunt and Wheeden (see the discussion starting on page 515), where they prove it for Lipschitz domains, but it was clearly well-known before then.


text:
Q: Check if users are in conversation with $in operator How can i make my code search for two user ids but take in consideration if its more users?
lets say my db only contains a conv with user 10 and 4.
my code:
return Conversations.findOne({"users.userid": { $in: SearchUsers }}).then(function (response) {
                return response;
        });

Test 1: users with ids: [10,4] -> would return the conversation. aka ( true)
test 2: users with ids [10,4,8] -> This example would NOT return it. Even that both 10 and 4 is in the users, cause there is more members in it, and therefore not a private for them alone. , because it does not have an match, even that 10 and 4 is there, there is a user with id 8, and it dosent exist. ( false )
The idea is to make like facebook has, group chat system, and in this particular matter, to check if an conversation exists or not.
Ideally the $searchUsers could contain anything from 1-50+ userids, and i need it returned if all the users are in a match, if not all is in it, then it wont return any.

A: tryThe $all operator : it should behave like an $and with $in
Conversations.findOne({"users.userid": { $all: SearchUsers }}).then(function (response) {
                return response;
        });


text:
Q: bash variable visibility in subshell of command substitution I am reading a Linux shell scripting book and have found the following warning:

"Command substitution creates what's called a subshell to run the
  enclosed command. A subshell is separate child shell generated from
  the shell that's running the script. Because of that, any variables
  you create in the script aren't available to the subshell command".

I have tried to create a variable in my current bash shell's CLI and then enter the subshell to check whether I can print it on the screen. So yes, I can't do it, seems to be according the citation above. However, I have run the following script with command substitution:
#!/bin/bash
var=5.5555
ans=$(echo $var)
echo $ans

And the result is:
5.5555

As I understood, it shouldn't print the value of var since the subshell shouldn't be able to "see it". Why does it happen?

A: The statement:

Because of that, any variables you create in the script aren't available to the subshell command.

is false. The scope of a variable defined in the parent shell is the entire script (including subshells created with command substitution).
Running:
#!/bin/bash
var=5.5555
ans1=$(echo $var)
ans2=$(var=6; echo $var)
echo $ans1
echo $ans2

will give the result:
5.5555
6

$var is resolved by the subshell:

*

*if no local variable is specified, the value of three global variable is used

*if a local variable is specified, it uses its value

See also the example 21-2.

A: The statement as quoted is not true. It is also not true that the variable has been pre-substituted before the subshell runs.
You can validate this directly using variable indirection:
$ x=hello
$ echo Result is $(y=x ; echo ${!y} ; echo world)
Result is hello world

The variable x is definitely available directly to the subshell (rather than having had its value previously expanded) because ${!y} reads from the variable whose name is stored in y - which didn't exist at the time the subshell was created.

A charitable reading of the passage from the book would be that it means to say that the "variable" is unavailable because you can't modify its value persistently. Any variable assignments you make within a subshell are not available to the parent shell afterwards, whether that's making new variables (like y) or assigning replacement values to existing variables. If the subshell assigned to x, the new value would have effect inside the subshell, but reading from it afterwards would give the original value:
$ x=world
$ echo $(x=hello ; echo $x)
hello
$ echo $x
world

It's not a very clear way of expressing that, at least in the passage you've quoted. If the whole book is like that, you may be able to find a better one (or read questions here instead).


text:
Q: Improve the performance of solutions to Project Euler (#14) Problem
I have following code, when n<=10^5 it's not slow, but n>2*10^5 it's became very slow.
I think maybe some temp value greater than 2^31-1, so make compile invalid.
Could you give any idea make it can be compiled? As far as possible not to use recursive algorithm.
pe14 = Compile[{},
   Module[{n1, len, maxLen = 0, res = 0},
    Do[n1 = n;
     len = 1;
     While[n1 != 1,
      n1 = If[EvenQ@n1,  n1~Quotient~2, 3 n1 + 1];
      len++
      ];
     If[len > maxLen, maxLen = len; res = n],
     {n, 1, 10^6}];
    {maxLen, res}
    ]
   ];

pe14[] // AbsoluteTiming

A: Here is a (tolerably slow) non compiled version I wrote some years ago:
s = Array[{}, 10^6];
f[x_] := f[x] = If[x == 1, 1, 1 + f[If[EvenQ[x], x/2, (3 x + 1)]]];
Block[{$RecursionLimit = 1000, a = 0, j},
     Do[If[a < (s[[i]] = f[i]), a = f[i]; j = i], {i, Reverse@Range@1000000}];
       Print@a; Print@j;
       ]

{Max@s, ListPlot@Tally@s}

{525, }

A: ClearAll[col]
col[1]=0
col[n_] := col[n] = If[EvenQ[n], col[n/2], col[3 n + 1]] + 1
ctab = Table[col[n], {n, 1, 1000000}]; // AbsoluteTiming
  {13.358787, Null}
Max[ctab]
  524

A: A print statement shows that this will overflow on platforms where Mathematica machine integers are 32 bits.
pe14 = Compile[{}, Module[{n1, len, maxLen = 0, res = 0, print = 0},
    Do[n1 = n;
     len = 1;
     While[n1 != 1, n1 = If[EvenQ@n1, n1~Quotient~2, 3 n1 + 1];
      If[n1 > 10^4*n && print < 10, print++; Print[{n, n1}]];
      len++];
     If[len > maxLen, maxLen = len; res = n], {n, 1, 2 10^5}];
    {maxLen, res}]];

pe14[] // AbsoluteTiming

During evaluation of In[356]:= {77671,1047216490}

During evaluation of In[356]:= {77671,1570824736}

During evaluation of In[356]:= {77671,785412368}

During evaluation of In[356]:= {103561,1047216490}

During evaluation of In[356]:= {103561,1570824736}

During evaluation of In[356]:= {113383,1654740898}

During evaluation of In[356]:= {113383,2482111348}

During evaluation of In[356]:= {113383,1241055674}

During evaluation of In[356]:= {113383,1861583512}

During evaluation of In[356]:= {113383,1325287492}

Out[357]= {4.547872, {383, 156159}}

On 64 bit platforms it will run to completion. Takes around 18 seconds on my desktop.
You can cut a factor of 2 by only explicitly handling odd values, adjusting for evens that are multiples thereof. Another factor of 4 comes from compiling to C.
pe14b = Compile[{{top, _Integer}},
   Module[{n1, len, maxLen = 0, res = 0},
    Do[n1 = n;
     len = 1;
     While[n1 != 1, n1 = If[EvenQ@n1, n1~Quotient~2, 3 n1 + 1];
      len++];
     If[len > maxLen, maxLen = len + Floor[Log[2, top/N[n]]];
      res = n], {n, 1, top, 2}];
    {maxLen, res}], CompilationTarget -> "C"];

In[377]:= pe14b[10^6] // AbsoluteTiming

Out[377]= {2.396513, {525, 837799}}

For platforms that do not support 64 bit machine integers, one might try to emulate this with machine doubles. EvenQ would have to check whether dividing by two creates a fractional part. The variant below seems to work as it ought.
pe14c = Compile[{{top, _Integer}},
   Module[{n1, len, maxLen = 0, res = 0.},
    Do[n1 = n;
     len = 1;
     While[n1 != 1,
      n1 = If[FractionalPart[n1/2.] == 0, n1/2, 3 n1 + 1];
      len++];
     If[len > maxLen, maxLen = len + Floor[Log[2, top/n]];
      res = n], {n, 1., top, 2.}];
    {maxLen, res}], CompilationTarget -> "C"];


text:
Q: Are the HL7-FHIR, HL7 CDA, CIMI, openEHR and ISO13606 approaches aiming to solve the same health data exchange problems? Are the HL7-FHIR, HL7 CDA, CIMI, openEHR and ISO13606 approaches aiming to solve the same health data exchange problems?

A: FHIR, CDA, 13606, CIMI, and openEHR all offer partial and overlapping approaches to 'solving health data exchange problems'. They each have strengths and weaknesses, and can work together as well as overlapping each other.
FHIR is an API exchange spec that's easy to adopt
CDA is a document format that's widely supported
CIMI is a community defining formal semantic models for content
openEHR does agreed semantic models and an application infrastructure
13606 is for EHR extract exchange

A: CIMI is clearly an initiative to think about the content of archetypes and recurring patterns
FHIR is a specification for API's including a limited set of content models
openEHR is a community and an open-source specification with standardised Reference Model, and Archetype Object Model, Data types and Termlist
CEN/ISO 13606 is a community using its formal, public(?), and CEN and ISO standardised Reference Model, and Archetype Object Model, Data types and Termlist
Scopes of all overlap. The most overlap is between openEHR and 13606. And to a lesser extend with CIMI.
Two level Modeling Paradigm. CIMI, openEHR and 13606 have a lot of interactions and adhere to the Two level Modeling Paradigm.
Archetypes can be used by FHIR. CIMI is creating archetypes as are the openEHR and 13606 communities.

A: I see a future for 13606 in context of cloud EHR, were the exact location of data is not always known, but what matters is how to get access to them.
13606 can provide a standard for interfacing to the cloud, and provide features as queries and requests for detailed information, instead of precooked general purpose message-formats, like patient summaries, etc.

A: Erik, you write: "I do not understand why you call the openEHR specification proprietary (it is CC-BY-ND licenced and freely available online) and you call the ISO 13606 more open (it is copyrighted and behind a paywall)"
The point is is that in case of an ISO standard third parties should not claim IP. You must pay for the information, and you may not distribute the copyrighted text, but you may use the information without risk of being confronted with excessive claims afterwards.
There is a policy on ISO deliverables regarding to patents, which gives insurance for not having to deal with excessive patent-claims afterwards. See for more information:
http://isotc.iso.org/livelink/livelink/fetch/2000/2122/3770791/Common_Policy.htm?nodeid=6344764&vernum=-2
Resume: There can be IP claims on ISO deliverables, except from the copyrighted text, but those claims must be handled in a non-discriminatory and reasonable way. So, no excessive claims are possible.
In a patent-related legal case, the judge will find it important that the deliverable was published at ISO.
Two equitable defenses to patent infringement that may arise from a patent owner's delay in taking action are laches and equitable estoppel. Delays give rise to a presumption that a delay is unreasonable, inexcusable, and prejudicial. This is certainly true when it concerns an ISO deliverable.
This policy does not exist in the case CC-BY-ND licenced work. This work gives no guarantee at all. The user of CC-BY-ND licenced work is not safe for claims.
Therefore it is important that AOM2.0 will be submitted to ISO. It can only be submitted to ISO in context of the 13606 Renewal. That is why the OpenEHR community, for its own sake, must work on a Reference Model agnostic standard in all parts, to help and convince the ISO13606 renewal committee to implement it.
AOM1.4 has been an ISO standard for years, so we can be pretty sure that there is no hidden IP on that.

A: I would say the only standard which aim is NOT to solve data exchange problems is openEHR.
openEHR defines a complete EHR platform architecture to manage clinical data structure definitions (archetypes, templates), including constraints and terminology/translations, manage clinical information (canonical information model), access clinical information (standard query language AQL), define rules for clinical decision support (standard rule language GDL), and defines a service model (REST API is close to be approved).
So looking at openEHR, it tries to solve the all the interoperability problems that come before any data exchange but are needed to make data exchanged interpreted and used correctly, in short openEHR allows interoperability but doesn't define how data is technically exchanged.


text:
Q: Does a generically injective morphism of schemes have a section? Let $f \colon X \to Y$ be a generically injective, finite morphism between projective varieties over $\mathbb{C}$, with $Y$ non-singular. Does $f$ have a section i.e., a morphism $g:Y \to X$ such that $f \circ g:Y \to Y$ is the identity?
If not true in general, is there any known condition under which $f$ has a section?
EDIT. The map $f$ is assumed to be dominant.

A: If $Y$ is normal, then every finite generically injective dominant morphism $f:X \to Y$ is an isomorphism. Indeed, take an open affine subset $U = Spec~ A$ of $Y$. Then $f^{-1}(Y) = Spec~B$ where $B$ is integral over $A$. Since $A$ is integrally closed and $A,B$ have the same field of fractions, $A = B$.
So the answer to your question is: ``Yes, always!''


text:
Q: Prevent GC when using Git as a simple KV store My situation is to use git only as a KV store for directory content. I use git update-index --add; git write-tree to add directory and use git read-tree to retrieve them when necessary. I will record the SHA1 hash of the tree manually in other ways.
In this scenario, what do I need to config to prevent some git commands to GC these unreachable objects?

A: You can disable auto GC by adding it to the config.
From the Description section in the docs (emphasis mine):

Some git commands may automatically run git gc; see the --auto flag
  below for details. If you know what you're doing and all you want is
  to disable this behavior permanently without further considerations,
  just do:
$ git config --global gc.auto 0


text:
Q: Retrieving CGVector from UserDefaults (Swift)? How can I properly retrieve this data from user defaults?
Saving force from north player class:
let forceSave = UserDefaults.standard
forceSave.set(directionVector, forKey: "NorthForce")
forceSave.synchronize()

Retrieving force vector value from game scene in collision detection function (player collides with ball):
ball!.physicsBody!.applyImpulse(UserDefaults.standard.data(forKey: "NorthForce"))

I get the following error when trying to retrieve data:
"Cannot convert value of type 'Data?' to expected argument type 'CGVector'"
As a background, I was delegating this data initially, but I found that I had to retrieve the data in a separate function when I delegated it. So the force calculation was an extra frame off which makes a difference when the game is played at fast speeds. I decided to try user defaults because I could access the data directly in the collision detection function.