text:
Q: Alternative for 'delay' term in case count - not time - does matter Let's say Bob asks Alice a question. If Alice does not answer the question Bob is posing now, but the question he posed earlier - how is this delay expressed?
Both the words 'lag' and 'delay' seem inappropriate here, as they are much more specific about time, and not about the time when the question was asked.

A: If, for example, you're talking about a series of texts in which you respond to someone's first text, even though new texts have come in, and then you respond to the next text, even as the other person responds to your first text, well ...  I don't think there is a name for it because it's so ubiquitous that it's normal.  Example:

Alex: Hey, are you coming over to watch the game tonight?
  Alex: By the way John says he can't make it, he's got the kids.
  Alex: Oh and grab a six-pack on your way?  I'm low.
  Brad: I'll be there, but probably late.  Who else is coming?
  Alex: OK, that's fine, kickoff is at 6pm
  Brad: Sorry about John, but family ya?  What kind of beer?
  Alex: Sam and Rick said they'd come by.
  Brad: Oh man Rick?
  Brad: Dude is gonna talk the whole game.
  Alex: Whatever.
  Brad: Whatever?
  Alex: Whatever kind of beer you want.
  Alex: Yeah about Rick but Sam is bringing him so what ya gonna do?
  Brad: K see you later on.

I'd call this a disjointed conversation, in which the questions and responses are out of whack but nevertheless comprehensible.
Skewed is also possible, or jumbled, or discontinuous, in which questions and answers are flying all over the place.
A technical person might call it an asynchronous conversation (as FumbleFingers suggested) which is accurate, but I don't think that would be meaningful to the average person.
However I would not call it confused or incoherent (or many of the other synonyms of disjointed) because the participants mostly understand each other even though the responses don't match up with the previous texts.
(Edit) More formally we could define this as a lag between query and response, which you could call a delay of some number of conversational cycles.  Anyone familiar with these terms (and how they relate to asynchronous communication) would easily understand what you mean.


text:
Q: Error in Easyapache 4 provision with php-cli I migrated from EasyApache 3 to EasyApache 4 using the migration tool in my shell. Right now, in the WHM, I'm setting the provision but I got an error with php-cli that says
Error: Transaction Check Error:
  file /usr/bin/php from install of ea-php-cli-0.2.0-1.1.1.cpanel.x86_64 conflicts with file from package php70w-cli-7.0.15-1.w6.x86_64

How can I solve this? I'm searching a lot of pages but couldn't find an answer

A: You could try to remove that package php70w-cli-7.0.15-1.w6.x86_64 since that's not an EA4 package (yum erase php70w-cli-7.0.15-1.w6.x86_64)
Do a rpm -qa | grep php and see what php packages are actually installed on the server.
Are you sure that the migration completed succesfully? Did you use the migration script from a ssh console?
This should be run first, then you can access EasyApache4 from WHM
/scripts/migrate_ea3_to_ea4

redpajama_set_name: RedPajamaStackExchange


text:
Q: Advantages of Restlet as a standalone application? It is quite easy to configure restlet to run as a standalone java application.
However I am wondering what the advantages are as opposed to deploying into a container like tomcat or jetty?
The main issue I have is one of stability and availability: a container is usually run as a service that is monitored by the OS and for example restarted on boot etc. For a standalone application I would have to create monitoring and startup services myself.
Are there specific use-cases in which a standalone application would be better?

A: The first thing I can think of is that a standalone application is more lightweight and needs somewhat less configuration.
Secondly I found it very useful when testing, because it is easy to start up within a junit environment.


text:
Q: Is there a way to schedule tasks in windows specifying a specific time zone? I need to schedule several tasks to run, where each needs to run at a specific local time in a different city.  For example, one job might need to run at 19:00 New York City, and another needs to run at 08:00 Berlin.
The problem is not only does daylight savings change the UTC time these jobs will run, but different cities adjust their clocks on different days, so the offset between different cities is also constantly changing.
Is there any way to do this in Windows without writing custom scripts?  Is there any commercial software package that can handle this?

A: This answer indicates Windows Task Scheduler 'New Trigger' window has a checkbox Synchronize across time zones. When it's checked:

the task is scheduled by UTC only. (All times are still shown as local time, but are stored as UTC.)

So basically create the task, create the trigger, check that box, set the time, BE SURE to subtract the timezone difference for the current location of the machine running the task.
Ex: the task is being setup on a server in California which is PST (Pacific Standard Time) so UTC -8 so we'd add 8hr to California/PST time to get UTC time. Say I want this to run at 6pm in New York which is EST, itself UTC -5 meaning add 5hr to NY/EST to get UTC time; so 6pm would be 11pm UTC. So on the California server task we want it to be 11pm UTC, however the task shows California time, but we know California time is UTC -8 so we simply set task to start at 3pm. This is all providing that checkbox is as that user advises. I can't seem to find official Microsoft documentation on it. It's clearly very confusing

A: Have you looked at the windows task scheduler?  It can get quite sophisticated on the scheduling.
There is quite a good tutorial in https://www.windowscentral.com/how-create-automated-task-using-task-scheduler-windows-10 .  If that link dies, just google for "windows task scheduler".
I've never used it on time zones, but it does look like it has a time zone feature.

A: You can schedule a variety of different tasks in the Task Scheduler at specific times. To do this, you go to the Task Scheduler >>Action >>Create Task
There you can experiment with the task
The Task Scheduler has many different actions you can experiment with. I don't know if they can run in different time zones, but you can make tasks go off at your local time zone.

A: I think it's possible without additional apps. You may add clocks to the taskbar's notification area. I know that works on Windows 10. You'll have separate clocks for different time zones. This way you can add reminders and events in the calendar in the time zone you need.

A: Why would you need the tasks run from one particular host? why not just run the tasks on each system and if needed host the script sources on one network associated volume. when the script finishes it can set whatever notifications and write them back out to the share or Each host already maintains its own time sync for local needs.
It would seem that you are making your work harder by including an unnecessary restriction.

A: If you are a pro python coder, then you might be able to do what you are aiming for. I am not that good of a python coder so i can't help with the code.
You could maybe run it on a Linux based system, or you can hold virtual operating systems that are for each timezone.


text:
Q: Linker errors when compiling OpenMP `target` directive using Clang 6 (trunk) with nvptx target I want to run OpenMP4+ code on my Nvidia GPU using LLVM/Clang. I downloaded and compiled llvm/clang/omp libraries from trunk following the instructions found here: https://clang.llvm.org/get_started.html and here: https://openmp.llvm.org/. I did not build Compiler-RT and libcxx, but I don't think that would make any difference.
My CMake command was this: cmake -G "Unix Makefiles" ../llvm -DCMAKE_BUILD_TYPE=Release -DOPENMP_ENABLE_LIBOMPTARGET=ON
I wrote a very basic program with a single OpenMP target directive:
int main(void)
{
    #pragma omp target
    {
    }
    return 0;
}

And I compile it with this:
/home/user/opt/llvm/bin/clang++ -v main.cpp -fopenmp -lomptarget -fopenmp-targets=nvptx64-nvidia-cuda --cuda-path=/home/user/opt/pgi/linux86-64/2017/cuda/8.0
In case you ask: Yes, I haven't set up my paths for the compiler but I made sure that my LD_LIBRARY_PATH points where the libomptarget is located.
And here is the output/error I get after executing the above command (The last ~10 lines show the error):
<If this is too much information, just go to the last 10 lines to see the error>
clang version 6.0.0 (trunk 312875)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /home/user/opt/llvm/bin
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/6
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/6.4.0
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/7
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/7.2.0
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.8
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.8.4
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.9
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.9.3
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/5
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/5.4.1
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/6
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/6.4.0
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/7
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/7.2.0
Selected GCC installation: /usr/lib/gcc/x86_64-linux-gnu/7.2.0
Candidate multilib: .;@m64
Selected multilib: .;@m64
Found CUDA installation: /home/user/opt/pgi/linux86-64/2017/cuda/8.0, version 7.0
 "/home/user/opt/llvm/bin/clang-6.0" -cc1 -triple x86_64-unknown-linux-gnu -emit-llvm-bc -emit-llvm-uselists -disable-free -disable-llvm-verifier -discard-value-names -main-file-name main.cpp -mrelocation-model static -mthread-model posix -mdisable-fp-elim -fmath-errno -masm-verbose -mconstructor-aliases -munwind-tables -fuse-init-array -target-cpu x86-64 -dwarf-column-info -debugger-tuning=gdb -v -resource-dir /home/user/opt/llvm/lib/clang/6.0.0 -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/7.2.0/../../../../include/c++/7.2.0 -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/7.2.0/../../../../include/x86_64-linux-gnu/c++/7.2.0 -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/7.2.0/../../../../include/x86_64-linux-gnu/c++/7.2.0 -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/7.2.0/../../../../include/c++/7.2.0/backward -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/7.2.0/../../../../include/c++/7.2.0 -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/7.2.0/../../../../include/x86_64-linux-gnu/c++/7.2.0 -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/7.2.0/../../../../include/x86_64-linux-gnu/c++/7.2.0 -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/7.2.0/../../../../include/c++/7.2.0/backward -internal-isystem /usr/local/include -internal-isystem /home/user/opt/llvm/lib/clang/6.0.0/include -internal-externc-isystem /usr/include/x86_64-linux-gnu -internal-externc-isystem /include -internal-externc-isystem /usr/include -internal-isystem /usr/local/include -internal-isystem /home/user/opt/llvm/lib/clang/6.0.0/include -internal-externc-isystem /usr/include/x86_64-linux-gnu -internal-externc-isystem /include -internal-externc-isystem /usr/include -fdeprecated-macro -fdebug-compilation-dir /tmp -ferror-limit 19 -fmessage-length 190 -fopenmp -fobjc-runtime=gcc -fcxx-exceptions -fexceptions -fdiagnostics-show-option -fcolor-diagnostics -o /tmp/main-be2d35.bc -x c++ main.cpp -fopenmp-targets=nvptx64-nvidia-cuda
clang -cc1 version 6.0.0 based upon LLVM 6.0.0svn default target x86_64-unknown-linux-gnu
ignoring nonexistent directory "/include"
ignoring nonexistent directory "/include"
ignoring duplicate directory "/usr/lib/gcc/x86_64-linux-gnu/7.2.0/../../../../include/x86_64-linux-gnu/c++/7.2.0"
ignoring duplicate directory "/usr/lib/gcc/x86_64-linux-gnu/7.2.0/../../../../include/c++/7.2.0"
ignoring duplicate directory "/usr/lib/gcc/x86_64-linux-gnu/7.2.0/../../../../include/x86_64-linux-gnu/c++/7.2.0"
ignoring duplicate directory "/usr/lib/gcc/x86_64-linux-gnu/7.2.0/../../../../include/x86_64-linux-gnu/c++/7.2.0"
ignoring duplicate directory "/usr/lib/gcc/x86_64-linux-gnu/7.2.0/../../../../include/c++/7.2.0/backward"
ignoring duplicate directory "/usr/local/include"
ignoring duplicate directory "/home/user/opt/llvm/lib/clang/6.0.0/include"
ignoring duplicate directory "/usr/include/x86_64-linux-gnu"
ignoring duplicate directory "/usr/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/lib/gcc/x86_64-linux-gnu/7.2.0/../../../../include/c++/7.2.0
 /usr/lib/gcc/x86_64-linux-gnu/7.2.0/../../../../include/x86_64-linux-gnu/c++/7.2.0
 /usr/lib/gcc/x86_64-linux-gnu/7.2.0/../../../../include/c++/7.2.0/backward
 /usr/local/include
 /home/user/opt/llvm/lib/clang/6.0.0/include
 /usr/include/x86_64-linux-gnu
 /usr/include
