text:
Q: Ta-lib and pandas series not working with python I'm new in Coding, so please be patient with me ;)
This is my code that didn't work, I'm trying several hours to solve it, but every time I got another error.
import pandas as pd
import numpy as np
import talib.abstract as ta

dfBTCUSD_1h = pd.read_csv('Bitfinex_BTCUSD_1h.csv', skiprows=1)
dfBTCUSD_1h.sort_values(by='Date') # This now sorts in date order

open = dfBTCUSD_1h.iloc[:,2]
high = dfBTCUSD_1h.iloc[:,3]
low  = dfBTCUSD_1h.iloc[:,4]
close =dfBTCUSD_1h.iloc[:,5]

short_ema = ta.EMA(close,timeperiod=10)

TypeError: cannot convert the series to <class 'int'>

How can I edit the pandas series to a working file for ta-lib?
best regards

A: Instead of supplying code to ta.EMA, do the following:
short_ema = ta.EMA(close.astype(float),timeperiod=10)

Talib functions usually take numpy arrays of dtype float as inputs


text:
Q: In picocli how do you make options on the command line to override the same option in an @-file I'm currently using picocli 4.7.0-SNAPSHOT to great effect in a Java 11 application that has a complex set of options, so I am making use of the @-file functionality.
What I am trying to get to work is an option specified directly on the command line to override the same option if it exists in the @-file. So options specified on the command line take precedence over the @-file. Is that possible.
When I try to run my test application, heavily based on the picocli example, with both a command line option and an @-file, I get the following error from picocli along with the expected usage:
myapp --sourceDatabaseType=MySQL @.\myapp.options

option '--sourceDatabaseType' (<sourceDatabaseType>) should be specified only once

and then the expected usage information.

A: Let me paraphrase the question to see if I understand it correctly:
If the end user specifies an option directly on the command line, the command line value should be used, while if that option is not specified on the command line, the value in a file should be used.
Essentially, you are using an @-file with the intention to define default values for one or more options.
However, that is not what @-files were designed for: picocli cannot distinguish between arguments that came from the command line and arguments that came from the @-file.
I would suggest using picocli's default provider mechanism instead.
One idea is to use the built-in PropertiesDefaultProvider:
import picocli.CommandLine.PropertiesDefaultProvider;

@Command(name = "myapp", defaultValueProvider = PropertiesDefaultProvider.class)
class MyApp { }

PropertiesDefaultProvider also uses a file, and the values in that file are only used for options that were not specified on the command line.
The tricky bit is the location of this file. PropertiesDefaultProvider looks for the file in the following locations:

*

*the path specified by system property picocli.defaults.${COMMAND-NAME}.path

*a file named .${COMMAND-NAME}.properties in the end user's user home directory

(Replace ${COMMAND-NAME} by the name of the command, so for a command named myapp, the system property is picocli.defaults.myapp.path)
To give end users the ability to specify the location of the file, we need to set the system property before picocli completes parsing the command line arguments.
We can do that with an @Option-annotated setter method. For example:
class MyApp {
    @Option(names = "-D")
    void setSystemProperty(Map<String, String> properties) {
        System.getProperties().putAll(properties);
    }
}

This would allow end users to invoke the command with something like this:
myapp --sourceDatabaseType=MySQL -Dpicocli.defaults.myapp.path=.\myapp.options

If this is too verbose, you could go one step further and create a special -@ option, to allow users to invoke the command with something like this:
myapp --sourceDatabaseType=MySQL -@.\myapp.options

The implementation for this would be an annotated setter method, similar to the above:
class MyApp {
    @Spec CommandSpec spec; // injected by picocli

    @Option(names = "-@")
    void setDefaultProviderPath(File path) {
        // you could do some validation here:
        if (!path.canRead()) {
            String msg = String.format("ERROR: file not found: %s", path);
            throw new ParameterException(spec.commandLine(), msg);
        }
        // only set the system property if the file exists
        System.setProperty("picocli.defaults.myapp.path", path.toString());
    }
}

redpajama_set_name: RedPajamaStackExchange


text:
Q: Função recursiva para montar árvore de arquivos Estou com problemas para montar uma árvore de diretórios virtuais com seus respectivos arquivos.
A modelagem á seguinte:
Table: folders

*

*id

*name

*company_id

*parent_folder (auto-relacionamento)

Montei a seguinte function:
 private function mountTree($folders = [], $folder_id = 0, $include_files = false)
        {
            $tree = [];
            foreach ($folders as $index => $folder) {
                if ($folder['parent_folder'] == $folder_id) {
                    $children = $this->mountTree($folders, $folder['id'], $include_files);
                    if ($children) {
                        $folder['children'] = $children;
                    }
                    if ($include_files) {
                        $folder['files'] = $this->getFilesByFolder($folder['id']);
                    }
                    $tree[$folder['name']] = $folder;
                }
                unset($folders[$index]);
            }
            return $tree;
        }

O problema é que o meu retorno está trazendo algumas pastas filhas na "raiz" e isso não deveria ocorrer:

O correto seria somente a posição 0 do array, nela a estrutura de pastas esta correta.
Por algum motivo algumas subpastas estão sendo duplicadas e indo para a "raiz" (posição 1 do array de exemplo). Essa posição não deveria existir pois essas pastas já estão em seus devidos lugares no array de índice 0.
Código para teste:
$folders = [
            0 => [
                "id" => "cc876497-d6a9-4b8a-bf4d-e39a8a416734",
                "name" => "archives",
                "company_id" => "bec5664f-30a2-4ca7-83ea-e6ff5a4ec244",
                "parent_folder" => null,
            ],
              1 =>  [
                "id" => "94cae4aa-0be1-4428-8e5a-e040059a4adf",
                "name" => "N1",
                "company_id" => "bec5664f-30a2-4ca7-83ea-e6ff5a4ec244",
                "parent_folder" => "cc876497-d6a9-4b8a-bf4d-e39a8a416734",

              ],
              2 => [
                "id" => "8426b4bb-8d9f-4ba1-b81c-53f2d350b217",
                "name" => "N2",
                "company_id" => "950e70c2-6791-44da-a74c-fc6e6b7dddc9",
                "parent_folder" => "94cae4aa-0be1-4428-8e5a-e040059a4adf",

              ],
              3 => [
                "id" => "cebb481a-e19c-449e-ad77-3469f08834fd",
                "name" => "N3",
                "company_id" => "950e70c2-6791-44da-a74c-fc6e6b7dddc9",
                "parent_folder" => "8426b4bb-8d9f-4ba1-b81c-53f2d350b217",
              ]

        ];

Eu reparei que alterando o id e consequentemente o parent_folder para inteiro o algoritmo funciona de forma correta, conforme a imagem abaixo:

Porem eu não posso alterar essa estrutura e necessariamente eu preciso trabalhar com uuid (string).
O retorno correto esperado seria a imagem 2, mas utilizando o id e parent_folder como string (uuid).

A: Solução:
 private function mountTree($folders, $folder_id = '', $include_files = false)
    {
        $tree = [];
        foreach ($folders as $folder) {
            if (strcmp($folder['parent_folder'], $folder_id) == 0) {
                $children = $this->mountTree($folders, $folder['id'], $include_files);
                if ($children) {
                    $folder['children'] = $children;
                }
                if ($include_files) {
                    $folder['files'] = $this->getFilesByFolder($folder['id']);
                }
                $tree[$folder['name']] = $folder;
            }
        }
        return $tree;
    }

Após identificar que o problema era com o tipo de dados (inteiro e string) eu alterei o default do parâmetro $folder_id para '' e também comparei as string com a função strcmp. Com isso a arvore é montada sem erros, conforme imagem abaixo:


text:
Q: Is there any way I can code to read txt file of atomic coordinates to represent each colum as a list This is the atomic coordinates
XYZ
A 5.98974561 7.80124465 15.1032457
B 5.60245671 7.50214457 16.0012454

I started coding as
with open(filename) as f:
    while True:
        line = f.readlines()
        if not line:
           break
        print((line[1]))
        print((line[2]))

And the results came as:
A 5.98974561 7.80124465 15.1032457
B 5.60245671 7.50214457 16.0012454

But I wanted it to be
A = [5.98974561 7.80124465 15.1032457]
B = [5.60245671 7.50214457 16.0012454]

A: You could do it like this with Abuday's suggestion:
with open(filename) as f:
   lines = f.readlines()[1:]

dictionary = {}
for i in lines:
   dictionary[i.split()[0]] = i.split()[1:]

This will give you a dictionary with indices (A, B, ...) as keys and lists as values.

A: Something like this could suite you
with open(filename) as f:
    line = f.readline() # to skip first line
    col_0 = [] # so store the first column
    col_1 = [] # so store the second column
    col_2 = [] # so store the third column
    col_3 = [] # so store the fourth column
    while True:
        line = f.readline() # read line one  by one
        if not line:
           break
        line = line.replace('\n','') # replace line return with nothing
        splitline = line.split(' ')
        col_0.append(splitline[0]) # append value of the first column + convert to float
        col_1.append(float(splitline[1])) # append value of the second column + convert to float
        col_2.append(float(splitline[2])) # append value of the third column  + convert to float
        col_3.append(float(splitline[3])) # append value of the fourth column + convert to float
        print(splitline[0] + ' = ' + str(splitline[1]) + ' ' + str(splitline[2]) + ' ' + str(splitline[3])   )
print(col_0)
print(col_1)
print(col_2)
print(col_3)

But I think there is more efficient ways to read 3D coordinate files. For example using numpy:
import numpy as np
filename = 't.txt'
Name = np.loadtxt(filename, skiprows=1, usecols=0,dtype = 'S1' )
Coordianates = np.loadtxt(filename, skiprows=1, usecols=(1,2,3) )
print( Name,Coordianates)

A: In order to produce the exact output as shown in the question then:
FILENAME = 'foo.txt'
with open(FILENAME) as data:
    for line in data.readlines()[1:]:
        t = line.split()
        print(f'{t[0]} = [{" ".join(t[1:])}]')

Output:
A = [5.98974561 7.80124465 15.1032457]
B = [5.60245671 7.50214457 16.0012454]


text:
Q: difference between character array initialized with string literal and one using strcpy Please help me understand what is the difference using an initialized character array like char line[80]="1:2" ( which doesn't work !! ) and using char line[80] followed by strcpy(line,"1:2").
As per my understanding in first case I have a charachter array, it has been allocated memory, and i am copying a string literal to it. And the same is done in the second case. But obviously I am wrong. So what is wrong with my understanding.
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
void tokenize(char* line)
{
   char* cmd = strtok(line,":");

    while (cmd != NULL)
    {
    printf ("%s\n",cmd);
    cmd = strtok(NULL, ":");
    }
}

int main(){
char line[80]; //char line[80]="1:2" won't work
/*
char *line;
line = malloc(80*sizeof(char));
strcpy(line,"1:2");
*/
strcpy(line,"1:2");
tokenize(line);
return 0;
}

A: You are wrong. The result of these two code snippets
char line[80] = "1:2";

and
char line[80];
strcpy( line, "1:2" );

is the same. That is this statement
char line[80] = "1:2";

does work.:)
There is only one difference. When the array is initialized by the string literal all elements of the array that will not have a corresponding initialization character of the string literal will be initialized by '\0' that is they will be zero-initialized. While when function strcpy is used then the elements of the array that were not overwritten by characters of the string literal will have undeterminated values.
The array is initialized by the string literal (except the zero initialization of its "tail") the same way as if there was applied function strcpy.
The exact equivalence of the result exists between these statements
char line[80] = "1:2";

and
char line[80];
strncpy( line, "1:2", sizeof( line ) );

that is when you use function strncpy and specify the size of the target array.
If you mean that you passed on to function tokenize directly the string literal as an argument of the function then the program has undefined behaviour because you may not change string literals.
According to the C Standard (6.4.5 String literals)

7 It is unspecified whether these arrays are distinct provided their
  elements have the appropriate values. If the program attempts to
  modify such an array, the behavior is undefined.


text:
Q: rsync does not follow symlink I want to copy one file from one Linux server to another one:
Firstly, I've checked the following:
ls -l /etc/letsencrypt/live/example.com/fullchain.pem
lrwxrwxrwx 1 root root 46 mar 28 19:50 /etc/letsencrypt/live/example.com/fullchain.pem -> ../../archive/example.com/fullchain260.pem

and
ls -l /etc/letsencrypt/archive/example.com/fullchain260.pem
-rw-r--r-- 1 root root 3578 mar 28 19:50 /etc/letsencrypt/archive/example.com/fullchain260.pem

