« first day (1001 days earlier)      last day (3946 days later) » 

7:00 PM
I rather have one way to do a thing that's clear and concise. Python is really good in this regard. Having only one way helps a lot with coding style / guides too (and of course having something that resembles PEP 8)
 
@IvoWetzel Yeah, pray we don't have that.
 
I hate python
 
@Zirak Ahhhh!!! Either do it static typed or infer it, but please, no more horrible annotation syntax :(
@Cygwinnian Why that?
 
I understand the whole "executable pseudo code", but overall I'm a boy who loves strict languages, like C
I love semicolons
and curly braces
 
That argument has always puzzled me
 
7:03 PM
Me too, although Python's also rather strict in regard to syntax
 
Some people are so lazy :(
@AprilRandolph You have a typo. Please don't ask me to fix your typos in your variable names again :) You can use the Chrome developer tools to find these yourself. — Benjamin Gruenbaum 1 min ago
 
It's not that different.
 
That's why I love JavaScript
I understand its all asyncronous
and stuff
 
It's a bit uncomfortable at first when your whitespace determines stuff, but ultimately...it doesn't matter
 
and I like that
I think its cute.
but i love the semicolons
 
7:04 PM
Why does it matter?
 
and bit wise operators it doesn't necessarily need.
They remind me of C
 
@Cygwinnian There is nothing asynchronous in JavaScript, you can't create asynchronous functions - you can just call existing ones.
 
@Cygwinnian So you dislike Python because it's not C?
 
@IvoWetzel I dislike some stuff about python.
 
I should eventually finish github.com/BonsaiDen/emblem I guess (staticly typed, no semicolons compile to JS thingy)
@BenjaminGruenbaum For example?
 
7:05 PM
There's plenty to dislike about Python (Rossum hates functional programming...)
 
@IvoWetzel Exceptions for flow control, not functional, annoying syntax at times
 
But the syntax? Wait till you get to a language like Haskell or J
 
@BenjaminGruenbaum I agree with the first one. I still wish JS had comprehensions though, syntax, dunno
 
@BenjaminGruenbaum i object
 
@IvoWetzel example?
 
7:06 PM
webworkers god-damnit
 
@Darkyen WebWorkers are not a part of the JavaScript language.
 
@Zirak I dislike python because its weird
 
true ...
but can't is a huge word
anyways .. somebody needs to implement a worker pool
 
Speaking of which
people
 
or ... factory
 
7:07 PM
An even if they were, the functions executed would still be synchronous, you'd be calling an asynchronous function
@Cygwinnian Why do you think it's weird?
 
@BenjaminGruenbaum I really miss stuff like list comprehensions in JS (yes array.map() but it's just not the same thing and doesn't work on objects). The syntax is fine for most things, and they got a with statement that's actually really useful :)
 
I HAD THIS WEIRD DREAM! I thought I figured out a way to make JavaScript not asynchronous!
 
@Zirak define a purely asynchronous function ?
@Cygwinnian you reinvented promises i guess ?
 
No, imagine if there was a way to put every single line of your javascript program into its own function
 
Also, lua is really awesome too (and pretty much already in your head (except for 1 or 2 things) if you're coming from JS)
 
7:09 PM
and then each function would be setTimeout() and call the next'
 
@IvoWetzel You don't need with since you open all resources in functions, the correct behavior would be for functions to release resources when done with execution. Also, Java for example executes with a lot better than Python. (I like C#'s version (using) too.
 
@Cygwinnian ew
 
@Darkyen A function separated from its thread's event queue is what js has. A webworker is an asynchronous thing, the things inside it are (unless they aren't) sync.
 
@Zirak and well thats mostly every async implementation
we use event queues and or thread pools to mimic true asychrnosity
how about somebody creates something like a worker pool
much like apple's grand central dispatch implementation
that'd be cool no ?
 
Guys is it possible to rescript the server-side from the client
like have the client post JS code in a string
and have the server eval() it
?
 
7:13 PM
Yes, it's possible.
 
it seems cool!
 
!!> console.log("Hello World");
 
@BenjaminGruenbaum "undefined" Logged: "Hello World"
 
@Cygwinnian there, see what I just did.
 
Cool!
THAT IS AWESOME!
 
7:15 PM
!!> "awesome ??? " + " this is zirak"
 
@Darkyen "awesome ??? this is zirak"
 
Cool
 
!!/eval "foo"
 
@Darkyen "foo"
 
oh
 
7:15 PM
Cautionary note: In production this can be a really horrible idea.
 
^
@TomW double bold it please
 
But could you send something like sever.on("request",function(req,res){res.end("ad")});
 
It's a 'let anybody do anything' button
 
Letting people execute random code on your server? What can possibly go wrong?
 
Can you guys make Caprica handle requests differently from the client side?
 
7:17 PM
@Cygwinnian phew u didnt typed sewer :3
 
eval is misspelled.
 
@Cygwinnian !!/learn
 
fuuuck.
I just put a tall glass of very, very orange beverage about 2/3 onto the edge of my desk, and casually let go of it without noticing
 
@TomW eval != fuck
fuck > eval big way
 
I could very easily have put it 0/3 onto my desk
 
7:20 PM
You could have
 
dodged a big pain in the arse there
especially as it would probably have spilled onto the back of my PC
 
is there some secret to... fucking getting thumbnails in their box?
 
@BenjaminGruenbaum wow
 
@BenjaminGruenbaum one does not simply ask a jQuery question
 
7:27 PM
Also, your comment on Palash Mondal's answer is incorrect, you forgot a .call
 
@BenjaminGruenbaum fas.harvard.edu ??
 
fixed.
@AtifMohammedAmeenuddin What?
 
I need help understanding a way of assigning timeouts to objects.
I create a time out and want to place it to:
window.timers = new Object();

But ill have many timers, they need to be uniquely identifiable so i can clear them but i don't know the best way to add them with a unique id. Any suggestions ?
 
you from harvard?
 
No :) Why?
 
7:30 PM
@phenomnomnominal priceless satement mate
 
No, relative though.
I thought you just thought that because I sound like a condescending prick when replying to horrible questions :)
 
