text:
Q: Cannot read all table elements with PHP and jQuery I have this file called crear_pedido_cliente.php, when nearly at the bottom there's a table with id="tabla". The user adds an article from a select, an ammount and the price, wich gives a total value per line; when the user clicks in the button "confirmar_linea", with jQuery those 4 fields are appended to the table. Here's the code:

    <?php echo mensaje(); ?>
    <?php echo errores_de_formulario($errores); ?>

Nuevo Pedido

    <form action="" name="form_pedido" method="post" novalidate>

Codigo del Pedido:
            <input type="text" class="encabezado_pedido" name="codigo_del_pedido" value="">

Cliente:

            <select name="cliente_select" id="custom-select" class="encabezado_pedido">
            <?php
                $grupo_clientes = buscar_clientes();
                foreach($grupo_clientes as $item) {
                    echo "<option value=\"{$item["idCliente"]}\">{$item["razonSocial"]}</option>";
                }
            ?>
            </select>

Fecha:
            <input type="text" class="encabezado_pedido" name="fecha_del_pedido" id="fecha" value="">

        <button type="button" id="otro_pedido" name="otro_pedido" onclick="otro_pedido()">Otro Pedido</button>
        <button type="button" id="confirmar_encabezado" name="confirmar_encabezado" onclick="encabezado_listo()">Confirmar Datos</button>

Articulo:

                <select id="articulo_select">
                <?php
                    $grupo_articulos = buscar_articulos();
                    foreach($grupo_articulos as $item) {
                        echo "<option value=\"{$item["idArticulo"]}\">{$item["descripcion"]}</option>";
                    }
                ?>
                </select>

Cantidad:
                <input type="text" class="detalle_pedido" name="cantidad" id="cantidad">

Precio:
                <input type="text" class="detalle_pedido" id="precio" name="precio">

        <button type="button" id="confirmar_linea" name="" onclick="">Aceptar Linea</button>

        <input type="submit" id="guardar_pedido" name="submit" value="Guardar Pedido" onclick="">

                        Articulo

                        Cantidad

                        Precio Unitario

                        Precio de Linea

Total:
                <input type="text" id="total" name="precio_total" disabled value="0.00"/>

    </form>

    Cancelar

My problem is that at the begginning of the file I want to read with PHP all those rows inserted with jQuery to insert in a database. I've tried the following in the same file:
if (isset($_POST['submit'])) {

$url = "crear_pedido_cliente.php";

function get_data_from_table($url)
{
   // retrieve the content of that url
   $content = file_get_contents($url);

   // load into DOM
   $dom = new DOMDocument();
   $dom->loadHTML($content);

   // make xpath-able
   $xpath = new DOMXPath($dom);

   $query = "//tr/td";
   $elements = $xpath->query($query);

   $element = $elements->item(0);

   // get his parent element (tr)
   $tr = $element->parentNode;
   $data = array();

   // iterate over it's td elements
   foreach ($tr->getElementsByTagName("td") as $td) {
        // retrieve the content as text
        $data[] = $td->textContent;
   }

   // return the array of  contents
   return $data;
}

echo '
';
print_r(get_data_from_table($url));
echo '
';

}

The result, besides some warnings, are the first 4 elements in that table, the "titles" that are written in the table in HTML and wrapped with label tags.
Is there any issue with jQuery adding this  that PHP doesn't recognize them as part of the DOM?
EDIT: I've tried this answer, using the Simple HTML Dom library. And the result is:
Array
{
}

A:

      EmployeeID
      Name
      Designation
      Process1
      Process2

         <input type="hidden" id="a1" class="firstName" value="1">
         0000011

         chidambaram

         Tech Lead

         <input type="hidden" id="a1" class="firstName" value="11">
         <input type="text" id="a1" class="firstName" value="text1">

         <input type="hidden" id="a1" class="firstName" value="22">
         <input type="text" id="a1" class="firstName" value="text2">

         <input type="hidden" id="a1" class="firstName" value="2">
         0000002

         Suresh

         Android Developer

         <input type="hidden" id="a1" class="firstName" value="33">
         <input type="text" id="a1" class="firstName" value="text3">

         <input type="hidden" id="a1" class="firstName" value="44">
         <input type="text" id="a1" class="firstName" value="text4">

<button id="target">Click me</button>

Jquery

$("#target").click(function() {

    //storage
    var data = {
        firstName: [],
        lastName: []
    }

    //loop through the td's
    $('table tr').each(function() {

        var tdlen = $(this).children('td').length
        var i = 0;

        $('td', this).each(function() {

            if (i == 0) {
                alert('Emp. ID is : ' + $(this).find("input[type='hidden']").val());
            }
            if (i > 2) {
                alert('ID is : ' +$(this).find("input[type='hidden']").val());
                alert('text value is : ' +$(this).find("input[type='text']").val());
            }
            i++;
        });

    });

});

https://jsfiddle.net/chidamca/ty30j2ju/ for demo

A: Ok, so the answer here was to create a series of hidden inputs, something @Rasclatt was suggesting in a way. Then it's easy to iterate trough $_POST names with PHP.
Thanks everyone for your time


text:
Q: Filtragem personalizada - pesquisa por intervalo - DataTables Estou usando umas das funções do DataTables que é a pesquisa por intervalo, porém esse tipo de pesquisa so aceita números inteiro. Gostaria de fazer com que essa pesquisa aceitasse formatos de data exemplo 10/10/2019. não sei por onde começa
https://datatables.net/examples/plug-ins/range_filtering.html
$('#min, #max').keyup(function () {
    table.draw();
});

$.fn.dataTable.ext.search.push(
    function (settings, data, dataIndex) {
        var min = parseInt($('#min').val(), 10);
        var max = parseInt($('#max').val(), 10);
        var age = parseFloat(data[0]) || 0; // use data for the age column

        if ((isNaN(min) && isNaN(max)) ||
            (isNaN(min) && age <= max) ||
            (min <= age && isNaN(max)) ||
            (min <= age && age <= max)) {
            return true;
        }
        return false;
    }
);

A: Você pode utilizar o mesmo conceito de parseInt que já usa para a idade, porém com formato diferente, no exemplo a seguir, a data do datepicker será formatada para um padrão yyyymmdd (note a função parseDateValue), veja no exemplo completo:

function parseDateValue(rawDate) {
    var dateArray = rawDate.split("/");
    var parsedDate = dateArray[2] + dateArray[1] + dateArray[0];
    return parsedDate;
}

$(document).ready(function() {
    $.fn.dataTable.ext.search.push(
        function(settings, data, dataIndex) {
            var dateStart = parseDateValue($("#min").val());
            var dateEnd = parseDateValue($("#max").val());
            var evalDate = parseDateValue(data[4]);

            if ((isNaN(dateStart)) || (isNaN(dateEnd))) {
                return true;
            }
            if (evalDate >= dateStart && evalDate <= dateEnd) {
                return true;
            } else {
                return false;
            }
        }
    );

    $("#min").datepicker({
        dateFormat: 'dd/mm/yy',
        onSelect: function() {
            table.draw();
        },
        changeMonth: true,
        changeYear: true
    });
    $("#max").datepicker({
        dateFormat: 'dd/mm/yy',
        onSelect: function() {
            table.draw();
        },
        changeMonth: true,
        changeYear: true
    });
    var table = $('#example').DataTable({
        "language": {
            "url": "//cdn.datatables.net/plug-ins/1.10.20/i18n/Portuguese-Brasil.json"
        }
    } );

    $('#min, #max').change(function() {
        table.draw();
    });
});

<link rel="stylesheet" type="text/css" href="https://code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css"></script>
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.10.13/css/jquery.dataTables.min.css"></script>

            Data Inicial:
            <input name="min" id="min" type="text" autocomplete="off">

            Data Final:
            <input name="max" id="max" type="text" autocomplete="off">

            Nome
            Profissão
            Localidade
            Idade
            Data de Inicio
            Salario

            Nome
            Profissão
            Localidade
            Idade
            Data de Inicio
            Salario

            Teste
            Arquiteto
            São Paulo
            61
            25/04/2011
            R$3208

            Teste
            Arquiteto
            São Paulo
            61
            25/04/2012
            R$3208

            Teste
            Arquiteto
            São Paulo
            61
            25/04/2013
            R$3208

            Teste
            Arquiteto
            São Paulo
            61
            25/04/2014
            R$3208

            Teste
            Arquiteto
            São Paulo
            61
            25/04/2015
            R$3208

            Teste
            Arquiteto
            São Paulo
            61
            25/04/2016
            R$3208

            Teste
            Arquiteto
            São Paulo
            61
            25/04/2017
            R$3208

            Teste
            Arquiteto
            São Paulo
            61
            25/04/2018
            R$3208

            Teste
            Arquiteto
            São Paulo
            61
            25/04/2019
            R$3208

            Teste
            Arquiteto
            São Paulo
            61
            25/06/2019
            R$3208

            Teste
            Arquiteto
            São Paulo
            61
            25/07/2019
            R$3208

            Teste
            Arquiteto
            São Paulo
            61
            25/08/2019
            R$3208

            Teste
            Arquiteto
            São Paulo
            61
            25/10/2019
            R$3208

            Teste
            Arquiteto
            São Paulo
            61
            25/11/2019
            R$3208

Código no GitHub para referência futura.

A: Para facilitar você pode usar o Moment.js: https://momentjs.com/
$.fn.dataTable.ext.search.push(
    function( settings, data, dataIndex ) {
        const inicio = moment("01/10/2019","DD/MM/YYYY");
        const fim = moment("01/11/2019","DD/MM/YYYY");

        var data= moment(data[posicao],"DD/MM/YYYY");

        if (data >= inicio && data <= fim) {
            return true;
        } else {
            return false;
        }
    }
);

A: Você pode fazer dessa forma tb:

$(document).ready(function() {
   jQuery.extend(jQuery.fn.dataTableExt.oSort, {
    "extract-date-pre": function(value) {
        var date = $(value, 'span')[0].innerHTML;
        date = date.split('/');
        return Date.parse(date[1] + '/' + date[0] + '/' + date[2])
    },
    "extract-date-asc": function(a, b) {
        return ((a  b) ? 1 : 0));
    },
    "extract-date-desc": function(a, b) {
        return ((a  b) ? -1 : 0));
    }
});
$('#leadtable').dataTable({
    language: {
        url: '//cdn.datatables.net/plug-ins/1.10.12/i18n/Hebrew.json'
    },
    columnDefs: [{
            type: 'extract-date',
            targets: [0]
        }

    ]
});

redpajama_set_name: RedPajamaStackExchange