then:
rsync  -e "ssh -i ~/.ssh/id_rsa-cert.pub" -uvvvvvL --chmod=F644 /etc/letsencrypt/live/example.com/fullchain.pem soporte.example.com:/etc/pki/tls/certs/soporte.example.com/tmp
cmd=ssh -i ~/.ssh/id_rsa-cert.pub machine=soporte.example.com user=<NULL> path=/etc/pki/tls/certs/soporte.example.com/tmp
cmd[0]=ssh cmd[1]=-i cmd[2]=~/.ssh/id_rsa-cert.pub cmd[3]=soporte.example.com cmd[4]=rsync cmd[5]=--server cmd[6]=-vvvvvue.LsfxC cmd[7]=. cmd[8]=/etc/pki/tls/certs/soporte.example.com/tmp
opening connection using: ssh -i "~/.ssh/id_rsa-cert.pub" soporte.example.com rsync --server -vvvvvue.LsfxC . /etc/pki/tls/certs/soporte.example.com/tmp  (9 args)
msg checking charset: UTF-8
FILE_STRUCT_LEN=24, EXTRA_LEN=4
(Server) Protocol versions: remote=31, negotiated=31
(Client) Protocol versions: remote=31, negotiated=31
FILE_STRUCT_LEN=24, EXTRA_LEN=4
[sender] change_dir(/etc/letsencrypt/live/example.com)
[sender] make_file(fullchain.pem,*,0)
[sender] flist start=0, used=1, low=0, high=0
[sender] i=0 /etc/letsencrypt/live/example.com fullchain.pem mode=0100644 len=3,578 flags=1000
send_file_list done
[sender] flist_eof=1
file list sent
send_files starting
server_recv(2) starting pid=1845
recv_file_name(fullchain.pem)
received 1 names
[Receiver] flist_eof=1
[Receiver] flist start=0, used=1, low=0, high=0
[Receiver] i=0 1 fullchain.pem mode=0100644 len=3,578 flags=1000
recv_file_list done
get_local_name count=1 /etc/pki/tls/certs/soporte.example.com/tmp
[Receiver] change_dir(/etc/pki/tls/certs/soporte.example.com)
generator starting pid=1845
delta-transmission enabled
recv_generator(tmp,0)
tmp is newer
generate_files phase=1
send_files phase=1
recv_files(1) starting
recv_files phase=1
generate_files phase=2
send_files phase=2
send files finished
total: matches=0  hash_hits=0  false_alarms=0 data=0
recv_files phase=2
recv_files finished
generate_files phase=3
generate_files finished
client_run waiting on 7070

sent 48 bytes  received 630 bytes  1,356.00 bytes/sec
total size is 3,578  speedup is 5.28
[sender] _exit_cleanup(code=0, file=main.c, line=1207): entered
[sender] _exit_cleanup(code=0, file=main.c, line=1207): about to call exit(0)

man pages of rysnc says: -L, --copy-links            transform symlink into referent file/dir
So the problem and the question are:
I want to copy the target of the symlink and the results is does nothing, but I don't see any errors. Am I doing something wrong?


text:
Q: How can I assign custom colors to groups in a dispersion chart in Numbers? I have a table with measurements of the runtime of different sorting algorithms. This data should be shown in a chart, with the number of items on the X axis and the runtime on the Y axis. To make the X axis on scale, I used a dispersion chart.
Numbers automatically picks some colors for the different groups of data. However, I'd like to choose different colors. I was only able to change the color of the trend line, but this didn't change the color in the legend.
How can I change the color so that the change is visible in the legend as well?

A: Just called AppleCare. The guy took some time to make a chart and afterwards explained that I could click the line to change the color (just as I did before). While we were talking I clicked a dot in the graph, representing a data point. It turned out that you could change the color of the dots the same way. This color was applied to the legend, so the problem was solved.


text:
Q: Retrieving the return value from Oracle with C# I'd like to be able to retrieve the return value from a function in Oracle with c#.
Currently, this is what  I have:
For SQL:
 FUNCTION add_resource (
     project_view BOOLEAN,
     project_id NUMBER,
     worker_id  NUMBER,
     role_id    NUMBER) RETURN NUMBER IS
     resource_id NUMBER;
 BEGIN
   INSERT INTO RESOURCE_T (WORKERID, ROLEID, PROJECTID)
   VALUES (worker_id, role_id, project_id)
   RETURNING RESOURCEID INTO resource_id;
   RETURN resource_id;
 END add_resource;

For C#
cmdText = "DECLARE resource_id NUMBER; BEGIN resource_id := PKG_RAP.add_resource(" + projectView + "," + id + "," + record["WORKERID"] + "," + record["ROLEID"] + "); END;";

using (OracleCommand cmd = new OracleCommand(cmdText, conn))
    {
         OracleTransaction trans = conn.BeginTransaction();
         try
         {
          OracleParameter prm = new OracleParameter("resource_id", OracleDbType.Int32, ParameterDirection.ReturnValue);
          cmd.Parameters.Add(prm);
          cmd.ExecuteNonQuery();
          trans.Commit();
         }catch
         {
          trans.Rollback();
          throw;
         }
    }

The query works individually when I test it out in the database, however, the c# is not able to grab the value for resource_id and only gets "null". Any tips would be appreciated!

A: Does something like this not work?
cmdText = @"select PKG_RAP.add_resource(:projectView, :projectId, :workerId, :roleId) from dual";
using (var cmd = new OracleCommand(cmdText, conn))
using (cmd.Parameters.Add(":projectView", projectView))
using (cmd.Parameters.Add(":projectId", id))
using (cmd.Parameters.Add(":workerId", record["WORKERID"]))
using (cmd.Parameters.Add(":roleId", record["ROLEID"]))
using (var tx = conn.BeginTransaction()) {
    try {
        // resource ID
        var resourceId = Convert.ToInt32(cmd.ExecuteScalar());
        tx.Commit();
        return resourceId;
    } catch {
        tx.Rollback();
        throw;
    }
}

This seems (to me) like the simplest solution to calling a PL-SQL function to return a single value.
ETA: I don't have sufficient rep to comment, yet, but Marc, above, means that you don't return anything in the PL-SQL block you are executing.

A: The command text must be like this one if you like to call a function (and if you want or have to avoid select ... from dual:
cmdText = "BEGIN :resource_id := PKG_RAP.add_resource(" + projectView + "," + id + "," + record["WORKERID"] + "," + record["ROLEID"] + "); END;";

As John Pederson already answered, all parameters should be defined as bind values, e.i.
cmdText = "BEGIN :resource_id := PKG_RAP.add_resource(:projectView, :projectId, :workerId, :roleId); END;";

However, I don't think you can use boolean variables when calling from C#. You have to cast it, e.g. to "0" and "1"


text:
Q: JSONTypeInfo to not ignore property in inheritance mapping I am using following dependency for JSON serialization/deserialization
<dependency>
    <groupId>com.fasterxml.jackson.core</groupId>
    <artifactId>jackson-databind</artifactId>
    <version>2.7.4</version>
</dependency>

<dependency>
    <groupId>com.fasterxml.jackson.core</groupId>
    <artifactId>jackson-annotations</artifactId>
    <version>2.7.4</version>
</dependency>

I have inheritance mapping.
Following is Parent class.
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "isOne")
@JsonSubTypes({ @Type(value = One.class, name = "true"), @Type(value = Two.class, name = "false") })
public class Parent extends AbstractValueObject {
     private Boolean isOne;
}

And we have two sub class One and Two extended by Parent.
This mapping is working when I serialize/deserialize with the help of property isOne.
But the problem is when JSON is converted to class jackson removes the property isOne. Is there any way which does not remove that property. It don't recommend any dummy property as long as i can have actual.

A: According to the doc for JsonTypeInfo you can use visible=true
Try this:
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "isOne", visible = true)


text:
Q: select the sales of a grouped date range of every month (SQLite) I need to make an inquiry obtaining the months that no sales were made. (SQLITE)
Table
| id |    date    | total | id_user |
|  1 | 2019-01-01 | 400   |    1    |
|  2 | 2019-01-09 | 600   |    1    |
|  3 | 2019-08-01 | 100   |    1    |
|  4 | 2019-08-08 | 500   |    1    |
|  5 | 2019-08-15 | 1400  |    1    |
|  6 | 2019-09-01 | 7000  |    1    |

I have this query
SELECT
    sum(venta.total) as Total,
    strftime('%m',venta.fecha_venta) as Month,
    strftime('%Y',venta.fecha_venta) as Year
FROM venta
LEFT JOIN VENTA_ESPECIE
WHERE strftime('%Y', date('now')) == strftime('%Y',venta.fecha_venta)
AND venta.fecha_venta
BETWEEN '2019-01-30' AND '2019-10-30'
 GROUP by Month ;

Result
| Total | Month | Year |
| 1000  |  01   | 2019 |
| 2000  |  08   | 2019 |
| 7000  |  09   | 2019 |

I want to get this result
| Total | Month | Year |
| 1000  |  01   | 2019 |
|   0   |  02   | 2019 |
|   0   |  03   | 2019 |
|   0   |  04   | 2019 |
|   0   |  05   | 2019 |
|   0   |  06   | 2019 |
|   0   |  07   | 2019 |
| 2000  |  08   | 2019 |
| 7000  |  09   | 2019 |
|   0   |  10   | 2019 |

the important thing is that it is between 2 dates that can change

A: The following solution is similar to @MikeT's, but computes the min and max time periods.  In addition, the input table has been called sales.
WITH monthly AS
       (SELECT strftime('%m', date) as Month,
               strftime('%Y', date) as Year,
               total
        FROM sales),
     minmax AS
       (SELECT MIN(date) mn,
               MAX(date) mx
        FROM sales),
     cte_dates(dates) AS
       (SELECT mn from minmax
        UNION ALL SELECT date(dates,'+1 Months')
                  FROM cte_dates WHERE dates <= (SELECT mx FROM minmax)),
     result AS
       (SELECT dates, total FROM cte_dates
        NATURAL LEFT JOIN
        (SELECT Year || '-' || Month || '-01' AS dates, SUM(total) total
         FROM monthly
         GROUP BY Year, Month))
SELECT COALESCE(total,0) as Total,
       strftime("%m", dates) as Month,
       strftime("%Y", dates) as Year
FROM result;

A: I believe that the following will do what you want :-
WITH cte_dates(dates) /*CTE generates a list of dates in the given range */ AS
    (
        SELECT '2019-01-01' /*<<<< start of range */
        UNION ALL SELECT date(dates,'+1 Months') FROM cte_dates WHERE dates <= '2019-10-01' /*<<<< end of range */
    )

SELECT
    coalesce(
        (
            SELECT sum(total)
            FROM venta
            WHERE strftime('%Y',date) = strftime('%Y',dates)
                AND strftime('%m',date) = strftime('%m',dates)
        )
        ,0 /* 0 instead of null for coalesce */
    ) AS Total,
    strftime('%m',dates) AS Month,
    strftime('%Y',dates) AS Year
FROM cte_dates
;

*

*Note this is based upon the table rather the the query which doesn't reflect the table.

i.e. with the venta table being :-

the result is :-


text:
Q: removing icon from input field VeeValidate I'm new in Vue.js and i have problem with validations. I'm using Vee-Validate framework for validations. Validation is working, but i got this red circle icon from 'is-danger' class.
Question: How to set only this red border, but without this little icon?
Look at the screenshot below:
 <ValidationProvider
      :rules="{
      required: true,
      digitsRegex: /^(0|[1-9][0-9]{0,2}(?:(,[0-9]{3})*|[0-9]*))(\.[0-9]+){0,1}$/
      }"
      v-slot="{ errors, valid }"
       name="Discount"
  >

       {{ error }}
  </ValidationProvider>

A: It would be better if you have shared the code for the validation you wrote, but you can refer below code for only warning text and red-bordered textbox and also attached image for output.
Please Mark as Right Answer, if this solves your problem
Keep Coding Buddy.
<template>

    Email

      <input
        v-validate="'required|email'"
        :class="{'input': true, 'is-danger': errors.has('email') }"
        name="email"
        type="text"
        placeholder="Email"
      >
      {{ errors.first('email') }}

</template>

VeeValidate Example

A: I used vee-validate3 and fixed this issue by adding
#password{
   background-image:none !important;
}

and it worked fine, I did this because I did not want to show check or cross icon for password field, hope this answer helps you


text:
Q: Adding lists of key/values to an existing hash I can initialize a hash from a list, e.g:
my %hash = (1..10);
my %hash2 = split /[\n=]/;

