« first day (984 days earlier)      last day (3971 days later) » 

9:00 AM
... you're dumber than I thought, or you read even less
> number of milliseconds elapsed since
 
hello all :D
 
> number of seconds since
 
\o/
 
uh? i mean it's the same UTC e GMT ?
 
over-riding firewall
 
9:01 AM
@FlorianMargaine So one counts the elapsed time, and one doesn't!
That's the only conceivable difference.
 
:(
@badbetonbreakbutbedbackbone read well
> milliseconds
> seconds
 
college firewalls :3 :3
 
can you see the difference now?
not to mention that one is on the client while the other is on the server...
 
Line-numbers they're on? You put a zwng in there????
TELL ME
 
@FlorianMargaine sure ired and i can fix that but UTC and GMT it's the same?
 
user1125394
9:03 AM
2 mins ago, by Florian Margaine
> number of seconds since
 
Yesterday I got so close to the rep-cap. And it eluded me so. Two answers in a day...that hasn't happened in a while.
 
?? dudes are you kidding me? i red that i understand difference between seconds and ms , but i was asking if since they uses UTC and GMT it's all the same
 
so hows everybody doing ?
 
cool u ^
 
@badbetonbreakbutbedbackbone Like everything you've asked us, this can be answered in 10 seconds using google.
@Connor It was pretty fun. They were nice questions.
 
9:05 AM
@Zirak im lost...
what was that a reply to?
 
Definitely.
 
@Zirak yeah, if i ask anyone again ill ping you for assistance on cooking
 
ok
sorry if but it was simply a question can be asked without opening new tab for google :D anyway no problems at all :D
 
hahaha
videojs.com <-- click on "Help & Support" in the header-bar
2
they outsourced that pretty neat
 
@GNi33 rofl
they clever ;)
 
9:13 AM
@GNi33 LOL
 
bye bye guys you should be proud of yourself today you helped me a lot! thank you
 
0
Q: Simple 2 player server

Sourabh LalI have recently started learning javascript and html and have developed simple 2 player games such as tick-tack-toe, battleship, and dots&boxes. However these 2 player games can only be played on one computer (i.e. the 2 players must sit together) However, I want to modify this so that one can pl...

 
@abdul Welcome to the JavaScript chat! Please review the room pseudo-rules. Please don't ask if you can ask or if anyone's around; just ask your question, and if anyone's free and interested they'll help.
 
guys
algorithm question
 
WHy are there so many versions of java ?
cant they just say "Hey you download this... it will work ?", if u need more download more ... ?
 
9:19 AM
>// How to get as many prices_product as ages, with the correct price (matching age)
 
@FlorianMargaine I don't quite get it. What do you mean? Example input/output?
 
I'm afraid I don't understand.. you're asking how you cycle a list in order to find the price associated with a specific age?
 
@Zirak let me build up this
 
are you all ignoring me ?
or is it something i did ?
 
you mentioned java ;)
 
9:24 AM
@FlorianMargaine For each item in list, add item in map using age as key
 
@FlorianMargaine So you want to make an age => object map, and duplicate the object for every age there?
@Darkyen I had no idea what you meant
 
For each age in list, find corresponding object by age (using map) and insert in new list
 
If you mean java versions as in "jdk 1.6 => jdk 1.7", then it's only natural
 
You want to know how to do it in general or you unsure how to do it in java?
 
@Zirak nvm
 
9:26 AM
That seems to be php
 
@GNi33 \o
Java is good dude.
i like it :-)
 
Better still, For each age in list, find corresponding object by age (using map). If it does not exist, search data collection and insert it if found. If found, insert found object in a new list
 
user1125394
java hello world is the world largest
 
So 39, 39, 14 will give you the objects associated with ages 39, 39, 14 in that order
 
@cx yes its actually longer then ASM x86
by a whole 20 characters!
 
9:37 AM
@Neil that's a lot of iterations
but it looks like a good idea
@Zirak yeah, but with the correct price
@Darkyen which hello world?
 