text:
Q: ora 12505 Error listener refused to connect import java.util.*;
import java.io.*;
import java.sql.*;
public class Stud
{
    public static void main(String args[])
    {
        try
        {
            Class.forName("oracle.jdbc.driver.OracleDriver");
            System.out.println("Driver Registered");
            Connection connection =DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:XE","bh","1234");
            System.out.println("Connection created");
            PreparedStatement ps=connection.prepareStatement("insert into Student(StudName,dob,math,phy,chem,agg) values(?,?,?,?,?,?)");
            System.out.println("prepare stmt ");
            ps.setString(1,"name");

            ps.setString(2,"dob");
            ps.setInt(3,96);
            ps.setInt(4,96);
            ps.setInt(5,94);
            ps.setDouble(6,96);
            int a=ps.executeUpdate();
            ps.close();
            connection.close();
        }
        catch(Exception ex)
        {
            ex.printStackTrace();
        }
    }
}

Error
java.sql.sql exception listner refused to connect with the following error
  ora 12505 the listner currently does not know of sid in give connectoin descriptor
  local host 1521

I'm using oracle 10 g and I have set the ojdbc14.jar in my class path.
I'm using Java 7 and my tnsname.ora also contain (PORT = 1521))
So I can't understand the given error.

A: You have your DB URL wrong. It should be:
jdbc:oracle:thin:@localhost:1521/XE  <- Notice slash instead of colon for a SID value (in your case "XE")

A: From the oracle documentation your connection string should have this format:
jdbc:oracle:thin:scott/tiger@//myhost:1521/myservicename


text:
Q: deployed the jars on tomcat and remane old jars but server still reading old jars I have modified some jars and deployed on tomcat.Due to policy of company i can not remove the old jars so i rename the jars like "myApp" to "myApp-bkp-12-2-21". But server still reading the old jars
What should be the solution of this?

A: Tomcat always assumes that all jars in specific directories (e.g. WEB-INF/lib) are on the classpath - no matter how elaborated your renaming is. Personally, I wouldn't even trust renaming a .jar file to .something-other-than-jar. So: Don't keep old crufty jars around. Delete them! Have the company policy changed.
A company policy that doesn't allow developers to delete old and obsolete code, or to overwrite it, sounds as if it's the wrong environment to develop software in. It's your job to update/add/remove new files and deploy new code. I'd question if that policy is interpreted correctly here.


text:
Q: how to get google search results links and store them in array using mechanize i  want to get the 10 google search results links (href) using mechanize so i wrote this code, but the code does not return the right google search results, what should i write?
    @searchword = params[:q]
    @sitesurl = Array.new
    agent = Mechanize.new
    page = agent.get("http://www.google.com")
    search_form = page.form_with(:name => "f")
    search_form.field_with(:name => "q").value = @searchword.to_s
    search_results = agent.submit(search_form)
    count = 0
    c = 0
    while  c < 10
    if (search_results/"li")[count].attributes['class'].to_s == "g knavi"
      site = (search_results/"li")[count]
      code = (site/"a")[0].attributes['href']
      @sitesurl << code
      c += 1
    end
    count += 1
end

A: Something like this should work:
@searchword = params[:q]
@sitesurl = Array.new
agent = Mechanize.new
page = agent.get("http://www.google.com")
search_form = page.form_with(:name => "f")
search_form.field_with(:name => "q").value = @searchword.to_s
search_results = agent.submit(search_form)

(search_results/"li.g").each do |result|
  @sitesurl << (result/"a").first.attribute('href') if result.attribute('class').to_s == 'g knavi'
end

A: This is the updated one for now. Tested and work's fine
require 'rubygems'
require 'mechanize'
require 'hpricot'

agent = Mechanize.new
agent.user_agent_alias = 'Linux Firefox'
page = agent.get('http://google.com/')
google_form = page.form('f') google_form.q = 'your search'

page = agent.submit(google_form)

 page.links.each do |link|
if link.href.to_s =~/url.q/
        str=link.href.to_s
        strList=str.split(%r{=|&})
        url=strList[1]
        # if You need cached url's then just remove this condition and simply use URL's
        if ! url.include? "webcache"
            puts url
        end
     end
  end

Just create a new array and push the url's to array.

A: It's not working now, I suppose that could be because Google recently changes their HTML in the search results and URLs.

A: Nowadays, the answers above don't work anymore. We have released our own gem that is easy to use and allow custom locations:
query = GoogleSearchResults.new q: "coffee", location: "Portand"
hash_results = query.get_hash

Repository: https://github.com/serpapi/google-search-results-ruby


text:
Q: How can I understand which value(s) are null        public static void ReadExcelFileDOM(string fileName)
        {
            using (SpreadsheetDocument spreadsheetDocument = SpreadsheetDocument.Open(fileName, false))
            {
                WorkbookPart workbookPart = spreadsheetDocument.WorkbookPart;
                WorksheetPart worksheetPart = workbookPart.WorksheetParts.First();
                SheetData sheetData = worksheetPart.Worksheet.Elements<SheetData>().First();
                string text;
                foreach (Row r in sheetData.Elements<Row>())
                {
                    foreach (Cell c in r.Elements<Cell>())
                    {

                        text = c.CellValue.Text;

                        Console.Write(text + " ");

                    }
                }

            }

Here is my code. When l run it, l am getting the error "c.CellValue.Text is null". That cause some of values returns null when excel file is finish but i do not understand which values are null. Could anyone help me with that?
Thanks a lot.


text:
Q: Contrast testing for nested lm I have a dataset with several grouping variables: CI (control/impact), BA (before/after), Time (years, either "1" or "2", nested in BA), and Month (factor, crossed with Time). I want to test specific contrasts after fitting the model (for example - is there a difference between control and impact in the Before, Year 1, Month = 7 period). I'm getting errors, and can't figure out what's going on.
a subset of my dataset (approximately 1/4 of original data):
df <- structure(list(CI = c("C", "C", "I", "C", "I", "I", "C", "C",
"I", "I", "I", "I", "I", "I", "I", "I", "C", "C", "I", "C", "C",
"I", "C", "C", "I", "I", "I", "C", "C", "C"), BA = c("A", "B",
"B", "A", "A", "A", "A", "A", "A", "B", "A", "A", "B", "A", "A",
"B", "B", "A", "A", "A", "B", "A", "B", "A", "A", "A", "B", "B",
"A", "A"), Time2 = structure(c(1L, 1L, 1L, 1L, 2L, 1L, 2L, 2L,
2L, 2L, 1L, 1L, 1L, 2L, 1L, 2L, 2L, 2L, 2L, 1L, 1L, 1L, 1L, 2L,
1L, 1L, 1L, 1L, 2L, 1L), .Label = c("1", "2"), class = "factor"),
Month = structure(c(3L, 2L, 1L, 1L, 1L, 3L, 3L, 3L, 2L, 2L,
1L, 3L, 2L, 3L, 2L, 1L, 3L, 3L, 3L, 3L, 1L, 2L, 2L, 1L, 3L,
1L, 1L, 2L, 3L, 2L), .Label = c("7", "8", "9"), class = "factor"),
Response = c(113.88752014619, 304.207128003067, 241.7310642075,
604.669028829096, 402.638407934937, 19.0787049433441, 224.594531044096,
102.158889818213, 72.0887353433368, 284.654363758235, 288.369185046419,
26.8008534995586, 178.586792242734, 16.2735094079759, 138.172423258193,
255.441227294758, 203.702896110198, 307.715788152883, 25.1695768835496,
80.6953963840745, 174.332452696881, 96.6109435701337, 318.393256208769,
338.175334072426, 21.8925598523342, 504.867294274189, 245.80372078514,
359.272337190666, 180.562152271052, 345.409069132269)), .Names = c("CI",
"BA", "Time2", "Month", "Response"), row.names = c("122", "391",
"51", "110", "163", "90", "201", "200", "169", "7", "78", "88",
"810", "173", "85", "3", "41", "202", "172", "126", "351", "82", "361",
"191", "89", "79", "46", "381", "203", "118"), class = "data.frame")

Model specification:
mod <- lm(log10(Response) ~ BA*CI + Month*(BA/Time2) + Month:CI:(BA/Time2), data = df)

I would normally set up the contrasts the following way. However, I'm getting an error.
library(contrast)
library(multcomp)

cc <- contrast(mod,
     a = list(Month = c("7"), Time2 = c("1"), CI = c("C"), BA = c("B")),
     b = list(Month = c("7"), Time2 = c("1"), CI = c("I"), BA = c("B")))
summary(glht(mod, linfct = cc$X))

Any help would be appreciated.


text:
Q: Snakemake workflow, ChildIOException or MissingInputException I am trying to add a file renaming step in my current workflow to make it easier on some of the other users. What I want to do is take the contigs.fasta file from a spades assembly directory and rename it to include the sample name. (i.e foo_de_novo/contigs.fasta to foo_de_novo/foo.fasta)
here is my code... well currently.
configfile: "config.yaml"

import os

def is_file_empty(file_path):
    """ Check if file is empty by confirming if its size is 0 bytes"""
    # Check if singleton file exist and it is empty from bbrepair output
    return os.path.exists(file_path) and os.stat(file_path).st_size == 0

rule all:
    input:
        expand("{sample}_de_novo/{sample}.fasta", sample = config["names"]),

rule fastp:
    input:
        r1 = lambda wildcards: config["sample_reads_r1"][wildcards.sample],
        r2 = lambda wildcards: config["sample_reads_r2"][wildcards.sample]
    output:
        r1 = temp("clean/{sample}_r1.trim.fastq.gz"),
        r2 = temp("clean/{sample}_r2.trim.fastq.gz")
    shell:
        "fastp --in1 {input.r1} --in2 {input.r2} --out1 {output.r1} --out2 {output.r2} --trim_front1 20 --trim_front2 20"

rule bbrepair:
    input:
        r1 = "clean/{sample}_r1.trim.fastq.gz",
        r2 = "clean/{sample}_r2.trim.fastq.gz"
    output:
        r1 = temp("clean/{sample}_r1.fixed.fastq"),
        r2 = temp("clean/{sample}_r2.fixed.fastq"),
        singles = temp("clean/{sample}.singletons.fastq")
    shell:
        "repair.sh -Xmx10g in1={input.r1} in2={input.r2} out1={output.r1} out2={output.r2} outs={output.singles}"

rule spades:
    input:
        r1 = "clean/{sample}_r1.fixed.fastq",
        r2 = "clean/{sample}_r2.fixed.fastq",
        s = "clean/{sample}.singletons.fastq"
    output:
        directory("{sample}_de_novo")
    run:
        isempty = is_file_empty("clean/{sample}.singletons.fastq")
        if isempty == "False":
          shell("spades.py --careful --phred-offset 33 -1 {input.r1} -2 {input.r2} -s {input.singletons} -o {output}")
        else:
           shell("spades.py --careful --phred-offset 33 -1 {input.r1} -2 {input.r2} -o {output}")

rule rename_spades:
    input:
        "{sample}_de_novo/contigs.fasta"
    output:
        "{sample}_de_novo/{sample}.fasta"
    shell:
        "cp {input} {output}"

When I have it written like this I get the MissingInputError and when I change it to this.
rule rename_spades:
    input:
        "{sample}_de_novo"
    output:
        "{sample}_de_novo/{sample}.fasta"
    shell:
        "cp {input} {output}"

I get the ChildIOException
I feel I understand why snakemake is unhappy with both versions. The first one is becasue I don't explicitly output the "{sample}_de_novo/contigs.fasta" file. Its just one of several files spades outputs. And the other error is because it doesn't like how I am asking it to look into the directory. I however am at a loss on how to fix this.
Is there a way to ask snakmake to look into a directory for a file and then perform the task requested?
Thank you,
Sean
EDIT File Structure of Spades output
Sample_de_novo
  |-corrected/
  |-K21/
  |-K33/
  |-K55/
  |-K77/
  |-misc/
  |-mismatch_corrector/
  |-tmp/
  |-assembly_graph.fastg
  |-assembly_graph_with_scaffolds.gfa
  |-before_rr.fasta
  |-contigs.fasta
  |-contigs.paths
  |-dataset.info
  |-input_dataset.ymal
  |-params.txt
  |-scaffolds.fasta
  |-scaffolds.paths
  |spades.log

A: Make {sample}_de_novo/contigs.fasta to be the output of spades and parse its path to get the directory that will be the argument to spades -o. Snakemake won't mind if there are other files created in addition to contigs.fasta. This should run --dry-run mode:
rule all:
    input:
        expand('{sample}_de_novo/{sample}.fasta', sample=['A', 'B']),

rule spades:
    output:
        fasta='{sample}_de_novo/contigs.fasta',
    run:
        outdir=os.path.dirname(output.fasta)
        shell(f'spades ... -o {outdir}')

rule rename:
    input:
        fasta='{sample}_de_novo/contigs.fasta',
    output:
        fasta='{sample}_de_novo/{sample}.fasta',
    shell:
        r"""
        mv {input.fasta} {output.fasta}
        """

A: Nope, spoke too soon. It didn't name the output directory correctly, so I moved it to the params and, now, finailly is working the way I wanted.
rule spades:
    input:
        r1 = "clean/{sample}_r1.fixed.fastq",
        r2 = "clean/{sample}_r2.fixed.fastq",
        s = "clean/{sample}.singletons.fastq"
    output:
        "{sample}_de_novo/contigs.fasta"
    params:
        outdir = directory("{sample}_de_novo/")
    run:
        isempty = is_file_empty("clean/{sample}.singletons.fastq")
        if isempty == "False":
          shell("spades.py  --isolate --phred-offset 33 -1 {input.r1} -2 {input.r2} -s {input.singletons} -o {params.outdir}")
        else:
           shell("spades.py --isolate --phred-offset 33 -1 {input.r1} -2 {input.r2} -o {params.outdir}")

rule rename_spades:
    input:
        "{sample}_de_novo/contigs.fasta"
    output:
        "{sample}_de_novo/{sample}.fasta"
    shell:
        "cp {input} {output}"


text:
Q: Counting the number of days inbetween certain date range with **for loop**? (c++) All the other questions i found were with different languages and were a bit too complicated for a beginner like me.
What is wrong with my code, that i cannot get the exact number of days inbetween my two input dates?
int getDate()
{
    std::cout << "Begins from: i.e 7th";
    int dateStart;
    std::cin >> dateStart;

    std::cout << "Ends: i.e 22nd";
    int dateStops;
    std::cin >> dateStops;

    int nrDays = dateStart;

    for(nrDays; nrDays < dateStops; nrDays++)
    {
    }

    return nrDays;
}

Is this possible using for loop?
I'm sorry for asking silly questions. I have just recently started to learn C++ and lots of things are still new to me.
Thank you for your answers! :)
p.s Also, if somebody wants to throw an idea on how to exclude weekends for example, it would be really nice. Although, my gut is telling me, that it will require a whole lotta more coding than what i have the capabilities to do yet.

