Oct 6, 2017 22:16
Thanks a lot though for helping me out, Its been a couple of days I have been trying to figure this out
Oct 6, 2017 22:16
Is that possible with your code?
Oct 6, 2017 22:16
when multiple calls are made at the within the delay threshold, I can identify as a non-human interaction and would like to cancel that call
Oct 6, 2017 22:15
yeah your code works but in my implementation it still leaks out a function call that breaks things on my end
Oct 6, 2017 22:00
So what I am doing is I have more than 20 ss-multiselect-dropdown boxes and something called an autoRefresh() turned on. Everytime some changes happen to the dropdown boxes, the autoRefresh() kicks in and starts firing all the onChange() functions. I want onChange() not to be fired unless there is a human interaction which should not be more than 1 clicks within 250ms
Oct 6, 2017 21:57
hi
Oct 6, 2017 21:43
Yes. That's what I want. The reason I am doing this is there is an automatic update call in my code that constantly checks and unchecks these checkboxes I have and I only want to run the onChange() when a user clicks on the boxes.
Oct 6, 2017 21:43
More Clarification: For example, if two calls are made within 250ms, both calls should be ignored.
Oct 6, 2017 21:43
Is it possible to change it up a little bit to debounce everything when multiple calls are made? And only allow 1 and only 1 call made to the function to pass through? i am not sure if debounce is the right word for this modified behavior.
Oct 6, 2017 21:43
does your code just add delays or work the same as Ben Alman's debounce ?
 

Java

Dedicated to the discussion of the Java programming language a...
Jul 12, 2017 17:55
yup, I know :) I meant, how does that impact the solution idea you were trying to give me?
Jul 12, 2017 17:40
what does that mean?
Jul 12, 2017 16:42
@JennaSloan Ofcourse I did, it just confused me and that's why I am here :)
Jul 12, 2017 16:40
@motaa So how do I create my JValue from a string? Can you please point me to an example or something?
Jul 12, 2017 16:26
do I need to have scala-library.jar in my classpath so that the scala classes are compatible with my JAVA project?
Jul 12, 2017 16:25
@motaa Which library should I use though? I have looked at jackson and Gson and they have their own types
Jul 12, 2017 16:16
I have to use a JAR that was originally written in Scala and uses the Json4s library to work with JSON
Jul 12, 2017 16:16
Hi, Is it possible to convert a string to Json4s JValue type in Java?
 

JavaScript

Topic: Anything JavaScript, ECMAScript including Node, React, ...
May 31, 2017 15:11
Thanks @KarelG
May 31, 2017 15:10
So basically I am getting a bunch of data through an external API and trying to read the dict inside it safely
May 31, 2017 15:09
@KarelG: I am not a true fan of one liners but in my case I am builing another JSON structure and assigning one of the new key ^THAT value :)
May 31, 2017 15:08
sure, how do I check as a one liner?
May 31, 2017 15:08
@ndugger
May 31, 2017 15:03
Hi Guys, I have a JS array defined as data[0]="hi there" now I would like to set a default value such as "go away!" if someone tries to access data[1] since it does not exist. How do I do this? I tried doing something like this if (!(data[1] in data)) data[1] = "go away!" but it does not work as expected
Apr 18, 2017 18:05
but this just worked --> new Date().toString()
Apr 18, 2017 18:04
OMG! thanks @KevinB, this should be in the docs somewhere, I was doing all sorts of hhhh:mm:sss formatters to get it
Apr 18, 2017 17:59
I am injecting JS inside a Apache Nifi processor
Apr 18, 2017 17:59
that's the sad think about this
Apr 18, 2017 17:59
I can't use external JS libraries :(
Apr 18, 2017 17:57
I can easily get the format until the time but GMT-0600 (MDT) I could not find related documentation for generate that string
Apr 18, 2017 17:57
Hi Guys, how do I print out DateTime in this format using plain javascript?
"Sat Mar 18 2017 08:28:59 GMT-0600 (MDT)"
 

Python

Room rules: sopython.com/chatroom Code formatting guide: tinyu...
Feb 21, 2017 21:06
yeah turns out when I run dzdo python, I am able to import all the files
Feb 21, 2017 20:55
all other packages are owned by root too
Feb 21, 2017 20:55
does it have to do with permissions then?
Feb 21, 2017 20:54
Guys, On the machine (in site-packages) I do see py3compat permissions as this:

drwx------ 2 root root 4096 Feb 21 13:25 py3compat-0.3-py2.6.egg-info
-rw------- 1 root root 3210 Feb 21 13:25 py3compat.py
-rw------- 1 root root 4778 Feb 21 13:25 py3compat.pyc
Feb 21, 2017 20:06
@AndrasDeakYes
Feb 21, 2017 19:55
I had to do dzdo pip install py3compat
Feb 21, 2017 19:55
I did install it using dzdo
Feb 21, 2017 19:50
yes, its kind of like that
Feb 21, 2017 19:48
Python2.7 is my dev machine
Feb 21, 2017 19:48
Sorry guys got a little busy, I have Python 2.6.6
Feb 21, 2017 19:35
I googled like half an hour and detoured towards SO
Feb 21, 2017 19:35
yup pip install pycrypto works, but when I try to import RSA from Crypto.PublicKey import RSA, I see the problem
Feb 21, 2017 19:34
So, on my dev machine, I am using python27 and pycrypto without a problem, I am trying to deploy a script on a host with python2.6 and I see this problem
Feb 21, 2017 19:31
so do you think there is an issue with pip2 and py3compat?
Feb 21, 2017 19:30
Thanks :)
Feb 21, 2017 19:30
@DSM Thanks, I will keep that in mind
Feb 21, 2017 19:30
since I am using python 2.6
Feb 21, 2017 19:30
yes
Feb 21, 2017 19:29
py3compat*