@FlorianMargaine You want to duplicate the price
 
@Zirak yep, so that I have a correct age => age map
 
is there a simple library to coordinate async response ordering?
 
@FlorianMargaine It sounds like you just want an age => price map
 
9:41 AM
Once you have that, it's easy to create the output array (unless prices_product is more complex, which is likely to be the case)
 
prices_product is exactly what I showed above
 
oh, so you really do just want an age => price map
 
var supaProducts = prices_product.reduce(function (ret, prod) { ret[prod.age] = prod; return ret; }, {})
ages.map(function (n) { return supaProducts[n]; })
 
but the end object must have as many items as the ages array, even if it means duplicating objects
 
9:43 AM
Something like that, I suppose (untested, I'm too lazy)
 
@FlorianMargaine In that way, you only perform a search once for each new type of object
 
I kept it as an age => product map, just in case. So it's O(n), which is fair
 
Well, maybe that wouldn't be better in retrospect
Would be better in terms of memory, but who cares about that?
 
@FlorianMargaine open wikipedia
 
@Darkyen too lazy
 
9:45 AM
you found it anyways :D
The Hello world program is a simple computer program that prints (or displays) the string "Hello, world!" or some variant thereof. It is typically one of the simplest programs possible in almost all computer languages, and often used as first program to demonstrate a programming language. As such it can be used to quickly compare syntax differences between various programming languages. The following is a list of canonical hello world programs in 107 programming languages. A ABAP REPORT HELLOWORLD. WRITE 'Hello, world!'. ActionScript 3.0 trace ("Hello, world!"); or (if you ...
        .section        .rodata
string:
        .ascii "Hello, world!\n"
length:
        .quad . -string         #Dot = 'here'

        .section        .text
        .globl _start           #Make entry point visible to linker
_start:
        movq $4, %rax           #4=write
        movq $1, %rbx           #1=stdout
        movq $string, %rcx
        movq length, %rdx
        int $0x80               #Call Operating System
        movq %rax, %rbx         #Make program return syscall exit status
        movq $1, %rax           #1=exit
 
3
A: Shortest Hello World program with no semi colons

AardvarkSoupJava (96 93 chars) Not C#, but I figure Java is similar enough: class H{public static void main(String[]a){if(System.out.append("Hello world").equals(a)){}}} Thanks to Prince John Wesley, here is a shorter version of 89 chars: class H{public static void main(String[]a){if(System.out.printf(...

 
vs
console.log('Hello, world!'); // i like this better
 
I like how javascript has no input/output at all.
 
"Hello, world!"
Lisp ^
 
Lisp, you cheater
 
9:50 AM
PHP: Hello world
 
Wasn't there a Hello, world language designed specifically to beat the "shortest hello world" thing?
The language accepts any or no characters, ignores them, and prints Hello, world (or Hello, world! or Hello world or whatever)
 
@Zirak How could you get smaller than "Hello, world!" as your source?
 
Error: Could not find or load main class HelloWorld.class ... dafuk ?
 
It would be a trivial language which ignores your code
 
the smallest in general purpose turing complete language is php
 
9:51 AM
do i need to set something other then path ?
for java to compile & run
 
@Neil If the language accepts the empty file?
 
@Zirak Then it's trivial
 
Completely.
 
Then I would argue I have a simpler language than that
You run the compiler, and without even providing a filename, it outputs Hello, world!
Saves you the effort of having to save an empty file
 
So, our solution is 0 characters. We win?
 
9:54 AM
@Zirak Depends on your definition of "language"
 
@Esailija ?
php is echo "Hello, world!";
 
php is just Hello world
 
@FlorianMargaine I think he means having a php file which is just html
 
@Neil "Language" in general is a way to communicate data. "Programming language", I'd say it's a way to communicate instructions to a machine.
 
9:56 AM
and contains the text "Hello, World"
 
that's not html
 
$ php -r "Hello, world\!"
PHP Parse error:  syntax error, unexpected ',' in Command line code on line 1
 
The "hello world" language fits both. It communicates data (it prints hello world), and it communicates instructions to a machine (it prints hello world)
 
@Esailija That's arguable. That's not strict html, but if you put it in an html page and open it with a browser, it'll show you Hello, World!
 
I'm afraid the PHP interpreter disagrees with you guys.
 
9:57 AM
and if you run it on command line
it will just print it on stdout
any text outside <?php tags is an echo instruction in byte code
 
@FlorianMargaine In a .php file, php code must start with <?php and end with ?> if I'm not mistaken
 
@Neil it's php -r, you evaluate php code
 
@FlorianMargaine I'm just telling you what he meant...
 
-r injects <?php tags it's not true php interpreter
 
$ php -r "echo 'Hello, world\!';"
Hello, world\!
 
9:59 AM
If you want to argue that a .php file is not php code, then that's your ball game
In an unrelated note, this guy may have found how life started
He's sort of replicated a primitive cell
 
@MESSIAH Welcome to the JavaScript chat! Please review the room pseudo-rules. Please don't ask if you can ask or if anyone's around; just ask your question, and if anyone's free and interested they'll help.
 
@FlorianMargaine again -r is not true PHP: ` -r <code> Run PHP <code> without using script tags <?..?>`
You can do
$ echo "<?php echo 'Hello world'; ?>" | php
Hello world
but that's just superflous
 
dudes seriously if have {id:'1298'} how do i turn it into {"id":"1298"} ?
 
$ echo "Hello world" | php
Hello world
generates exactly the same OPcodes
 
oic
cool
 
can you help guys?
 
@badbetonbreakbutbedbackbone {"id":"1298"} is the same thing as {id: '1298'}
 
not for mongodb :( @Neil
 
Did you mean '{"id":"1298"}'?
 
{id:'1298'} to {"id":"1298"}
 
10:06 AM
@badbetonbreakbutbedbackbone Oh ouch
 
@Esailija nice, didn't know that
 
I'm not convinced that mongodb can't handle {id:'1298'}
You sure about that?
 
You mean...you want JSON?
 
i already tryed really
yes using json
 
10:08 AM
And, if I'm not mistaken, mongodb uses _id to identify objects
 
no i'm matching documents
 
@FlorianMargaine now it should be easy to see why constantly opening and closing <?php tags doesn't affect performance
 
db.users.find({id:'1298'})
doesn't works while
db.users.find({'id':'1298'}) works
 
@badbetonbreakbutbedbackbone db.users.find({"id":"1298"}) works then?
 
yep
probably i need a loop for explode - implode again
 
10:11 AM
So use db.users.find({"id": obj.id})
where obj is {id:'1298'}
 
does anyone know why this happens to me? damnn..
 
@Neil i'm passing php -> js
 
@Connor Sounds like you're stuck in a loop stuck in a loop stuck in a loop
 
then in js i do JSON.parse()
 
posted on June 26, 2013

This Monday I left the house I lived in for the past 25 years and moved to a new, larger one about a kilometer west in Amsterdam. Among other amenities it sports a separate office with a phone drawer of my own design, a working dishwasher, and enough bookshelves to contain my considerable history library. I ran this large moving project side by side with Mobilism and CSS Day for the last six

 
10:12 AM
@Neil hows that....?
 
@badbetonbreakbutbedbackbone That will get you the obj
 
also why only the middle one has __proto__ not proto
 
i'm trying JSON.stringify sec
 
@Connor That is odd
@badbetonbreakbutbedbackbone That sends a string, not a js object
 
php sends a string and js parse it to json
 
10:14 AM
@Neil yes.... would you be able to take a look at my code its only 17 lines?
var app = function () {
	return this.configuration();
};

app.prototype = {
	configuration: function () {
		return this;
	},
	find: function(name) {
		return this.wrap(document[name])
	},
	wrap: function(obj) {
		this.element = obj;
		return this;
	}
}

window.app = new app();
and this calls it
  console.log(app.find('head'))
  console.log(app.find('body'))
  console.log(app.find('documentElement'))
 
oh yeahhh @Neil fixed dude, it was just to do theDocument = JSON.stringify(JSON.parse(req.get('X-Query')))
stringify fixed all :D thanks
it puts quotes to unbelievable and awesome
 
brb
 
@Connor Why is this particularly interesting? Does it not work?
@badbetonbreakbutbedbackbone Ah.. what happens if you just pass req.get('X-Query')?
 
@Neil not tryed sincerilly but it's a REST API so i need to be sure it's a json before querying :P
and code is not mine lol
so i would avoid to touch it :D
 
  $prices = array();
  foreach ($ages as $i => $age) {
    foreach ($prices_product as $pp) {
      if ((int) $pp->age === (int) $age) {
        $prices[] = $pp->price;
      }
    }
  }
is what I ended up using
I hate php
 
10:19 AM
@FlorianMargaine you got error in your loops
where do you define $prices_product ?
 
@badbetonbreakbutbedbackbone Ah, well I suppose that would do it
 
@Neil yes indeeed i can remove that :P
it works the same as to stringify
 
You could just verify that JSON.parse returns correctly and then return the value of req.get('X-Query') in order to save you the effort of turning it back into JSON
 
@Neil right, problem now it's more complicated but i really think you're right about ;)
 
@Neil well, if you look at the image you will see that object.element says its one thing but actually is another
 
10:22 AM
@FlorianMargaine just guessing you have to use $prices[] .= $pp->price;
in a loop
 
you want to add all values into that array nope?
or just one?
and sincerilly i preferr array_push($prices,$pp->price);
in this case
 
I don't :)
 
eheh as you want :)
 
@Connor I'm missing the point here. Does it bother you that it says something else?
 
10:24 AM
PHP .....ouch
@Neil yes a lot, would it not bother you?
 
lol why people so prevented about php, i saw coding ruby , phyton i never found so big advantages in those languages
 
@badbetonbreakbutbedbackbone no1 mentioned ruby/python
 
@Connor Perhaps a bit, but if you're sure that you're running that code once..
 
php it's a bucket cause it uses not types and all vars are global, but for the rest it's really not away from other languages
 
10:26 AM
@Connor uh? :)
 