A: You have to use a separate variable to count number of days .
try this one.
int getDate()
{
    std::cout << "Begins from: i.e 7th";
    int dateStart;
    std::cin >> dateStart;

    std::cout << "Ends: i.e 22nd";
    int dateStops;
    std::cin >> dateStops;

    int nrDays = dateStart;
    int daysCount=0;

    for(nrDays; nrDays < dateStops; nrDays++)
    {
           daysCount++;
    }

    return daysCount;
}

A: The problem with your loop is that you're assuming the iteration variable is a counter.  That turns out to be true in many loops, but here it isn't.  Your variable nrDays is not actually a number of days at all, but a date (it starts  at dateStart and goes to dateStops).  You really want something more like this:
int nrDays = 0;

for( int date = dateStart; date < dateStops; date++)
{
    if (isWeekday(date)) nrDays++;
}

return nrDays;

Note that you can't detect weekdays from just the day of the month.  You need to know what month and what year, or somehow else get the day of the week.

A: Your code shouldn't compile because of this line:
std::cin dateStart;

which should be:
std::cin >> dateStart;

A part from that, you loop is useless. What you apparently want is for nrDays to be equal to dateStop - 1:
int nrDays = dateStop - 1;

or more precisely:
int nrDays = std::max(dateStop - 1, dateStart);

which is: the maximum between dateStart and dateStop - 1.


text:
Q: Who are Bogdan and Björn in "Bogdan/Björn's Erlang Abstract Machine"? (BEAM) I understand that the acronym for Erlang's virtual machine, BEAM, stands for "Bogdan/Björn's Erlang Abstract Machine".
But I can't find definitive reference anywhere to exactly who Bogdan and Björn are.
Searching the erlang.org mailing list I do see posts by developers named "Bogdan Andu" and "Björn-Egil Dahlberg". Can anyone confirm, are these the engineers that BEAM is named after?

A: Erlang and OTP in Action on page 17 says that BEAM means Bogdan's Erlang Abstract Machine. Also see this errata - scroll down to page 41. Here is the history of the Erlang VM - BEAM was not the first and only VM capable of executing Erlang code! Bogdan is actually an English version of Bogumil. All those names are employees at Ericsson who worked on implementing the language and its execution environment after Joe Armstrong's initial implementation in Prolog.


text:
Q: How do I apply a shell command to many files in nested (and poorly escaped) subdirectories? I'm trying to do something like the following:
for file in `find . *.foo`
do
somecommand $file
done

But the command isn't working because $file is very odd.  Because my directory tree has crappy file names (including spaces), I need to escape the find command.  But none of the obvious escapes seem to work:
  -ls gives me the space-delimited filename fragments
  -fprint doesn't do any better.
I also tried:  for file in "find . *.foo -ls"; do echo $file; done
- but that gives all of the responses from find in one long line.

Any hints?  I'm happy for any workaround, but am frustrated that I can't figure this out.
Thanks,
Alex
(Hi Matt!)

A: Instead of relying on the shell to do that work, rely on find to do it:
find . -name "*.foo" -exec somecommand "{}" \;

Then the file name will be properly escaped, and never interpreted by the shell.

A: find . -name '*.foo' -print0 | xargs -0 -n 1 somecommand

It does get messy if you need to run a number of shell commands on each item, though.

A: You have plenty of answers that explain well how to do it; but for the sake of completion I'll repeat and add to it:
xargs is only ever useful for interactive use (when you know all your filenames are plain - no spaces or quotes) or when used with the -0 option.  Otherwise, it'll break everything.
find is a very useful tool; put using it to pipe filenames into xargs (even with -0) is rather convoluted as find can do it all itself with either -exec command {} \; or -exec command {} + depending on what you want:
find /path -name 'pattern' -exec somecommand {} \;
find /path -name 'pattern' -exec somecommand {} +

The former runs somecommand with one argument for each file recursively in /path that matches pattern.
The latter runs somecommand with as many arguments as fit on the command line at once for files recursively in /path that match pattern.
Which one to use depends on somecommand.  If it can take multiple filename arguments (like rm, grep, etc.) then the latter option is faster (since you run somecommand far less often).  If somecommand takes only one argument then you need the former solution.  So look at somecommand's man page.
More on find: http://mywiki.wooledge.org/UsingFind
In bash, for is a statement that iterates over arguments.  If you do something like this:
for foo in "$bar"

you're giving for one argument to iterate over (note the quotes!).  If you do something like this:
for foo in $bar

you're asking bash to take the contents of bar and tear it apart wherever there are spaces, tabs or newlines (technically, whatever characters are in IFS) and use the pieces of that operation as arguments to for.  That is NOT filenames.  Assuming that the result of a tearing long string that contains filenames apart wherever there is whitespace yields in a pile of filenames is just wrong.  As you have just noticed.
The answer is: Don't use for, it's obviously the wrong tool.  The above find commands all assume that somecommand is an executable in PATH.  If it's a bash statement, you'll need this construct instead (iterates over find's output, like you tried, but safely):
while read -r -d ''; do
    somebashstatement "$REPLY"
done < <(find /path -name 'pattern' -print0)

This uses a while-read loop that reads parts of the string find outputs until it reaches a NULL byte (which is what -print0 uses to separate the filenames).  Since NULL bytes can't be part of filenames (unlike spaces, tabs and newlines) this is a safe operation.
If you don't need somebashstatement to be part of your script (eg. it doesn't change the script environment by keeping a counter or setting a variable or some such) then you can still use find's -exec to run your bash statement:
find /path -name 'pattern' -exec bash -c 'somebashstatement "$1"' -- {} \;
find /path -name 'pattern' -exec bash -c 'for file; do somebashstatement "$file"; done' -- {} +

Here, the -exec executes a bash command with three or more arguments.

*

*The bash statement to execute.

*A --.  bash will put this in $0, you can put anything you like here, really.

