« first day (588 days earlier)      last day (4343 days later) » 

1:46 AM
noone home?
 
 
6 hours later…
7:48 AM
hi all
how to solve jquery conflicts problem?
@FlorianMargaine
@Esailija @AndyE
any idea?
 
stfu
 
8:18 AM
google for noconflict, that should be enough for you
hi @Esailija :)
 
^^
 
not in a good mood today, heh? :p
currently reading "The Definitive Guide to Django"
 
no it was not bad mood but spamming with pings :P
 
guess so :-)
@Esailija 245 rep yesterday :p
 
Lol
yea
 
8:34 AM
the book is really good btw
I started with the online tutorial, but it went straight into deep stuff, this book starts with basic stuff, it's really great
 
8:48 AM
do you think this is uniform distribution?
var rand = function() {
	var cur = +new Date(),
		mod = Math.pow( 2, 48 ),
		a = 25214903917,
		c = 11;

	return function() {

		var ret = cur = (a*cur + c) % mod;
		return ret / mod;
	};
}();

var a = {}, l = 1000000;

while( l-- ) {
	var r = Math.floor(rand() * 100) + 1;
	if( !a[r] ) {
		a[r] = 0;
	}
	a[r]++;
}
log the object a to see how many times each value was hit
the ideal is 10000 for every number
 
what do you mean "uniform distribution"?
 
the each number is equally likely
replace rand() with Math.random()
(the built in random number generator)
with that I get worse results
with built-in Math.random() some numbers deviate too much from 10000
in most ideal result, every value in the object should be 10000
do you get it?
 
yeah
let me think :p
 
ok now I got some bad results
Object
1: 10008
2: 10013
3: 10006
4: 10009
5: 10012
6: 10006
7: 9767
8: 10017
9: 10011
10: 10011
11: 10010
12: 10011
13: 10009
14: 10007
15: 10008
16: 10007
17: 10005
18: 10010
19: 10013
20: 10010
21: 10005
22: 10008
23: 10013
24: 10010
25: 10013
26: 10011
27: 10009
28: 10014
29: 10014
30: 10013
31: 10011
32: 9766
33: 10007
34: 10008
35: 10012
36: 10008
37: 10010
38: 10012
39: 10010
40: 10008
41: 10011
42: 10007
43: 10009
44: 10010
45: 10007
46: 10006
47: 10012
48: 10007
49: 10011
50: 10010
51: 10012
 
oh so you want random numbers around 10000, but not too much deviated?
 
8:57 AM
it is to test the correctness
 
of what?
 
if I do 1 000 000 random numbers between 1 and 100
then I should get 10 000 results for each number
if you roll a dice a million times, every number in the dice should get the same amount of hits
if you flip a coin a million times, you should get about the same amount of heads as tails
 
yeah, get it
 
here is result for 10 million coin flips
Object
1: 5000035
2: 4999965
seems to work
(this was using the rand() function, not Math.random() )
 
I don't even know how Math.random() works behind the scenes
generating a random number for a computer is complicated :/
but I guess it takes current time and parses it through some kind of mathematical function that generates "almost random" patterns
 
9:02 AM
well I just pasted the code for it
var rand = function() {
	var cur = +new Date(),
		mod = Math.pow( 2, 48 ),
		a = 25214903917,
		c = 11;

	return function() {

		var ret = cur = (a*cur + c) % mod;
		return ret / mod;
	};
}();
it only reads date once, you can use other seed value but then it's always the same seed value
it needs to be less than Math.pow( 2, 48 )
 
yeah, the seed value is hardcoded for Math.random() too?
 
I don't know the javascript implementation
this is java.util.random according to en.wikipedia.org/wiki/Linear_congruential_generator
well not the seed value
but everything else (those that matter) are same as java
 
yeah
I'm not too much into maths
my studies were business oriented, not so much theory
and not really programming oriented actually <<
 
I gave it another run in 10 million coin flips
Object
1: 4999984
2: 5000016
now it's lightly biased towards 2
I think it's pretty fascinating :D
there is not much magic going on even
 
math.random is worse?
what about a jsperf? :p
 