Is there a better (briefer) way to add lists of new key/values to a hash than using temporary variables?
while (<>) {
    my ($k, $v) = split /=/, $_, 2;
    $hash{$k} = $v;
}

A: It's possible, yes. It's rather like adding some numbers to an existing total - you might accomplish that like this:
my $total = 1 + 2 + 3;   # here's the existing total

# let's add some additional numbers
$total = $total + 4 + 5;   # the $total variable appears both
                           # left and right of the equals sign

You can do similar when inserting values to an existing hash...
my %hash = (a => 1, b => 2);  # here's the existing hash.

# let's add some additional values
$_ = "c=3" . "\n" . "d=4";
%hash = (%hash, split /[\n=]/);  # the %hash variable appears both
                                 # left and right of the equals sign

With addition, there's a nice shortcut for this:
 $total += 4 + 5;

With inserting values to a hash, there's no such shortcut.

A: Maybe I'm wrong but the next
use 5.014;
use warnings;
use Data::Dumper;

#create a hash
my %hash = map { "oldvar" . $_ => "oldval" . $_ } (1..3);

#add to the hash
%hash = (%hash, map {split /[=\n]/}  <DATA>);
say Dumper \%hash;

__DATA__
var1=val1
var2=val2
var3=val3

prints
$VAR1 = {
      'oldvar1' => 'oldval1',
      'oldvar2' => 'oldval2',
      'var1' => 'val1',
      'var3' => 'val3',
      'oldvar3' => 'oldval3',
      'var2' => 'val2'
    };


text:
Q: Convolution perfomed by an analog circuit As a Electronic Engineering student I have a fair knowledge about convolution and DSP. But, I was wondering if it is possible to perform a convolution only using analog circuit (without memory)? And if it is possible, what would be the restrictions?
In short, I would like to project this using only an analog circuit:
$$
y(t) = (x * h)(t) = \int^{b}_{a}x(\tau)h(t-\tau)d\tau
$$
Clarifications:

*

*Both signals would be an arbitrary input (x and h in the above formula).

*I am willing to make simplifications of all kinds, since it is doing what I am asking.

A: Before digital processing got fast and cheap enough to do convolutions, various ways were developed to do it in analog electronics.  If you want to convolve two arbitrary signals, then you're out of luck unless you are willing to make a lot of compromises and/or spend a lot of money.  Historically, analog convolutions were limited to convolving one real time signal by a pre-determined fixed signal, called the "filter kernel".  Either way, some storage is required for each signal, but with one signal fixed it can be implemented by a "permanent" memory, which allows for a lot more possibilities than doing it on the fly.
You still have the problem of storing some portion of the live signal, since some interval of that needs to be multiplied by the kernel as the signal passes by.  Systems have been developed that do this with delay lines, traveling electron beams, bucket-brigage charges on a CCD, and accoustic waves.  There are probably others that I am not aware of or forgot about.
Once you can somehow store a snapshot of the live signal wide enough to match the filter kernel, you will have to then multiply it by that kernel and sum up the products.  In delay line systems, this would be done with "taps" at regular intervals.  The signal at each tap would be multiplied by a fixed gain (the filter kernel value at that tap), then all these resulting signals summed.  CCDs had split pickups over each charge bucket so that the gain for each bucket was set by where the split was located.  This would be set when the chip was made, so there were CCD filter chips with certain pre-determined filters.  The most common use was for a sync filter, which is a low pass filter with a sharp frequency cutoff.  Surface accoustic wave devices had the signal propagate accross the chip accoustically, which is much slower than light so a large enough time snapshot would be on the chip at any one time.  Like with CCD, the pickups were arranged on the chip with pre-determined gains.  These parts were typically used for IF and RF notch filters at a well tuned frequency.

A: For a Linear Time-Invariant system convolution is equivalent to filtering. When you pass a signal through an LTI system you are simply convolving it with the impulse response of the system.
If you want to convolve two signals though then that's a lot trickier to do in the analogue domain. It would certainly need "memory" in some form, e.g. a delay line.

A: If you look at your equation, you will need to replay X & H at many values of Tau as you integrate on the fixed interval from a to b.  This means that you will need storage/memory of some sort.
But what a good question.
On one end of the spectrum you have a sampled and digitized sequence (commonly called "digital") on the other you have a purely analog signal.  Intermediate between the two is a sampled analog system.  The act of sampling and storing (whether analog or digital) allows operations such as convolution, and non-causal filtering which is what your equation is one form of.
The very first CCD's (Charge Coupled Devices) where developed for similar signal processing tasks as you describe.  Although those early signal processing chains were notably less complex than your choice, being simple delay lines and feedback/feedforward systems.  For example, guitar effects like a flanger and echo were done using CCD's. (I may have the terms guitar effects wrong - please correct me).
In your case you would need to run the sampled system many many time faster than the sampling rate of the incoming signal.  If your sample depth is say 16 then it would need to be run \${16}^2\$ = 256X faster.
I do know that these devices exist still, in some signl processing applications like support chips for image processing in analog signal chains.  And they would be called analog delay lines or sampled analog delay lines.
But in  purely analog sense without sampling you would still need an analog memory of some sort which is replayable.


text:
Q: PHP not getting POST data from Unity I am trying to send POST data from Unity to PHP server.
C#:
    WWWForm form = new WWWForm();
    form.AddField("playerName", "myName");
    using (UnityWebRequest www = UnityWebRequest.Post("https://myserver.com/savedata.php", form))
    {
        yield return www.SendWebRequest();

        if (www.result != UnityWebRequest.Result.Success)
        {
            Debug.Log(www.error);
        }
        else
        {
            Debug.Log(www.downloadHandler.text);
        }
    }

In PHP, $_POST is empty and $_REQUEST is empty. I tried everything I could find online. What could possibly be going on?

A: It worked when I added "www." in front of url!


text: Q: Neovim suggestion selection menu Some menus in the neovim autocomplete suggestion can not be selected and I have no idea how to select them. I tried several keyboard shortcuts, such as Ctrl +P, Ctrl + N, Alt + F, Ctrl + Space + F..., but none of them worked.


text:
Q: Add Custom Claim I currently have a SharePoint 2013 Web Application using Claims and FBA, once the user logs in I can see the ClaimsIdentity object, and in there is the Claims collection. How would I go about adding a claim such as country to the claims?

A: You'll have to write a custom claims provider and override the FillClaimsForEntity method (cf. http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.administration.claims.spclaimprovider.fillclaimsforentity(v=office.15).aspx).
I hope this helps.
Regards,
Raphael.


text:
Q: How do I maximize $|t-e^z|$, for $z\in D$, the unit disk? I guess this question doesn't have a closed form solution for all $t\in \Bbb C$, but I know one for $t=1$ provided by Daniel Fischer in a question I asked.
$$\begin{align}
\left\lvert e^w-1\right\rvert &= \left\lvert \sum_{m=1}^\infty \frac{w^m}{m!}\right\rvert\\
&\leqslant \sum_{m=1}^\infty \frac{\lvert w\rvert^m}{m!}\\
&= e^{\lvert w\rvert}-1,
\end{align}$$
with equality for $w \geqslant 0$.
So this $|1-e^z|$ maximized by $z=1$. I tried doing the same for other values of $t$, but without success. Here is an attempt for $t=8$
$$\begin{align}
\left\lvert e^w-8\right\rvert &= \left\lvert \sum_{m=1}^\infty \frac{w^m}{m!} -7\right\rvert\\
&\leqslant \sum_{m=1}^\infty \frac{\lvert w\rvert^m}{m!} + 7\\
&= e^{\lvert w\rvert}+6,
\end{align}$$
But I don't get equality for $w \geqslant 0$. Is there a way to maximize $|t-e^z|$ for $z\in D$, the unit disk, for other values of $t$ besides $0,1$?

A: Suppose $t=x_0+iy_0$. Then write down the boundary of the image of the unit disk under the map $t-e^z$ in the parametric form for $\varphi \in [0,2\pi)$:
$$
x(\varphi)=x_0-e^{\cos\varphi}\cos{\sin\varphi},
$$
$$
y(\varphi)=y_0-e^{\cos\varphi}\sin{\sin\varphi}.
$$
By the maximum modulus principle the maximum modulus value is obtained somewhere on the boundary. Moreover, tangent line to the boundary at the point of the maximum modulus has to be orthogonal to its radius-vector.
Therefore, we are looking for a (one out of an even number of) solution to the "equation"
$$
(x(\varphi),y(\varphi))\perp\frac{d}{d\varphi}(x(\varphi),y(\varphi)),
$$
which, after substitutions of $x$, $y$ and simplifications is equivalent to
$$
x_0e^{\cos\varphi}(\sin\varphi\cos{\sin\varphi}+\cos\varphi\sin{\sin\varphi})+y_0e^{\cos\varphi}(\sin\varphi\sin{\sin\varphi}-\cos\varphi\cos{\sin\varphi})-e^{2\cos\varphi}\sin{\varphi}=0
$$
The obvious family of cases when this equation has simple solutions is when $y_0=0$. Then $\varphi=0,\pi$ satisfies the equation (one of them is the one we seek). I'd need more time to think whether there are more.
Of course, one has to choose out of all solutions the one with the maximal absolute value, since not every stationary point of the distance function correspond to the maximum. But at least this, I believe, is the easiest way to solve this problem numerically.

A: This is not a full answer, I just wanted to show the plot of the curve $\gamma: \phi \mapsto \exp(\exp(i\phi))$. The solution to the question for a given $t \in {\bf C}$ is given by a point(s) on the curve that are farthest from $t$. There are few observations one can make immediately.

*

*when $t \in {\bf R}$ there are four candidate points, $\phi = 0$, $\phi = \pi$ and two conjugate points, such that the normal to the curve at those point intersects $t$. These are candidate solutions. It seems that when $t < 1$, the solution is $\phi = 0$, when $t > 2$ the solution is $\phi = \pi$, while for $ 1 \leq t \leq 2$ (especially at $t=1.5$) there might be a non-trivial solution $\phi \neq 0, \pi$.


text:
Q: Compare list of objects without equal defined I have a class without equal function defined. I need to compare two lists of this objects. There is some sample of my current solution:
def fromRecords = [new FooRecord(['ABC', 123L]), new FooRecord(['XYZ', 789L])]
storage.write(fromRecords)
def toRecords = storage.read()

for (int i = 0; i < outRecords.size(); i++) {
 assert outRecords[i].contents == records[i].contents
}

Is there more elegant groovy way to perform same comparison?

A: You don't need to loop, the equals method on the lists should take care of comparing order and check element-wise equality:
assert outRecords.contents == records.contents

The == operator will result in outRecords.contents.equals(records.contents) being called, which will check List equality (taking care of order and list content - element by element .equals checks).


text:
Q: googleCast getMediaInfo() returning null value each time Currently, I'm trying to communicate with my receiver app and sender app (android, iOS both).
I am just trying to fetch  getMediaInfo() but its returning null value each time. Can anyone please help me to resolve my issue.
Note: For now I have implemented a queue mechanism at receiver app CAF v3 than facing this issue. I have also checked in the case of queue mechanism at sender app (android) than i am able to get all getMediaInfo() and its working fine.
Please find my code snippet below:
@Override
        public void onMetadataUpdated() {
         MediaInfo mediaInfo =  getRemoteMediaClient().getMediaStatus().getMediaInfo();
        }

While getRemoteMediaClient().getMediaStatus() is not null , but
getRemoteMediaClient().getMediaStatus().getMediaInfo() is returning always null value.
Note: "Title" and "Image" is showing on TV which are connected to cast device and working fine with iOS.
iOS code are below:
[[[[GoogleCastManager mediaControlChannel] mediaStatus] mediaInformation] metadata]

If any one have a solution, then please suggest it to me.  I would be very thankful to you.
Thanks in advance.


text:
Q: Why can't std::variant find operator<() when not in same namespace as compared classes I was trying to provide a custom operator< for a class from an external library. This class is within that library's namespace, however, the operator I wanted to define is not. Now if I define a std::variant and want to use it in a std::set, the compilation fails as it can't detect the operator<. Here's an example (godbolt):
#include <variant>
#include <set>
#include <string>

namespace myClasses
{
struct classA
{
    classA(const unsigned int i) :i(i) {};
    int i;
};

struct classB
{
    classB(const unsigned int u) :u(u) {};
    unsigned int u;
};

}// namespace myClasses

//namespace myClasses { //<- uncomment this