*Your filename or filenames (depending on whether you used {} \; or {} + respectively).  The filename(s) end(s) up in $1 (and $2, $3, ... if there's more than one, of course).

The bash statement in the first find command here runs somebashstatement with the filename as argument.
The bash statement in the second find command here runs a for(!) loop that iterates over each positional parameter (that's what the reduced for syntax - for foo; do - does) and runs a somebashstatement with the filename as argument.  The difference here between the very first find statement I showed with -exec {} + is that we run only one bash process for lots of filenames but still one somebashstatement for each of those filenames.
All this is also well explained in the UsingFind page linked above.

A: xargs is your friend.  You will also want to investigate the -0 (zero) option with it.  find (with -print0) will help to produce the list.  The Wikipedia page has some good examples.
Another useful reason to use xargs, is that if you have many files (dozens or more), xargs will split them up into individual calls to whatever xargs is then called upon to run (in the first wikipedia example, rm)

A: find . -name '*.foo' -print0 | xargs -0 sh -c 'for F in "${@}"; do ...; done' "${0}"

A: I had to do something similar some time ago, renaming files to allow them to live in Win32 environments:
#!/bin/bash
IFS=$'\n'
function RecurseDirs
{
for f in "$@"
do
  newf=echo "${f}" | sed -e 's/[\\/:\*\?#"\|<>]/_/g'
  if [ ${newf} != ${f} ]; then
    echo "${f}" "${newf}"
    mv "${f}" "${newf}"
    f="${newf}"
  fi
  if [[ -d "${f}" ]]; then
    cd "${f}"
    RecurseDirs $(ls -1 ".")
  fi
done
cd ..
}
RecurseDirs .

This is probably a little simplistic, doesn't avoid name collisions, and I'm sure it could be done better -- but this does remove the need to use basename on the find results (in my case) before performing my sed replacement.
I might ask, what are you doing to the found files, exactly?


text:
Q: How do I connect to Jboss through the CLI tool? I'm using JBoss 7.1.3.Final.  I'm trying to connect to the CLI tool, but keep getting this OutOfMemoryError.  In my standalone.xml config, I have
<management>
    <security-realms>
        <security-realm name="ManagementRealm">
            <authentication>
                <local default-user="$local"/>
                <properties path="mgmt-users.properties" relative-to="jboss.server.config.dir"/>
            </authentication>
        </security-realm>
        <security-realm name="ApplicationRealm">
            <authentication>
                <local default-user="$local" allowed-users="*"/>
                <properties path="application-users.properties" relative-to="jboss.server.config.dir"/>
            </authentication>
            <authorization>
                <properties path="application-roles.properties" relative-to="jboss.server.config.dir"/>
            </authorization>
        </security-realm>
    </security-realms>

I connect to the CLI tool like so with the error …
bin]$ ./jboss-cli.sh --controller=192.169.1.118:9999
You are disconnected at the moment. Type 'connect' to connect to the server or 'help' for the list of supported commands.
[disconnected /] connect
java.lang.OutOfMemoryError: Java heap space
    at java.util.Arrays.copyOf(Arrays.java:2882)
    at java.lang.AbstractStringBuilder.expandCapacity(AbstractStringBuilder.java:100)
    at java.lang.AbstractStringBuilder.append(AbstractStringBuilder.java:390)
    at java.lang.StringBuilder.append(StringBuilder.java:119)
    at org.jboss.as.cli.impl.CommandContextImpl.handleSafe(CommandContextImpl.java:551)
    at org.jboss.as.cli.impl.CommandContextImpl.interact(CommandContextImpl.java:1113)
    at org.jboss.as.cli.impl.CliLauncher.main(CliLauncher.java:243)
    at org.jboss.as.cli.CommandLineMain.main(CommandLineMain.java:34)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.jboss.modules.Module.run(Module.java:270)
    at org.jboss.modules.Main.main(Main.java:294)

Anyone have any suggestions?  How do I connect to JBoss through the CLI tool?
Edit: My memroy settings within standalone.conf are set through JAVA_OPTS like so
JAVA_OPTS="-Xms256m -Xmx10240m -XX:-UseGCOverheadLimit -XX:MaxPermSize=512m -Djava.net.preferIPv4Stack=true -Dorg.jboss.resolver.warning=true -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000"

Edit 2 K, added the memory settings to the last line of the jboss-cli.sh file.  Got past "connect" but then got the OutOfMemoryError shortly after …
bin]$ ./jboss-cli.sh
You are disconnected at the moment. Type 'connect' to connect to the server or 'help' for the list of supported commands.
[disconnected /] connect
Authenticating against security realm: ManagementRealm
Username: admin
Password:
java.lang.OutOfMemoryError: Java heap space
    at java.util.Arrays.copyOf(Arrays.java:2882)
    at java.lang.AbstractStringBuilder.expandCapacity(AbstractStringBuilder.java:100)
    at java.lang.AbstractStringBuilder.append(AbstractStringBuilder.java:390)
    at java.lang.StringBuilder.append(StringBuilder.java:119)
    at org.jboss.as.cli.impl.CommandContextImpl.handleSafe(CommandContextImpl.java:551)
    at org.jboss.as.cli.impl.CommandContextImpl.interact(CommandContextImpl.java:1113)
    at org.jboss.as.cli.impl.CliLauncher.main(CliLauncher.java:243)
    at org.jboss.as.cli.CommandLineMain.main(CommandLineMain.java:34)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.jboss.modules.Module.run(Module.java:270)
    at org.jboss.modules.Main.main(Main.java:294)


text:
Q: Does having no trial period on your Google playstore subscription still automatically subscribe the user to the subscription? I am using:

*

*Flutter

*Revenue Cat

I have tried to find out if you have no trial period for a subscription whether the user is still automatically subscribed. I have setup a manual trial expiring mechanism and I don't want users to be automatically subscribed.
Is this possible? Also, if I do add a trial period to the subscription will the user be notified before they are automatically subscribed? For example:

A: If you are using a free trial for your subscription, then after the free trial ends, the user is automatically charged the subscription price (or introductory price if you have set one).
If you do not have a free trial, then the user is charged straight away for the subscription.
If you create a manual mechanism, then the users will not be automatically subscribed as they will have to complete the subscription purchase flow.


text:
Q: MongoKitten : Find using contains I have started using MongoKitten (Swift) which is really nice, however, I can't find anywhere how to do a Mongo find looking for a partial string.
In Mongo, it would be:

db.users.findOne({"username" : {$regex : ".son."}});

Seems such a normal thing to do.

A: So after talking to the MongoKitten people on Slack I thought I would come back and answer the question.  Code for Swift 4
func findDocsWith( str: String) -> CollectionSlice<Document>? {

    do {
        let server = try Server(Settings.server)
        let database = server["YourDB"]
        let pages = database["YourCollection"]

        let query: Query = [
            "url": RegularExpression(pattern: ".\(str).")
        ]

        let matchingEntities: CollectionSlice<Document> = try pages.find(query)
        print (try matchingEntities.count())

        return matchingEntities

    } catch {
        print("error: unable to start rest service.\n")

        return nil
    }

}


text:
Q: How to erase a QGraphicsItem from QGraphicsView using QPushButton I am building a major user interface but I am stuck on a problem and in order to shrink the problem I build a small working example that carries exactly the problem.
After the user creates a new .db file using the icon and saving for example to Desktop it is possible to load images(only in .png format for now) in the QGraphicsView and cliking on the checkbox to enable from Right: Drag to Right:Select it is possible to draw boxes on the image. With a right click inside the drawn box we can open a QDialog that asks to name the extracted image from the box. The image is stored in the QTableView as shown in the small working example below:

The problem:
I tried several ways to erase the box (and the related index on the QTableView of the related box) but none of them was successful.
With the use of the "Erase Square" QPushButton I am trying to erase the box. Every box can be re-activated by just left double-clicking within the interested box. See below what I am trying to achieve:

I draw the box on the QGraphicsView and right mouse click to capture the image from the box:
void MainWindow::mousePressEvent(QGraphicsSceneMouseEvent *event)
{
    if(event->button() == Qt::RightButton)
      {
        this->setContextMenuPolicy(Qt::CustomContextMenu);
        connect(this, SIGNAL(customContextMenuRequested(const QPoint &)),
                this, SLOT(ShowContextMenu(const QPoint &)));
      }
}

void MainWindow::contextMenuEvent(QContextMenuEvent *event)
{
    Q_UNUSED(event);
    leftScene->clearSelection();     // Selections would also render to the file
    leftScene->setSceneRect(leftScene->itemsBoundingRect());    // Re-shrink the scene to it's bounding contents
    QImage image(leftScene->sceneRect().size().toSize(), QImage::Format_ARGB32);  // Create the image with the exact size of the shrunk scene
    image.fill(Qt::transparent);     // Start all pixels transparent

    QPainter painter(&image);
    leftScene->render(&painter);
    QImage subimage = image.copy(QRect(start.toPoint(), end.toPoint()));

    clipSceneDialog d(this);
    d.show();
    d.setImage(subimage);
    d.setHeaderImage(currentLeftImagePath);
    d.setBoundingBox(QRect(start.toPoint(), end.toPoint()));

    if(d.exec() == QDialog::Rejected) {
        return;
    } else {
        //
    }
    Param result = d.getData();
    Parameters* param = new Parameters(result);
    mDatabaseLeftCamera->addItem(param);
    mModelLeftCamera->select();
    ui->tableView->show();
}

Draw as many boxes as the user wants:
void MainWindow::onRubberBandUpdate(const QRect &viewportRect,
                                    const QPointF &fromScenePoint,
                                    const QPointF &toScenePoint)
{
    if(viewportRect.isNull() && fromScenePoint.isNull() && toScenePoint.isNull() && imageLoaded)
    {
        if(currentSelection >= 0)
                selections[currentSelection]->setActiveState(false);
            QRectF select;
            select.setCoords(start.x(), start.y(), end.x(), end.y());
            square = new Square(select);
            square->setActiveState(true);
            currentSelection = selections.size();
            selections.append(square);
            leftScene->addItem(square->getGraphics());
            ui->graphicsView->show();
    }
    else
    {
        start = fromScenePoint;
        end = toScenePoint;
    }
}

After drawing several boxes the user decides to reactivate one of the boxes by double-cliking within the box:
void MainWindow::onSceneDoubleClick(QPointF point)
{
    qDebug() << "Click!";
        QList<QGraphicsItem*> foundItems = leftScene->items(point);
        if(foundItems.size() > 0 && foundItems[0]->group() != nullptr)
        {
            qDebug() << "Found";
            int i = 0;
            for(i=0;i<selections.size();i++)
            {
                qDebug() << "Iterate";
                if(selections[i]->getGraphics() == foundItems[0]->group())
                {
                    qDebug() << "Target";
                    break;
                }
            }
            if(currentSelection >= 0)
                selections[currentSelection]->setActiveState(false);
            currentSelection = i;
            selections[currentSelection]->setActiveState(true);
        }
}

The user decides to erase the re-activated square:
void MainWindow::on_eraseSquare_clicked()
{
    clearSceneLeft();
}

void MainWindow::clearSceneLeft()
{
    if (selections.size() > 0) {
        qDeleteAll(selections);
        selections.clear();
        currentSelection = -1;
    }
    for(int p=0;p<shape.size();p++)
    {
        leftScene->removeItem(shape[p]);
        delete shape[p];
    }
        shape.clear();
}

But this is not working and nothing happens. Additionally because the box corresponds to an SQL reference on the QTableView I dont know how that could be connected in the SQL class.
I have been trying for many days to solve this problem and am running out of ideas. Thanks for shedding light on this problem or point in the right direction.
If you would like to try the small example interface you can do it from here