all vars are global
lol
 
yeah into a method each var is global
 
omg this is pissing me offfff
 
but anyway lol i do not found any differences between using a php framework or a ruby framework, probably ruby has lot more features like gems and easy-install things but at the end when you good on one language there is no such big differences
imo
and remember comfort not always allows much comfort in personalizing things
i think the "PHP sucks" it's a huge ball launched to the world
 
does anyone know why javascript is being a twat today?
17 mins ago, by Connor
user image
 
10:30 AM
it's not obvious that there is any problem in the screenshot
 
lol most people wow you do this in ruby in 3 lines i need 20 lines in php, well ruby 3 lines are 50 at runtime i guess
 
@Esailija ok 1 sec
 
well PHP and Ruby are both in the slow as shit category
so doesn't really matter if you expand to 50 lines or not
you still cannot do anything that even remotely needs raw performance
 
@Esailija so what in fast list? :)
 
anything with JIT implementations
 
10:31 AM
is there any other server language based on c++ ?
 
what do you mean by based on c++
 
@Esailija oh sec here i'm talking about web side not standalone languages uh ;)
 
syntax?
 
@Esailija php module is c++
 
the canonical php implementation is written in C
 
10:32 AM
@Esailija what about now
 
lol no sorry maybe Perl !?
lol dunno about those languages :D never gone so deep :D
 