..also called Benjamin.
oo...kayy..
 
haha that was the start of my suspicion
just kidding, I was trying to find you on LinkedIn
and Google search led me to that link
 
anyone here from prestigious institutions?
I applied to Magdalen, Oxford. I didn't get in.
 
7:35 PM
@AtifMohammedAmeenuddin I try very hard to stay away from LinkedIn. I'm not a businessman, I'm a mathematician, a computer scientist and a programmer. Although I'm fairly new and bad at the first two, only having a bachelor's degree.
 
@Tom, my colleague got selected for MIT. He is running a bit short on money
 
@TomW I learned how to make egg salad from a blind man with no hands.
 
@Zirak that sounds like a cryptic euphemism for elitist education; possibly losing a local idiom through translation
 
@BenjaminGruenbaum I almost realized that when I didn't find you on LinkedIn
 
@AtifMohammedAmeenuddin don't MIT provide funds for people they know can't afford it otherwise?
 
7:37 PM
@AtifMohammedAmeenuddin You seem to be answering a lot of questions recently
 
@TomW Not at all. Do you know what egg salad is? That's what I learned to make. Do you know what blindess is? My mentor suffered from it (I never asked how he got blind though). Now, hands? My mentor didn't have those either.
 
okay I know I am doing something stupid, but could someone help with something real quick?
 
@TomW I am not aware of that. Do they for Internation students?
 
never mind ill ask on SO questions
 
International*
@BenjaminGruenbaum Yeah, I often get this itching to answer on SO. Apart from gaining knowledge, SO is pure business for me
"Good SO profile" == "Impressed Hiring Managers"
 
7:39 PM
@AtifMohammedAmeenuddin SO rep is meaningless in terms of getting a job, anyone who tells you otherwise is lying.
 