text:
Q: Second order derivative of an implicit function - Calculus problem I am trying to find the second order derivative of following implicit function.
$$y^3-2xy+4=0$$
I can find the first order no problem. For $y(x)$ this gives:
$$(3y^2-2x)y'=2y \Rightarrow  y'=\frac{2y}{3y^2-2x}$$
Halfway through the second order derivative however, I seem to get lost and end up with something different compared to the solution.
I get:
$$(3y^2-2x)y''=2y'-(6yy'-2)y'$$
Which provides a completely different answer compared to the solution that my book gives at this point, which is the following:
$$(3y^2-2x)y''=(4-6yy')y'$$
The change in signs i can understand, but they seem to be multiplying the $2$ from the $2y'$ in the right part of the function with the $2$ inside the parenthesis of $(2-6yy')$. Which does not make much sense to me as there is no multiplication going on between these two terms, and even if there was then I would think it would result in $(4-12yy')$ instead, no?
Any pointers are appreciated.

A: You always have that
$$
2a-(6b-2)a=4a-6ab=(4-6b)a.
$$

A: \begin{align}
(3y²-2x)y'' & =2y'-(6yy'-2)y'\\
(3y²-2x)y'' & =2y'-6yy' y'+2y'\\
(3y²-2x)y'' & =4y'-6yy' y'\\
(3y²-2x)y'' & =(4-6yy') y'\\
\end{align}
Clear?


text:
Q: Limiting camera azimuth angle using OrbitControls
So, im building an architectural visualization with Three.js, and one of the things the user should be able to do is to click on things and orbit around them. The problem is that the camera is able to clip through wall. I fixed that by assigning each clickable object its own limiting azimuth and polar angles. Now the Problem is that azimuth angles go from -PI to +PI and its impossible to limit between for example 1.5, and -2.4 because its limiting the "wrong" way. I hope this graphic explains that a little better:

Heres a link to the live version:
(You control by clicking on the ground)
https://jim-fx.com/modern/
As you can see, on objects on the right side of the room the limiting works flawless, but on the cabinet and the vases the camera clips through the wall.
If anyone could help me that would be amazing. And any other tipps are welcome aswell.
Greetings, Max

A: There is several solution to your problem. One is to implements a kind of collision detection with some real or virtual wall for your camera, wich stops the rotation. However, I guess your are looking for something simpler to implement.
As i don't know Three.js very well, I will provides you a generic solution, but which should be easily adaptable to Three.js.
The first thing is to do not use the built-in Three.js orbit control, but to implement your own, where you control all your transformations. And, this is in fact very easy.
To create an orbitable camera, you simply have to crate:

*

*A "null" transformable object, which mean a simple transformable entity that does not embed any shape (is not rendered, is invisible, but exists). I hope Three.js provides such elementary thing.

*A camera, which should be itself another transformable.
Once you have this, you simply parent the camera to the "null" object. Now parented to the "null" object, if you rotate the "null" object, you rotate the camera with. Then to orbits, you now have to move back the camera from the parent object:
     Null                Camera

       + - - - - - - - - - |>

Like this, the "null" object becomes the camera "look at point", and if you rotate the "null" object around Y (I believe Three.js use Y up), you controls the camera azimuth. If you rotate the "null" object in X or Z (depending coordinate system), you will control the camera altitude. Then, you even can control the camera forward-backward to close up to the "look at point" by moving your camera in its local Z axis..
Well, you now have an orbit-camera easy to control. But your problem is not yet solved: How to make this control Pi / -Pi possible in every camera initial orientation ?
Simple: You create second "null" transform object, name it "the socle", and you parent the first one to this last one: Like this, the rotation of the camera "look at point" is always local, and you can now rotate "the socle" to give your "Orbital camera" group, an initial orientation in the world space.
In fact, it is pretty like creating virtual gimbals. I hope I was clear, with pictures this would be more easy to visualize...


text:
Q: Does ADO.NET Entity Framework have a construct similar to LINQ to SQL's GetTable? Does ADO.NET Entity Framework have a construct similar to LINQ to SQL's GetTable?
I'm trying to do something similar in Entity Framework, that I'm very used to doing in LINQ to SQL. Does ADO.NET Entity Framework have the same capability?
LINQ to SQL:
dataContext.GetTable<T>();

It would yield a Queryable collection of type 'T'.
In Entity Framework I would like to do the same:
    //NOTICE: This is a partial extension of the auto-generated Entities-model
    //        created by the designer.
    public partial class Entities : IEntities
    {
      public IQueryable<T> FindAll<T>()
      {
        //pseudo-code
        // return from all entities, the entities that are of type T as Queryable
      }
    }

Since I wasn't able to figure this out, I made, what I consider, a "smelly" work-around:
    //NOTICE: This is a partial extension of the auto-generated Entities-model
    //        created by the designer.
    public partial class Entities : IEntities
    {
      public IQueryable<Users> FindAllUsersQueryable
      {
        get { return Users; }
      }

      public IQueryable<Registrations> FindAllRegistrationsQueryable
      {
        get { return Registrations; }
      }

      //... and so on ...
    }

What I want is something similar to:
    //NOTICE: This is a partial extension of the auto-generated Entities-model
    //        created by the designer.
    public partial class Entities : IEntities
    {
      public IQueryable<T> FindAll<T>()
      {
        return GetEntities<T>();
      }
    }

But so far I haven't been able to find out how to do that.
What is the solution?

A: Marking as wiki as I can't claim any credit, but an MSFT answer to this question is here: What is the equivilant of GetTable in L2E.

A:     public IQueryable<T> FindAll<T>()
    {
        var baseType = typeof(T);
        return CreateQuery<T>("[" + baseType.Name.ToString() + "]").OfType<T>();
    }

Also seems to do the job for me :-)


text:
Q: Define $g(x)=\log_b(x)$ for $b>0$ in terms of the exponential function $f(x)=b^x$. I know that these two functions are inverses of each other, therefore how can you define one in terms of its inverse?

A: Let $f(x): (0,\infty) \to \mathbb{R}:x \mapsto \log_b{x}$. Then, $f^{-1}(x):\mathbb{R}\to(0,\infty):x \mapsto b^x$, with the relationship that $$f \circ f^{-1} = f(f^{-1}(x)) = x = f^{-1}(f(x)) = f^{-1} \circ f .$$


text:
Q: Address for "Home" is incorrect in Maps and I can't seem to find a way to updated it? When I originally got my iPhone 5s I asked Siri to set my home address. At that time, it recognized a wrong address and I can't seem to find a way to correct it.  It is listed with a little house icon as my home address within my recent listing of addresses but not sure how to correct it.  My iPhone (which I recently updated to an iPhone 6) does recognize "me" as my correct contact information within contacts.  My contact information does have my correct home address and when I ask Siri what my home address it is does list my contact information but when I say "take me home" it goes to the historic wrong address.
I've read prior posts and one suggested it might be pulling from my AppleID but that isn't the case.  It's listed right there.
I can't seem to find where this information is editable?  The only place where I can find where it seems to be stored is within the iPhone/Apple "Maps" application.
I've cleared the history in the application and it clears everything but the home so can't seem to find a way to get rid of it or change it (swipe to left or right doesn't seem to work easily).
As stated, I now have an iPhone 6.  It's running iOS8 but has the same problem on my 5s when it was running iOS7.
Please help, I find this frustrating and haven't seem to find any posts that help.

A: Don't know if you've figured this out yet, but I finally did today. I've had the same problem for years and multiple phones. Today I opened my contact info and as always, my home address was correct. I clicked on edit and down at the bottom, under my home address was an "other" address, the one maps always tried to take me to. I was able to delete that address and it fixed my problem!
Also - be sure to check if you have many sources to contacts. Facebook, work or exchange contact lists, google contact lists, etc.. can all link and pull an address that's somehow indicated as "home".
The steps to clear up contacts when contacts only exist locally or only in one cloud database is:

*

*How do I tell iOS 7 which address is my "home" address?

A: I had to unlink my Facebook 'me' contact from my regular 'me' contact, then re-link them. That solved my map problem.

A: Your home location on Apple Maps is linked and shown as the "Home" address on the Contact you have set as "yourself".
You can change what Contact is "yourself" by tapping Settings > Mail, Contacts, Calendars > My Info and choosing a Contact in your list.

A: You should only need to update your own contact information for yourself in your contact list. Note: you will see "me" shaded gray to the right, next to your own contact name. Make sure your current address is updated and delete the old address.

A: I had this issue too. Checking my addresses (and as others, I have a number of linked accounts), I noticed one that had the right streetname and number, but no city information. From the small map excerpt shown next to it, I could see it was matched to a street in a completely different city. The moral is that if the problem is not obvious, make sure you very carefull at each entry under your own entry in the address book.

A: Go to your contacts and where your details are listed at the top, edit and then update your address.


text:
Q: For which integers $n \ge 3$ is the dihedral group $D_{2n}$ a sub group of $Alt_n$
For which integers $n \ge 3$ is the dihedral group $D_{2n}$ a subgroup of $Alt_n$

Disclaimer, we are supposed to get the answer without Lagrange's Theorem.
I have just started working with the Alternating group $Alt_n$, or also denoted $\mathbb{A}_n$.
$$Alt_n := \{ f\in S_n \mid \operatorname{sg}(f)=1 \}$$
$\operatorname{sg}(f)=1$ when f is a product even pair of 2-cycles in the symmetric group $S_n$, which equivalently means that f is product of 3-cycles.
So this is all very new to me, and I am at a loss of how to consider how the dihedral group could be a subgroup of $Alt_n$. Define:
$$D_{2n} = \langle r,s\mid r^n = s^2 = 1, sr^i=r^{-i}s\rangle$$
In this part of the class we are talking about sub groups generated by sub sets of the group; order of subgroups; the subgroup criterion, which says for a subset to be a subgroup then it need to be closed under product and inverses. So I assume the first step is to show that $D_{2n}$ is a sub set of $S_n$. But I'm just not making the connection.
It seems like elements of $S_n$ will always have an odd order, so perhaps $n$ needs to be odd.
So like I said, I am a little at a loss of even the criteria that we would need to show that $D_{2n}$ is a sub group of $Alt_n$. Thanks for the help!

A: Idea: We can embed $D_{2n}$ to $S_{n-2}$ for certain $n$, and $S_{n-2}$ can always be embedded into $A_n$ for all $n\ge 2$, see the following posts:
The smallest symmetric group $S_m$ into which a given dihedral group $D_{2n}$ embeds
Embedding $S_n$ into $A_{n+2}$
Hence we can embed $D_{2n}$ into $A_n$ for these $n$.
We need $n\ge 5$, because for $n=4$, $D_8$ is not isomorphic to a subgroup of $A_4$, because $8\nmid 12$ contradicts Lagrange. If you cannot use Lagrange (as you say), you could use a classification of subgroups of $A_4$ here:
Find the subgroups of A4

A: This additional answer is just to clarify the confusion about what was being asked. Apparently the intended question was, for which $n$ is the subgroup $$\langle (1,2,3,\ldots,n),(2,n)(3,n-1) \cdots \rangle\cong D_{2n}$$ of $S_n$ contained in $A_n$?
For that we need $n$ to be odd, since otherwise the $n$-cycle is an odd permutation. We also need $n \equiv 1 \bmod 4$, since otherwise the reflection $(2,n)(3,n-1) \cdots$ has an odd number of transpositions. But if $n \equiv 1 \bmod 4$ then both of the group generators are even permutations, and so the subgroup lies in $A_n$.


text:
Q: A deterministic function to generate a random number Using Mathematica, I need to define a function of one integer variable that generates the same real number in the range 0 to 1, if it is called with the same argument, but gives a different real number if its argument is changed.  For example :
Func[1] = 0.12675,
Func[2] = 0.11213,
Func[2] = 0.11213,
Func[1] = 0.12675,
Func[3] = 0.02561,

and so on.
How can I define such a function?
Edit
A more precise statement of the pseudo-random nature of the function Func.
The function should generate new numbers for each Mathematica session. So after thousands of sessions, the values Func[1] are uniformly distributed on the intervall 0 to 1. For a given session, Func[1] generates the same number again and again. But in the next session, Func[1] would be a different number.  Otherwise, the generated numbers couldn't be considered as "random" if they are always the same.

A: You can simply create a big list of numbers, list = RandomReal[1, 1000000], and take those numbers one by one.
The elements of this list will be uniformly distributed and uncorrelated.  I was assuming that this is what you meant by "random", which is the most important part of the question here.  Perhaps you could clarify this.

A: I believe ...
f[x_] := (SeedRandom[x]; RandomReal[])

A: This one will be the same in a single session. However, it will be different each time the kernel is (re)started, or if func is cleared and the definition re-executed.
func[x_] := func[x] = RandomReal[];

If you wish func to give the same values every time you run Mathematica, then you could use SeedRandom[1], or whatever seed appeals to you, in a session before func is used.  The values will be the same provided func[x] is always evaluated in the same order for each x.  (If the order cannot be guaranteed, then another answer will be better.)
Here is a related answer on the use of the above trick in similar circumstances, called memoization.


text:
Q: How do I place a button inside of an image? Is it possible to place a UIButton inside of a UIImage with the Apple Watch? It seems that I can only place objects beside each other rather then on top of them as I can with iOS

A: Short answer, you can't really place items on top of each other with WatchKit, but you can use the background image of a group to do it:

Can I position interface elements on top of each other?
No, interface elements can't be positioned on top of each other natively. However, there are workarounds. For example, you can use a WKInterfaceGroup and set its background image to something that represents the control you want to overlay. Inside the group you can then add the necessary labels, buttons and so on.

This comes from Ray Wenderlich's WatchKit FAQ, which is a pretty reliable source. I'll link to fully official sources if I find it.
The solution is, as stated above, to use a WKInterfaceGroup and set its background image to something that represents the control you want to overlay. Inside the group you can then add the necessary labels, buttons and so on.
Note that this question also is about laying elements on top of images.

A: As far as I know you can not do that.
But what you can do is to create a button and set it's backgroundImage.
Hope that helps :)