bool operator<(const myClasses::classA &v, const myClasses::classA &w)
{
    return v.i < w.i;
}

bool operator<(const myClasses::classB &v, const myClasses::classB &w)
{
    return v.u < w.u;
}

//} //<- and uncomment this

using var_t = std::variant<myClasses::classA, myClasses::classB>;

int main()
{
    std::set<var_t> myset;

    myset.emplace(myClasses::classB(1));
    myset.emplace(myClasses::classA(2));

    return 0;
}

If you put the operator<s in the namespace myClasses it compiles fine.
Can someone explain to me, why my original attempt failed? If I just compare
myClasses::classA(1) < myClasses::classA(2), there's no need to put the operators in the myClasses namespace.
Thank you very much in advance.

A: This is an feature of argument dependent lookup (ADL), which you are relying on when the operator is search for from std::variant.
When searching for free functions, including overloaded operators, the compiler will only search in namespaces related to the arguments to the function in question.
There are more details in this cppreference article.
Where you call the comparison directly from your code, at the same namespace scope as the operator< declarations, "normal" (i.e. non-ADL) lookup can find the operator definition directly.


text:
Q: Regex-match everything and stop at I'm trying to match everything up to a key phrase using regex.  Basically, it's looking at an email, I want it to return everything before the conversation history.
I've been trying to use (?:^|\W)From:(?:$|\W)([A-Z][a-z]*)[\s-]([A-Z][a-z]*) to stop at From: Dave Patel (in the example below) and match everything before.
Example text below, whenever I search I am only able to return the preceding line or two.
This is just some test text.

Many thanks,

James Jones
Some company
51 made up street
The world

From: Dave Patel
Sent: 08 December 2017 14:57
To: Clare Jones <Clare.Jones.com>; Paul Smith <paul.smith@company.com>
Subject: Re: Files

Well done!  Let me know when implemented if you want me to test.

From: Dave Patel
Sent: 08 December 2017 14:57
To: Clare Jones <Clare.Jones.com>; Paul Smith <paul.smith@company.com>
Subject: Re: Files

The fox jumps over the lazy dog

Joseph Smith

A company
bla bla
blaaaa

A: Try this regex
(.*?)From:(?:$|\W)([A-Z][a-z]*)[\s-]([A-Z][a-z]*)

I think Group 1 from the result of this regex is what you are looking for.
From you example, Group 1 will be:
This is just some test text.

Many thanks,

James Jones
Some company
51 made up street
The world


text:
Q: fetch updated sheet data I am using a sheet addon which updates data when the sheet is opened or when done manually through the addon (there is a refresh button)

Another sheet grabs/stores historical data using a script (with a trigger). The script however, does not update the first sheet's data (because it appears to grab what was loaded when i last opened the first sheet or manually clicked refresh).
For example:
9am - i open sheet and it either auto-updates or i manually click refresh
10am - trigger runs script and grabs 9am data
11am - trigger runs script again but grabs same 9am data
Here is the script:

function snapData() {

// get current sheet and tabs
var ss = SpreadsheetApp.getActiveSpreadsheet();

// click 'refresh' if possible???

var current = ss.getSheetByName('currentTrack');
var database = ss.getSheetByName('trackHistory');

// count rows to snap
var current_rows = current.getLastRow();
  Logger.log(current_rows);
var database_rows = database.getLastRow() + 1;
  Logger.log(database_rows);
var database_rows_new = current_rows + database_rows - 3;
  Logger.log(database_rows_new);
var rows_new = current.getRange("A" + current_rows + ":I" + current_rows).getValues();

// snap rows, can run this on a trigger to be timed
database.getRange("A" + database_rows_new + ":I" + database_rows_new).setValues(rows_new);

}

disclaimer: I have not tested this script for more than 1 video, as I merely grabbed it from somewhere else and modified it for my needs (just 1 video).
Is it possible to somehow script the data update? One solution I may have found is to download an addon which refreshes the sheet (granted the sheet is open), but would like to hear of other options...