@Zirak you might see how I made that guess though. It's a task you can't learn through being told, particularly by someone who can't demonstrate. Isn't that a metaphor for most types of learning?
 
only if they dig in my profile and see my lame questions 4 years back
 
Good answers might work towards helping you land a job, but rep is meaningless.
 
@AtifMohammedAmeenuddin no idea.
 
I agree with @BenjaminGruenbaum
 
7:39 PM
@TomW Sweet, my subconscious is profound.
 
although apparently you can
 
hey good answers reminds me of something
 
whispers I knew I had it in you...
 
I have a pretty nice problem for you @BenjaminGruenbaum
though I think it might have already be solved a lot of times
 
Go for it, I'm always interested in a good challenge :)
 
7:40 PM
22
Q: Facebook like notifications tracking (DB Design)

Atif Mohammed AmeenuddinI am just trying to figure out how facebook's database is structured for tracking notifications. Wont go much into complexity like facebook is. If we imagine a simple table structure for notificaitons notifications (id, userid, update, time); We can get the notifications of friends using SE...

ITs not pure maths though
I wanted to acoomplish that in SQL
accomplish*
 
SQL is probably the last thing I'd use for this in 2013
The design pattern is called event store.
I'd denormalize, I'd stick notifications both in the DB and on a user receiving them. That's the only sane thing to do performance wise.
I'd run a query once a day removing notifications from my table to an archive table, and stick the last 100 notifications on the user, on every user receiving them.
 
has just discovered sharknado
Mother of God
 
there.. you solved it in a matter of seconds
 
Basically, if I posted something and I have 100 friends, I'd update 100 users' notifications. This works so much better in a NoSQL world where denormalization is so natural.
 
anyways lol I coded all these years in PHP so I might be pretty rusty when it come to backend/scripting. What would be a good source to move to a better lang? I wanted to learn more JAVA and NoSQL however the concept of Generics and Strong Typing almost owns me and never tried researching about NoSQL
 
7:44 PM
There are many per-case ways to solve this, I just suggested one, I'm sure there are many better DB people who can solve this better. @Shmiddty can probably do a better job here.
@AtifMohammedAmeenuddin Java is dead, it's a horrible language anyway. I'd go for one of C#, Python, Ruby in addition to JavaScript of course
 
are you sure about java? almost 3/4 of our community works on java
i mean in the usual companies that I interview
 
That might be, but if you're learning something for yourself I wouldn't touch it. It misses a lot of features a language should have
 
assuming you already read my SO profile
 
not really no :P
 
python looked easy
but here in India I only find start ups working on python and ruby
where as all the well establish orgs still work on Java
maybe it is hard to transition quickly?
 
7:46 PM
thats because it probably costs them too much to change from Java they started on Java when it was not dying :P
don't change what isn't causing problems after all
 
exactly, they moved from C to JAVA maybe a decade ago
 
@AtifMohammedAmeenuddin Working for a startup is something everybody should try
 
I'd go for C#
decent community out there for it
 
any good books to start with ?
 
C# is pretty much a more clever superset of JS in most areas :P
Jon Skeet has a decent one I enjoyed reading
C# in depth
 
7:48 PM
i personally used websites to learn rather than books
 
@AtifMohammedAmeenuddin that's probably true everywhere
 
keeping in mind that I am an Indian and English is my foreign language I would love books that are easier to understand like HeadFirst Java
 
Link in his profile
 
half a million rep.... wow
 
7:49 PM
@dave who doesnt know Jon SKeet :-)
 
Had to share this everyone lol
 
ah lol
 
Jon Skeet can divide by zero. is my favourite
and Jon Skeet coded his last project entirely in Microsoft Paint, just for the challenge.
 
@AtifMohammedAmeenuddin In Piet
 
7:53 PM
@BenjaminGruenbaum can you take a look at my SO question your wise with these things :P
 
@Dave link?
 
@Dave new Object(); ?!?
 
another thing is would it make sense to learn/know about all the common data structures and algorithms first before going deep into coding?
 
@Dave setTimeout returns an ID
!!/tell Dave mdn setTimeout
 