text:
Q: Navigate from one sso saml protected SP org to another saml protected SP org without logging into the 2nd SP? I have 2 service providers, SP1 and SP2 both connected to an IDP through SSO and I have obtained my SAML response from IDP into SP1.
Now, I want the user from SP1 to go to SP2 upon clicking a link/button without login credentials. The SP2
org should validate this user's authentication against the IDP.
Any thoughts on this would be really helpful.


text:
Q: MvvmCross Bind to UIButton.TitleLabel.Text I am attempting to bind to the text property of TitleLabel on a UIButton using MvvmCross for Xamarin.iOS. Here's what I have so far...
set.Bind(btnFoo).For(btn => btn.TitleLabel.Text).To(vm => vm.BtnFooText);

I've also tried...
set.Bind(btnFoo.TitleLabel).For(lbl => lbl.Text).To(vm => vm.BtnFooText);

Neither of which seem to work. I appreciate the help!

A: For debugging issues, enabling trace may help - see MvvmCross Mvx.Trace usage
For binding a property on a fixed pre-existing subcontrol of a subcontrol then this approach should work:
set.Bind(sub.subSub).For(c => c.PropertyName).To(vm => vm.Foo);

However, that won't continue to work if the sub control then changes its sub control at any point. For those cases, look at custom bindings - eg see http://slodge.blogspot.co.uk/2013/06/n28-custom-bindings-n1-days-of-mvvmcross.html
For the specific case of a uibutton, you can just bind its "Title" - see Fluent Bindings and UIButton titles

A: For me UIButton binding to TitleLabel doesn't work. I came up with custom binding which works great and way flexible:
Apply binding:
  set.Bind(FinishedButton).For(UIButtonTextBinding.Property).To(v => v.FinishActionText);

Binding code:
public class UIButtonTextBinding : MvxTargetBinding
{
    public const string Property = "ButtonText";

    protected UIButton View
    {
        get { return Target as UIButton; }
    }

    public UIButtonTextBinding(UIButton target)
        : base(target)
    {
    }

    public override void SetValue(object value)
    {
        var view = View;
        if (view == null)
            return;

        var stringValue = value as string;
        view.SetTitle(stringValue, UIControlState.Normal);
    }

    public override Type TargetType
    {
        get { return typeof(string); }
    }

    public override MvxBindingMode DefaultMode
    {
        get { return MvxBindingMode.OneWay; }
    }
}

A: The easiest way to bind a UIButton Title:
set.Bind(btnFoo).For("Title").To(vm => vm.BtnFooText);

A: You can use:
set.Bind(btnFoo).For(btn => btn.BindTitle()).To(vm => vm.BtnFooText);

adding the following using:
using MvvmCross.Binding.iOS;


text:
Q: Check many conditions in a loop of an array of objects efficiently I have an array of objects and one property is their statuses, I need to calculate the status following this:
if all the statuses are failed return "failed", if all are canceled return "canceled", and so on, but if the array has one failed, or one canceled return "partially completed", I did, but I am looping a lot and I feel that exist a better and efficient way to do the same, this is my code:
function getComputedStatus(list) {

      if (list.every(status => status.statusName == 'Failed'))
          return 'Failed';

      if (list.every(status => status.statusName == 'Canceled'))
          return 'Canceled';

      if (list.every(status => status.statusName == 'DidNotRun'))
          return 'DidNotRun';

      if (list.some(status => status.statusName == 'InProgress' ||
          status.statusName == 'Pending'))
          return 'InProgress';

      if (list.some(status => status.statusName === 'Failed'   ||
                              status.statusName === 'Canceled' ||
                              status.statusName === 'DidNotRun'))
         return 'PartiallyCompleted';

      return 'Completed';
}

A: So, it appears that your logic is actually this:

*

*You have an array of status objects.

*If any status is 'InProgress' or 'Pending', then return 'InProgress'

*If all statuses are the same and are 'Failed', 'Canceled' or 'DidNotRun', then return that value.

*If any status are 'Failed', 'Canceled' or 'DidNotRun', then return 'PartiallyCompleted'

*Otherwise, return 'Completed'

So, there would be a huge efficiency of execution gain if you can figure out how to do all these checks with one pass through the array instead of your 5 partial passes through the array.
Here's one way to do that:
const doneStatuses = new Set(["Failed", "Canceled", "DidNotRun", "Completed", "InProgress"]);

function getComputedStatus(list) {
    const allStatuses = new Set();

    // collect all status values in a Set object
    for (let status of list) {
        allStatuses.add(status.statusName);
    }

    // if all the statusName values were the same and they were
    // "Failed", "Canceled", "DidNotRun", "InProgess" or "Completed"
    // then return that specific status
    if (allStatuses.size === 1) {
        let theStatus = Array.from(allStatuses)[0];
        if (doneStatuses.has(theStatus)) {
            return theStatus;
        }
    }
    // if any status was "InProgress" or "Pending", return "InProgress"
    if (allStatuses.has("InProgress") || allStatuses.has("Pending")) {
        return "InProgress";
    }

    // If any status was "Failed", "Canceled" or "DidNotRun" (but not all)
    // then return "PartiallyCompleted"
    if (allStatuses.has("Failed") || allStatuses.has("Canceled") || allStatuses.has("DidNotRun")) {
        return "PartiallyCompleted";
    }

    // otherwise, return "Completed"
    return "Completed";
}


text:
Q: pouchdb, the view creation seems making normal data unavailable I don't understand the possibity to create a view like Couchdb.
When i create a db in couchdb without views, i can replicate in pouchdb.
I can use the datas to print in table with D3.js, but when i create a view
in couchdb or pouchdb, the datas seems to exist but the requests with the same code seems to get trouble.
(function(p_url, p_debug) {
'use strict';
var debug = p_debug;
var url = p_url;
var ENTER_KEY = 13;
var synStart = document.getElementById('synchronize');
var printArray = document.getElementById('printArray');
var printGraph = document.getElementById('printGraph');
var destroydb = document.getElementById('delete');
var dbOptions = {
   auto_compaction : false,
   cache : false
};
var db = new PouchDB('dblocal',dbOptions);
var remoteCouch = url;

/* getRemoteDB sans filter */
function getRemoteDB(remote) {
    db.replicate.from(remoteCouch).on('complete', function() {
        console.log('complete');
    }.on('error', function() {
        console.log('error replicate');
    }));
}

/* getRemoteDB by filter */
function getlocalDB(filter) {

}

function reset() {
    db.destroy().then(function(response) {
        console.log('destroy success');
    }).catch(function(err) {
        console.log(err);
    });
}
// The table generation function
function tabulate(id, data, columns) {
    var table = d3.select(id).append("table")
            .attr("style", "margin-left: 20px; border: solid 1px black;"),
            thead = table.append("thead"),
            tbody = table.append("tbody");
    // append the header row
    thead.append("tr")
            .selectAll("th")
            .data(columns)
            .enter()
            .append("th")
            .text(function(column) {
                return column;
            });
    // create a row for each object in the data
    var rows = tbody.selectAll("tr")
            .data(data.etablissement)
            .enter()
            .append("tr");
    // create a cell in each row for each column
    var cells = rows.selectAll("td")
            .data(function(row) {
                return columns.map(function(column) {
                    return {column: column, value: row[column]};
                });
            })
            .enter()
            .append("td")
            .attr("style", "font-family: Courier; color : white;") // sets the font style
            .html(function(d) {
                return d.value;
            });
    return table;
}

function showDatas() {
    var tab = document.getElementById('db_array');
    tab.innerHTML = '';
    db.allDocs({include_docs: true, descending: true}).then(function(doc) {
        var jsonvalues = {etablissement: []};
        doc.rows.forEach(function(row) {
            jsonvalues.etablissement.push({'numerouai': row.doc.etablissement.numerouai, 'reponses': row.doc.reponses[0].idreponse});
        });
        var dataset = jsonvalues;
        tabulate('#db_array', dataset, ['numerouai', 'reponses']);
        d3.select("db_graph").selectAll("div.h-bar") // <-B
                .data(dataset.etablissement)
                .enter()
                .append("div")
                .attr("class", "h-bar")
                .append("span");
    }).catch(function(err) {
        console.log(err);
    });
}

function createViews() {
    var ddoc = {
        _id: '_design/questions',
        views: {
            id_question: {
                map: function(doc) {
                    emit(doc.etablissement.numerouai,doc.academie.codeaca);
                }.toString()
            }
        }
    };
    db.put(ddoc).then(function() {
        console.log('vue poussée');
    }).catch(function(err) {
        console.log(err);
    });
}

function getQuestions(i) {
    console.log('getQuestions');
    db.query('questions/id_question').then(function(res) {
        console.log('res');
        console.log(res.key);
    }).catch(function(err) {
        console.log(err);
    });

}
/* main function */
function sync() {
    console.log('synchronisation ...');
    synStart.addEventListener("click", getRemoteDB.bind(this, url));
    printArray.addEventListener("click", showDatas.bind(this));
    destroydb.addEventListener("click", reset.bind(this));
    printGraph.addEventListener("click", getQuestions.bind(this));
    createViews();
}
sync();
})('http://192.168.2.128:5984/eticdegre1', true);