End of search list.
 "/home/user/opt/llvm/bin/clang-6.0" -cc1 -triple nvptx64-nvidia-cuda -aux-triple x86_64-unknown-linux-gnu -S -disable-free -disable-llvm-verifier -discard-value-names -main-file-name main.cpp -mrelocation-model pic -pic-level 2 -mthread-model posix -mdisable-fp-elim -fmath-errno -no-integrated-as -fuse-init-array -mlink-cuda-bitcode /home/user/opt/pgi/linux86-64/2017/cuda/8.0/nvvm/libdevice/libdevice.compute_20.10.bc -target-feature +ptx42 -target-cpu sm_20 -dwarf-column-info -debugger-tuning=gdb -v -resource-dir /home/user/opt/llvm/lib/clang/6.0.0 -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/7.2.0/../../../../include/c++/7.2.0 -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/7.2.0/../../../../include/x86_64-linux-gnu/c++/7.2.0 -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/7.2.0/../../../../include/x86_64-linux-gnu/c++/7.2.0 -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/7.2.0/../../../../include/c++/7.2.0/backward -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/7.2.0/../../../../include/c++/7.2.0 -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/7.2.0/../../../../include/x86_64-linux-gnu/c++/7.2.0 -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/7.2.0/../../../../include/x86_64-linux-gnu/c++/7.2.0 -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/7.2.0/../../../../include/c++/7.2.0/backward -internal-isystem /usr/local/include -internal-isystem /home/user/opt/llvm/lib/clang/6.0.0/include -internal-externc-isystem /usr/include/x86_64-linux-gnu -internal-externc-isystem /include -internal-externc-isystem /usr/include -internal-isystem /usr/local/include -internal-isystem /home/user/opt/llvm/lib/clang/6.0.0/include -internal-externc-isystem /usr/include/x86_64-linux-gnu -internal-externc-isystem /include -internal-externc-isystem /usr/include -fdeprecated-macro -fno-dwarf-directory-asm -fdebug-compilation-dir /tmp -ferror-limit 19 -fmessage-length 190 -fopenmp -fobjc-runtime=gcc -fcxx-exceptions -fexceptions -fdiagnostics-show-option -fcolor-diagnostics -o /tmp/main-7ffbd7.s -x c++ main.cpp -fopenmp-is-device -fopenmp-host-ir-file-path /tmp/main-be2d35.bc
clang -cc1 version 6.0.0 based upon LLVM 6.0.0svn default target x86_64-unknown-linux-gnu
ignoring nonexistent directory "/include"
ignoring nonexistent directory "/include"
ignoring duplicate directory "/usr/lib/gcc/x86_64-linux-gnu/7.2.0/../../../../include/x86_64-linux-gnu/c++/7.2.0"
ignoring duplicate directory "/usr/lib/gcc/x86_64-linux-gnu/7.2.0/../../../../include/c++/7.2.0"
ignoring duplicate directory "/usr/lib/gcc/x86_64-linux-gnu/7.2.0/../../../../include/x86_64-linux-gnu/c++/7.2.0"
ignoring duplicate directory "/usr/lib/gcc/x86_64-linux-gnu/7.2.0/../../../../include/x86_64-linux-gnu/c++/7.2.0"
ignoring duplicate directory "/usr/lib/gcc/x86_64-linux-gnu/7.2.0/../../../../include/c++/7.2.0/backward"
ignoring duplicate directory "/usr/local/include"
ignoring duplicate directory "/home/user/opt/llvm/lib/clang/6.0.0/include"
ignoring duplicate directory "/usr/include/x86_64-linux-gnu"
ignoring duplicate directory "/usr/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/lib/gcc/x86_64-linux-gnu/7.2.0/../../../../include/c++/7.2.0
 /usr/lib/gcc/x86_64-linux-gnu/7.2.0/../../../../include/x86_64-linux-gnu/c++/7.2.0
 /usr/lib/gcc/x86_64-linux-gnu/7.2.0/../../../../include/c++/7.2.0/backward
 /usr/local/include
 /home/user/opt/llvm/lib/clang/6.0.0/include
 /usr/include/x86_64-linux-gnu
 /usr/include
End of search list.
"/home/user/opt/pgi/linux86-64/2017/cuda/8.0/bin/ptxas" -m64 -O0 -v --gpu-name sm_20 --output-file /tmp/main-64fc86.cubin /tmp/main-ca9e59.s -c
ptxas info    : 1 bytes gmem, 8 bytes cmem[14]
ptxas info    : Compiling entry function '__omp_offloading_803_18004c0_main_l3' for 'sm_20'
ptxas info    : Function properties for __omp_offloading_803_18004c0_main_l3
0 bytes stack frame, 0 bytes spill stores, 0 bytes spill loads
ptxas info    : Used 5 registers, 32 bytes cmem[0]
ptxas info    : Function properties for __omp_offloading_803_18004c0_main_l3_worker
24 bytes stack frame, 8 bytes spill stores, 8 bytes spill loads
"/home/user/opt/pgi/linux86-64/2017/cuda/8.0/bin/nvlink" -o /tmp/main-f247e3.out -v -arch sm_20 -L/home/user/opt/llvm/lib -lomptarget-nvptx main-64fc86.cubin
nvlink error   : Undefined reference to '__kmpc_kernel_init' in 'main-64fc86.cubin'
nvlink error   : Undefined reference to '__kmpc_kernel_deinit' in 'main-64fc86.cubin'
nvlink error   : Undefined reference to '__kmpc_kernel_parallel' in 'main-64fc86.cubin'
nvlink error   : Undefined reference to '__kmpc_kernel_end_parallel' in 'main-64fc86.cubin'
nvlink info    : 1 bytes gmem, 8 bytes cmem[14]
nvlink info    : Function properties for '__omp_offloading_803_18004c0_main_l3':
nvlink info    : used 18 registers, 24 stack, 0 bytes smem, 32 bytes cmem[0], 0 bytes lmem
clang-6.0: error: fatbinary command failed with exit code 255 (use -v to see invocation)

Any idea which library is supposed to have these __kmpc* symbols?
 I tried to run:
nm libomptarget.so | grep __kmpc_kernel_parallel
and
nm libomptarget.rtl.cuda.so | grep __kmpc_kernel_parallel,
but both commands return nothing.
Finally, if I remove -fopenmp-targets=nvptx64-nvidia-cuda from my compile flags, I get no linker errors. But of course in that case no CUDA code is generated.
Any feedback that may help me to figure out what is going on, where these symbols are supposed to be located, and why they are not there, is more than welcome.

A: Unfortunately OMP target offloading support for the nvptx device hasn't been upstreamed as yet. A recent branch is available on github with build instructions at the wiki
https://github.com/clang-ykt/clang/wiki


text:
Q: Convert a string array into php array object I have a PHP string array that I would like to convert into a PHP array object.
string ->