@Wolverine Welcome to the JavaScript chat! Please review the room pseudo-rules. Please don't ask if you can ask or if anyone's around; just ask your question, and if anyone's free and interested they'll help.
 
@Connor ok so you have different element. now what
 
hi i need a help
 
Officially called "Personal Home Page Tools (PHP Tools)". This is the first use of the name "PHP
 
10:33 AM
can anyone here?
anyone who want to answer me
pls
 
@Esailija well..... why would it say its something it isn't
@Wolverine answer what!
 
i need a js validation in somebox following some criteris
 
I think this is borderline obsessive compulsive disorder isn't it?
 
@Wolverine hi, i anwsered you now
@Wolverine just cause i idn't find any other quesiton from you here ...
 
-3
Q: how to do js and php validation?

WolverineI have four text boxes name textbox1: textbox2: textbox3: textbox3: I need to validate this field by following some criteria like below : 1.If anyone put value in textbox1,he must forced to put value in textbox2.Otherwise both textbox can be empty. 2.If anyone put value in textbox3,he mus...

i need a js validation in somebox following some criteris
?
 
10:36 AM
@Wolverine php and js are two different things d'you know ?
php validation is different from js validation
 
yap @badbetonbr
 
so do you need to make php controls + js errors live?
 
mostly i need js validation
 