9:07 AM
They are about the same performance I think
Math.random
Object
1: 5000782
2: 4999218
very high bias here now
well not very high but a lot higher than 16
lol ok it's a lot slower :d
261,579,557
±0.14%
fastest
13,920,057
±8.16%
95% slower
still, when storing in object both were just as slow
so that must have been the bottleneck
 
probably
what about raw perf?
like rand() vs Math.random()
well btw of course it's going to be slower
Math.random() is native...
 
yea those above are the results
261 mops vs 14 mops
for pure calls
 
but from initial tests it seems to be more accurate :P
maybe I just got lucky
I'll do 20 runs with both
 
share the link :)
 
9:14 AM
20 10 million coin flips with rand()
{"1":5000119,"2":4999881}
{"1":4999885,"2":5000115}
{"1":5000063,"2":4999937}
{"1":4999940,"2":5000060}
{"1":5000024,"2":4999976}
{"1":5000049,"2":4999951}
{"1":4999879,"2":5000121}
{"1":5000120,"2":4999880}
{"1":4999913,"2":5000087}
{"1":5000090,"2":4999910}
{"1":4999976,"2":5000024}
{"1":4999948,"2":5000052}
{"1":5000111,"2":4999889}
{"1":4999895,"2":5000105}
{"1":5000074,"2":4999926}
{"1":4999915,"2":5000085}
{"1":4999999,"2":5000001}
{"1":5000111,"2":4999889}
{"1":4999899,"2":5000101}
{"1":5000060,"2":4999940}
biggest bias is about 120
 
yeah 121 seems to be the biggest
 
Math.random()
{"1":5000782,"2":4999218}
{"1":4997103,"2":5002897}
{"1":4998774,"2":5001226}
{"1":4999334,"2":5000666}
{"1":5001324,"2":4998676}
{"1":5001447,"2":4998553}
{"1":5000277,"2":4999723}
{"1":4998570,"2":5001430}
{"1":5000009,"2":4999991}
{"1":4999937,"2":5000063}
{"1":4999946,"2":5000054}
{"1":5000221,"2":4999779}
{"1":5002053,"2":4997947}
{"1":5000932,"2":4999068}
{"1":4999305,"2":5000695}
{"1":4999910,"2":5000090}
{"1":4999740,"2":5000260}
{"1":4996873,"2":5003127}
{"1":4999417,"2":5000583}
{"1":4999682,"2":5000318}
 
~1500 is biggest bias
 
you mean ~3000?
 
9:16 AM
I'll do a jsfiddle so you can test on different computer
 
look at the second result, it's almost 3000
and the third result from the end, it's 3127
 
the code is ugly as fuck but look at console :D
so it seems to suck in windows7 chrome
 
Math.random() fiddle.jshell.net:32
{"1":4999510,"2":5000490} fiddle.jshell.net:30
{"1":4997365,"2":5002635} fiddle.jshell.net:30
{"1":4999677,"2":5000323} fiddle.jshell.net:30
{"1":5000369,"2":4999631} fiddle.jshell.net:30
{"1":5000885,"2":4999115} fiddle.jshell.net:30
{"1":5001137,"2":4998863} fiddle.jshell.net:30
{"1":4997757,"2":5002243} fiddle.jshell.net:30
{"1":5000793,"2":4999207} fiddle.jshell.net:30
{"1":5000816,"2":4999184} fiddle.jshell.net:30
{"1":5000413,"2":4999587} fiddle.jshell.net:30
math.random: 4k bias
rand(): less than 100 bias
 
idd
what is going on :D
 
... don't ask me :D
 
9:22 AM
star the fiddle pls maybe someone will notice
:d
 
I think @IvoWetzel may be able to answer :p
or maybe @AndyE too?
 
maybe i'll even make a question
 
heck, @copy might too.
 
chances are I'll be embarrased :D
 
might be an interesting question
 