"Array(
    [0] => Array
        (
            [item_id] => 315428396
            [title] => Luke Heith
            [link] => somelinks
            [rights] => Array
                (
                    [0] => update
                    [1] => view
                    [2] => grant_view
                    [3] => delete
                    [4] => comment
                    [5] => add_task
                    [6] => subscribe
                    [7] => grant
                    [8] => add_file
                    [9] => add_conversation
                    [10] => rate
                )"

Solution a PHP object array. Does someone know how I can achieve this?

A: That format is a debugging output format only. It is not possible to 100% convert this back into an actual array; you will always find edge cases where the input will represent ambiguous values. There's also no function to convert this back into an array; you'd have to write one yourself, which is something of an ambitious project.
In short: use a format which can actually be deserialised (like JSON or serialize), this one cannot.


text:
Q: linux - running a process and tailing a file simultaneously I want a run a long task on a remote machine (with python fabric using ssh).
It logs to a file on the remote machine.
What I want to do is to run that script and tail (actively display) the log file content until the script execution ends.
The problem with
python test.py & tail -f /tmp/out

is that it does not terminate when test.py exits.
Is there a simple linux trick I can use to do this or do I have to make a sophisticated script to continuously check the termination of the first process?

A: I would simply start the tail in background and the python process in foreground. When the python process finishes you can kill the tail, like this:
#!/bin/bash

touch /tmp/out # Make sure that the file exists
tail -f /tmp/out &
pid=$!
python test.py
kill "$pid"


text:
Q: Criar um site com programação JAVA? Gostaria de saber como poderia começar para criar um simples site através de programação JAVA.
Se alguém puder ajudar ou indicar algum tutorial, agradeço muito!
Obrigado

A: Existem muitas alternativas para fazer isso. Mas no geral, a idéia consiste em:

*

*Página HTML tendo um formulário para que o usuário entre com as informações necessárias;

*Uma vez com as informações, um servidor recebe essas informações e as consome (é aqui que o Java entra!) e retorna algo;

*A página então reage à resposta do servidor, mostrando o que o cliente deseja.

Uma biblioteca em java que pode ajudar na sua intenção é a Apache HttpClient para envio de requisições e respostas por HTTP. Para o servidor, pode usar o Apache Tomcat ou Apache Hadoop.
Estou dando uma resposta muito superficial com algumas recomendações pois a pergunta é MUITO ampla.


text:
Q: Maven Filtering of WSDL URL I am trying to use resource filtering to generate the SOAP addresses for WSDLs. But somehow it is not working. I have written the plugin and resource element as:
<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-resources-plugin</artifactId>
    <inherited>false</inherited>
    <executions>
        <execution>
            <id>process-urls</id>
            <phase>clean</phase>
            <goals>
                <goal>resources</goal>
            </goals>
            <inherited>false</inherited>
            <configuration>
                <delimiters>
                    <delimiter>${*}</delimiter>
                </delimiters>
                <filters>
                    <filter>src/main/resources/PO/WSDLFiles/ProcessOrder.wsdl</filter>
                    <filter>src/main/resources/DAC/WSDLFiles/InternalRequest.wsdl</filter>
                </filters>
                <overwrite>true</overwrite>
            </configuration>
        </execution>
    </executions>
</plugin>

<resources>
    <resource>
        <directory>src/main/resources/</directory>
        <includes>
            <include>**/*</include>
        </includes>
        <filtering>true</filtering>
    </resource>
</resources>

I have some profile values defined under, ${protocol}, ${fullhostname} and ${port}
The WSDL tag, that I want to get modified is like:
<service name="ProcessOrderService">
    <port name="ProcessOrderSoapHttpPort" binding="tns:ProcessOrderSoapHttpBinding">
        <soap:address location="${protocol}://${fullhostname}:${port}/PO/services/ProcessOrderSoapHttpPort"/>
    </port>
</service>

When I run my pom file which also has a CXF plugin to generate classes I see that the URL in the JAVA objects get generated with:
${protocol}://${fullhostname}:${port}/PO/services/ProcessOrderSoapHttpPort
It just picks up the string as-is, with no values applied. Can you please tell me what I am doing wrong? I am guessing the "" in the WSDL attribute is causing the problem but I might be wrong.

A: I assume Maven Resources Plugin works as intended. If you use debug mode mvn clean install -X you will find some additional info like:
[DEBUG] file ProcessOrder.wsdl has a filtered file extension
[DEBUG] filtering /work/source/stackoverflow/wsdl-filtering/src/main/resources/PO/WSDLFiles/ProcessOrder.wsdl to /work/source/stackoverflow/wsdl-filtering/target/classes/PO/WSDLFiles/ProcessOrder.wsdl
[DEBUG] no use filter components

If no <outputDirectory> was specified the default output folder will be ${project.build.outputDirectory} (target/classes).
In this case just specify wsdl file locations in CXF plugin:
<plugin>
    <groupId>org.apache.cxf</groupId>
    <artifactId>cxf-codegen-plugin</artifactId>
    <version>${cxf.version}</version>
    <executions>
        <execution>
            <id>generate-sources</id>
            <phase>generate-sources</phase>
            <configuration>
                <sourceRoot>${project.build.directory}/generated-sources/cxf</sourceRoot>
                <wsdlOptions>
                    <wsdlOption>
                        <wsdl>${project.build.outputDirectory}/PO/WSDLFiles/ProcessOrder.wsdl</wsdl>
                    </wsdlOption>
                </wsdlOptions>
            </configuration>
            <goals>
                <goal>wsdl2java</goal>
            </goals>
        </execution>
    </executions>
</plugin>

Do not use the same directory because you will lost the content of original file. The result will an empty wsdl file.
Additionally I recommend to fix Resources Plugin Configuration. You use <filters> which is for defining properties file which contains key-value pairs. Use <resources> and <include> instead as you did in the build section.


text:
Q: Relationship between textLabel and contentView Would it make sense to use both textLabel and contentView in a UITableViewCell or does one "cover" the other?

A: An instance of UILabel is created and added to the content view the first time you access the textLabel property. Generally, you're either going to customize the content view by adding subviews yourself, or else use the built-in textLabel (and optionally, detailTextLabel) property.


text:
Q: Salesforce process builder - When removing active account from hierarchy, failed but works when added to hierarchy I currently created a process which checks if a parent account is present, has been changed and checks if a parent field contains a certain value. If these conditions are met, update other fields in the active account. This works however, when I try removing the parent from the active account the process fails resulting in the following error.

"An error occurred at element myDecision (FlowDecision).
  The flow failed to access the value for myVariable_current.Parent.referenceField__c because it hasn't been set or assigned."

The decision where the process fails is the following
AND(
    NOT(ISBLANK([Account].ParentId)),
    ISCHANGED([Account].ParentId),
    ISPICKVAL([Account].Parent.referenceField__c, "Strategic")
)

I also tried checking if that field was empty
AND(
    NOT(ISBLANK([Account].ParentId)),
    ISCHANGED([Account].ParentId),
    NOT(ISBLANK(TEXT([Account].Parent.referenceField__c))),
    ISPICKVAL([Account].Parent.referenceField__c, "Value")
)

I'd assume that the decision would result in false when ParentId is found to be empty but the system is still checking if the parent's variable has been set. Any help is appreciated!

A: From reading the phrasing of your question and then seeing your formula code, I believe I have some thoughts on how to resolve your issue.

checks if a parent account is present, has been changed and checks if a parent field contains a certain value.

Your formula below as written, doesn't do what you describe above sequentially:
AND(
    NOT(ISBLANK([Account].ParentId)),
    ISCHANGED([Account].ParentId),
    ISPICKVAL([Account].Parent.referenceField__c, "Strategic")
)

What the above does is an All or Nothing test. It's a Boolean Result. If any of the above are false, the test fails. However, unlike much of Apex, in a formula, all tests have to execute for the formula to complete. You're not first testing to see if the ParentId is ISBLANK before the code decides whether to test to see if the ParentId ISCHANGED and then decides to test if the referenceField__c picklist value is equal to "Strategic".
If that's what you want, you need to "nest" your formulas or "sequence" them by inserting decision trees in your flow with exit branches. Exactly how depends on the answer to this question: Are there different directions your flow would take if one of the above were false and the others were true?
Clearly if there's no parent, there's no Parent.referenceField__c that can be assigned to the equivalent field on the Account record your flow is working with. To me, that sounds exactly like what the error message is saying. In essence, if there's no parent, your flow can't process the record any further and you need to discard it from the list of records you've collected for further processing in your flow.
Its either that or you need to send those records at your decision tree in another direction that processes them differently than the records that pass the test. I don't know the details of your flow and it's not clear to me at what point the parentId is being removed from the record (or it's a case of needing to screen for records that may not even have a parentId).
If you're removing the parentId within your flow, you may be populating a variable with the look-up to the parentId and the related field. When the parentId disappears, you lose the context for the lookup to the related field. At that point, the flow doesn't know what to do with the orphaned field once that lookup is removed that it was using to provide that reference.
This could be a case of where you need to assign the value by reference rather than as a lookup to the parent record in order to solve the issue you're having which admittedly, is not an ideal solution. Either that, or you'd need to remove the reference to the field first before removing the look-up. I don't have enough information to guide you further, but clearly that's what it's searching for and your process needs to direct these records around that part of your code if they don't have the look-up available.


text:
Q: SHA512 client handshake implementation I'm attempting to make an hmac implementation that interacts with a server api and the only example I have to go off of is a python snippet. Unfortunately I've never touched python and my Java is a bit rusty.
The python example code includes the function:
handshake = str(hmac.new(secret, hash_data, sha512))

where secret is the decoded hash retrieved from the server being connected to,
hash_data is the data to be sent,
and sha512 is the "MessageDigest" type when converted to Java.
I'm just wondering if there is a close java equivalent to this function. It seems like it should be in the Java.Security class but I'm having trouble finding hmac functions and implementations.

A: API's and functions related to cryptology are present in javax.crypto, not java.security.
I don't know Python, but given your description and the documentation of the methods shown, you want something along these lines:
final Charset charset = Charset.forName("ASCII");
final String secret = "mykey";
final String data = "A message to be turned to gibberish";
final String algorithm = "HmacSHA512";

byte[] keyBytes = secret.getBytes(charset);
SecretKeySpec signingKey = new SecretKeySpec(keyBytes, algorithm);

Mac mac = Mac.getInstance(algorithm);
mac.init(signingKey);

byte[] hashed = mac.doFinal(data.getBytes(charset));
System.out.println(new String(hashed, charset));

The code assumes byte and string conversions are based on ASCII (which I believe Python uses by default). You will in all likelihood have to tweak the logic, but its a good starting point.


text:
Q: MSTest with Moq - DAL setup I'm new to Moq, and just started on a project that's already in development. I'm responsible for setting up unit testing. There's a custom class for the DatabaseFactory that uses EnterpriseLibrary and looks like this:
public Database CreateCommonDatabase()
{
  return CreateDatabaseInstance(string.Empty);
}

private static Database CreateDatabaseInstance(string foo)
{
  var database = clientCode == string.Empty
      ? DatabaseFactory.CreateDatabase("COMMON")
      : new OracleDatabase(new ClientConnections().GetConnectionString(foo)));
  return database;
}

Now, here's where that gets used (ResultData is another class of the type DataSet):
public ResultData GetNotifications(string foo, string foo2, Database database)
{
    var errMsg = string.Empty;
    var retval = 0;
    var ds = new DataSet();

    var sqlClause =
    @"[Some SELECT statement here that uses foo]";

    DbCommand cm = database.GetSqlStringCommand(sqlClause);
    cm.CommandType = CommandType.Text;

    // Add Parameters
    if (userSeq != string.Empty)
    {
      database.AddInParameter(cm, ":foo2", DbType.String, foo2);
    }

    try
    {
      ds = database.ExecuteDataSet(cm);
    }
      catch (Exception ex)
    {
      retval = -99;
      errMsg = ex.Message;
    }

    return new ResultData(ds, retval, errMsg);
}

Now, originally, the Database wasn't passed in as a parameter, but the method was creating a new instance of the DatabaseFactory using the CreateCommonDatabase method, and using it from there. However, that leaves the class untestable because I can't keep it from actually hitting the database. So, I went with Dependency Injection, and pass the Database in.
Now, I'm stuck, because there's no way to mock Database in order to test GetNotifications. I'm wondering if I'm overly complicating things, or if I'm missing something. Am I doing this the right way, or should I be rethinking how I've got this set up?
Edit to add more info*****
I really don't want to test the database. I want the Data.Notifications class (above) to return an instance of ResultData, but that's all I really want to test. If I go a level up, to the Business layer, I have this:
public DataSet GetNotifications(string foo, string foo1, out int returnValue, out string errorMessage, Database database)
{
    ResultData rd = new data.Notifications().GetNotifications(foo, foo1, database);

    returnValue = rd.ResultValue;
    errorMessage = rd.ErrorMessage;

    return rd.DataReturned;
}

So, originally, the database wasn't passed in, it was the Data.Notifications class that created it - but then again, if I left it that way, I couldn't help but hit the database to test this Business layer object. I modified all of the code to pass the Database in (which gets created a the web's Base page), but now I'm just not certain what to do next. I thought I was one unit test away from having this resolved, but apparently, either I'm wrong or I've got a mental roadblock to the right path.

A: You should be able to create a mock Database object if the methods in it are virtual.  If they are not, then you have a little bit of a problem.
I don't know what type "Database" is, but you have a few options.

*

*If you own the source code to Database, I would recommend extracting an interface IDatabase, rather than dealing with a Database class type.  This will eliminate some complexity and give you something extremely testable.

*If you don't have access to the Database class, you can always solve this with another layer of abstraction.  Many people in this case use a Repository pattern that wraps the data access layer.  Generally speaking in this case, most people leave testing Respository classes to integration tests (tests without any isolation), rather than unit tests.
Here's how you'd setup your test using option #1:
[TestMethod]
public void GetNotifications_PassedNullFoo_ReturnsData()
{
     //Arrange
     Mock<IDatabase> mockDB = new Mock<IDatabase>();
     mockDB.Setup(db => db.ExecuteDataSet()).Returns(new DataSet() ... );

     //Act
     FooClass target = new fooClass();
     var result = target.GetNotifications(null, "Foo2", mockDB.Object);

     //Assert
     Assert.IsTrue(result.DataSet.Rows.Count > 0);
}

My dataset code is a little rusty, but hopefully this gives you the general idea.

A: Based on the code you've given, I would think you would want to talk to the database, and not a mocked version.
The reason is that your GetNotifications code contains DB-specific instructions, and you'll want those to pass validation at the DB Engine level. So just pass in a Database that is connected to your test DB instance.
If you took the testing abstraction to a higher level, where you built unit tests for the database call and a version of this test that used a mocked database, you'd still have to run integration tests, which ends up being triple the work for the same amount of code coverage. In my opinion, it's far more efficient to do an integration test at tier borders you control then to write unit tests for both sides of the contract and integration tests.


text:
Q: Not receiving emails [phpmailer] Using phpmailer to send email when someone will fill form and click on submit. But, don't know why its not sending email at set address (n*****b@gmail.com)
Code is as below:
<?php
function notifiyCustomerOnNewOrderCreation($orderDetails, $order_id = '', $update = false)
{
    global $wpdb;
    $orderHTML = makeHTMLfromOrderDetails($orderDetails);
    $order_link = admin_url('admin.php?page=cust_edit_order&id=' . str_replace("#", "*", $order_id));
    $userId = $orderDetails->OD("user_id");
    $userDetails = $wpdb->get_results("SELECT display_name,user_email FROM {$wpdb->users} WHERE ID ='{$userId}' LIMIT 1");
    global $phpmailer;
    // (Re)create it, if it's gone missing
    if ( !is_object( $phpmailer ) || !is_a( $phpmailer, 'PHPMailer' ) ) {
    require_once ABSPATH . WPINC . '/class-phpmailer.php';
    require_once ABSPATH . WPINC . '/class-smtp.php';
    $mail = new PHPMailer( true );
    } else { $mail = clone $phpmailer; }
    $mail->IsSendmail();
    if($userDetails){
    foreach($userDetails as $ca){
    try {
    $mail->AddAddress($ca->user_email, $ca->display_name);
    $mail->AddAddress('n*****b@gmail.com', 'Navnish Bhardwaj');
    if($update){
    $mail->Subject = 'Your order has been updated. ' . "[{$order_id}]";
    $mail->AltBody = 'To view the message, please use an HTML compatible email viewer!';
    $mail->MsgHTML("Your order has been updated.
View Order
" . $orderHTML);
    } else {
    $mail->Subject = 'Your order has been created. ' . "[{$order_id}]";
    $mail->AltBody = 'To view the message, please use an HTML compatible email viewer!';
    $mail->MsgHTML("Your order has been created.
View Order
" . $orderHTML);
    }
    $mail->Send();
    $mail->ClearAllRecipients();
    } catch(phpmailerException $e){ return false; }
    catch(Exception $e){ return false; }
    } } return true;
}

Any suggestion would be appreciated.

A: I don't know exactly what you're asking for, but I assume you want to center a div inside of its parent container. To do that, the div must have a width smaller than the width of the parent container (of course), it must be display: block, and have margin: 0 auto.
You can also center an element with display: inline-block or display: inline by using text-align: center on the parent element. This will center the text inside as well. I think this may be what you want, since you said you wanted to align everything to the center. Just put it all into the div.
For example:

        Lorem ipsum dolor sit amet...

CSS:
.container {
}

.centerthis {
    width: 50%;
    margin: 0 auto;
}

OR:
.container {
    text-align: center;
}

.centerthis {
    display: inline-block; /*or inline*/
    width: 50%;
}