making them unavailable data, but there is no error in console javascript.
Is it possible to have data and views in the same times like couchdb.
I'm newbie in PouchDB
thanks

A: I'm not quite following your question, but I see a couple potential problems:
1) You are not re-creating the database after calling db.destroy(). When you destroy(), you need to call new PouchDB() again to use it again.
2) When you do allDocs(), you are using {include_docs: true}, but you are not doing the same thing when you query(). If you expect to get the docs back, you should do query('questions/id_question', {include_docs: true}).
Also in general, these kinds of questions may be better for the #pouchdb IRC channel or for the mailing list than StackOverflow. (See the "Discuss" links at the bottom of http://pouchdb.com/) Usually there is somebody there who can provide step-by-step guidance! :)

A: thanks for your answer. You found my script problems, now it works perfectly. the most important was  query('questions/id_question', {include_docs: true})
thanks


text:
Q: Sunk cost auction modeling. Consider the following auction concept. I call it a "SUNK COST AUCTION" Each person bids, but you pay all of the money that you bid for every bid you make. So, if you bid \$1 that \$1 is gone, even if you are out-bid by someone bidding \$2. The last person to bid (the highest bid) gets the item.

*

*There is an item that you value at \$100 up for auction.

*You are in the room with 100 people who also want the item and who value it too but you don't know how much they value it. You can safely assume, though, that the level they value it is normally distributed around some well-known value that is not too different from your own evaluation. (Maybe, that well-known value is \$120.)

*Bidding starts at \$10, the person who bids \$10 WILL (probably)  NOT WIN obviously so it's just lost money... but if no one bids except that one person ... well then they do win. So early bidding is low-risk, high reward.

*The time limit for bidding re-sets after each bid. So, you take \$10 at the last moment... but then there is another 1 min added where you can be outbid.
How would such an auction go down? No one wants to bid until the price is high enough that they have a shot at being "last" ... but, there's always the slim chance that no one will take the risk and you could win a \$100 for only \$10.
Also, as the price rises biding becomes very risky. It would be awful to bid \$100 only to have someone else take it for \$120.

A: Everyone is obviously very reluctant to bid when they don't think that bid will actually win. I don't think, therefore, that this auction would move like a standard auction: \$10, \$15, \$20, etc. In a regular auction, that \$15 bid is all upside if you value the item at more than \$15, since you either don't pay anything and don't get the item (status quo) or pay \$15 and get the item. In this case, moving in small increments is hugely costly, so I think the rational thing to do is to make a much higher bid right away.
You said to assume that everyone else's valuation of the item is normally distributed about \$120, but first I'm going to assume it's normally distributed around \$80, with a standard deviation of \$5 (you didn't give one, but this process should work for any SD). With 100 people, there's a $50\%$ chance that any given person will value the item over \$80, which means that the likelihood of no one outbidding me is $(1/2)^{100}$, i.e., really small. So there's a $1-(1/2)^{100}$ chance of me losing \$80 for nothing, and a $(1/2)^{100}$ chance of me paying \$80 for something I give \$100 of value. Obviously not a good bid to make.
We can write a function of my bid that compares utility to risk (and painfulness) of being outbid. For a bid of $\$X$, the risk of an $\$X$ loss is $1 - (P(z<(X-80)/5))^{100}$, and the likelihood of an $\$100 - \$X$ gain is $P(z<(X-80)/5)^{100}$. The expected utility from an \$X bid, therefore, is $$[P(z<(X-80)/5)^{100}] * (100 - X) - [1 - (P(z<(X-80)/5))^{100}] * X$$
After the bidding opens, you should immediately bid the lowest $X$ where this function $=0$. It doesn't look too good -- this is negative most places I've checked, so I think with a 100 person group that has a value that close to yours, you're better off not bidding, since the risk of someone outbidding you is just too high. (I chose \$80 instead of \$120 for the mean of their normal distribution since clearly \$120 would be even more unlikely).


text:
Q: Breeze C# client fails when using WHERE clause on iOS Device I am using the C# client for Breeze 0.6 in a Xamarin.Forms 2.0 app on iOS 9.3. When I do a query with an WHERE clause, the app will work in the iPhone simulator, but fails on the actual device. The failure on the device is an exception with the message:

The type initializer for 'System.Data.Services.Client.TypeSystem'
  threw an exception.

If I remove the where clause, the app no longer throws an exception, but I need to be able to use WHERE clauses to properly limit the amount of data being sent back from the server.
What is it that causes this error?

A: Woohoo! That helped. Thank you @hankide. There are three options for "Linker Behavior". They are "Don't Link", "Link Framework SDKs Only", and "Link All". The default was "Link Framework SDKs Only". I changed it to "Don't Link" and now it runs on my iPhone.
Edited:
Just an FYI for people seeing this. When you turn off the linker, you need to do it twice. Once for the Debug build configuration and another time for the Release build configuration. I was frustrated for a while because I couldn't get the release build to work. After setting up Xamarin Insights, I saw the same linker error I had seen before and figured out that there was a similar but separate linker config for the release build.


text:
Q: Actualizar Sin Recargar Pagina Estoy usando DataTable el cual le he puesto unos botones que no son propios de DataTable sino botones de BootStrap. La pregunta es:
¿Cómo recargar/actualizar esa tabla o eliminar esa fila de la tabla cuando yo oprima el botón de eliminar sin tener que utilizar un windows.location.href....?
Codigo Ajax
    .done(function(respuesta)
    {
        var resultado = $.parseJSON(respuesta);
        if(resultado)
        {
            swal({
                  title: "Buen Trabajo",
                  text: "Se Elimino",
                  type: "success",
                  confirmButtonText: "ok"
                },

            function(isConfirm)
            {
              if (isConfirm)
              {
                tabla_mostrar.row( ('tr') ).remove();//Esta linea de codigo no sirve; es aqui donde debo de hacer el cambio que necesito

              }
            });
        }
        else
        {
            swal("error!!","No Se elimino","error");
        }
       return resultado;
    })

Gracias.

A: Lo que deseas se encuentra en un ejemplo de dataTables
Ejemplo funcionando

$(document).ready(function() {
    var table = $('#example').DataTable();

    $('#example tbody').on( 'click', 'tr', function () {
        if ( $(this).hasClass('selected') ) {
            $(this).removeClass('selected');
        }
        else {
            table.$('tr.selected').removeClass('selected');
            $(this).addClass('selected');
        }
    } );

    $('#button').click( function () {
        table.row('.selected').remove().draw( false );
    } );
} );

<link href="https://cdn.datatables.net/1.10.13/css/jquery.dataTables.min.css" rel="stylesheet"/>

<button id="button">Eliminar Seleccion</button>

                Name
                Position
                Office
                Age
                Start date
                Salary

                Name
                Position
                Office
                Age
                Start date
                Salary

                Tiger Nixon
                System Architect
                Edinburgh
                61
                2011/04/25
                $320,800

                Garrett Winters
                Accountant
                Tokyo
                63
                2011/07/25
                $170,750

                Ashton Cox
                Junior Technical Author
                San Francisco
                66
                2009/01/12
                $86,000

                Cedric Kelly
                Senior Javascript Developer
                Edinburgh
                22
                2012/03/29
                $433,060

                Airi Satou
                Accountant
                Tokyo
                33
                2008/11/28
                $162,700

                Brielle Williamson
                Integration Specialist
                New York
                61
                2012/12/02
                $372,000

                Herrod Chandler
                Sales Assistant
                San Francisco
                59
                2012/08/06
                $137,500

                Rhona Davidson
                Integration Specialist
                Tokyo
                55
                2010/10/14
                $327,900

                Colleen Hurst
                Javascript Developer
                San Francisco
                39
                2009/09/15
                $205,500

                Sonya Frost
                Software Engineer
                Edinburgh
                23
                2008/12/13
                $103,600

                Jena Gaines
                Office Manager
                London
                30
                2008/12/19
                $90,560

                Quinn Flynn
                Support Lead
                Edinburgh
                22
                2013/03/03
                $342,000

                Charde Marshall
                Regional Director
                San Francisco
                36
                2008/10/16
                $470,600

                Haley Kennedy
                Senior Marketing Designer
                London
                43
                2012/12/18
                $313,500

                Tatyana Fitzpatrick
                Regional Director
                London
                19
                2010/03/17
                $385,750

                Michael Silva
                Marketing Designer
                London
                66
                2012/11/27
                $198,500

                Paul Byrd
                Chief Financial Officer (CFO)
                New York
                64
                2010/06/09
                $725,000

                Gloria Little
                Systems Administrator
                New York
                59
                2009/04/10
                $237,500

                Bradley Greer
                Software Engineer
                London
                41
                2012/10/13
                $132,000

                Dai Rios
                Personnel Lead
                Edinburgh
                35
                2012/09/26
                $217,500

                Jenette Caldwell
                Development Lead
                New York
                30
                2011/09/03
                $345,000

                Yuri Berry
                Chief Marketing Officer (CMO)
                New York
                40
                2009/06/25
                $675,000

                Caesar Vance
                Pre-Sales Support
                New York
                21
                2011/12/12
                $106,450

                Doris Wilder
                Sales Assistant
                Sidney
                23
                2010/09/20
                $85,600

                Angelica Ramos
                Chief Executive Officer (CEO)
                London
                47
                2009/10/09
                $1,200,000

                Gavin Joyce
                Developer
                Edinburgh
                42
                2010/12/22
                $92,575

                Jennifer Chang
                Regional Director
                Singapore
                28
                2010/11/14
                $357,650

                Brenden Wagner
                Software Engineer
                San Francisco
                28
                2011/06/07
                $206,850

                Fiona Green
                Chief Operating Officer (COO)
                San Francisco
                48
                2010/03/11
                $850,000

                Shou Itou
                Regional Marketing
                Tokyo
                20
                2011/08/14
                $163,000

                Michelle House
                Integration Specialist
                Sidney
                37
                2011/06/02
                $95,400

                Suki Burks
                Developer
                London
                53
                2009/10/22
                $114,500

                Prescott Bartlett
                Technical Author
                London
                27
                2011/05/07
                $145,000

                Gavin Cortez
                Team Leader
                San Francisco
                22
                2008/10/26
                $235,500

                Martena Mccray
                Post-Sales support
                Edinburgh
                46
                2011/03/09
                $324,050

                Unity Butler
                Marketing Designer
                San Francisco
                47
                2009/12/09
                $85,675

                Howard Hatfield
                Office Manager
                San Francisco
                51
                2008/12/16
                $164,500

                Hope Fuentes
                Secretary
                San Francisco
                41
                2010/02/12
                $109,850

                Vivian Harrell
                Financial Controller
                San Francisco
                62
                2009/02/14
                $452,500

                Timothy Mooney
                Office Manager
                London
                37
                2008/12/11
                $136,200

                Jackson Bradshaw
                Director
                New York
                65
                2008/09/26
                $645,750

                Olivia Liang
                Support Engineer
                Singapore
                64
                2011/02/03
                $234,500

                Bruno Nash
                Software Engineer
                London
                38
                2011/05/03
                $163,500

                Sakura Yamamoto
                Support Engineer
                Tokyo
                37
                2009/08/19
                $139,575

                Thor Walton
                Developer
                New York
                61
                2013/08/11
                $98,540

                Finn Camacho
                Support Engineer
                San Francisco
                47
                2009/07/07
                $87,500

                Serge Baldwin
                Data Coordinator
                Singapore
                64
                2012/04/09
                $138,575

                Zenaida Frank
                Software Engineer
                New York
                63
                2010/01/04
                $125,250

                Zorita Serrano
                Software Engineer
                San Francisco
                56
                2012/06/01
                $115,000

                Jennifer Acosta
                Junior Javascript Developer
                Edinburgh
                43
                2013/02/01
                $75,650

                Cara Stevens
                Sales Assistant
                New York
                46
                2011/12/06
                $145,600

                Hermione Butler
                Regional Director
                London
                47
                2011/03/21
                $356,250

                Lael Greer
                Systems Administrator
                London
                21
                2009/02/27
                $103,500

                Jonas Alexander
                Developer
                San Francisco
                30
                2010/07/14
                $86,500

                Shad Decker
                Regional Director
                Edinburgh
                51
                2008/11/13
                $183,000

                Michael Bruce
                Javascript Developer
                Singapore
                29
                2011/06/27
                $183,000

                Donna Snider
                Customer Support
                New York
                27
                2011/01/25
                $112,000

