J.Z.

2

votes
0

answer
29

views

How to force gRPC cpp program using single thread only

I need to run my client application (written in c++ with gRPC) in an operating system (which only support single thread). However, I noticed that grpc::InsecureChannelCredentials(); is trying to create multiple threads. Here is the output from debugger after calling that gRPC function in my host mac...
J.Z
1

votes
2

answer
692

views

How can exclude term from get_terms by term name not by term id

My code below. It does not work to delete using the terms. I need it to work like this and not delete by ID. $terms = get_terms( 'MY_TAXONOMY', array( 'orderby' => 'name', 'order' => 'ASC', 'exclude' => array(), ) ); $exclude = array('MY TERM', 'MY TERM 2', 'MY TERM 3'); $new_the_category = '';...
J.Z
0

votes
2

answer
25

views

Best strategy to process this text file into a structured table?

My collaborator wants me to process the a input text file into a structured table: The raw input text file looks like PMID 22224631 Title -765 G_C and -1195 A_G promoter variants of the cyclooxygenase-2 gene decrease the risk for preeclampsia. Found 8 gene(s) Gene CRP Mentions Gene GC...
J.Z.
2

votes
3

answer
84

views

How to calculate the product from combinations of several vectors in R?

I feel it hard to give an accurate title, though I have tried my best. Here's my problem. a = 1/(1:10) b = 3/(1:10) c = 1/(1:5) d = 1/(1:11) I would like to get a vector e, such that e consists of the product calculated from the combinations of values chosen from a, b, c and d. For example, supposin...
J.Z.
1

votes
1

answer
578

views

ReactPHP/Socket server - set connection timeout

I have TCP Socket server using react\socket. Depending on received data from the client, it doing something, then it close connection with the client. The problem is i can't understand how to make connection timeout, if the server have not received any data for a period of time, how to close connect...
J_z
2

votes
2

answer
3.1k

views

Nginx real client IP to TCP stream backend

I'm trying to use Nginx as proxy for my TCP daemon, to make Nginx be SSL/TLS frontend, as well as load control. My backend app needs real client IP, and this is a problem. stream { server { listen 3333; proxy_pass 127.0.0.1:2222; } } I found one solution in docs: proxy_bind $remote_addr transpar...
J_z
1

votes
3

answer
54

views

How to enumerate all combinations in a matrix in R?

I am trying to construct a matrix that includes all the possible combinations. For example, a=(1:2)^3 #=c(1,8) b=(1:3)^2 #=c(1,4,9) And I would like to define c such that c=c(1+1,1+4,1+9,8+1,8+4,8+9). I have learned from my previous question on how to get such a c from function outer. My current que...
J.Z.
7

votes
2

answer
3.1k

views

window.navigator or just navigator?

What object I should use to determine browser's info? alert(window.navigator.userAgent); or alert(navigator.userAgent); Is there any recomendations about cross-browser compatibility of a decision?
J_z
2

votes
1

answer
325

views

brew install libxml2 timing out

brew install libxml2 doesn't work for me, and I can't determine why. jzohrab:~ jzohrab$ brew install libxml2 --verbose ==> Downloading ftp://xmlsoft.org/libxml2/libxml2-2.9.0.tar.gz /usr/bin/curl -f#LA Homebrew 0.9.4 (Ruby 1.8.7-358; Mac OS X 10.8.2) ftp://xmlsoft.org/libxml2/libxml2-2.9.0.tar.gz -C...
J.Z.
2

votes
1

answer
185

views

PyParsing: Is it possible to globally suppress all Literals?

I have a simple data set to parse with lines like the following: R1 (a/30) to R2 (b/30), metric 30 The only data that I need from the above is as follows: R1, a, 30, R2, 192.168.0.2, 30, 30 I can parse all of this easily with pyparsing, but I either end up with a bunch of literals in my output, or I...
J.Z.
7

votes
2

answer
3.4k

views

HTML5 Input Pattern vs. Non-Latin Letters

I want to make pre-validation of some input form with new HTML5 pattern attirbute. My dataset is 'Domain Name', so regex preset isn't applied. But there is a problem, I wont use A-Za-z , because of damned IDN's (Internationalized domain name). So question: is there any way to use for random non-en...
J_z
1

votes
5

answer
60

views

How to use SQL (postgresql) query to conditionally change value within each group?

I am pretty new to postgresql (or sql), and have not learned how to deal with such 'within group' operation. My data is like this: p_id number 97313 4 97315 10 97315 10 97325 0 97325 15 97326 4 97335 0 97338 0 97338 1 97338 2 97344 5 97345 14 97349 0 97349 5 p_id is no...
J.Z.
3

votes
1

answer
906

views

how to get variable returned from struts-2-jquery <sj:a> action oncompletetopics call

I have a button 'Show Me', which makes an AJAX call to get the name, if the call successfully returns the name, the button 'Get Key' will show in target result div. How can I get the variable name in the oncompletTopics function? Righ now in script, the name is undefined. The anchortag and terget di...
J Z
7

votes
1