cause js validation is somenthing more, but without php validation you fucked up
 
right
 
10:38 AM
@Wolverine in this case i would do google.it/…
on stack you have to try somenthing then check if you got problems and paste what you tryed to a question
you can't ask people to do things for you ;)
or your question will get closed/downvoted
 
Oh, a random thought occured to me this morning: In the double slit experiment in which results change according to whether or not its being observed, are results the same when humans observe it as opposed to say, cats?
 
@Neil It's a little more complicated with cats as you already know that due to their special wave nature they're both dead and alive. So it's more like a quadruple slit.
 
@Neil That's not the double-slit experiment. Not the one I know of, anyway
And I don't see any reason the result will change between species. It'll vary between subjects in general, but nothing special between species.
 
Seriously, it's not really about the observer but about any kind of detection.
 
It is considered detected if Joe is observing the experiment, right?
So if you get an animal to observe the experiment, what happens?
 
10:48 AM
Can you link to some explanation of the experiment? I know a different double-slit one (where it shows the particle/wave duality of light)
 
@Zirak That's the same one
You simply shoot photons one at a time through the slits, and if it is observed, it behaves as a particle
 
oohhh
It's the fact that there is some form of detection, some form of measuring, which changes it.
A dumb camera will change it
 
Otherwise it seems to act like it were being manipulated by other photons, even if we can prove there were no other photons present
 
yes, it's about "detection", not observation. From wikipedia :
> The observer can decide whether or not to put detectors into the interfering path. That way, by deciding whether or not to determine the path through the two-slit experiment, he can decide which property can become reality
 
@Zirak So an animal could change it too, logically
It just has to be observed in some fashion
But that lends to the idea that, however absurd, a bacteria bacterium could observe the experiment, right?
At what point is it "not observed"?
 
10:53 AM
It was always my very humble opinion that it was always both observed and not-observed
 
@Zirak Schrodinger's cat then?
Seems silly, but all evidence seems to suggest that if it is not being observed, it is in an array of positions at once according to probability, and it only "picks one" when it must be measured
 
11:10 AM
2
A: break out of IF