@AtifMohammedAmeenuddin The Corman book is nice "Introduction to Algorithms"
 
but i need to keep its scope to clear it so i wanted to put it to object which is connected to window.
 
Read the documentation for setTimeout.
 
their example does the same as mine but only for one timer i have multiple..
 
When you call setTimeout it returns an ID
when you want to clear it you cann clearTimeout with that returned ID
 
7:56 PM
so whats wrong with assigning that to an object?
 
I don't see why.
 
@Dave Press F12, Console, try this a = window.setTimeout(function(){},1000); a;
 
well see the documentation example has this:
var timeoutID;

function delayedAlert() {
  timeoutID = window.setTimeout(slowAlert, 2000);
}

function slowAlert() {
  alert("That was really slow!");
}

function clearAlert() {
  window.clearTimeout(timeoutID);
}
but lets say you have 7 time outs running
 
loop through the array and clear them ?
 
@Dave have the delayedAlert function return the timeout ID, and then call clearTimeout on that.
 
7:59 PM
lost me now
 
I want to change the text inside the button from next to signup.
what should I do?
 
@name There you go help vampire, enjoy :) jsfiddle.net/fZUg4
(hint, include jquery)
 
load jQuery
lol
 
lol
Thank you
 
8:02 PM
hmm
my brain really cant seem to function properly today
 
@Dave wouldn't it be good to put the clearAlert in the function itself like this
 
@Connor thats the documentation code not my code (which is on SO)
 
@Dave also why don't you use setInterval to progress?
 
@Dave so what's the issue then or the goal?
 
the goal is have any number of time outs stored with enough scope for me to clear them
so my first attempt was to create an object assigned to window.
 
8:06 PM
deep down somewhere in the dark @BenjaminGruenbaum is coding the solution while we discuss the possibilities
 
i dont think so @AtifMohammedAmeenuddin lol
then they are accessible through out but its not an elegant setup the way i've done it - infact its a big ugly
 
@Dave can you please explain me the use case?
 
imagine on screen you have 7 progress bars going up in %
im using set time out to update these progress bars
now i want to clear one of those 7
 
but its based on user's clicking something, but how do i know which id to clear from that
 
8:09 PM
so you need to map UI interactions to a progress bar?
 
well i was hoping to assign them to an object so if user closed the div and re-opened the right timers will be set to the right buttons again
from looping that object
 
what's that thing called where the page will scroll to where you want it to and append #(pagename) to the URL?
 
a feature?
Anchor scroll ? @Crowz
 
yep that looks like it, thanks
 
8:24 PM
@Dave you still here?
 
yup
 
needs some cleaning but how about this? jsfiddle.net/BdYxR/1
binding it to the div itself
 
well i dont use jquery so that particular method would not work id have to rewrite it
so the time out clears if the div is removed?
 
Guys what do you think of brython/
?
 
does anyone know of a way to make a bootstrap button bigger?
 
8:29 PM
You change the css files
 
just use jQuery
kill me now everyone
 
Agree with @Cygwinnian
 
fuck no lol
i need to learn the language fully before i use a library :P
6
also jQuery is not worth it for me given alot of my site is canvas
 
Guys
what do you think of this? github.com/shrimpboyho/blackmonkey
 
@Dave then you need just 2 thing
things*
add a data attribute to the div with the value you get in setInterval
use that value to clearInterval
 
@AtifMohammedAmeenuddin i ended up getting a jQuery answer on my SO question aswell
 
9:10 PM
I just realized that here: i.imgur.com/arneUlU.png
4
The grammar nazi is this guy: stackoverflow.com/users/63550/peter-mortensen
He's awesome, he edited like 4-5 of my posts with grammar errors :P
 
9:23 PM
haha
 
9:46 PM
@BenjaminGruenbaum Haha, where did you get that one?
 
any one here play any instruments?
 
@Resure 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.
 
guess not
 
i do
i play piano
and guitar
 

« first day (1001 days earlier)      last day (3946 days later) »