answer
1.7k

views

What's the difference between “performSelector:withObject:afterDelay:” where delay is 0, and just calling the selector?

I'm working on an iPad project that uses a third-party SDK, and have been reading through the SDK code to learn about it and objective-c. I came across the following line in an asynchronous callback: [self performSelector:@selector(doSomething) withObject:nil afterDelay:0]; I've read through the do...
J.Z.
2

votes
2

answer
1.3k

views

Spring Boot, Autowired is null in ServletContextListener.contextInitialized

I get a NullPointerException by Autowiring in contextInitialized, maybe somebody can help me, thanks a lot. The Main class @SpringBootApplication @CompnentScan public class Application extends SpringBootServletInitializer { public static void main(String[] args) throws Exception { SpringApplication....
J.Z.
8

votes
1

answer
767

views

Regex: Capture one or more groups if exists (Java)

I want to capture groups matching a pattern where the input can contain this group one or more times. Example: input = 12361 randomstuff371 12 Mar 16 138more random381 stuff73f I want to capture the '12 Mar 16'. From this I have easily used the regex: pattern = ('.*(\\d{2}\\s\\w+\\s\\d{2}).*'); Howe...
J Z
2

votes
1

answer
40

views

How to put Rmpfr values into a function in R?

I am calculating the inverse of a Vandermonde Matrix. I have written the codes to calculate the inverse explicitly by its formula as below: library(gtools) #input is the generation vector of terms of Vandermonde matrix. FMinv library(Rmpfr) > a=mpfr(c(10:1),1000)/Rmpfr::mpfr(sum(1:10),1000) > a 10...
J.Z.
2

votes
2

answer
2.5k

views

How to pass a Map<ObjectA, List<ObjectB>> to action in Struts 2

I have a event object, inside there is a Map, the ObjectA is the label, and the list are table rows. With following code, I can display the tables correctly, but when I submit the form to Action class, the map is null inside the event. JSP CODE: Plan Type: @Andrea & Roman, So I modified the code....
J Z
0

votes
0

answer
6

views

Segmentation Fault in C - Doubly Linked List

I am currently writing a Doubly Linked List program in C, and I am coming across issues when testing. I seem to successfully pass the first test of appending values (which is just adding 1-9 to begin with) but afterwards, my program doesn't do anything. When I run in the terminal, it prints the list...
J Z
2

votes
1

answer
61

views

GCC keeps complaining “error: incorrect rounding operand” for a AVX512 functions _mm512_cvt_roundpd_epi64

I am using _mm512_cvt_roundpd_epi64 and keep getting complier error as: /dump/1/alicpp2/built/gcc-7.3.0-7u2/gcc-7.3.0/lib/gcc/x86_64-pc-linux-gnu/7.3.0/include/avx512dqintrin.h:1574:14: error: incorrect rounding operand __R); Here is my code: #include #include void Date64Align(int64_t* dst, int64...
j.z.
2

votes
1

answer
254

views

How to best design custom delegates wrapping other delegates

I am relatively new to Objective C, and have an architecture question regarding creating custom delegates around existing delegates. It's probably best described in pseudocode. Apologies for the length, I couldn't determine how to make it more succinct. Overall desired architecture summary I have...
J.Z.
2

votes
1

answer
140

views

PostgreSQL: compare NULL and normal value

I have a trigger in PostgreSQL CREATE OR REPLACE FUNCTION table_update_func_pk1() RETURNS trigger AS $$ DECLARE ri RECORD; old_value TEXT; new_value TEXT; BEGIN FOR ri IN SELECT column_name FROM information_schema.columns WHERE table_schema = quote_ident('public') AND table_name = quote_ident(TG_TAB...
J.Z.
2

votes
4

answer
70

views

JQuery, get input id

$(document).ready(function() { $('#hotelo_div :input').onblur = validate(1, this.id, 'abcd'); }); PMI1 % % % % ... How to send input id(e.g. PMI_1, PMI_2, ...) to function validate for parameter at posiont 'this.id'?
J.Z.
1

votes
1

answer
52

views

Aggregate multiple rows in R based on common values in given columns by column indices

Here is a very similar question: Aggregate multiple rows of the same data.frame in R based on common values in given columns In my situation, the selection of columns is changing in different simulated samples. I have the selected column indices in each simulation. How can I use the function aggrega...
J.Z.
0

votes
1

answer
96

views

How to guarantee that a particular delegate will handle a RestKit response

This question is about wrapping RestKit requests in custom objects, and whether or not I can guarantee that an object sending the RestKit request will also be used as a delegate when the response is returned. I'm working with an abstruse REST API (Salesforce), and RestKit doesn't appear to handle so...
J.Z.
0

votes
0

answer
221

views

Apache Cordova - Media Plugin play/stop button toggle

I am creating a app for android using cordova plugin media. How creating a button to switch the play/stop using the function below? function playAudio(src) { my_media = new Media(src, onSuccess, onError); my_media.play();} function pauseAudio() { if (my_media) { my_media.pause();}} function stopAu...
J.Z