A: si tu boton esta dentro de la tabla
<input type='button'/>

lo que puedes hacer si estas dentro de tu contexto button on click, o puedes asignar el elemento a una variable
var button = this;
......

dentro de tu metodo done
button.parent().parent().remove()


text:
Q: docker containers: mariaDB connection issue with nextcloud I'm the super user at my maschine. There is docker inside my volumne (/volume1/docker). I pulled the latest version of the images and run MariaDB, PhpMyAdmin and NextCloud:
docker run -d --name mariadb --network nextcloud --network-alias db -e MYSQL_ROOT_PASSWORD=r00tp@ss -e MYSQL_USER=nextcloud_rw -e MYSQL_PASSWORD=N3xtCl0ud! -e MYSQL_DATABASE=nextcloud -v /volume1/docker/mariadb:/var/lib/mysql --restart=unless-stopped mariadb:latest

docker run -d --name phpmyadmin --network nextcloud --link mariadb:db -e PMA_ARBITRARY=1 -e PMA_HOST=db -e PMA_USER=nextcloud_rw -e PMA_PASSWORD=N3xtCl0ud! -p 8082:80 --restart=unless-stopped phpmyadmin:latest

docker run -d --name nextcloud --network nextcloud -e MYSQL_HOST=db -e MYSQL_DATABASE=nextcloud -e MYSQL_USER=nextcloud_rw -e MYSQL_PASSWORD=N3xtCl0ud! -v /volume1/docker/nextcloud:/var/www/html -v db:/var/lib/mysql --restart=unless-stopped -p 8080:80 nextcloud:latest

When I open the browser and navigate to http:\\whereNextCloudLives:8080, I see the NextClud background plus the installation form. I enter the user nextcloud and the pw N3xtCl0ud! and get the response "Please check your mysql credentials. Cannot connect to DB".
MariaDB-Log:
[Note] mariadbd: ready for connections.
[Note] [Entrypoint]: Securing system users (equivalent to running mysql_secure_installation)
[Note] [Entrypoint]: Giving user nextcloud_rw access to schema nextcloud
[Note] [Entrypoint]: Creating user nextcloud_rw
[Note] [Entrypoint]: Creating database nextcloud
[Note] [Entrypoint]: Temporary server started.
stderr  Version: '10.9.3-MariaDB-1:10.9.3+maria~ubu2204'  socket: '/run/mysqld/mysqld.sock'  port: 0  mariadb.org binary distribution
[Note] mariadbd: ready for connections.
[Warning] Access denied for user 'nextcloud_rw'@'172.18.0.4' (using password: YES)
[Warning] Access denied for user 'nextcloud_rw'@'172.18.0.4' (using password: YES)
[Warning] Access denied for user 'nextcloud_rw'@'172.18.0.4' (using password: YES)
stderr  Version: '10.9.3-MariaDB-1:10.9.3+maria~ubu2204'  socket: '/run/mysqld/mysqld.sock'  port: 3306  mariadb.org binary distribution

NextCloud-Log:
442381598Z  stdout  172.18.0.1 - - [02/Dec/2022:18:26:11 +0000] "POST /index.php HTTP/1.1" 200 3538 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36"
2022-12-02T18:26:11.300610626Z  stdout  127.0.0.1 - - [02/Dec/2022:18:26:11 +0000] "OPTIONS * HTTP/1.0" 200 126 "-" "Apache/2.4.54 (Debian) PHP/8.0.24 (internal dummy connection)"
2022-12-02T18:26:05.648774341Z  stdout  172.18.0.1 - - [02/Dec/2022:18:26:04 +0000] "GET /dist/core-common.js.map?v=dc4002698c876c22453e HTTP/1.1" 200 4483569 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36"
2022-12-02T18:26:04.864831573Z  stdout  172.18.0.1 - - [02/Dec/2022:18:26:04 +0000] "GET /dist/core-main.js.map?v=0a05117109bf8b6240ea HTTP/1.1" 200 106976 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36"
2022-12-02T18:26:04.845899731Z  stdout  172.18.0.1 - - [02/Dec/2022:18:26:04 +0000] "GET /core/vendor/zxcvbn/dist/zxcvbn.js.map HTTP/1.1" 404 680 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36"
2022-12-02T18:26:04.844799000Z  stdout  172.18.0.1 - - [02/Dec/2022:18:26:04 +0000] "GET /dist/core-install.js.map?v=ee580b4e58a4177adf85 HTTP/1.1" 200 9627 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36"
2022-12-02T18:26:04.331553336Z  stdout  172.18.0.1 - - [02/Dec/2022:18:26:04 +0000] "GET /core/img/manifest.json HTTP/1.1" 200 728 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36"
2022-12-02T18:25:47.268364543Z  stderr  [Fri Dec 02 18:25:47.267810 2022] [core:notice] [pid 1] AH00094: Command line: 'apache2 -D FOREGROUND'
2022-12-02T18:25:47.268255142Z  stderr  [Fri Dec 02 18:25:47.267778 2022] [mpm_prefork:notice] [pid 1] AH00163: Apache/2.4.54 (Debian) PHP/8.0.24 configured -- resuming normal operations
2022-12-02T18:25:47.252431732Z  stderr  AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.18.0.4. Set the 'ServerName' directive globally to suppress this message
2022-12-02T18:25:47.240345812Z  stderr  AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.18.0.4. Set the 'ServerName' directive globally to suppress this message

I just use the IP. There is no domain configured. I've access to the DB with PhpMyAdmin.
Anyone with an idea what is wrong?


text:
Q: iOS Parse table structure I am creating an application which requires the user to register. All data entered by user will be stored in this table called "customer". Now part of the information being collected is the address but I don't want to congest the table structure and would like to store address as an object (city, address, post code, etc).
What's the best practice: create an address table and refer the table through foreign key in the customer table or store the customer address as an object and store it in customer table?
I am not sure how parse fully functions so looking for your experience in the answer.
Thanks

A: I faced this exact problem a few months ago, and solved it by having a pointer in the customer object structure to the additional data. Note that if you do this, you'll need to make sure to include the pointed to field in future customer queries, or the data won't be fetched.
Retrospectively, I'm not sure I'd recommend splitting the objects up. It does create a more normalised data structure, but Parse fights against this in several ways:

*

*You have to remember to include the pointed to field in all future queries. This is a pain.

*You can only follow pointers up to a certain depth within a query (I think 3?)

*Parse charges you by the database access, so denormalised data can be an issue.

*Parse doesn't really support atomic operations or transactional queries, so it's easy to get your data into an inconsistent state if you're not careful about when you save. For example, you update your customer record, go to change the address record, and have the second query fail. Now you're in a "half updated state", and without transaction rollback, you'll have to fix it yourself (and you might not even know it's broken!).

Overall, were I to use Parse again (unlikely), I'd probably stick with giant denormalised objects.

A: Here is a solution to handle two table by the help of userId.
Note- You are creating a table of REGISTRATION and filling few data by your end(code).
      so you can create an other one table for Address. and when you will create a new table of
      Address a question will arise that how you manage these table
      so its simple here you have same user id for both table "REGISTRATION & ADDRESS"
      then by the help of that unique "userid" you can play. And as per your requirement find
      the detail of both table and merge as well.
Hope it will resolve your problem .


text:
Q: Position of icons on the desktop of windows using hexadecimal code After using icosauve to save the position of icon on the desktop windows, I want to reposition an icon of one the elements. Using Icosauve I get a hexadecimal code of the icon, my problem is that I can't udnerstand the position, which is in hexadecimal. This is the code of an icon naming Computer:
"Computer"=hex:1a,00,00,00,02,00,00,00

I don't know how to interpret this so that I can reposition the icon.

A: Put 4 icons in the corners (1 in each).
Get their hexes.
You will now have a fully relevant coordinate system, you will exactly see how X and Y vary by position.
Note that the values are also resolution-dependent (the XY furthest from 0,0).


text:
Q: How to find a good way to struct api permissions Question
I am trying to find a good way to struct the permissions of my api gateway to be accessed from a external software.
The context
In my current company we have an API gateway.
When a user log in we send all the user permissions to the front-end service and generate all the menus and screens for the current user and what it is allowed to access.
Example:
{
 user: joe,
 permissions: [
  'fancyMenu',
  'anotherFancyMenu'
 ]
}

This approach worked really well, but right now we need to expose the API to other clients and they will access directly our endpoints.
Problem
So previously the user who had access to fancyStuff menu need to access the endpoints x,y,z to complete a operation. Each endpoints has to check if the logged user have the fancyStuff permission.
Now we need to expose our API to other softwares.
In this example the permission fancyMenu needed to access this 3 diferent endpoints to finish the operation. Get some stuff and fancy coins to create a new fancy operation.
fancyMenu -> POST /fancy
fancyMenu -> GET /coins/fancy
fancyMenu -> GET /stuff

Solution
That being said we created a new class on our api gateway and mapped all the menu permissions with the required endpoint.
One example is our menu fancyMenu now have a list of all endpoints that are required to do its all functionalities and we check this new class on all endpoints.
I am not sure if this is the right approach for the problem, but I couldn't find a better one.