9:24 AM
I'll edit it to automatically log min and max bias
ok improved jsfiddle now
Math.random() min bias: 66 max bias: 3850 values: [{"1":5001490,"2":4998510},{"1":5001657,"2":4998343},{"1":4998538,"2":5001462},{"1":5000564,"2":4999436},{"1":5003850,"2":4996150},{"1":4999925,"2":5000075},{"1":4997916,"2":5002084},{"1":5000171,"2":4999829},{"1":4997901,"2":5002099},{"1":5001401,"2":4998599},{"1":5000886,"2":4999114},{"1":5000066,"2":4999934},{"1":5001690,"2":4998310},{"1":5000745,"2":4999255},{"1":4999091,"2":5000909},{"1":5001863,"2":4998137},{"1":5000098,"2":4999902},{"1":4999370,"2":5000630},{"1":5001484,"2":4998516},{"1":4999087,"2":5000913}] fiddle.jshell.net:62
lol firefox seems to be taking forever
holy shit
in firefox
[12:34:29.251] Math.random() min bias: 10 max bias: 2941 values: [{"1":5000604,"2":4999396},{"2":4997818,"1":5002182},{"2":4998215,"1":5001785},{"2":5001463,"1":4998537},{"1":4999704,"2":5000296},{"2":4997606,"1":5002394},{"2":5000044,"1":4999956},{"1":4997566,"2":5002434},{"1":4999415,"2":5000585},{"1":4999650,"2":5000350},{"1":4998644,"2":5001356},{"2":4997849,"1":5002151},{"2":4998760,"1":5001240},{"2":4999164,"1":5000836},{"1":5001474,"2":4998526},{"2":4998695,"1":5001305},{"2":5001205,"1":4998795},{"1":4998959,"2":5001041},{"2":4999990,"1":5000010},{"1":5002941,"2":4997059}] @ http://f
though it took like 3 minutes to run D:
 
9:51 AM
@FlorianMargaine Y U PING RAGE
 
lol
 
so why does it "suck" :P
or is bias a good thing here?
btw java uses by default current system time in milliseconds as seed as well
 
10:12 AM
@FlorianMargaine it seems someone else figured out that Math.random() sucks as well: baagoe.com/en/RandomMusings/javascript
 
11:05 AM
0
Q: How do I keep user input and rendering independent of the implementation environment?

alexI'm writing a Tetris clone in JavaScript. I have a fair amount of experience in programming in general, but am rather new to game development. I want to separate the core game code from the code that would tie it to one environment, such as the browser. My quick thoughts led me to having the re...

 
11:55 AM
Hi there :-)
Lol this transcript got me in trouble with my Stereo Typed Indian Parents :-|
 
12:44 PM
@Abhishek what, your parents look at the internet?
@copy CUZ U LOVE IT
 
did you know that v8 can optimize classes at the level of static language almost :P
function Person() {

}

Person.prototype = {

	constructor: Person
};
that will be infinitely faster than any Object.create hacks
 
even Object.create itself?
(not any hack, just the method, it isn't optimized?)
 
I'll make a jsperf
 
@Abhishek y u no create your site completely? :p
 
@FlorianMargaine coz i got busy working on Jarvis and Voscast [work highest priority]
 
12:48 PM
oh btw, you guys know about announce.js? it looks awesome, seriously
@Abhishek noob :p
 
@FlorianMargaine , they looked my name and that transcript showed up . they translated it into hindi and it became an awesomness of vulgarity
@FlorianMargaine -.- don't call me that
 
aiight i will funish it today
 
i was being sarcastic, I don't expect anything from you :)
don't worry
 
12:50 PM
:-|
that sounds even more offensive now
 
it's more verbose, doesn't run a constructor and v8 is not able to optimize... wtf is the point :D
 
" I don't expect anything from you :)"
@FlorianMargaine
 
@Abhishek yeah, meaning I don't care whether you finish the site or not
I was just kidding, that's it
 
:-/ would be better if u did
 
so that you could finish it? :p
 
12:52 PM
no cause that makes me feel , friendship
and as a sideeffect i can finish it -.-
@FlorianMargaine v
the linux variant would have been so many times more concise
 
Hi to all
I have the trouble in json object updating
I am createing JSOn object dynamically
While doing this latest added element is not showing in stringify
but in my console its loging
Check my console:
selected_stores
[Object { row_0="3230::3216::1486::3220"}]

0
Object { row_0="3230::3216::1486::3220"}

row_0
"3230::3216::1486::3220"

row_2
"1636"
row_2 is not updating in alert(JSON.stringify(selected_stores_jsonObj));
 
1:09 PM
What did i just read ?
 
this my output
{"selected_stores":[{"row_0":"3230::3216::1486::3220"}]}
 
@FlorianMargaine .. big brother,,, pls any tips
@gowri do you know there exists multi-dimensional array's ?
// tips in how to complete a task -.-
i fail on that unless it gives me big money
@gowri the better JSON would be

{ "selected_stores":[ "rows":[['3432','3243','2343','234324'],['3234','23432','23432'.'3243']] ] }
 
@Abhishek: yes its multidimensional array. Whats wrong with that
 
the way you use it eats up more resources
and you dont use whats already present
actually i dont think i need to do that ' ' , just numbers will do there
 
{"selected_stores":[{"row_0":"3230::3216::1486::3220"},{"row_2":"xxx"}]}
this is right?
Is this right ?
 
1:13 PM
Sort of
but i dont get why you are doing :: ?
are those ratios ?
 
no i need data in that format. just as string
but my problem is why the new row is not updating
 
Can you show the code ?
 
sure
 
please do
 
selected_stores_jsonObj = jQuery.parseJSON(selected_stores);

selected_stores_jsonObj.selected_stores['row_'+row_num] = outcheckedStr;
selected_stores_jsonObjStr = JSON.stringify(selected_stores_jsonObj);
while i check console.log(selected_stores_jsonObj);
row_2 is up
but in alert(JSON.stringify(selected_stores_jsonObj));
its not up !
 
1:17 PM
guyz goto doesnt work in my code yyy???
 
@Abhishek for me, friendship = w/e you do, you're still my friend :)
 
aww :-)
 