Check out this demo to see it in action.

A: You can try this to solve your problem

Try the css within your page head section

`       `

Try the html within your page body section

Enter your all contents within 'alignCenter' div to align all data to the center


text:
Q: Expected resource of type animator [ResourceType] I've updated my SDK to the newest version, but now I am getting a lint error.

Error: Expected resource of type animator [ResourceType]

The error occurs on this line:
AnimatorInflater.loadAnimator(context, R.anim.right_slide_in)

The referenced resource /res/anim/right_slide_in.xml looks like this:
<?xml version="1.0" encoding="utf-8"?>
<objectAnimator xmlns:android="http://schemas.android.com/apk/res/android"
    android:interpolator="@android:anim/linear_interpolator"
    android:valueTo="0"
    android:valueFrom="1.0"
    android:propertyName="xFraction"
    android:valueType="floatType"
    android:duration="450" />

It always worked before. Could somebody explain why I am getting that error?

A: The error occurs because you store your Animator resources in the wrong directory! It worked before because the AnimatorInflater can load the xml regardless of in which folder it is saved.

*

*R.anim.* resources from the res/anim/ folder are for view animations.

*R.animator.* resources from the /res/animator/ folder are for Animators.

So to fix the error just move your Animator resources from /res/anim/ to /res/animator/.

This used to make no difference at all until the resource type annotations were added to the support library. A long with those annotations there also were many new lint checks among others the one which tripped you up.
In the future if you get an error like this you can look at the annotation to figure out what you are doing wrong. For example the implementation of loadAnimator() of the AnimatorInflater looks like this:
public static Animator loadAnimator(Context context, @AnimatorRes int id)
        throws NotFoundException {
    return loadAnimator(context.getResources(), context.getTheme(), id);
}

The @AnimatorRes annotation on the id parameter indicates that only Animator resources should be passed here. If you look at the documentation of @AnimatorRes it reads like this:

Denotes that an integer parameter, field or method return value is
  expected to be an animator resource reference (e.g.
  android.R.animator.fade_in).

If the description doesn't explain the error already, then the example usually does ;)

A: Add this code to your build.gradle (Module: app):
android {
  lintOptions {
    disable "ResourceType"
  }
}


text:
Q: How to continue the process of component after routing back in Angular? I'm struggling with the problem mentioned in the title... In application, which I'm writing, at the beginning of the flow, user lands on /process page, where one REST service is called multiple times with different input based on previous response. During this process some data are presented on the screen. If something goes wrong with one of the calls, user is redirected to /resolve page where he needs to take some actions. After that, by clicking 'Retry' button, he can go back to /process page in state, which left and continue the process. By continue the process, I mean that application will continue its flow by finishing the calls in the loop and refreshing the view with new data for each iteration.
In order to navigate between the routes, I'm using: Router.nagivate(['/expectedPath']). To go back to page in state, which has been left, I decided to use RouteReuseStrategy. And it's working like a charm.
But now I'm wondering how to continue 'paused' flow on /process page. Was it a good choice to go with Router and RouteReuseStrategy or should I achieve it different way? At the beginning it seemed like a reasonable way, but now I'm not sure and that's why I decided to ask for help. I'm using Angular 8.


text:
Q: Unity 5 C# login system - www.data return 1 but it keeps going to else? So I'm trying to make a simple login system in Unity using C#, PHP and MySQL on localhost, but there is a problem. My code works like this:
In the php file, if the username and password matches the ones in the MySQL database, then echo 1. Else echo 0.
In the C# script file in Unity, the problem is in this part of the code:
if (www.error == null)
    {
        if (www.data == "1")
        {
            Debug.Log("Successful login/nLoading Scene...");
            StartCoroutine(GoToMenu());
        }
        else
        {
            Debug.Log("Invalid account or password");
            print(www.url);
            print(www.data);
        }
    }