text:
Q: Creating sub-packages in android studio problem I am having a really bothering issue. In my app, I am trying to reorganize my classes under com.proje.myapp folder. Under this folder I have a package named screenparts. And I am creating a new folder called dialog_fragments.When i tried to move a class from screenparts folder to dialog_fragments folder, move(refactor) screen pops up. So far everything normal. But when i pressed the refactor button it does some process in the background but folder does not move. And refactor button disables (i can't push it twice). Can anybody help me about that issue? What is the right way to reorganize under subfolders after the app is already done?

A: Go to c drive and android studio project and search com/proje/myapp folder then copy or cut  files . Then go to dialogue_fragment paste inside this folder


text:
Q: Visio - How to use the same shape property for many shapes I have created one master shape with many properties. In the "Define Shape Data" windows of the master shape (of the document stencil), one of the properties (masterProp) is a variable list (so with a list of allowed values).

Is it possible to re-use the list of values allowed for this property (masterProp) to define the format of another property of type variable list in another master shape so that the list of values has to be maintained only once ?
Maybee is there a way to set up "lists" in Visio and link the expected/allowed values (format field) of a property to this list (without using excel) ?
Thanks for your advises,

A:
Is it possible to use the same property (masterProp) in another master
shape to inherit the same allowed values? Or is it possible to link
the values of another property of type fixed list in another master
shape to the values of this masterProp property ?

You mean mastershape in document stencil or in external stencil ?
You can refer to some cell of mastershape in document stencil

To reference a cell of
Use this syntax
Example

A master
Masters[MasterName]!SheetName!CellReference
Masters[Gear]!Shaft!Geometry1.X1

About Cell References

A: Well, Thanks to @Surrodate, this is the correct way of doing this:

*

*Add a user-defined cell in the ShapeSheet of the document (or the page)

*Open the master shape for editing

*In the master shape, open the shapesheet of the master shape and go to the section of the Shape Data

*In the Format column, refer to your user-defined cell. Begin typing with a "=" otherwise it takes your entry as text (even if it recognise your data ...). To refer to the document, begin with =TheDoc!User... if your data are in the page, begin with ThePage!User... Do not forget to set the type of data to 1 or 4 (in case of list).

A:
Ok, I found the shapeSheet of the Page-1. I added a user-defined
section, then a cell named "User.Softwares". I set the value to
="Soft1;Soft2;Soft3". Correct for list ? Then in the field "Format" of the "Define Shape Data" windows in have written
"Page-1!User.Softwares". Is that the correct way to refer to the
page-1 ? When I click on the property of a shape, it proposes the text
"Page-1!User.Softwares" and not the value of the user-defined cell in
Page-1 ... What is the mistake ?

*

*You must also change Type field ! If in this cell stores 0, it mean "String". if cell value is 1 it mean Fixed list.

*You must write Page-1!User.Softwares, without quotation marks !


text:
Q: Why zk/etcd over rdbms for cluster coordination What's the advantage of zk/etcd over rdbms such as mysql/pgsql for cluster coordination?
HA: rdbms nowadays has synchronous transparent failover with witness.
Distributed system can scale horizontally better, but I don't think cluster coordination for stuff such as hadoop/kubernetes/etc have that high volume of throughout or data size requirement.
So eh... What does zk/etcd offer for cluster coordination that traditional rdbms cannot fulfill?

A: Automatic leader election is the reason. etcd and other consensus systems implement consensus algorithms like Raft or PAXOS so that in the face of individual machine failures a cluster of machines can figure out what to do next without human intervention. People use this as a way of implementing safe distributed locks that are immune to machine failure and split-brain scenarios.
Here is an animation of etcd recovering from two machine failures including the leader: https://speakerdeck.com/philips/coreos-plus-kubernetes-at-all-things-open?slide=55


text:
Q: How to define a collection in .NET so you can reference items either by value or name I often have a class defined and I also define another class that is simply a collection of the other class. To do this I found it easiest just to define the other class as Inherits List(Of Type). The reason I define a collection class is to add extra functionality to the collection. Take the following code for example.
Class Car
    Property Name As String
    Property Year As Short
    Property Model As String
End Class

Class CarCollection
    Inherits List(Of Car)

    Overloads Sub Add(ByVal Name As String, ByVal Year As Short, ByVal Model As String)
        Dim c As New Car

        c.Name = Name
        c.Year = Year
        c.Model = Model

        Add(c)
    End Sub
End Class

Now if I declare a CarCollection variable, how can I reference the Car by either name or the index value, the way that .NET seems to do collections. Take for instance the .NET ToolStripItemCollection. You can reference items within it either of these two ways:
MyCollection(2)
MyCollection("MyItemName")
My quesion of course is how can I define my own collection so that I can reference it by index or name like that. Right now I can only reference it by index.

A: You can use a KeyedCollection:
Imports System.Collections.ObjectModel

Public Class CarCollection
    Inherits KeyedCollection(Of String, Car)

    Protected Overrides Function GetKeyForItem(ByVal item As Car) As String
        Return item.Name
    End Function
End Class

A: You can overload Item:
'''<summary>
'''Gets or sets a Car object by name.
'''</summary>
Public Default Property Item(ByVal name As String) As Car
     Get
           'Return the Car with the specified name
     End Get
     Set(ByVal value As Car)
           'Set the Car with the specified name
     End Set
End Property

A: You could try inheriting from System.Collections.Generic.Dictionary instead of List, and when you Add, set the key also.

A: Give the SortedDictionary a look...something like this:
Public Class Car
    Property Name As String
End Class

Public Class CarCollection
    Inherits SortedDictionary(Of String, Car)

    'Extend, override as needed, adding in your indexer property

    Public Default ReadOnly Property Item(index As Integer) As Car
        Get
            Return Me.Values.ElementAt(index)
        End Get
    End Property

End Class

Then you can use it like this:
Dim collection As New CarCollection()
collection.Add("YourNameHere", New Car())

collection("YourNameHere")

A: The System.Collections.Generic.SortedList collection allows you to access items by index (through the Keys and Values properties), and by key.


text:
Q: What numbers are not represented by $5xy+2x+2y$? What numbers are not represented by $5xy+2x+2y$? Do they have a positive density?
This came up for me while investigating some cases here. Here's what I've found:

*

*All evens are represented with $x=0$, and all $3m+1$ are represented with $x=-1$.

*There are infinitely many $n$ not represented, e.g. any $n$ for which $5n+4$ is prime.

*If $5xy+2x+2y=n$, then either $|x|$ or $|y|$ is less than $|n|/5+2$, so for each $n$ this is decidable.

*Of numbers with absolute value less than 6000, about 80% are represented by this polynomial.

I'd expect a nice characterization for these numbers, but I haven't found it.

A: $n = 5xy + 2x + 2y$ if and only if $5n+4 = (5x+2)(5y+2)$.
So a necessary and sufficient condition is that $5n+4$ have
a factor congruent to $2 \bmod 5$ --- or $3 \bmod 5$ since you're
allowing negative $x,y$ such as $x = -1$.  This makes it easy to decide
whether a given $n$ is so represented.  In particular, the numbers
not represented by $5xy + 2x + 2y$ are those for which $5n+4$ is
the product of primes all congruent to $\pm 1 \bmod 5$
(you already found the special case of prime $5n+4$).
Such numbers have density zero, but convergence is slow:
the density in $|n| < X$ is asymptotically proportional to $1 \left / \sqrt{\log X} \right.$.
P.S. Here's some quick gp code to count such $n$ up to $N$:
f(v) = sum(n=1,#v,(v[n]%5!=1)&&(v[n]%5!=4))
F(n) = f(factor(n)[,1])==0
S(N) = sum(n=1,N,F(5*n+4))

For $N=6000$ the count $S(N)$ is $1204$, which agrees with Matt F.'s
calculation that "about 80%" of $n \leq 6000$ are represented by $5xy+2x+2y$.
Taking $N=10^5, 10^6, 10^7, 10^8$ finds $S(N) = 17992$, $166612$, $1557892$, $14680787$
(the last count took about 5.5 minutes to compute); this is quite close to
$CN \left / \sqrt{\log(5N)} \right.$
for $C$ somewhere between $0.65$ and $0.66\,$.


text:
Q: A dictionary that systematizes commonly accepted combinations of words Where can I find a dictionary that contains words along with their commonly accepted "neighbors"?
I had one, but it's not for English language. The structure of this dictionary is the following. Take a noun in this dictionary. Along with its brief definition, the dictionary shows what adjectives, verbs, and other parts of speech are appropriate to use with this noun.
E.g., a "day." Possible adjectives: "sunny," "long," "bad," etc. Verbs: "spend," "waste," etc. And so forth for many instances. Quite a handy thing for writing.
What English dictionaries offer similar capacities?
PS: It's not about simple collocations or corpuses and ngrams that don't differentiate parts of speech, like Corpus Concordance English. It's important to have this part-of-speech distinction.
UPDATE:
Brief list of dictionaries from the answers:

*

*Online version of Oxford Collocation Dictionary

A: OXFORD COLLOCATIONS DICTIONARY FOR STUDENTS OF ENGLISH
In Indian English one can see such mistakes as 'I did a mistake when I wrote the letter'. It is because they do not know that did does not collocate with mistake and that the word which collocates with mistake is made. Always say make a mistake, not do a mistake. It is also correct if you use commit a mistake. Such mistakes can be avoided if you have a copy of OXFORD COLLOCATIONS DICTIONARY FOR STUDENTS OF ENGLISH at your elbow. I assure you that it is an excellent dictionary. It may be available all over the world.

A: MacMillan Collocations Dictionary can also be used for the very same purpose. However, a learner may find what Mr Abootty suggested to be more useful.


text:
Q: SQL Server Inner Join using WITH(NOLOCK) I have a database query:
DECLARE @Pager_PageNumber AS INT, @Pager_PageSize AS INT;

SET @Pager_PageNumber = 1;
SET @Pager_PageSize = 12;

SELECT
    [Name], [Description], [Table1ID], [VersionNo], [Status]
FROM
    (SELECT
         CAST(Table1.name AS VARCHAR(MAX)) As [Name],
         CAST(Table1.description AS VARCHAR(MAX)) AS [Description],
         CAST(CAST(Table1.Table1_ID AS DECIMAL(18,0)) AS VARCHAR(MAX)) AS [Table1ID],
         CAST(CAST(Table1.VERSION_NO AS DECIMAL(18,0)) AS VARCHAR(MAX)) AS [VersionNo],
         CAST(Table2.br_status AS VARCHAR(MAX)) AS [Status]
    FROM
        Table1 WITH (NOLOCK)
    INNER JOIN
        (SELECT
             Table1_id, MAX(version_no) as version_no
         FROM Table1
         WHERE Table1.status = '00002'
         GROUP BY Table1_id) AS BR WITH (NOLOCK) ON Table1.Table1_id = BR.Table1_id
                                                 AND BR.version_no = Table1.version_no
    INNER JOIN
        Table2 WITH (NOLOCK) ON Table1.status = Table2.br_status_code) A
ORDER BY
    [Name], [Description], [Table1ID], [VersionNo], [Status]
    OFFSET ((@Pager_PageNumber - 1) * @Pager_PageSize) ROWS
       FETCH NEXT @Pager_PageSize ROWS ONLY;

SELECT COUNT(*)
FROM
    (SELECT
         CAST(Table1.name AS VARCHAR(MAX)) AS [Name],
         CAST(Table1.description AS VARCHAR(MAX)) AS [Description],
         CAST(CAST(Table1.Table1_ID AS DECIMAL(18,0)) AS VARCHAR(MAX)) AS [Table1ID],
         CAST(CAST(Table1.VERSION_NO AS DECIMAL(18,0)) AS VARCHAR(MAX)) As [VersionNo],
         CAST(Table2.br_status AS VARCHAR(MAX)) AS [Status]
    FROM
        Table1 WITH (NOLOCK)
    INNER JOIN
        (SELECT Table1_id, MAX(version_no) as version_no
         FROM Table1
         WHERE Table1.status = '00002'
         GROUP BY Table1_id) AS BR WITH (NOLOCK) ON Table1.Table1_id = BR.Table1_id
                                                 AND BR.version_no = Table1.version_no
    INNER JOIN
        Table2 WITH (NOLOCK) ON Table1.status = Table2.br_status_code) A;

In SQL Server I get the error near : BR WITH (NOLOCK) that :

Incorrect syntax near the keyword 'WITH'.
    Incorrect syntax near the keyword 'with'. If this statement is a common table expression, an xmlnamespaces clause or a change tracking context clause, the previous statement must be terminated with a semicolon.

But as per my understanding from sources like the syntax is as
SELECT
    first_name, last_name,
FROM
    dbo.person p WITH (NOLOCK)
JOIN
    dbo.employee e WITH (NOLOCK) ON e.person_id = p.person_id
WHERE
    p.person_id = 1;

So, my query looks just about right.
Also, when I remove the WITH (NOLOCK) next to BR WITH (NOLOCK) i.e. my inner join query the query runs fine. Any ideas of what I might be missing??
PS: My DB compatibility level is 110.

A: You apply with (nolock) to tables, not to subqueries.  So, instead of:
(SELECT Table1_id, MAX(version_no) as version_no
 FROM Table1
 where Table1.status='00002'
 GROUP BY Table1_id
) as BR WITH (NOLOCK)

You would write:
(SELECT Table1_id, MAX(version_no) as version_no
 FROM Table1 WITH (NOLOCK)
 where Table1.status='00002'
 GROUP BY Table1_id
) BR

A: Just put
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED

before your query. NOLOCK behavior will be used for all your tables in the query. Using hint NOLOCK just means using READ UNCOMMITTED transaction isolation level for a particular table.

A: The error is where you have WITH (NOLOCK) in the GROUP BY clause, when it should only be in the FROM clause:
 GROUP BY Table1_id) as  BR WITH (NOLOCK)

should be
FROM Table1 WITH (NOLOCK)

This is 3 lines from the bottom of your posted code. It also appears further up.
Your code with corrections (I think I got them all!):
DECLARE @Pager_PageNumber AS INT, @Pager_PageSize AS INT; SET @Pager_PageNumber = 1; SET @Pager_PageSize = 12; SELECT [Name],[Description],[Table1ID],[VersionNo],[Status] FROM(SELECT CAST(Table1.name AS VARCHAR(MAX)) As [Name],CAST(Table1.description AS VARCHAR(MAX)) As [Description],CAST(CAST(Table1.Table1_ID AS DECIMAL(18,0)) AS VARCHAR(MAX)) As
 [Table1ID],CAST(CAST(Table1.VERSION_NO AS DECIMAL(18,0)) AS VARCHAR(MAX)) As [VersionNo],
 CAST(Table2.br_status AS VARCHAR(MAX)) As [Status]  FROM  Table1 WITH (NOLOCK)
  INNER JOIN (SELECT Table1_id, MAX(version_no) as version_no
    FROM Table1 WITH (NOLOCK)
    where Table1.status='00002'
    GROUP BY Table1_id) as BR ON Table1.Table1_id = BR.Table1_id AND BR.version_no=Table1.version_no
    INNER JOIN Table2 WITH (NOLOCK) ON Table1.status = Table2.br_status_code )A
    ORDER BY [Name],[Description],[Table1ID],[VersionNo],[Status] OFFSET ((@Pager_PageNumber - 1) * @Pager_PageSize)
     ROWS FETCH NEXT @Pager_PageSize ROWS ONLY;SELECT COUNT(*) FROM(SELECT CAST(Table1.name AS VARCHAR(MAX)) As
     [Name],CAST(Table1.description AS VARCHAR(MAX)) As [Description],CAST(CAST(Table1.Table1_ID AS DECIMAL(18,0))
     AS VARCHAR(MAX)) As [Table1ID],CAST(CAST(Table1.VERSION_NO AS DECIMAL(18,0)) AS VARCHAR(MAX)) As [VersionNo],
     CAST(Table2.br_status AS VARCHAR(MAX)) As [Status]  FROM  Table1 WITH (NOLOCK)  INNER JOIN
      (SELECT Table1_id, MAX(version_no) as version_no
    FROM Table1 WITH (NOLOCK)
    where Table1.status='00002'
    GROUP BY Table1_id) as  BR
     ON Table1.Table1_id = BR.Table1_id AND BR.version_no=Table1.version_no INNER JOIN Table2
     WITH (NOLOCK) ON Table1.status = Table2.br_status_code )A;

A: Can you not move the WITH (NOLOCK), so it's inside the sub-query?
Essentially, this...
INNER JOIN ( SELECT Table1_id
                                       ,MAX(version_no) AS version_no
                                 FROM   Table1 WITH ( NOLOCK )
                                 WHERE  Table1.status = '00002'
                                 GROUP BY Table1_id
                               ) AS BR

Full code
DECLARE @Pager_PageNumber AS INT
   ,@Pager_PageSize AS INT;
SET @Pager_PageNumber = 1;
SET @Pager_PageSize = 12;
SELECT  [Name]
       ,[Description]
       ,[Table1ID]
       ,[VersionNo]
       ,[Status]
FROM    ( SELECT    CAST(Table1.name AS VARCHAR(MAX)) AS [Name]
                   ,CAST(Table1.description AS VARCHAR(MAX)) AS [Description]
                   ,CAST(CAST(Table1.Table1_ID AS DECIMAL(18, 0)) AS VARCHAR(MAX)) AS [Table1ID]
                   ,CAST(CAST(Table1.VERSION_NO AS DECIMAL(18, 0)) AS VARCHAR(MAX)) AS [VersionNo]
                   ,CAST(Table2.br_status AS VARCHAR(MAX)) AS [Status]
          FROM      Table1 WITH ( NOLOCK )
                    INNER JOIN ( SELECT Table1_id
                                       ,MAX(version_no) AS version_no
                                 FROM   Table1 WITH ( NOLOCK )
                                 WHERE  Table1.status = '00002'
                                 GROUP BY Table1_id
                               ) AS BR ON Table1.Table1_id = BR.Table1_id
                                          AND BR.version_no = Table1.version_no
                    INNER JOIN Table2 WITH ( NOLOCK ) ON Table1.status = Table2.br_status_code
        ) A
ORDER BY [Name]
       ,[Description]
       ,[Table1ID]
       ,[VersionNo]
       ,[Status]
       OFFSET ( ( @Pager_PageNumber - 1 ) * @Pager_PageSize ) ROWS FETCH NEXT @Pager_PageSize
        ROWS ONLY;
SELECT  COUNT(*)
FROM    ( SELECT    CAST(Table1.name AS VARCHAR(MAX)) AS [Name]
                   ,CAST(Table1.description AS VARCHAR(MAX)) AS [Description]
                   ,CAST(CAST(Table1.Table1_ID AS DECIMAL(18, 0)) AS VARCHAR(MAX)) AS [Table1ID]
                   ,CAST(CAST(Table1.VERSION_NO AS DECIMAL(18, 0)) AS VARCHAR(MAX)) AS [VersionNo]
                   ,CAST(Table2.br_status AS VARCHAR(MAX)) AS [Status]
          FROM      Table1 WITH ( NOLOCK )
                    INNER JOIN ( SELECT Table1_id
                                       ,MAX(version_no) AS version_no
                                 FROM   Table1 WITH ( NOLOCK )
                                 WHERE  Table1.status = '00002'
                                 GROUP BY Table1_id
                               ) AS BR ON Table1.Table1_id = BR.Table1_id
                                          AND BR.version_no = Table1.version_no
                    INNER JOIN Table2 WITH ( NOLOCK ) ON Table1.status = Table2.br_status_code
        ) A;

A: DECLARE @Pager_PageNumber AS INT,
        @Pager_PageSize AS INT;

SELECT @Pager_PageNumber = 1, @Pager_PageSize = 12;

SELECT [Name],[Description],[BRMAINID],[VersionNo],[Status]
FROM (
    SELECT
        Table1.name As [Name],
        Table1.[description] As [Description],
        Table1.Table1_ID AS [BRMAINID],
        Table1.VERSION_NO AS [VersionNo],
        Table2.br_status AS [Status]
    FROM dbo.Table1 WITH(NOLOCK)
    JOIN (
        SELECT Table1_id, MAX(version_no) as version_no
        FROM dbo.Table1 WITH(NOLOCK)
        WHERE Table1.[status] = '00002'
        GROUP BY Table1_id
    ) AS BR ON Table1.Table1_id = BR.Table1_id AND BR.version_no=Table1.version_no
    JOIN dbo.Table2 WITH(NOLOCK) ON Table1.status = Table2.br_status_code
) A
ORDER BY [Name], [Description], [BRMAINID], [VersionNo], [Status]
    OFFSET ((@Pager_PageNumber - 1) * @Pager_PageSize)
    ROWS FETCH NEXT @Pager_PageSize ROWS ONLY

SELECT COUNT(*)
FROM dbo.Table1 WITH(NOLOCK)
JOIN (
    SELECT Table1_id, MAX(version_no) as version_no
    FROM dbo.Table1 WITH(NOLOCK)
    where Table1.[status] = '00002'
    GROUP BY Table1_id
) as BR ON Table1.Table1_id = BR.Table1_id AND BR.version_no=Table1.version_no
JOIN dbo.Table2 WITH(NOLOCK) ON Table1.status = Table2.br_status_code

just try...


text:
Q: struts error upon deploying the application on tomcat 5.5 I am getting the below error upon deploying the web application on tomcat 5.5 , Please advise which jar is missing in my class path so that I can add the required jar
SEVERE: Error configuring application listener of class org.apache.struts2.tiles.StrutsTilesListener
java.lang.NoClassDefFoundError: org/apache/tiles/web/startup/TilesListener
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClassCond(Unknown Source)
    at java.lang.ClassLoader.defineClass(Unknown Source)
    at java.security.SecureClassLoader.defineClass(Unknown Source)
    at java.net.URLClassLoader.defineClass(Unknown Source)
    at java.net.URLClassLoader.access$000(Unknown Source)
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)

A: Well a little bit of googling says that the this class is in:
http://repo1.maven.org/maven2/org/apache/tiles/tiles-servlet/2.2.2/tiles-servlet-2.2.2.jar
this jar. If it still not works try googling somethink like: org/apache/tiles/web/startup/TilesListener jar

A: Use findjar.com for such situations where you don't know which jar to add to classpath.
In your case the system is not able to load the definition of TilesListener. So, probably you want to add that class to your classpath. For that the related jar can be found at, http://www.findjar.com/index.x?query=org%2Fapache%2Ftiles%2Fweb%2Fstartup%2FTilesListener
Just click on the [class] link.

A: Add This jar file to library packages if you are using any ide or else set classpath of the class
http://www.jarfinder.com/index.php/java/info/org.apache.struts2.tiles.StrutsTilesListener


text:
Q: Query to get recursive records based on first ID I am trying to get the first spot for a given Lot, and how many other spots were refurbished to that first spot. My table is :
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Spots](
[SpotID] [int] NOT NULL,
[LotID] [int] NULL,
[RefurbedSpotID] [int] NULL,
[datestamp] [datetime] NULL,
 CONSTRAINT [PK_Spots] PRIMARY KEY CLUSTERED
(
    [SpotID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF,
ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO

INSERT [dbo].[Spots] ([SpotID], [LotID], [RefurbedSpotID], [datestamp]) VALUES (178, 5,
NULL, CAST(N'2022-08-30T12:41:50.833' AS DateTime))
GO
INSERT [dbo].[Spots] ([SpotID], [LotID], [RefurbedSpotID], [datestamp]) VALUES (183, 5,
178, CAST(N'2022-08-30T12:42:01.263' AS DateTime))
GO
INSERT [dbo].[Spots] ([SpotID], [LotID], [RefurbedSpotID], [datestamp]) VALUES (193, 5,
183, CAST(N'2022-08-30T12:43:03.527' AS DateTime))
GO
INSERT [dbo].[Spots] ([SpotID], [LotID], [RefurbedSpotID], [datestamp]) VALUES (212, 5,
NULL, CAST(N'2022-08-30T12:43:12.373' AS DateTime))
GO
INSERT [dbo].[Spots] ([SpotID], [LotID], [RefurbedSpotID], [datestamp]) VALUES (213, 5,
193, CAST(N'2022-08-30T12:43:19.023' AS DateTime))
GO
INSERT [dbo].[Spots] ([SpotID], [LotID], [RefurbedSpotID], [datestamp]) VALUES (380, 70,
NULL, CAST(N'2022-08-30T12:43:36.837' AS DateTime))
GO
INSERT [dbo].[Spots] ([SpotID], [LotID], [RefurbedSpotID], [datestamp]) VALUES (381, 70,
380, CAST(N'2022-08-30T12:43:43.637' AS DateTime))
GO
INSERT [dbo].[Spots] ([SpotID], [LotID], [RefurbedSpotID], [datestamp]) VALUES (382, 70,
NULL, CAST(N'2022-08-30T12:43:54.780' AS DateTime))
GO
INSERT [dbo].[Spots] ([SpotID], [LotID], [RefurbedSpotID], [datestamp]) VALUES (383, 70,
381, CAST(N'2022-08-30T12:44:06.390' AS DateTime))
GO
INSERT [dbo].[Spots] ([SpotID], [LotID], [RefurbedSpotID], [datestamp]) VALUES (384, 70,
383, CAST(N'2022-08-30T12:44:13.800' AS DateTime))
GO
INSERT [dbo].[Spots] ([SpotID], [LotID], [RefurbedSpotID], [datestamp]) VALUES (385, 71,
NULL, CAST(N'2022-08-30T12:46:17.660' AS DateTime))
GO
INSERT [dbo].[Spots] ([SpotID], [LotID], [RefurbedSpotID], [datestamp]) VALUES (389, 70,
NULL, CAST(N'2022-08-30T12:44:17.070' AS DateTime))
GO
INSERT [dbo].[Spots] ([SpotID], [LotID], [RefurbedSpotID], [datestamp]) VALUES (398, 71,
NULL, CAST(N'2022-08-30T12:46:26.670' AS DateTime))
GO
INSERT [dbo].[Spots] ([SpotID], [LotID], [RefurbedSpotID], [datestamp]) VALUES (465,
101, NULL, CAST(N'2022-08-30T12:46:44.450' AS DateTime))
GO
INSERT [dbo].[Spots] ([SpotID], [LotID], [RefurbedSpotID], [datestamp]) VALUES (491,
118, NULL, CAST(N'2022-08-30T12:48:32.380' AS DateTime))
GO
INSERT [dbo].[Spots] ([SpotID], [LotID], [RefurbedSpotID], [datestamp]) VALUES (1496,
 118, 491, CAST(N'2022-08-30T12:48:38.497' AS DateTime))
GO
INSERT [dbo].[Spots] ([SpotID], [LotID], [RefurbedSpotID], [datestamp]) VALUES (1497,
118, NULL, CAST(N'2022-08-30T12:48:42.617' AS DateTime))
GO
INSERT [dbo].[Spots] ([SpotID], [LotID], [RefurbedSpotID], [datestamp]) VALUES (1498,
118, 1496, CAST(N'2022-08-30T12:48:49.290' AS DateTime))
GO
 INSERT [dbo].[Spots] ([SpotID], [LotID], [RefurbedSpotID], [datestamp]) VALUES (1633,
70, 382, CAST(N'2022-08-30T12:44:24.183' AS DateTime))
GO
ALTER TABLE [dbo].[Spots] ADD  CONSTRAINT [DF_Spots_datestamp]  DEFAULT (getdate()) FOR
[datestamp]
gO

This is the expected result. First SpotIDs are in brackets.
for LotID : 5
213, 193, 183,  [ 178 ]

for LotID : 70      x
384, 383, 381, [ 380 ]

for LotID : 71      x
[ 385 ]

for LotID : 101     x
[ 465 ]

for LotID : 118
1498, 1496,  [ 491 ]

What I tried was :
select *
from (
    select s2.spotID, s2.lotID , s2.RefurbedSpotID
    from spots s2
    where s2.lotID = @lotID
    and s2.RefurbedSpotID is not null

    union

    select s1.spotID, s1.lotID, s1.RefurbedSpotID
    from spots s1
    inner join ( select s2.spotID as s2_SpotID, s2.lotID as s2_lotID, s2.RefurbedSpotID
as s2_RefurbedSpotID
                 from spots s2
                 where s2.lotID = @lotID ) s3 on s2_RefurbedSpotID = s1.spotID
    where s1.lotID = @lotID
    ) q
 order by spotID

However, I don't get the correct  results for LotIDs 70, 71, and 101. Any suggestions?

A: You then need a recursive CTE for this. Start with the first row for each LotId and calculate a Level column along with the recursion.
Then you simply aggregate using STRING_AGG with a WITHIN GROUP (ORDER BY clause
WITH cte AS (
    SELECT
      s.SpotID,
      s.LotID,
      SpotIdString = CAST(CONCAT('[ ', s.SpotId, ' ]') AS varchar(30)),
      Level = 1
    FROM (
        SELECT *,
          rn = ROW_NUMBER() OVER (PARTITION BY s.LotID ORDER BY s.datestamp)
        FROM Spots s
    ) s
    WHERE s.rn = 1

    UNION ALL

    SELECT
      s.SpotID,
      s.LotID,
      SpotIdString = CAST(s.SpotId AS varchar(30)),
      Level = cte.Level + 1
    FROM cte
    JOIN Spots s ON s.RefurbedSpotID = cte.SpotID AND s.LotID = cte.LotID
)
SELECT
  cte.LotID,
  STRING_AGG(SpotIdString, ', ') WITHIN GROUP (ORDER BY cte.Level DESC)
FROM cte
GROUP BY
  cte.LotID;

Another option is to calculate the string during the recursion, and then just filter to the last one of the recursion using ROW_NUMBER
WITH cte AS (
    SELECT
      s.SpotID,
      s.LotID,
      SpotIdString = CAST(CONCAT('[ ', s.SpotId, ' ]') AS varchar(4000)),
      Level = 1
    FROM (
        SELECT *,
          rn = ROW_NUMBER() OVER (PARTITION BY s.LotID ORDER BY s.datestamp)
        FROM Spots s
    ) s
    WHERE s.rn = 1

    UNION ALL

    SELECT
      s.SpotID,
      s.LotID,
      SpotIdString = CAST(CONCAT(s.SpotID, ', ', cte.SpotIdString) AS varchar(4000)),
      Level = cte.Level + 1
    FROM cte
    JOIN Spots s ON s.RefurbedSpotID = cte.SpotID AND s.LotID = cte.LotID
)
SELECT
  cte.LotID,
  cte.SpotIdString
FROM (
    SELECT *,
      rn = ROW_NUMBER() OVER (PARTITION BY cte.LotID ORDER BY cte.Level DESC)
    FROM cte
) cte
WHERE cte.rn = 1;

db<>fiddle


text:
Q: How do I resize a text box by dragging with mouse? I am using web application.I have used C#,SQL,ASP.NET.I want resize textbox by dragging it so user can enter text.How to do that?.I don't have any idea about it.

A: You can use jqueryUI Resizable plugin


text:
Q: UICollectionView: Assertion failure in -[UICollectionView _endItemAnimations] I'm getting this error in my app:
*** Assertion failure in -[UICollectionView _endItemAnimations], /SourceCache/UIKit/UIKit-2372/UICollectionView.m:2801
It happens in my -controllerDidChangeContent: method on this line:
[self.collectionView performBatchUpdates:^{...}];

Does anyone know what causes this? My code is closely based off of https://gist.github.com/4440c1cba83318e276bb and I'm at a loss.
Thanks!

A: These types of assertions get thrown as exceptions.  Wrap the batch updates in a try/catch and dump the exception description.  It will tell you exactly what it doesn't like about your call.
In other words:
    @try
    {
        [self.collectionView performBatchUpdates:^{...}];
    }
    @catch (NSException *except)
    {
        NSLog(@"DEBUG: failure to batch update.  %@", except.description);
    }

A: I bet it's because of that your
-controllerDidChangeContent

is being called in background thread multiple times, and performBatchUpdates is still working when another thread calls it, so it leads to incorrect behavior.
Solution - try to wrap it in @synchronized or using NSLocks

A: The issue was not setting the FRC delegate to nil on view didDisappear.


text:
Q: Uma trigger pode "anular/desfazer" a ação que a dispara? Cenário exemplo
Tenho uma tabela telefones onde tenho uma trigger que é disparada ao realizar a instrução insert.

Dúvida

*

*Posso usar a trigger para verificar uma condição e diante do retorno, "cancelar" a ação na tabela que a disparou?

*Teria como definir a mensagem de "atenção/erro" que o SQL irá retornar?

(Um exemplo seria extremamente importante)

A: Pela descrição que você deu o ideal seria utilizar uma trigger do tipo instead of:
ALTER TRIGGER tr_tabela ON tabela
INSTEAD OF INSERT AS
BEGIN
    SET NOCOUNT ON;

    IF -- Sua condição para o erro aqui
    BEGIN
        RAISERROR('Mensagem de erro.', 16, 1);
    END
    ELSE -- Insere
    BEGIN
        INSERT tabela
        SELECT i.*
          FROM inserted i;
    END;
END;
GO

No caso do exemplo não executável acima a inserção somente será realizada na tabela caso a condição do IF não seja satisfeita.

INSTEAD OF
Especifica que o gatilho DML será executado em vez da instrução SQL de gatilho, substituindo as ações das instruções de gatilho. INSTEAD OF não pode ser especificado para gatilhos DDL ou de logon.
No máximo, um gatilho INSTEAD OF por instrução INSERT, UPDATE ou DELETE pode ser definido em uma tabela ou exibição. Entretanto, você pode definir exibições sobre exibições, onde cada uma tem seu próprio gatilho INSTEAD OF.
Os gatilhos INSTEAD OF não são permitidos em exibições atualizáveis que usam WITH CHECK OPTION. O SQL Server gera um erro quando um gatilho INSTEAD OF é adicionado a uma WITH CHECK OPTION de exibição atualizável especificado. O usuário deve remover essa opção usando ALTER VIEW antes de definir o gatilho INSTEAD OF.


text:
Q: Trigger click on a tag when pressing fake read more button Structure is as following:
div
  h1
    a
  p
  .more-info

When I click on .more-info div I need to simulate a click on the 'a'.
 $(".more-info").click(function() {
   $(this).parent().find('h1').find('a').get(0).trigger('click');
 })

This gives following error:
$(...).parent(...).find(...).find(...).get(...).trigger is not a function

Output of
 console.log($(this).parent().find('h1').find('a').get(0))

is the correct element I need to click.
I've tried without .get(0) and get following when I log that
 [a, prevObject: jQuery.fn.init(1), context: p.more-info, selector: "h1 a"]

A: .get(0) returns the DOM element within the jQuery object, but .trigger() is a jQuery function, so it needs to operate on the jQuery object.
But if you're trying to emulate the browser's built-in action when clicking on a link, .trigger() won't do it. You need to call the DOM element's .click() method.
 $(".more-info").click(function() {
   $(this).parent().find('h1').find('a').get(0).click();
 });

See How to trigger a click on a link using jQuery

A: You could use the element's .click() method, but I would recommend putting a link on the more-info element itself.
Anyhow, this should work:
$(this).parent().find('h1 > a').get(0).click();
Check out the fiddle here:
https://jsfiddle.net/Lpyctuga/4/


text:
Q: Is it possible to return a child node and a parent node with JSON PATH in the same queries in javascript Suppose that we have this JSON:
{
  "table" :
    [
        {
            "A": "A1",
            "B":
            {
                "BA":"BA1",
                "BB":"BB1"
            }
        },
        {
            "A": "A2",
            "B":
            {
                "BA":"BA2",
                "BB":"BB2"
            }
        }
    ]
}

With ONLY ONE query I want to return a set of data composed by 2 type of data: "A" and "BA". For example I can make a request : $.table[<filter>].[A,B.BA]  it doesn't work, but it's the idea. I want to return the value of the parent A and the child BA in ONLY one query. Firstly is it possible and secondly if yes, how ?

A: It seem that's impossible to retrieve precisely multiple attribute from a JSON Path request. But in certain case, we can do it... But these case are rare and it's risky to use this type of request.
SO there is another way to query JSON objet: JMESPATH. It's FAR better and simplier, and most importantly it solve the problem of retrieving multiple attribute, for my problem the syntax would be: table[<filter>].[A,B.BA] (as I wanted in the initial post). Here's some links:
 - install it: npm page
 - tutorial/official website: website


text:
Q: How can I prioritize one rsync process over another? I have two separate cronjobs running on a Red Hat instance. Both are copying log files from a remote server to the instance via rsync. The first cronjob runs rsync-new.sh, which copies any new log files (from today or yesterday) from various directories on the server. The second cronjob runs rsync-backfill.sh, which copies any log files older than yesterday. I separated the rsync processes so that the new files will always be copied quickly, and a large backfill job won't interfere with the copying of new files.
This generally works, except for the following case: if rsync-backfill.sh is already copying the old files from a folder, the rsync-new.sh won't copy its files until after rsync-backfill.sh has finished with the folder.
Is there any way to prioritize the rsync command from rsync-new.sh over the rsync command from rsync-backfill.sh? Or to at least let the rsync commands run in parallel so that the new files are always copied quickly?
Here's the general script structure:
rsync-new.sh
for SUBDIR in $(ls $SOURCEDIR)
do
  rsyc -zt \
    --exclude-from=$TRACKERFILE \
    --out-format="%n" \
    $SOURCEDIR/$SUBDIR/log-$TODAY*.log $DESTDIR/ | tee -a $TRACKERFILE
done

for SUBDIR in $(ls $SOURCEDIR)
do
  rsyc -zt \
    --exclude-from=$TRACKERFILE \
    --out-format="%n" \
    $SOURCEDIR/$SUBDIR/log-$YESTERDAY*.log $DESTDIR/ | tee -a $TRACKERFILE
done

rsync-backfill.sh
for SUBDIR in $(ls $SOURCEDIR)
do
  rsyc -zt \
    --exclude-from=$TRACKERFILE \
    --exclude="log-$TODAY*.log" \
    --exclude="log-$YESTERDAY*.log" \
    --out-format="%n" \
    $SOURCEDIR/$SUBDIR/log-*.log $DESTDIR/ | tee -a $TRACKERFILE
done

A: This is a non-issue, turns out it was just a coincidence that the new log files for one of the directories weren't syncing until after the backfill was complete (the new log files just happened to be much larger than the backfill files).
Cron runs jobs in isolated environments, so the rsync processes weren't interacting with each other.


text:
Q: fixed header goes under an element My fixed header goes under the article tag with class "huge-box" see the image i can't really figured out what is the problem... i tried reconstructing the html but it still do the same thing..
Here's the css of that header
.navs {
    position: fixed;
    margin-top: 30px;
    width: 100%;
    background-color: #FFFFFF;
    max-height: 50px;
    height: 50px;
}

*{
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    -o-box-sizing:border-box;
}

a{
    text-decoration: none;
}
body{
    background-color: #F5F5F5;
    font-family: 'Maquette-regular', sans-serif;
}
ul{
    padding: 10px;
}
.header{
    background-color: #131313;
    max-height: 32px;
    display: block;
    font-size: 13px;

}

.header:after { content: ""; clear: both; display: block; }

.item{
    display: inline-block;
    color: rgba(255,255,255,.6);
    margin-left: 15px;
}

.item:hover{
    color: silver;
    cursor: pointer;
}

.right-nav{
    float: right;

}

.left-nav{
    float: left;

}

.item-list{

}

.navs{
    position: fixed;
    margin-top: 30px;
    width: 100%;
    background-color: #FFFFFF;
    max-height: 50px;
    height: 50px;
}

.categories{
    color: silver;
    display: inline-block;
 /* line-height: 4em; */
    margin: 20;
    font-size: 15px;
}

.categories:hover{
    color: #000000;
    cursor: pointer;
}
.fa{
    color: silver;
    padding: 5px;
    font-size: 20px;
}

.social-btn .fa:hover{
    color: #808080;
    cursor: pointer;
}
.fa-search{
    border-left: 1px solid #EEEEEE;
}

.social-btn{
    float: right;
    padding: 10px;
}

.cover-img{
    background: linear-gradient(160deg, rgba(191, 0, 71, 0.9) 0%, transparent 50%), linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, transparent 100%), url(https://cdn2.tnwcdn.com/wp-content/blogs.dir/1/files/2017/06/Screen-Shot-2017-06-27-at-16.59.59-796x462.png) no-repeat;
    background-size: cover;
    width: 100%;
    height: 100%;
    position: relative;
}

.articles-box{
    outline: 1px solid;
    height: 75vh;
    max-height: 560px;
    margin-top: 55px;
}

.huge-box{
    background-color: grey;
    width: 66.66666%;
    height:  90%;
    margin: 10px;
}

.tnw-logo{
    background: url(../images/logo.svg) no-repeat;
    background-size: contain;
    left: 24px;
    top: 105px;
    max-width: 50%;
    height: 100%;
    max-height: 112px;
    line-height: 1;
    pointer-events: none;
    text-align: right;
    position: absolute;
    color: #FFF;
    z-index: 5;
    right: 24px;
}

.article-date{
    position: absolute;
    color: #fff;
    top: 110px;
    left: 620px;
    font-size: 15px;
}

.article-about{
    position: relative;
    margin-top: -250px;
    width: 100%;
    padding: 15px;
}
.article-info{
    color: #fff;
    position: relative;
    margin: 0px 15px 0px;

}
.article-category{
    text-decoration: none;
    color: #fff;
    font-size: 20px;

}

#article-author{
    font-size: 14px;
    color: silver;
}

#article-author a{
    text-decoration: none;
    color: rgba(255,255,255,.6);
    font-size: 12px;
}

#article-author a:hover{
    color: silver;
}
.article-info .fa-clock-o, .article-info .fa-share-alt{
    font-size: 12px;
    color: rgba(255,255,255,.6);
}

.article-title{
    color: #fff;
    font-size: 55px;
    font-weight: 700;
}

.cover-img-small{
    background: linear-gradient(550deg, rgb(0, 0, 0) 0%, transparent 50%), linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0.09) 100%), url("https://cdn2.tnwcdn.com/wp-content/blogs.dir/1/files/2017/06/galaxy-note7_design-phone2-796x437.png") no-repeat;
    background-size: cover;
    width: 100%;
    height: 100%;
}

.cover-img-small-2{
    background: linear-gradient(550deg, rgb(72, 62, 13) 0%, transparent 50%), linear-gradient(to top, rgba(163, 175, 67, 0.9) 0%, rgba(0, 0, 0, 0.09) 100%), url(https://cdn2.tnwcdn.com/wp-content/blogs.dir/1/files/2017/06/Ransomware-Locked-PC-Computer-Security-796x398.jpg) no-repeat;    background-size: cover;
    width: 100%;
    height: 100%;
}

.small-box{
    width: 31.3333%;
    height: 45%;
    /* outline: 1px solid red; */
    float: right;
    margin: -484px 8px 0px 0px;
}

.small-box-2{
    width: 31.3333%;
    height: 45%;
    /* outline: 1px solid red; */
    float: right;
    margin: -246px 8px 0px 0px;
}

.article-category-small, .article-category-small-2{
    text-decoration: none;
    color: #fff;

}

.article-about-small{
    margin-top: -200px;
    padding: 25px;
}

.article-about-small-2{
    padding: 25px;
    margin-top: -195px;
}

.article-title-small, .article-title-small-2{
    font-size: 30px;
    color: #fff;
}

.article-info-small{
    margin-top: -25px;
    margin-left: 25px;
}

.article-info-small-2{
    margin-left: 25px;
    margin-top: -25px;
}

#article-author-small, #article-author-small-2{
    color: silver;
}

#article-author-small a, #article-author-small-2 a{
    color: silver;
    font-size: 12px;
}

.article-info-small .fa-clock-o, .article-info-small .fa-share-alt , .article-info-small-2 .fa-clock-o, .article-info-small-2 .fa-share-alt{
    font-size: 12px;
    color: rgba(255,255,255,.6);
}

.adbar{
    max-height: 95px;
    max-width: 550px;
    height: 100%;
    width: 100%;
    background-color: #5a4646;
}

#adspace{
    display: block;
    margin: 0px 250px 0px 250px;
}

.article{
    background-color: grey;
    width: 250px;
    height: 150px;
    display: inline-block;
    /* margin: 15px; */
    margin-top: 35px;
    margin-left: 15px;
}

.related-articles{
    margin-left: 50px;
    padding: 15px;
}

.latest-news-link{
    color:#F42;
    font-size: 24px;
    text-decoration: none;
}

.article-1-title{
    margin-top: 165px;
}

.articles-info{
    margin-top: 10px;
}

#author, #post-time{
    color: #AAAAAA;
    font-size: 12px;
}

/* Media Queries */

@media only screen and (min-width: 320px) {
    body:after {
        content: "320 to 480px";
        background-color: hsla(90,60%,40%,0.7);
    }
}
@media only screen and (min-width: 480px) {
    body:after {
        content: "480 to 768px";
        background-color: hsla(180,60%,40%,0.7);
    }
}
@media only screen and (min-width: 768px) {
    body:after {
        content: "768 to 1024px";
        background-color: hsla(270,60%,40%,0.7);
    }
}
@media only screen and (min-width: 1024px) {
    body:after {
        content: "1024 and up";
        background-color: hsla(360,60%,40%,0.7);
    }
}
@media only screen and (max-width: 767px) {
    .item-list {
        display: none;
    }
}

<meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title> The Next Web | International </title>
    <link rel="stylesheet" href="./css/reset.css">
    <link rel="stylesheet" href="./css/font-awesome/css/font-awesome.min.css">
    <link rel="stylesheet" href="./css/main.css">

 News

 Conference

 Index

 TQ

 Deals

 Answers

 Tech5

 About

 Team

 Advertise

 Jobs

 Contact

CATEGORIES

Wednesday — June 28, 2017

TECH

Massive ransomware attack is causing chaos in airports, banks and more worldwide

 by  MIX
 17 hours ago
 1B+

GEAR

Samsung is bringing back its Galaxy Note 7 for fans who aren't afraid of exploding phones

 by  Abhimanyu Ghoshal
 6 hours ago
 1B+

SECURITY

Petya ransomware victims can't get their files back even if they pay up

 by  Abhimanyu Ghoshal
 7 hours ago
 1B+

Latest news >

Tinder Gold lets you see who likes you without matching

 Rachel Kaser
 3 hours ago

Tinder Gold lets you see who likes you without matching

 Rachel Kaser
 3 hours ago

Tinder Gold lets you see who likes you without matching

 Rachel Kaser
 3 hours ago

Tinder Gold lets you see who likes you without matching

 Rachel Kaser
 3 hours ago

Tinder Gold lets you see who likes you without matching

 Rachel Kaser
 3 hours ago

Tinder Gold lets you see who likes you without matching

 Rachel Kaser
 3 hours ago

Tinder Gold lets you see who likes you without matching

 Rachel Kaser
 3 hours ago

Tinder Gold lets you see who likes you without matching

 Rachel Kaser
 3 hours ago

Latest funding rounds on Index.co

A: Added z-index value in .navs class
Read more here
.navs{
    position: fixed;
    margin-top: 30px;
    width: 100%;
    background-color: #FFFFFF;
    max-height: 50px;
    height: 50px;
    z-index: 1; /* <-- here */
}

*{
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    -o-box-sizing:border-box;
}

a{
    text-decoration: none;
}
body{
    background-color: #F5F5F5;
    font-family: 'Maquette-regular', sans-serif;
}
ul{
    padding: 10px;
}
.header{
    background-color: #131313;
    max-height: 32px;
    display: block;
    font-size: 13px;

}

.header:after { content: ""; clear: both; display: block; }

.item{
    display: inline-block;
    color: rgba(255,255,255,.6);
    margin-left: 15px;
}

.item:hover{
    color: silver;
    cursor: pointer;
}

.right-nav{
    float: right;

}

.left-nav{
    float: left;

}

.item-list{

}

.navs{
    position: fixed;
    margin-top: 30px;
    width: 100%;
    background-color: #FFFFFF;
    max-height: 50px;
    height: 50px;
    z-index: 1;
}

.categories{
    color: silver;
    display: inline-block;
 /* line-height: 4em; */
    margin: 20;
    font-size: 15px;
}

.categories:hover{
    color: #000000;
    cursor: pointer;
}
.fa{
    color: silver;
    padding: 5px;
    font-size: 20px;
}

.social-btn .fa:hover{
    color: #808080;
    cursor: pointer;
}
.fa-search{
    border-left: 1px solid #EEEEEE;
}

.social-btn{
    float: right;
    padding: 10px;
}

.cover-img{
    background: linear-gradient(160deg, rgba(191, 0, 71, 0.9) 0%, transparent 50%), linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, transparent 100%), url(https://cdn2.tnwcdn.com/wp-content/blogs.dir/1/files/2017/06/Screen-Shot-2017-06-27-at-16.59.59-796x462.png) no-repeat;
    background-size: cover;
    width: 100%;
    height: 100%;
    position: relative;
}

.articles-box{
    outline: 1px solid;
    height: 75vh;
    max-height: 560px;
    margin-top: 55px;
}

.huge-box{
    background-color: grey;
    width: 66.66666%;
    height:  90%;
    margin: 10px;
}

.tnw-logo{
    background: url(../images/logo.svg) no-repeat;
    background-size: contain;
    left: 24px;
    top: 105px;
    max-width: 50%;
    height: 100%;
    max-height: 112px;
    line-height: 1;
    pointer-events: none;
    text-align: right;
    position: absolute;
    color: #FFF;
    z-index: 5;
    right: 24px;
}

.article-date{
    position: absolute;
    color: #fff;
    top: 110px;
    left: 620px;
    font-size: 15px;
}

.article-about{
    position: relative;
    margin-top: -250px;
    width: 100%;
    padding: 15px;
}
.article-info{
    color: #fff;
    position: relative;
    margin: 0px 15px 0px;

}
.article-category{
    text-decoration: none;
    color: #fff;
    font-size: 20px;

}

#article-author{
    font-size: 14px;
    color: silver;
}

#article-author a{
    text-decoration: none;
    color: rgba(255,255,255,.6);
    font-size: 12px;
}

#article-author a:hover{
    color: silver;
}
.article-info .fa-clock-o, .article-info .fa-share-alt{
    font-size: 12px;
    color: rgba(255,255,255,.6);
}

.article-title{
    color: #fff;
    font-size: 55px;
    font-weight: 700;
}

.cover-img-small{
    background: linear-gradient(550deg, rgb(0, 0, 0) 0%, transparent 50%), linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0.09) 100%), url("https://cdn2.tnwcdn.com/wp-content/blogs.dir/1/files/2017/06/galaxy-note7_design-phone2-796x437.png") no-repeat;
    background-size: cover;
    width: 100%;
    height: 100%;
}

.cover-img-small-2{
    background: linear-gradient(550deg, rgb(72, 62, 13) 0%, transparent 50%), linear-gradient(to top, rgba(163, 175, 67, 0.9) 0%, rgba(0, 0, 0, 0.09) 100%), url(https://cdn2.tnwcdn.com/wp-content/blogs.dir/1/files/2017/06/Ransomware-Locked-PC-Computer-Security-796x398.jpg) no-repeat;    background-size: cover;
    width: 100%;
    height: 100%;
}

.small-box{
    width: 31.3333%;
    height: 45%;
    /* outline: 1px solid red; */
    float: right;
    margin: -484px 8px 0px 0px;
}

.small-box-2{
    width: 31.3333%;
    height: 45%;
    /* outline: 1px solid red; */
    float: right;
    margin: -246px 8px 0px 0px;
}

.article-category-small, .article-category-small-2{
    text-decoration: none;
    color: #fff;

}

.article-about-small{
    margin-top: -200px;
    padding: 25px;
}

.article-about-small-2{
    padding: 25px;
    margin-top: -195px;
}

.article-title-small, .article-title-small-2{
    font-size: 30px;
    color: #fff;
}

.article-info-small{
    margin-top: -25px;
    margin-left: 25px;
}

.article-info-small-2{
    margin-left: 25px;
    margin-top: -25px;
}

#article-author-small, #article-author-small-2{
    color: silver;
}

#article-author-small a, #article-author-small-2 a{
    color: silver;
    font-size: 12px;
}

.article-info-small .fa-clock-o, .article-info-small .fa-share-alt , .article-info-small-2 .fa-clock-o, .article-info-small-2 .fa-share-alt{
    font-size: 12px;
    color: rgba(255,255,255,.6);
}

.adbar{
    max-height: 95px;
    max-width: 550px;
    height: 100%;
    width: 100%;
    background-color: #5a4646;
}

#adspace{
    display: block;
    margin: 0px 250px 0px 250px;
}

.article{
    background-color: grey;
    width: 250px;
    height: 150px;
    display: inline-block;
    /* margin: 15px; */
    margin-top: 35px;
    margin-left: 15px;
}

.related-articles{
    margin-left: 50px;
    padding: 15px;
}

.latest-news-link{
    color:#F42;
    font-size: 24px;
    text-decoration: none;
}

.article-1-title{
    margin-top: 165px;
}

.articles-info{
    margin-top: 10px;
}

#author, #post-time{
    color: #AAAAAA;
    font-size: 12px;
}

/* Media Queries */

@media only screen and (min-width: 320px) {
    body:after {
        content: "320 to 480px";
        background-color: hsla(90,60%,40%,0.7);
    }
}
@media only screen and (min-width: 480px) {
    body:after {
        content: "480 to 768px";
        background-color: hsla(180,60%,40%,0.7);
    }
}
@media only screen and (min-width: 768px) {
    body:after {
        content: "768 to 1024px";
        background-color: hsla(270,60%,40%,0.7);
    }
}
@media only screen and (min-width: 1024px) {
    body:after {
        content: "1024 and up";
        background-color: hsla(360,60%,40%,0.7);
    }
}
@media only screen and (max-width: 767px) {
    .item-list {
        display: none;
    }
}

<meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title> The Next Web | International </title>
    <link rel="stylesheet" href="./css/reset.css">
    <link rel="stylesheet" href="./css/font-awesome/css/font-awesome.min.css">
    <link rel="stylesheet" href="./css/main.css">

 News

 Conference

 Index

 TQ

 Deals

 Answers

 Tech5

 About

 Team

 Advertise

 Jobs

 Contact

CATEGORIES

Wednesday — June 28, 2017

TECH

Massive ransomware attack is causing chaos in airports, banks and more worldwide

 by  MIX
 17 hours ago
 1B+

GEAR

Samsung is bringing back its Galaxy Note 7 for fans who aren't afraid of exploding phones

 by  Abhimanyu Ghoshal
 6 hours ago
 1B+

SECURITY

Petya ransomware victims can't get their files back even if they pay up

 by  Abhimanyu Ghoshal
 7 hours ago
 1B+

Latest news >

Tinder Gold lets you see who likes you without matching

 Rachel Kaser
 3 hours ago

Tinder Gold lets you see who likes you without matching

 Rachel Kaser
 3 hours ago

Tinder Gold lets you see who likes you without matching

 Rachel Kaser
 3 hours ago

Tinder Gold lets you see who likes you without matching

 Rachel Kaser
 3 hours ago

Tinder Gold lets you see who likes you without matching

 Rachel Kaser
 3 hours ago

Tinder Gold lets you see who likes you without matching

 Rachel Kaser
 3 hours ago

Tinder Gold lets you see who likes you without matching

 Rachel Kaser
 3 hours ago

Tinder Gold lets you see who likes you without matching

 Rachel Kaser
 3 hours ago

Latest funding rounds on Index.co

A: use z-index:99 in css
for more details visit https://www.w3schools.com/cssref/pr_pos_z-index.asp


text:
Q: AWS S3 Bucket: What is TagStorage-TagHrs Our AWS S3 bucket has 10,000 images, and each image had 5 tags, so in total, we had 50,000 tags and we were getting charged for that.
From the AWS documentation, it says that:
region-TagStorage-TagHrs: The total of tags on all objects in the bucket reported by hour

Now, we want to cut the costs, and hence we deleted all 5 tags across each image, but still, we see that charges are getting applied. Does anyone know how to understand these charges?

A: The billing suggests that there are more objects with tags.
I couldn't find a way to easily list all objects with tags, so here's a Python script that will iterate through all buckets and objects in a region:
import boto3

REGION = 'ap-southeast-2'

s3_resource = boto3.resource('s3', region_name = REGION)
s3_client = boto3.client('s3', region_name = REGION)

for bucket in s3_resource.buckets.all():
    print(bucket.name)
    for object in bucket.objects.all():
        response = s3_client.get_object_tagging(Bucket = bucket.name, Key = object.key)
        for tag in response['TagSet']:
            print('Tag found: ', tag['Key'], tag['Value'])s3


text:
Q: How to manually start Docker after shutting down wsl I ran the wsl --shutdown command to stop vemmem from consuming too much RAM

wsl --shutdown

Immediately after doing so windows notified me that Docker Desktop wsl 2 had stopped unexpectedly and there was a restart option, if I click on the restart option the Docker Daemon starts up again.
However if I close Docker Desktop and reopen it the daemon stays closed.
Running wsl on the command line starts up vemmem but it seems that the Daemon remains off.

wsl

What do I need to do to manually simulate the restart option that windows provides after shutting down wsl?


text:
Q: How do I stop IE8 session sharing? I'd like to stop IE8 from sharing my sessions in one of two ways (or both if possible):

*

*Through configuring the browser to always do this (so I can force my users to configure their browsers in this way).

*Through code in my web application.
Thanks.

A: Instead of storing data in the session directly, create a custom tab-level session upon demand and store everything there.  When a new request for any page comes in, create a Dictionary<string, object> to use as the tab-level session and then store it in the session based on a unique key.  Pass this unique key from page to page either in the viewstate or url.
However, you need to prevent users from opening links in a new tab (which will make them mad, so this really isn't a good thing to do anyways).  To do that make sure all links are postbacks only.