@Abhishek wat?
 
@gowri why you .... inconsistent
you name them row_0 , row_2 ?
where is row_1 ? is it there ?
 
1:22 PM
if now a for loop will mess u up real bad
Florian , well i was just awwing on how nice u are XD
 
@Abhishek look at the little arrow to see what it was answering to
 
@Abhishek: each row_x is a my data rows . if i delete row_1
 
@FlorianMargaine Badass.
 
oh that .. xD
i mean i need tips on how to stay focussed on one single project -.-
gowri can u make sure your parser understands that ?
 
I especially like the notes
> NOTE: Seriously. Never use this.
 
1:25 PM
yeah sure no error logs
 
@Abhishek make a planning
with deadlines, steps to reach at this or this time, etc
and force yourself to follow it
two benefits:
- you learn how to estimate your work (**very** useful when you work)
- you *have* to finish your job at this time, so you *must* work on it
to plan: break your work in the smallest possible tasks
and estimate them
smallest possible tasks: minutes/hours if possible
 
@Abhishek: this functions logs the same alert(jQuery.param(selected_stores_jsonObj));
 
@gowri there wont be error logs :P
i am intrested more in how u traverse
how are you updating each and every row
show the whole code
 
its big function
`jQuery("#store-save").next().click(function(){

var checkedVal,outcheckedStr,temp,row_num,selected_stores,selected_row_data,param,selected_stores_jsonObjStr,checkedStr='';

var selected_stores_jsonObj;

selected_stores = jQuery("#selected-stores").val();

jQuery('.chk-select:checked').each(function(){

checkedVal = jQuery(this).val();
temp = checkedVal +'::';
checkedStr += checkedVal +'::' ;
});
outcheckedStr = checkedStr.replace(/(^\s*::)|(::\s*$)/g, '');


row_num = jQuery("#store-save").attr('data-row');
 
jsfiddle maybe?
 
1:37 PM
While i alert
selected_stores_jsonObj.selected_stores['row_2']
value appearing !
Any thoughts
 
-.-
jesus christ
you dont wanna understand or what
listen whatever ur object is
and use
parse it
for( var item in list ){
list[item];

}
instead of for (var i = 0 ; i < list.length ; i ++){
list[i]++
}
 
1:54 PM
Exact same function works in other page. I feel like full hang over
 
Target For tonight make holographs in CSS [as in the neon flashy ones]
 
0
Q: POST data send and change URL to the same. [PHP][JS]

Akshat MittalI have a URL shortening service, Which I have made in PHP. It receives the URL to shorten via POST method via the form on the main page. I want to create a Bookmarklet for this service. It should be like as one clicks it (it stays on the bookmark bar), it takes the current url and POST send it t...

 
@Abhishek looks like @rlemon's js for fonts
 
2:30 PM
@FlorianMargaine nope
Rlemon uses canvas !??!?!
How to list all files and folders on a computer as a document tree using node.js ??
subsequent calls to a blocking exponential function ?!??!
or there is some better way using async ?
readAllDirsAndFIles(dirName){
 var filesAndFolders = fs.readdirSync('dirName'),obj;
 for(var i = 0  ; i < filesAndFolders.length ; i++){
   obj[filesAndFolders[i] =  fs.statSync(dirName + "/" + filesAndFolders[i]).isDirectory()? readAllDirsAndFiles(dirName + "/" + filesAndFolders[i]):filesAndFolders[i] ;
 }
 return obj;
}
 
3:33 PM
0
Q: Finding a string in MongoDB collection

AbhishekI want to implement a minor file system like collection in MongoDB . So say my object looks like this { "\":{ 'autoexec.bat':{ name:'autoexec', filetype:'bat', size:1302 }, 'user...

 
how can I add social media to my wordpress gallery ?
How can I add social media icons to my wordpress gallery plugin called TN3Gallery ?

http://goo.gl/h0nXB
 
@Extelliqent Read the room description, most probably not many people can here help you
3
 
thanks alfred you were so helpful ;)
 
3:51 PM
lolz...
 
4:03 PM
@Extelliqent "google it" ^_^
 
4:29 PM
...
vote ups ??
0
A: Finding a string in MongoDB collection

Sergio TulentsevI'd say: don't do this in one gigantic document. Let each file be its own document in a collection, with references to parent and (probably) children. Almost all operations are now trivial. You only have to think about efficient way to read/delete the whole tree.

 
 
1 hour later…
5:50 PM
Anyone still here?
@alFReDNSH @Abhishek anybody?
 
 
3 hours later…
8:21 PM
The ghosts have came back
 
0
Q: Improving the Controller Module of an MVC - How to?

stack.user.0The code below is for modern browsers only. The current structure uses two module patterns Cin and Cout. As the controller handles all (in)coming and (out)going requests to the user, this made most sense. This is for a pure ajax application...all content changes are ajax requests, even the i...

 
8:35 PM
0
Q: WordPress Carousel Hover Image

Josh RodgersI a using an image carousel to display some pictures on my website. The carousel I am using is called: Jcarousellite (http://www.gmarwaha.com/jquery/jcarousellite/). I have the carousel setup, styled, and configured...but am having trouble getting through the last little bit of the code to work. ...

 
 
2 hours later…
10:54 PM
what about the google moog doodle, i heard it uses an advanced technique for processing sound, i tested it and it only works if a swf file is in its path,
 
user1385191
11:27 PM
 
user1385191
uh…
 
IE 7 on XP? :/
 
user1385191
yep
 
user1385191
a wrapper for gEBTN that uses a closure is faster than gEBTN
 
user1385191
that's very odd
 
11:35 PM
Well, old browsers...
 
user1385191
didn't happen in IE 6
 
IE 6 was JScript, right?
 
user1385191
IE has always been JScript
 
user1385191
JScript is Microsoft
 
JScript is Microsoft's implementation of the ECMAScript standard
Ah yeah, right, seems I came across a table that stopped version numbering at IE 6.
It's quite nice that IE 10 has try / catch performance similar to if in jsperf.com/try-catch-error-perf/3
Wow, JS seems to be on the decline. :|
 
11:43 PM
query selector is jquery death
:))))
 
user1385191
Sizzle actually doesn't use QSA that much
 
user1385191
it basically tries to guess your intention, and then maps it to gEBI, gEBTN or gEBCN first
 
Hmm, even supported by IE8.
 
user1385191
and then QSA if it's too complex
 
user1385191
and then gEBTN(("*") if support isn't there
 
user1385191
11:45 PM
it's why my recursive code is slower
 
user1385191
because Sizzle doesn't use recursion
 
This is quite concerning for JS... google.com/trends/?q=javascript
 
user1385191
it also does a ton of "patching"
 
After 8 years only 1/4 search.
India and Hong Kong being the main ones...
 
user1385191
myLib has some interesting "patches"
 
user1385191
11:48 PM
I really don't care about what India has to say technologically
 
C++ one the same decline
Programming trend summarizes it:
 

« first day (588 days earlier)      last day (4343 days later) »