EsailijaYou can break out of labeled if with break: $.ajax({ success: function(data) { mainCondition: if (data.condition1) { if (data.condition1.value1 == 0) { break mainCondition; } //some code } if (data.condition2) { ...

haha
 
@Esailija how about putting those code in if statements into separate functions and use return?
function namethisfunc(){
if (!data.condition1.value1)
                return;

            //some code
}
 
that's just zombie rewriting
think outside of the box so that both are unnecessary
and yet clean
unfortunately that's quite hard since the OP didn't give any hint what is supposed to be done
 
I think I have a case of a labeled break from a nested loop. Is there a cure?
 
I dunno but break inside loops is pretty known and common thing
 
it's used here: jsfiddle.net/xdEcr
 
11:20 AM
going Jon Skeet on it and extracting stuff to a function and passing everything around is just as horrible if not more
 
yay, Flexbox landed in FF22
 
@JanDvorak Where is the labled break? I cannot find it
 
@JanDvorak holy crap, I put 65 and pressed set size
 
@Esailija that's a huge matrix
 
so that's like 12000 dom elements
 
11:23 AM
!!>65*65*3
 
@JanDvorak 12675
 
yep. it did take a while to render
I guess it would be worse without document fragments
 
well it's still pretty bad, a dom object is ridiculously fat
 
phonegap question please help ty
http://stackoverflow.com/questions/17308641/phonegap-jquery-mobile-mvc-structure
 
If I knew you wanted four thousand checkboxes to check, I would have considered a canvas :-)
 
The labeled break is on the L64
basically it says "if you run out of potential pivots, terminate the downwards elimination"
 
according to very rough estimations one dom object is like 4 kilobytes... that's still far less than objects created using closures though
 
4 kilobytes of WHAT???
how could it be this big?
 
well just do console.dir(document.createElement("input")) and look at all the data
even empty string pointers cost 8 bytes
 
ew
What about nulls?
 
11:31 AM
null, true, false, undefined are singleton objects that are pointed at, so 4 or 8 bytes
 
I thought true and false were primitive?
Object.keys(document.createElement("input")).length => 111 -- ew
 
at the abstract language level yes
note that the dom element has also other objects like classList, dataset and so on
 
note that I'm running a 32bit machine
 
in actual implementation only certain class of numbers are truly primitve and that depends whether code is unoptimized or optimized mode
so in unoptimized mode you could be allocating objects with just number+number
 
I thought most properties were / should actually be inherited getters
 
11:35 AM
true stuff like .innerHTML is not data
 
and yet all 111 enumerable properties of a new input elements are claimed own by Chrome
 
well you can't say anything about that except use intuition whether something needs to be stored directly on the object as data
e.g. how do I calculate .required on the fly from something?
at very least it should be a bit in some integer flag
 
only make it an own property if it's not the default value
Now, concerning that labeled break... :-)
 
will look, thanks
 
11:48 AM
you can't just remove or add properties unless you are talking hash table or something
 
How big is bool? Please tell me it's not eight bytes :-)
 
which defeats the point of memory compactness
clone the repo then do $ grep -rn "typedef bool" .
 
You can add properties ad-hoc if you don't mind having a ton of anonymous classes :-)
 
again defeating the point of memory compactness I presume
most compact is to store all the boolean flags in a byte if there is only <= 8 flags and then on getters and setters do bitwise operations
 
perhaps. depends on how many classes are actually going to be there.
Yep. 8 booleans per byte is pretty good :-)
 
11:51 AM
my god
$ git clone github.com/WebKit/webkit.git
Cloning into webkit...
remote: Counting objects: 2281120, done.
remote: Compressing objects:  25% (119516/470797)
it's taking forever
 
wow !
facebook has some privacy
 
@Esailija Try cloning mozilla-central...
 
I have
 
oh, have you seen Benjamin's question yesterday?
 
after fighting 2 hours I couldn't get it to build on windows
endless python dependency problems
@Zirak nope, link :D
 
11:54 AM
I have noticed something from my phone
link please
 
we are retarded, we can find the link just as fast as zirak
8
Q: Why does nesting a bunch of blocks causes a stack overflow in JavaScript

Benjamin GruenbaumI the code {} is perfectly legal in JavaScript as it represents a Block. However, I notices that nesting a lot of blocks ({{...}}) inside another raises in Chrome*: Uncaught RangeError: Maximum call stack size exceeded Why is a stack overflow happening here? Here is a codepen illustra...

10 secs
 
It was a fun question. People on #jsapi were very nice.
 
anyone seen the McDonalds UK promo-page?
that's some pretty sweet canvas-stuff
@Loktar @SimonSarris i think you guys could enjoy this -> mcdonalds.co.uk/ukhome/promotions.html
 
its taking FOREVER to load
 
hehe, yeah
but I think it's worth the wait
 

« first day (984 days earlier)      last day (3971 days later) »