The problem is that my www.data is returning 1, but it's skipping the condition www.data == "1" and going to else, where it print it's URL (I checked it, it's correct and functional) and it's data (equal to 1).

A: From your last comment it is obvious that your PHP script is puting special character into the responce string.
The best way would be to ensure that you use same encoding on server and client and not adding the special characters.
But the fastest way to do this is to remove all of them on client side with method like this: (source)
public static string RemoveSpecialCharacters(string str) {
   StringBuilder sb = new StringBuilder();
   foreach (char c in str) {
      if ((c >= '0' && c <= '9') || (c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z') || c == '.' || c == '_') {
         sb.Append(c);
      }
   }
   return sb.ToString();
}

I am quessing that this special character is "\n"
Maybe this is not what you were looking for, but still it is some solution.

A: Try this
if (www.text == "1")

Or
if((int)www.text==1)


text:
Q: I would like to know when to use have and has in a sentence talking about a country Jamaica has or have snakes?
Which is correct?
Explain

A: Normally, the verb agrees with the subject in number, so

This region has snakes.
Those regions have snakes.

Countries are normally singular:

Jamaica has snakes.

even if grammatically they look plural:

The Seychelles has snakes.
The United States has snakes.

What might be confusing you is that collective nouns (nouns denoting a collection of people) sometimes take a plural verb when the sense is that your are talking about  what the people do or are, rather than what the group as a whole is:

Manchester United has/have scored a goal.
The committee is/are worried.

And this can even apply to names of countries when it means a the national team in some competition:

Jamaica has/have scored a goal.

Using plural in these cases is more common in British than American English.


text:
Q: Create index in MongoDB I want to create Index in mongodb , but with the classic method

db.OPC_PLANT_DATA.createIndex( { "ITEM_ID" : 1.0,"ITEM_TIMESTAMP" : -1.0 } )

the db get stucked and it takes lot of time , so if I want to do it in Production it will impcat all the work !!
Someone knows how to do it without having any impact on documents insertion ??

A: Mongo Db allowed creation of indices in background. You had to specify background:true option while creating an index.
This was deprecated in version 4.2 of mongo though because they've optimized the index creation process.
Read the relevant documentation chapter


text:
Q: Net Force of Equal and Opposite Gravitational Forces Don't Equal Zero? I've come across this question, and I'm at at a loss.

Two masses, m and M, are in an isolated system. The gravitational forces, F (by M on m) and F (by m on M), are equal and opposite. Why do they not add to a zero net force? Explain your answer.

I approached the question by simply adding vectors. In the question F(1) and F(2) are defined as equal and opposite. Mathematically that is F(1) = -F(2). Hence, is stands to reason that F(1) + F(2) = 0.
If it's an isolated system there there should be no other forces present.
Also, even if the forces are moving towards each other, then they could be at a constant velocity (zero acceleration).
Is this flawed reasoning, or is there another explanation?

A: See this depends what are you considering as your system.
If you consider each ball separately as your system then there is a net force acting on the object.
But if you consider both balls together as your system then for sure no net force acts on the system.
I think you might be confused by the fact that both balls come towards one another and therefore the system might be accelerating. But I assure you that this is not the case. We define a quantity called centre of mass which is measure of the net translational effect of external force on the system and this fact that no net force acts on the system can be verified from the fact that the centre of mass does not accelerate even a bit.

The answer to the following question provides a mathematical treatment to the center of mass:

*

*Newton's Third law of Motion, who can tell me how to deduct below?

A:
"Two masses, m and M, are in an isolated system. The gravitational
  forces, F (by M on m) and F (by m on M), are equal and opposite. Why
  do they not add to a zero net force? Explain your answer."

You are making the common mistake of thinking Newton's third means the forces "cancel" and that nothing will happen to each of the objects involved. Although the net force on the system as a whole is zero, the net force on each mass individually is not.
Since in this case the only force acting on each mass is the force applied by the other, you can assume the net force on each mass is F. To find the effect of that force F on each mass you need to apply Newton's second law to each mass individually. Then the magnitude of the acceleration of each towards the other will be
$$a_{m}=\frac{F}{m}$$
$$a_{M}=\frac{F}{M}$$
If the masses are the same, their accelerations will be the same. Otherwise, they will be different.
Hope this helps.

A: You must only add up forces that act on the same object (or system or particle etc.).
The two forces mentioned act on different objects, so the net force on either of them, is non-zero (since only one force in acting on each).

A: Your depicted question is about Newton third law, now problem is you need to define system before arriving at any conclusion , I mean if you consider the two ball together as system then both forces termed as internal and they cancel out each other, but if you separately consider the balls then force on the each ball is not zero, because
According to Newton's Law, we always consider forces on the body - not by the body - to calculate its acceleration
So to make the net force on the body zero we should have the situation like this!
$F_1- F_2 =ma$ in this situation two forces cancel out each other. (where both $F_1 $ and $F_2$ are equal in magnitude and are on the body m).


text:
Q: VLOOKUP and MATCH function to extract data from a table in excel. Can I use the same function across multiple cells? could anyone please tell me if they see something wrong with this code? I've been staring at it for hours and I still can't see anything wrong with it but I can't drag it across the cells or even reword it to work for the others it is only working for the first column(Yr3).Any help at all with getting my head around this would be sooo much appreciated!
=IF($B$26="Thousands",VLOOKUP($B29,Assumptions!$C$4:$K$23,MATCH(C$26,Assumptions!$C$4:$K$4),FALSE)/K,VLOOKUP($B29,Assumptions!$C$4:$K$23,MATCH(C$26,Assumptions!$C$4:$K$4),FALSE)/M)

This is the part where I am trying to extract the data from

This is the code I am using

And this is where I want to PUT the information. The highlighted cell is the one that seems to work but doesn't work going across at all which is my problem


text:
Q: OpenAPI 3.0 file format giving error around allowedValues in parameters I've API Spec specified in OAS 3.0
post:
  tags:
    - One Time Payment
  summary: One Time Payment API
  operationId: oneTimePaymentUsingPOST
  parameters:
    - in: body
      name: realTimePaymentRequest
      description: realTimePaymentRequest
      required: true
      schema:
        $ref: '#/components/schemas/RealTimePaymentRequest'

When I edit this spec file in https://editor.swagger.io/ - It's throwing errors as :
Structural error at paths./banks/payments.post.parameters.0.in
should be equal to one of the allowed values
allowedValues: path, query, header, cookie

I can see that describing in: body in parameters is supported as per https://swagger.io/docs/specification/2-0/describing-request-body/
thought Swagger Editor is throwing errors. What could be wrong here ? schema ?
Any help is appreciated. Thank you.

A: In OpenAPI 3.0, in: body and in: formData parameters were replaced with requestBody:
post:
  tags:
    - One Time Payment
  summary: One Time Payment API
  operationId: oneTimePaymentUsingPOST

  requestBody:
    description: realTimePaymentRequest
    required: true
    content:
      application/json:
        schema:
          $ref: '#/components/schemas/RealTimePaymentRequest'

The documentation link you posted is for OpenAPI 2.0. For OpenAPI 3.0, use this link:
https://swagger.io/docs/specification/describing-request-body/


text:
Q: XMPPClient with vysper server gets no response everyone I'm trying to implement a xmppclient on iOS.I start from the example in XMPPFRAMEWORK.But I can't connect to my server,which is apache-vysper-server.After receiving a xml,client send a xml to server. But there is no response ever. what is wrong?Is the tls setting mismatch or?
SEND: ?xml version='1.0'?>
SEND: stream:stream xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' version='1.0' to='vtc365.com'>
RECV: (stream:stream xmlns="jabber:client" xmlns:stream="http://etherx.jabber.org/streams"  from="vtc365.com" version="1.0" id="0c726f4d2a694b69897069a818447ee3"/>
RECV:(stream:featuresxmlns:stream="http://etherx.jabber.org/streams(starttls>xmlns="urn:ietf:params:xml:ns:xmpp-tls">(required/>(/starttls>(/stream:features>
SEND: starttls xmlns='urn:ietf:params:xml:ns:xmpp-tls'/>
RECV: proceed xmlns="urn:ietf:params:xml:ns:xmpp-tls"/>
 allowSelfSignedCertificates
SEND: stream:stream xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' version='1.0' to='vtc365.com'>

A: It looks like you're connecting but then you don't authenticate. Are you invoking -authenticate:error in your delegate's -xmppStreamDidConnect: method?


text:
Q: How to stop location tracking in app? I wrote a simple run tracking app. The location manager gets initialized when the user presses a start running button. But even after they press stop to stop location updates, ios continues to indicate thatnapp is using location tracking. How/what do I need to turn off apart from telling location manager to stop updates? This continues even after the view controller is destroyed and user has popped back to the main menu.
Thanks for any suggestions.

A: Try
[locationManager stopUpdatingLocation];
locationManager = nil;


text:
Q: Procurar componentes isoladas em grafo Qual será o melhor algoritmo para encontrar componentes isoladas num grafo? Isto é, componentes que não perdem informação.

Nesta imagem, a única componente isolada é a H, porque só recebe "informação".

A: Está difícil entender o que está sendo perguntado, pois tanto sua pergunta quanto algumas fontes que consultei usam nomes diferentes para o mesmo conceito, e vice-versa. Vou definir alguns termos, uns em português e outros em inglês mesmo, de acordo com o que pude entender:

*

*strongly connected component ("componentes fortemente conectados"): conjuntos de vértices em que cada um possui um caminho até o outro. Na sua pergunta, seriam os 4 conjuntos delineados ({a,b,e}, {c,d}, {f,g} e {h}).

*sorvedouro (sink): no caso de vértices, são vértices que não têm nenhuma aresta saindo dele, no máximo entrando; no caso de um conjunto de vértices, conjuntos em que nenhum vértice possui arestas saindo. No seu caso, o conjunto {h} é um sorvedouro. O vértice h, por outro lado, tem uma aresta entrando - aquela que sai dele próprio.

*conjunto isolado: um conjunto de vértices que é ao mesmo tempo uma fonte e um sorvedouro. Em outras palavras, conjuntos que não possuam arestas entrando nem saindo - apenas entre seus próprios vértices. No seu caso, não há conjuntos isolados não triviais (i.e. o conjunto vazio, e o conjunto de todos os vértices).
Se você já possui uma lista de strongly connected components, e quer saber quais deles são sorvedouros, faça como o @utluiz sugeriu nos comentários: verifique todos os vértices de um componente, se todas as arestas saindo levam somente a vértices no próprio componente. Se isso for verdade, esse componente é um sorvedouro. Se algum vértice no componente levar a outro fora do componente, então o componente não é um sorvedouro.
Se seu problema por outro lado for encontrar esses strongly connected components, aí já é mais complicado. Vou transcrever aqui (traduzindo livremente) o algoritmo proposto em "Introduction to Algorithms", mas sem entrar muito em detalhes pois o conteúdo é bastante extenso.
STRONGLY-CONNECTED-COMPONENTS(G)

1. Chame DFS(G) para encontrar os tempos de término f[u] de cada vértice u
2. Faça a tranposição de G (Gt)
3. Chame DFS(Gt), mas no loop principal itere na ordem decrescente de f[u]
                                           (tal como computado no passo 1)
4. Os vértices de cada árvore na floresta do passo 3 são um strongly connected component

Caso você já tenha os tempos de término f[u] (na sua figura de exemplo, são os números dentro de cada vértice, depois da barra: d[u]/f[u]), basta chamar DFS no grafo transposto. não vou colocar aqui o algoritmo de transposição, pois deve ser trivial (é só inverter a direção de todas as arestas).

DFS é o algoritmo de busca em profundidade. d[u] e f[u] são subprodutos desse algoritmo, mostrando a ordem em que cada vértice foi visitado (d[u] é o momento em que o vértice foi encontrado pela primeira vez, e f[u] o momento em que todas suas arestas de saída foram visitadas). Não vou transcrever o algoritmo do mesmo livro, pois o link acima dá uma implementação mais compreensível, em C++. Apenas vou adaptá-lo para incluir f[u], já que o original somente contempla d[u] (lá chamado pre).
/* Vamos supor que nossos digrafos têm no máximo maxV vértices. */
static int conta, d[maxV], f[maxV];

/* A função DIGRAPHdfs visita todos os vértices e todos os arcos do digrafo G.
   A função atribui um número de ordem d[x] a cada vértice x:  o k-ésimo vértice visitado
   recebe número de ordem k.  (Código inspirado no programa 18.3 de Sedgewick.) */
void DIGRAPHdfs( Digraph G)
{
   Vertex v;
   conta = 0;
   for (v = 0; v < G->V; v++)
      d[v] = -1;
   for (v = 0; v < G->V; v++)
      if (d[v] == -1)
         dfsR( G, v);
}

/* A função dfsR supõe que o digrafo G é representado por uma matriz de adjacência.
  (Inspirado no programas 18.1 de Sedgewick.) */
void dfsR( Digraph G, Vertex v)
{
   Vertex w;
   d[v] = conta++;
   for (w = 0; w < G->V; w++)
      if (G->adj[v][w] != 0 && d[w] == -1)
         dfsR( G, w);
   f[v] = conta++;
}

Alternativa para grafos representados por uma lista de adjacêcia (também adaptada):
/* A função dfsR supõe que o digrafo G é representado por listas de adjacência.
  (Inspirado no programas 18.2 de Sedgewick.) */
void dfsR( Digraph G, Vertex v)
{
   link a;
   d[v] = conta++;
   for (a = G->adj[v]; a != NULL; a = a->next)
      if (d[a->w] == -1)
         dfsR( G, a->w);
   f[v] = conta++;
}

Se o passo 4 do algoritmo principal não está claro, a "floresta" que te interessa é formada por todos os vértices visitados em DIGRAPHdfs. Ou seja, se o primeiro vértice tem d[u] = 0 e f[u] = N, todos os vértices que tem d[u] > 0 e f[u] < N fazem parte dessa árvore. A próxima árvore seria o vértice com d[u] = N+1 e f[u] = M, e assim por diante até acabarem os vértices.
Nota: segundo a fonte citada, o algoritmo acima é eficiente (tempo linear em V + A) e embora não pareça está correto - a prova está em 4 páginas de teoremas que não vou transcrever aqui.


text:
Q: Counting the number of lines in a file using try and catch I need to try count the number of lines in a file while using "try" and "catch". This is what I have so far. Hoping I could get some help. It just keeps timing out.
public class LineCount {

public static void main(String[] args) {

    try {
        Scanner in = new Scanner(new FileReader("data.txt"));

        int count = 0;
        //String line;
        //line = in.readLine();
        while (in.hasNextLine()) {
            count++;

        }
        System.out.println("Number of lines: " + count);

    }catch (Exception e){e.printStackTrace();}

}

}

A: It times out because you do not advance the Scanner. If you enter the while loop you will never exit it.
Also it would be better if you use BufferedReader as is is faster than a standard Scanner. Although if the file is small, maybe for readability purposes you do not. But this is up to you. Anyway.
Here you go:
//this is the try-with-resources syntax
//closing the autoclosable resources when try catch is over
try (BufferedReader reader = new BufferedReader(new FileReader("FileName"))){

    int count = 0;
    while( reader.readLine() != null){
        count++;
    }
    System.out.println("The file has " + count + " lines");
}catch(IOException e){
    System.out.println("File was not found");
    //or you can print -1;
}

Probably your questiong has already been answered and you should not ask already answered questions before you search, for a while at least.

A: Seems like you are doing everything but consuming the newline character. To do this with java.util.Scanner, simply run in.nextLine() in your while loop. This Scanner.nextLine() method will return all characters before the next newline and consume the newline character itself.
Another thing to consider with your code is resource management. After opening the Scanner, it should be closed when it'll no longer be read. This can be done with in.close() at the end of your program. Another way to accomplish this is to setup a try-with-resources block. To do this, just move your Scanner declaration like this:
try (Scanner in = new Scanner(new FileReader("data.txt"))) {

Regarding the need for the try-catch block, as part of the Java compilation process, checked-exceptions will be checked if they are caught or thrown from a method. Checked-exceptions are everything that are not RuntimeExceptions or Errors.


text:
Q: generic foreach iteration of NamedNodeMap In Java, looking at the NamedNodeMap interface, how do you iterate it with generics?  It seems to use Node rather than String, but I'm not so sure how to use Node objects...
NamedNodeMap namedNodeMap = doc.getAttributes();
Map<String, String> stringMap = (Map<String, String>) namedNodeMap;
for (Map.Entry<String, String> entry : stringMap.entrySet()) {
  //key,value stuff here
}

Yes, I can see how to iterate without using generics and with a regular for loop, but I'd like to use the above ?idiom? for maps.  Of course, the problem would appear to be that, despite the name, NamedNodeMap doesn't actually implement the Map interface!  :(
Guess you just gotta bite the bullet here and do something like:
/*
 * Iterates through the node attribute map, else we need to specify specific
 * attribute values to pull and they could be of an unknown type
 */
private void iterate(NamedNodeMap attributesList) {
    for (int j = 0; j < attributesList.getLength(); j++) {
        System.out.println("Attribute: "
                + attributesList.item(j).getNodeName() + " = "
                + attributesList.item(j).getNodeValue());
    }
}

there's nothing nicer?

A: You can create your own Iterable wrapper for NamedNodeMap and then use it in a foreach loop.
For example, this could be a simple implementation:
public final class NamedNodeMapIterable implements Iterable<Node> {

    private final NamedNodeMap namedNodeMap;

    private NamedNodeMapIterable(NamedNodeMap namedNodeMap) {
        this.namedNodeMap = namedNodeMap;
    }

    public static NamedNodeMapIterable of(NamedNodeMap namedNodeMap) {
        return new NamedNodeMapIterable(namedNodeMap);
    }

    private class NamedNodeMapIterator implements Iterator<Node> {

        private int nextIndex = 0;

        @Override
        public boolean hasNext() {
            return (namedNodeMap.getLength() > nextIndex);
        }
        @Override
        public Node next() {
            Node item = namedNodeMap.item(nextIndex);
            nextIndex = nextIndex + 1;
            return item;
        }

        @Override
        public void remove() {
            throw new UnsupportedOperationException();
        }

    }

    @Override
    public Iterator<Node> iterator() {
        return new NamedNodeMapIterator();
    }
}

In this case, this would be the usage:
private void iterate(NamedNodeMap attributesList) {
    for (Node node : NamedNodeMapIterable.of(attributesList)) {
        System.out.println("Attribute: "
                + node.getNodeName() + " = " + node.getNodeValue());
    }
}

With a similar approach you could create an Iterable over Map.Entry<String, String> instances.

A: I don't think there is a nicer way to use those APIs.  (Update: OK - maybe https://stackoverflow.com/a/28626556/139985 counts as nice.)
Bear in mind that the W3C DOM Java APIs were specified before Java had generics or the new for syntax, or even the Iterator interface.  Also bear in mind that the W3C DOM APIs for Java are actually the result of mapping an IDL specification to Java.
If you want nicer APIs for manipulating XML, etc in memory, maybe you should look at JDOM.

A: As you can't cast NamedNodeMap to a Map, I suggest to loop using a classic for loop like that :
int numAttrs = namedNodeMap.getLength();
System.out.println("Attributes:");
for (int i = 0; i < numAttrs; i++){
   Attr attr = (Attr) pParameterNode.getAttributes().item(i);
   String attrName = attr.getNodeName();
   String attrValue = attr.getNodeValue();
   System.out.println("\t[" + attrName + "]=" + attrValue);
}

A: From Java 8 solution:
private static Iterable<Node> iterableNamedNodeMap(final NamedNodeMap namedNodeMap) {
    return () -> new Iterator<Node>() {

        private int index = 0;

        @Override
        public boolean hasNext() {
            return index < namedNodeMap.getLength();
        }

        @Override
        public Node next() {
            if (!hasNext())
                throw new NoSuchElementException();
            return namedNodeMap.item(index++);
        }
    };
}


text:
Q: Jedit editor ftp lastmodyfiaction file jEdit editor "Local File Browser" has last modification column. It's cool!

How to set last modification file column in FTP plugin remote browser in jEdit editor?

A: You need to post a feature request for the FTP plugin at https://sourceforge.net/p/jedit/plugin-feature-requests/. As far as I remember the plugin providing a file system can provide a flag whether it provides this information and the FTP plugin seems not to provide this bit of information, so the column is not shown.


text:
Q: Repo sync error on macOS with _ssl.so image not found I've got my AOSP repo initialized after downloading a tar file from mirro.tuna, but I met the following error when I executed repo sync.
ERROR:root:code for hash md5 was not found.
Traceback (most recent call last):
  File "/usr/local/Cellar/python@2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/hashlib.py", line 147, in <module>
    globals()[__func_name] = __get_hash(__func_name)
  File "/usr/local/Cellar/python@2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/hashlib.py", line 97, in __get_builtin_constructor
    raise ValueError('unsupported hash type ' + name)
ValueError: unsupported hash type sha512
Traceback (most recent call last):
  File "/Volumes/Android/Source/aosp/.repo/repo/main.py", line 50, in <module>
    from git_config import init_ssh, close_ssh
  File "/Volumes/Android/Source/aosp/.repo/repo/git_config.py", line 24, in <module>
    import ssl
  File "/usr/local/Cellar/python@2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ssl.py", line 98, in <module>
    import _ssl             # if we can't import it, let the error propagate
ImportError: dlopen(/usr/local/Cellar/python@2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_ssl.so, 2): Library not loaded: /usr/local/opt/openssl/lib/libssl.1.0.0.dylib
  Referenced from: /usr/local/Cellar/python@2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_ssl.so
  Reason: image not found

A: Looking at the log, the error occurs when import ssl is executed. I found libssl.1.0.0.dylib is missing. It could be due to my partial update on brew install python@2 or some other unknown broken. I reinstalled the python@2 through Homebrew and the error disappears.
brew reinstall python@2

A: @Jeremy's solution fixed my problem on Python 3 as well. Cannot comment directly so put a separate answer here. Just run
brew reinstall python@3

A: I guess it depends on what python symlink to version, so it is better to reinstall python
brew reinstall python


text:
Q: Check Input when Select with same class change I actually have this code but I do not wanted to write it for every select (since I have more than 10 select and that it will change with time).
$('select.myClass').on('change', function() {
  $('input.myClass').prop('checked', true);
});

Is it possible to make it better with something like "if a select option is changed, check the input with the same class as the changed option"?
Codepen UPDATED with answer from sojtin
https://codepen.io/Qasph/pen/pPjrpx

A: Please find below snippet on change of select get selected value and find checkbox with the class with same class as selected value

$('.'+ $('.level').val()).prop('checked', true);
$('.level').on('change', function() {
$(".common").prop('checked',false);
  $('.'+ $(this).val()).prop('checked', true);
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<label>
  <input class="common easy" type="checkbox">easy
</label>
<label>
  <input class="common hard" type="checkbox">hard
</label>
<label>
  <input class="common impossible" type="checkbox">impossible
</label>
<select class="level">
  <option>easy</option>
  <option>hard</option>
  <option>impossible</option>
</select>

A: If you have single class for select, try this:

$('select').on('change', function() {
  $('input.'+$(this).prop('class')).prop('checked', true);
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<label>
  <input class="level" type="checkbox">This is
</label>
<select class="level">
  <option>easy</option>
  <option>hard</option>
  <option>impossible</option>
</select>

<label>
  <input class="asdfasdf" type="checkbox">This is
</label>
<select class="asdfasdf">
  <option>easy</option>
  <option>hard</option>
  <option>impossible</option>
</select>

A: Try this for your current case
$('select').change(function(){
  var target = $(this).attr('class');
  $('input.'+target).prop('checked', true);
});

I suggest adding an ID with the same value to the target with the above code and change it to
$('select').change(function(){
  var target = $(this).attr('id');
  $('input.'+target).prop('checked', true);
});

A: Just use select as selector on change you can get the class name of current element and concat $('input.'+class_val) like this to check the same class checkbox

$('select').on('change', function() {

class_val =  $(this).attr('class');
  $('input.'+class_val).prop('checked', true);
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<label>
  <input class="level" type="checkbox">This is
</label>
<select class="level">
 <option>select</option>
  <option>easy</option>
  <option>hard</option>
  <option>impossible</option>
</select>

<label>
  <input class="level1" type="checkbox">This is
</label>
<select class="level1">
  <option>select</option>
  <option>easy1</option>
  <option>hard1</option>
  <option>impossible1</option>
</select>

A: You can pack inputs in outer div, use closest("div") to find him and inside search for input.level, see Codepen: https://codepen.io/anon/pen/YVyxgZ. Based ot this SO question: Find element within parent container with jQuery . With this solution, you can have many selects with the same CSS classes - it's easier to style them.


text:
Q: How to start my Angular Server A couple of days ago I've started learning angular and today I've stepped over this project which looks very promissing. What commands should I use or add to my project in order to make it run in a browser? Thank you a lot

A: Generally this and this might help. Proper configuration will make the development process super-easy.
If the project is well organised you can start working on it like this:
git clone https://github.com/itswadesh/angularcode-authentication-app.git myapp
cd myapp
npm install
npm start

In the second link look at the section named "Keep the app transpiling and running", here's the command shown there:
npm start

The above generally runs the server, keeps track of changes in files and acts on them - translating code to typescript/javascript and re-running the server with changed files.


text:
Q: Highchart Color Issue for series with single data with multiple colors I was working on my chart,But it gives only single color for a name:vengadesh ,
Here is my  Chart code in Fiddle..
My Example Chart in FIDDLE
But i want to get multiple colors for a single person dynamically...
My Actual Chart

MY EXPECTED CHART

A: Another solution is to set array of colors for series, then set colorByPoint: true, see: http://jsfiddle.net/7VNwk/2/
        series: [{
            type: 'column',
            name: 'Vengadesh',
            data: [2, 2, 2],
            colors: ['blue', 'red', 'green'],
            colorByPoint: true

        }]

A: series: [{
type: 'column',
name: 'Member Average Packer Price',
data: [{y: 110.20, color: 'red'},     // this point is red
                           // default blue
      {y: 110.20, color: '#aaff99'}, // this will be greenish
     ],

FIDDLE


text:
Q: SSH user client config with host wildcards I have this in my ~/.ssh/config file:
Host jupiter
  HostName jupiter.engin.x.edu
  User rob

Host *.engin.x.edu
  User bladex

Local user is 'rob' and I want to use the username 'bladex' for every host in the engin.x.edu sub-domain. But this isn't working, typing "ssh host.engin.x.edu" responds with "rob@host.engin.x.edu's password:"
What am I doing wrong? My resolv.conf includes "search engin.x.edu".

A: Most of the times that ssh ignores a file, that's because file permissions are wrong.
For example, man ssh_config says:

~/.ssh/config
This is the per-user configuration file.  The format of this file is described above.  This file is used by the SSH client.  Because of the potential for abuse, this file must have strict permissions: read/write for the user, and not accessible by others. It may be group-writable provided that the group in question contains only the user.

You must also check the permissions of all the parent directories of the file. I.e., if your home is /home/rob, you should check the permissions of /home, /home/rob, /home/rob/.ssh, and /home/rob/.ssh/config.
Assuming that your home has already secure permissions, a command that often helps is:
chmod -R go= ~/.ssh

Remember that ssh -vvv host.engin.x.edu it useful to debug those problems.


text:
Q: Vim - how to run a command immediately when starting vim? I have a plugin (FindFile.vim) that needs to run :FindFileCache . whenever I start vim to gather a file cache for quick opening.. I have to run this every time I start vim though.
How might I write a command that runs once, every time that vim starts up?

A: To get even later than other answers but still just after startup, use a timer in .vimrc.  For example, this code in .vimrc waits half a second after startup before setting a variable.
function DelayedSetVariables(timer)
    let g:ycm_filetype_blacklist['ignored'] = 1
endfunction
let timer=timer_start(500,'DelayedSetVariables')

(The variable in the example is the blacklist from YouCompleteMe plugin.  I assume, the plugin starts up some other process asynchronously which then creates variables, but is not quite ready by the time vim has started.  The variable does not exist when I try to set it in .vimrc, an after file, or VimEnter event.  This is specific to my Windows system somehow, YCM documentation says .vimrc should work for setting options.)

A: The best place to keep your configuration stuff is in your .vimrc
file. However, it's sourced too early, check :h startup:

At startup, Vim checks environment variables and files and sets values
accordingly.  Vim proceeds in this order:

1. Set the 'shell' and 'term' option                *SHELL* *COMSPEC* *TERM*
2. Process the arguments
3. Execute Ex commands, from environment variables and/or files *vimrc* *exrc*
4. Load the plugin scripts.                                 *load-plugins*
5. Set 'shellpipe' and 'shellredir'
6. Set 'updatecount' to zero, if "-n" command argument used
7. Set binary options
8. Perform GUI initializations
9. Read the viminfo file
10. Read the quickfix file
11. Open all windows
12. Execute startup commands

As you can see, your .vimrc will be loaded before plugins. If you put :FindFileCache . in it an error will occur, since that command does not exist yet. (It will exist once the plugin is loaded in step 4.)
To solve this, instead of executing the command directly, create an
auto-command. Auto-commands execute some command when an event occurs. In this case, the VimEnter event looks appropriate (from :h VimEnter):
                                                    *VimEnter*
VimEnter                    After doing all the startup stuff, including
                            loading .vimrc files, executing the "-c cmd"
                            arguments, creating all windows and loading
                            the buffers in them.

Then, just place this line in your .vimrc:
autocmd VimEnter * FindFileCache .

A: Create a file named ~/.vim/after/plugin/whatever_name_you_like.vim and fill it with
FindFileCache .

The order in which scripts are read and executed in the vim directories is described in :help 'runtimepath'

A: There is also the -c flag of vim. I do this in my tmuxp config to have vim start with a vertical split:
vim -c "vnew"

At least with neovim you can also open a file at the same time:
nvim -c "colorscheme mustang" some_file

A: Put FindFileCache in your .vimrc.
Autload commands are different and will not work for your scenario.

A: You can run vim file.txt "+:FindFileCache ."


text:
Q: Looking for an example of quotient ring isomorphism. In a homework problem,  I need to find an example of quotient ring isomorphism $\frac{R}{I}\cong\frac{R}{J}$ such that $I\neq J$. I think that it is a common issue but I am not pretty sure about it...
I have been reading about this issue and I have found that if I take any polynomial ring $R=K[X]$ for some field $K$, if I consider the ideal $I=(X)$ and the ideal $J=(X-1)$ then $\frac{R}{I}\cong\frac{R}{J}\cong K$.
It is true? Could you give me a specific example with a little clarification or comment?

A: For $a\in \mathbb{R}$, fuction: $$\phi_a:\mathbb{R}[x]\to \mathbb{R}:\phi_a(p(x)):=p(a)$$
is a ring homeomorphism:
$$\phi_a(p(x)+q(x))=p(a)+q(a)=\phi_a(p(x))+\phi_a(q(x))$$
$$\phi_a(p(x)q(x))=p(a)q(a)=\phi_a(p(x))\phi_a(q(x)).$$
Also:
$$\mathrm{Ker}\,\phi_a=\{p(x)\in\mathbb{R}[x]:\phi_a(p(x))=p(a)=0\}=
\{p(x)\in\mathbb{R}[x]:x-a | p(x)\}=<x-a>$$
and
$$\mathrm{Im}\,\phi_a=\{\phi_a(p(x))=p(a): p(x)\in\mathbb{R}[x]\}=\mathbb{R}.$$
So function: $$\mu_a:\frac{\mathbb{R}[x]}{<x-a>}\to \mathbb{R}:\mu_a\big(p(x)+<x>\big)=p(a)$$ is a ring isomorphism.
So $$\frac{\mathbb{R}[x]}{<x-a>} \cong \frac{\mathbb{R}[x]}{<x-b>}\cong \mathbb{R},$$
while $<x-a>\neq <x-b>$ for $a\neq b.$

A: Yes note that since K is a field K[x] is an Euclidean domain. Now map you want to consider is sending polynomial to its remainder. (This is almost an answer  I won't elaborate more as this is a homework.)


text:
Q: Electrical conductivity circuit help, with two solenoids I have a project im working on but cant seem to figure out the basic of the circuit.
The principal of the circuit is two solenoids wrapped around a chemistry glass making a magnetic field. The purpose is to measure salinty of the water in the cup. Plan is to amplify the signal enough to see a clear difference in salinty levels, which shall become proportinal with a 4-20mA signal.
 The two solenoids around the glass.
 Picture is from an pdf.
My question is, what components is needed in the circuit and why? How much Vpeak-peak and hertz would you recommend? Im using an signal generator and  a osciloscope to measure.


text:
Q: What is Dark Elixir? What is Dark Elixir storage, Dark Elixir drill, and Dark Elixir? I am in level 6 town hall I'll get Dark Elixir storage in the next town hall level. I need to know what it is and what it's used for.

A: The Dark Elixir storage is where Dark elixir is stored and is similar to Elixir and Gold storage buildings. Dark Elixir is used to train Dark Elixir Troops through the Dark Barracks, as well as buy and upgrade Heroes.
Dark Elixir Troops are extremely expensive to train (because of the rarity of Dark Elixir), but are also generally more powerful than normal troops. Dark Elixir troops reside in the Army Camp, similar to normal troops e.g. Barbarian, archer etc.
Heroes are super powerful troops that do a lot of damage. They are immortal, but if injured in battle must sleep to regenerate their health. There are two heroes, the Barbarian King and the Archer Queen.
You can acquire Dark Elixir from raiding, or with the Dark Elixir Drill which is first unlocked at town hall 7 and a second one at town hall 8.
As of the Dark Spell Factory Update (1/7/15), Dark Elixir can also be spent on Dark Spells which are simpler spells which although are more specialized, are more powerful (compared power-per-storage-space to their elixir counterparts) and take up less space.

A: Dark Elixir is a more powerful and rare form of elixir. According to the Clash of Clans Wiki:

Dark Elixir is a resource that is collected by dark elixir drills. Once collected it is stored in your dark elixir storage. The amount of dark elixir you have is displayed at the top right side of the screen under elixir. Dark elixir is used for purchasing and upgrading hero class troops, as well as training and upgrading dark elixir troops.

Dark Elixir is created/found with a Dark Elixir Drill. They can be obtained once you reach Town Hall Level 7. Mining Dark Elixir takes time, because it IS rare.
Dark Elixir can buy you several troops, which include minions, Hog riders, Valkyrie, and others.


text:
Q: How to test calculation functions, when your function returns different amount of decimals to the calculated number? I have a function that changes food ingredient amount and adjusts the macronutrients accordingly.
For example - changing 100g of rice to 150g, would 1.5x its macronutrients.
Here is my test code:
const fakeIngredient = {
  product_name: 'test',
  number_of_servings: 100,
  serving_quantity: 1,
  nutrients: {
    'energy-kcal_serving': 100,
    carbohydrates_serving: 3.75,
    fat_serving: 1.25,
    protein_serving: 3.773
  },
  amount: 100,
  uid: 'test'
};
const fakeIngredientChanged = {
  product_name: 'test',
  number_of_servings: 140,
  serving_quantity: 1,
  nutrients: {
    'energy-kcal_serving': 140,
    carbohydrates_serving: 5.25,
    fat_serving: 1.75,
    protein_serving: 5.2822
  },
  amount: 140,
  uid: 'test'
};

describe('Home', () => {
  it('should change amount of ingredient', () => {
    const result = changeAmountOfIngredient(
      fakeIngredient.serving_quantity,
      140,
      fakeIngredient
    );
    expect(result).toStrictEqual(fakeIngredientChanged);
  });
});

My test fails, because of this:
    -     "protein_serving": 5.2822,
    +     "protein_serving": 5.2822000000000005,

I manually created these 2 variables and used calculator to let calculated ingredient match 140g.
It seems like calculator gets the same number as my function, however the rounding is messed up?
What can I do to test this calculation function accurately, am I doing something wrong?


text:
Q: Android - Adding Views to Images doesn't update - onClick Summary
When a user clicks on the RecyclerView item, I would like to add tags to that image from the information that has been stored in a BaaS [Sashido] (X Co-ordinates, Y Co-ordinates and Tag name). But, the problem I'm having isn't getting the position per-say. I create a toast when the image has been clicked, it shows the correct position corresponding to the view itself. (zero for the beginning, so on and so forth)
But how to update the position once the user clicks on another item in the list, so that the tags that correspond to the position in the array in Sashido, match the position in the RecyclerView, because at the moment the first row in the Sashido class is populating all images with that row's tags.
My assumption was to the pass the position to the getTagInformation() method using getLayoutPosition() so that when objects.get(position) array is called, it'll get the same position for Sashido class but it isn't. I feel the adapter must not be updating correctly after the user has clicked on a new item.
onBindViewHolder:
@Override
public void onBindViewHolder(RecyclerViewHolderPreviousPosts holder, int position) {
    holder.bind(previousPostsList.get(position), listener);
}

onBind:
void bind(final PreviousPostsDataModel model, final OnItemClickListener listener) { ...

uploadedImage.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View v) {
                        if (count == 0) {
                            imageid = model.getImageId();
                            Toast.makeText(App.getContext(), "Image ID: " + imageid, Toast.LENGTH_SHORT).show();
                            Toast.makeText(App.getContext(), "Position: " + getAdapterPosition(), Toast.LENGTH_SHORT).show();
                            getTagInformation(getLayoutPosition());
                        } else {
                            Log.e("qwert", "" + imageid);
                            imageContainer.removeAllViews();
                            imageContainer.addView(uploadedImage);
                            count = 0;
                        }
                }
            });
... }

getTagInformation:
private void getTagInformation(final int position) {
                ParseQuery<ParseObject> query = ParseQuery.getQuery("FashionFeed");
                query.findInBackground(new FindCallback<ParseObject>() {
                    @Override
                    public void done(List<ParseObject> objects, ParseException e) {
                        if (e == null) {
                            Toast.makeText(context, "" + position, Toast.LENGTH_SHORT).show();
                            JSONArray tagNamesArray = objects.get(position).getJSONArray("tagName");
                            JSONArray posXArray = objects.get(position).getJSONArray("tagPointX");
                            JSONArray posYArray = objects.get(position).getJSONArray("tagPointY");

                            for (int i = 0; i < tagNamesArray.length(); i++) {
                                for (int t = 0; t < tagNamesArray.length(); t++) {
                                    tagNames.add(tagNamesArray.optString(t));
                                    tagXPositions.add(posXArray.optString(t));
                                    tagYPositions.add(posYArray.optString(t));

                                }

                                for (int o = 0; o < tagNamesArray.length(); o++) {
                                    tag = new TextView(App.getContext());
                                    tag.setX(Float.parseFloat(tagXPositions.get(o)));
                                    tag.setY(Float.parseFloat(tagYPositions.get(o)));
                                    tag.setText(tagNames.get(o));
                                    tag.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT));
                                    tag.setMaxLines(1);
                                    tag.setTextSize(11);
                                    tag.setClickable(true);
                                    tag.setHintTextColor(Color.WHITE);
                                    tag.setTextColor(Color.WHITE);
                                    tag.setBackgroundResource(R.drawable.tags_rounded_corners);
                                    imageContainer.addView(tag);
                                    count = 1;
                                }
                            }
                        } else {
                            Toast.makeText(context, "" + e.getMessage(), Toast.LENGTH_LONG).show();
                        }
                    }
                });
        }

I have also tried
public void getTagInformation(String imageid) {
ParseQuery query = ParseQuery.getQuery("FashionFeed");
query.WhereEqualTo("objectId", imageId);
....
}

with the imageId passed into the method and with also me manually entering an objectId that will match, it'll still only produce the tags that belong to that objectId. it just doesn't seem that this query is going through all of the objects. Just getting the tag information from that one object and then setting all the images with those tags.
if you need me to provide anymore code, I'm more than happy to.

A: Hi @BIW please follow below link link
In onBindViewHolder, you are adding listener every time, so it returns same object every time as recyclerView ViewHolder pattern uses same object to render recyclerView item in onBindViewHolder. So you need to add when you are creating holder object and set listener to it so that you will get a proper position.
package com.subbu.moviemasti.adapter;

import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;

import com.squareup.picasso.Picasso;
import com.subbu.moviemasti.Constants;
import com.subbu.moviemasti.R;
import com.subbu.moviemasti.entities.Movie;

import java.util.List;

import butterknife.Bind;
import butterknife.ButterKnife;

/**
 * Created by subrahmanyam on 25-11-2015.
 */
public class MovieAdapter extends RecyclerView.Adapter<MovieAdapter.ViewHolder> {

    private final List<Movie> movieList;
    private onRecyclerViewItemClickListener mItemClickListener;

    public MovieAdapter(List<Movie> movieList) {
        this.movieList = movieList;
    }

    @Override
    public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
        View view = LayoutInflater.from(parent.getContext())
                .inflate(R.layout.grid_item, null);
        ViewHolder holder = new ViewHolder(view);
        return holder;
    }

    @Override
    public void onBindViewHolder(ViewHolder holder, int position) {
        final Movie movie = movieList.get(position);
        String imageUrl = Constants.MOVIE_POSTER_BASE_URL + movie.getPosterPath();
        if (imageUrl != null) {
            Picasso.with(holder.posterImage.getContext()).load(imageUrl).
                    placeholder(R.drawable.img_default).
                    into(holder.posterImage);
        }
    }

    @Override
    public long getItemId(int position) {
        return 0;
    }

    @Override
    public int getItemCount() {
        return movieList.size();
    }

    public void setOnItemClickListener(onRecyclerViewItemClickListener mItemClickListener) {
        this.mItemClickListener = mItemClickListener;
    }

    public interface onRecyclerViewItemClickListener {
        void onItemClickListener(View view, int position);
    }

    public class ViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener {
        @Bind(R.id.poster)
        ImageView posterImage;

        public ViewHolder(View view) {
            super(view);
            ButterKnife.bind(this, view);
            view.setOnClickListener(this);
        }

        @Override
        public void onClick(View v) {
            mItemClickListener.onItemClickListener(v, getAdapterPosition());
        }
    }

}

Where we are creating adaper object, from there we need to set listener
like adapter.setOnItemClickListener(this)
class MyActivity extendsActivity implements onRecyclerViewItemClickListener {
@Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_home);
    manager = new GridLayoutManager(getActivity(), cols);
            gridView.setLayoutManager(manager);
gridView.setAdapter(adapter);
adapter.setOnItemClickListener(this);
}
 @Override
        public void onItemClickListener(View view, int position) {
            //Do wantever you want to do
        }
}

From ViewHolder class we need to pass position of a recyclerView or we can write code what you need to execute when click on item.

A: Solved the problem. It wasn't so much that the position was wrong, it was because I was trying to find the tags before I was populating the list of images due to Parse's FindInBackground() callback, it was being populated far too late.
The solution was that I got the JSONArray that contained the Tag names, x-coordindates and y co-ordinates inside the original query that was populating the original list of images. So they would execute simultaneously, then I passed the JSONArray values into the model, which then was passed to the bind() function in the Adapter.
Before, the problem was that the adapter was binding all of the tags onto every image, so when the click event happened on the image it would only add the tag to the imageContainer that was currently selected (in the current position), not any partiular view in any particular position.
This made it so every time the image was clicked it was always finding the first object in the database and assigning it to the selected image. [due to the click event triggering the getTagInformation() function).
With the automation of the getTagInformation method within the Bind function of the ViewHolder, I was able to populate every image with the correct tags and further manipulate it using an onClickListener assigned to the image as shown below:
RecyclerView Holder:
public class RecyclerViewHolderPreviousPosts extends RecyclerView.ViewHolder implements View.OnClickListener {
        // View holder for gridview recycler view as we used in listview
        public TextView createdAt;
        public ImageView uploadedImage;
        public TextView caption;
        TextView number_of_likes;
        TextView number_of_comments;
        TextView number_of_tags;
        public ImageView comments;
        public RelativeLayout imageContainer;

    RecyclerViewHolderPreviousPosts(View view) {
        super(view);
        // Find all views ids
        this.createdAt = (TextView) view
                .findViewById(R.id.created_date);
        this.uploadedImage = (ImageView) view
                .findViewById(R.id.image);
        this.caption = (TextView) view
                .findViewById(R.id.caption_post);
        this.number_of_likes = (TextView) view
                .findViewById(R.id.number_of_likes);
        this.number_of_comments = (TextView) view
                .findViewById(R.id.number_of_comments);
        this.number_of_tags = (TextView) view
                .findViewById(R.id.number_of_tags);
        this.comments = (ImageView) view
                .findViewById(R.id.comments_image);
        this.imageContainer = (RelativeLayout) view
                .findViewById(R.id.image_container);
        view.setOnClickListener(this);
    }

    void bind(PreviousPostsDataModel model1, final int position) { ....
        model = previousPostsList.get(position);
        getTagInformation();
....}

    private void getTagInformation() {
        for (int o = 0; o < model.getTagSize(); o++) {
            tag = new TextView(App.getContext());
            tag.setX(Float.parseFloat(model.getXpoints(o)));
            tag.setY(Float.parseFloat(model.getYpoints(o)));
            Log.e("x", "" + tag.getX());
            Log.e("y", "" + tag.getY());
            tag.setText(model.getTagName(o));
            tag.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT));
            tag.setMaxLines(1);
            tag.setTextSize(11);
            tag.setClickable(true);
            tag.setHintTextColor(Color.WHITE);
            tag.setTextColor(Color.WHITE);
            tag.setBackgroundResource(R.drawable.tags_rounded_corners);
            imageContainer.addView(tag);
            tags.add(tag);
        }
    }

    @Override
    public void onClick(View v) {
        if (count == 0) {
            for (int i = 0; i < tags.size(); i++) {
                tags.get(i).setVisibility(View.INVISIBLE);
            }
            count = 1;
        }
        else {
            for (int j = 0; j < tags.size(); j++) {
                tags.get(j).setVisibility(View.VISIBLE);
            }
            count = 0;
        }
    }
}

Profile Fragment [Original Query] :
private void populateSelectedUserRecyclerView(String objectid) {
        ParseQuery<ParseObject> query = ParseQuery.getQuery("FashionFeed");
        query.whereEqualTo("uploader", ParseObject.createWithoutData("_User", objectid));
        query.orderByDescending("createdAt");
        Log.e("get order", "ordered");
        query.findInBackground(new FindCallback<ParseObject>() {
            @Override
            public void done(List<ParseObject> objects, ParseException e) {
                Log.e("gets done", "gets into done");
                if(e == null) {
                    if (objects.size() > 0) {
                        Log.e("does it get here", "it got here");

                        latestPostList = new ArrayList<>();
                        for (ParseObject j : objects) {
                            JSONArray tagNamesArray = j.getJSONArray("tagName");
                            JSONArray posXArray = j.getJSONArray("tagPointX");
                            JSONArray posYArray = j.getJSONArray("tagPointY");
                            latestPostList.add(new PreviousPostsDataModel(tagNamesArray, posXArray, posYArray));
                        }
                    }
                    else {
                        no_follow_display.setVisibility(View.VISIBLE);
                        no_follow_display.setText(R.string.no_posts);
                        no_follow_display.bringToFront();
                        recyclerView.setVisibility(View.GONE);
                    }

                    adapter = new RecyclerViewAdapterPreviousPosts(getActivity(), latestPostList, listener);
                    recyclerView.setAdapter(adapter);// set adapter on recyclerview

                    adapter.notifyDataSetChanged();
                }
                else {
                    Log.e("failed", "failed" + e.getMessage());
                }
            }
        });
    }

Thanks for your help.

A: If I understand correctly question the problem is that ParseQuery don't return objects in the same order. So the assumptions that position of object in Your RecycleView is the same as in ParseDatabase is wrong.
If u want to get TAG from Sashido You should firstly make some relations to Images e.g additional column. Then make query white extra parameter like:
private static final String UNIQ_TAG_ID= "tagId";
query.whereContainedIn(UNIQ_TAG_ID, id);
or get All ParseObjects like u doing now and find that TAG that correspond to Your image, then take info.