« first day (1642 days earlier)      last day (3309 days later) » 

1:00 PM
@NickDugger Pretty sure they prefer the term "African American"
 
user1994804
<script>
function addListeners() {
if(window.addEventListener) {
document.getElementById('').addEventListener("click", btn1func, false);
} else if (window.attachEvent) {
document.getElementById('').attachEvent("onClick", btn1func);
}

function btn1func() {
alert(this.id + "Anything")

}


}

window.onload = addListeners
</script>
 
@Kippie I think as long as you don't use the term "spade", you should be fine
 
@Kippie He's actually a Canadian-American. Nice try on the joke, though
 
@YourAdrenalineFix I don't think '' is a valid ID
 
Can someone tellme how this is different from Promises? rq.crockford.com -- seems redundant...
 
user1994804
1:01 PM
My problem / misunderstanding is that I want btn1func to run after the page has fully loaded
 
user1994804
bear with me, slow typer
 
user1994804
NOT after a click
 
user1994804
but here's what I'm seeing
 
so use the window load event
 
user1994804
Hold on
 
user1994804
1:02 PM
im trying to type
 
user1994804
The line before the closing script tag fires everything off once the content is fully loaded anyways doesn't it?
 
user1994804
I was previously doing this like so;
 
It calls the function you assigned
 
user1994804
<script>
document.addEventListener('DOMContentLoaded', function() {
 
user1994804
1:05 PM
If I replace "click" with DOMContentLoaded" in the following line document.getElementById('').addEventListener("click", btn1func, false); isn't that repeating myself?
 
You can still do window.onload = function(){...
 
@YourAdrenalineFix I don't understand why you would just replace it
 
user1994804
Hi @JanDvorak you just confused the matter Im afraid
 
user1994804
Learning JS
 
window.onload = btn1func;
 
1:06 PM
don't use window.onload, use window.addEventListener("load", ...)
 
what is the problem with this?
@KendallFrey addeventHandler??
 
user1994804
Building a better mouse trap
 
addEventListener*
 
@YourAdrenalineFix DOMContentLoaded is an event that gets called when the page is loaded. click is an event that gets fired when an element is clicked.
 
user1994804
No Shit
 
1:07 PM
@rlemon what are you talking about? :P
 
user1994804
Ok everyone lets backup and let me reexplain
 
@YourAdrenalineFix what are you confused about then?
 
@KendallFrey I'm talking bout sex baby.
 
Why would you show the sane approach only to demonstrate the insane one? — Benjamin Gruenbaum 10 secs ago
 
!!s/(\w+) (\w+)(?=\.)/$2 $1/
!!undo
 
1:08 PM
how can i create and send new parameters in a jqgrid server side call ?
 
user1994804
Please tell me if the following has any redundancy
 
Your HTML is invalid. — Benjamin Gruenbaum 24 secs ago
scream it benji
aww
pre edit damn
 
@rlemon Haha
YOUR HTML IS INVALID
1 message moved to JS trash
2 messages moved to JS trash
 
user1994804
WTF @BenjaminGruenbaum
 
1:10 PM
It's all ogre now
 
Remove this
 
@YourAdrenalineFix how many times have you been in this room?
 
:/
 
Yes
 
@YourAdrenalineFix most definitely.
 
1:10 PM
1 message moved to JS trash
we can calm down please
 
Also, how many times have you been in this room @YourAdrenalineFix?
 
how is my question not worthy ? :s
 
Thats a great way to get banned
 
user1994804
Plenty times and trying to understand JS
 
@YourAdrenalineFix awesome, so why aren't you formatting your code?
 
1:10 PM
Ok
bend over
 
kicked
 
damn, flagged the wrong message accidentally
 
@Joseph You posted your question twice, also it was php, but mostly the twice thing
 
Entitlement is strong with that one
 
there was no need to get hostile @YourAdrenalineFix
 
1:11 PM
why was the code snippet he posted (re)moved actually ?
 
@BenjaminGruenbaum ok , i am sorry
 
Anyone used RethinkDB? Is a disposer pattern a good idea?
 
@jAndy repost, I believe
 
Since I need to pass the connection to each query.
 
the rage began when someone deleted his code
 
1:12 PM
should've used source control
 
1:26 PM
Chat just die for anyone else?
 
all my tabs refreshed
not sure what that means
 
Yeah, chat died for everyone.
 
maybe you kicked a bot-net script-kid?
 
@BenFortune yes
died for me, benji, friend in the uk and friend in italy.
so i think it is safe to say it died for everyone
We are aware of the chat issue - we are working on bringing the chat load balancer online now.
 
Morning everybody :)
 
1:36 PM
import rethink from 'rethinkdb';
import Promise from 'bluebird';

export default function(config) {
    let connection = () => {
        return rethink.connect(config.database)
            .disposer(connection => connection.close());
    };
    return Promise.using(connection());
}
This look right?
 
user2620028
morning
 
user2620028
The hell has been happening up in here
 
@BenFortune no
 
@HatterisMad programming, arguing, rockets, sometimes unexpected banana life.
 
This is incorrect usage of using, you want to return the rething.connect... so people can call using from the outside.
 
user2620028
1:47 PM
@rlemon please elaborate on some of those subjects
 
@HatterisMad @Jhawins missed you
 
user2620028
@rlemon emotionally or literally?
 
no one talked engines with him, he was sad
it came up once or twice
 
user2620028
haha he messages me on facebook actually
 
user2620028
believe it or not hawins talks to me more than anyone else from the united states has since i left for thailand
 
user2620028
1:49 PM
i have more or less stopped getting on chat at all since the only people i get to see online during the timezones i am active are.... inactive or non regulars
 
user2620028
I haven't stopped programming however, just switched my main focus to learning php
 
> I haven't stopped programming however, just switched my main focus to learning php
isn't that an oxymoron?
 
user2620028
i said main focus, which is why i had to specify i havent stopped programming. Still a little js here and there :P
 
so you in thailand long term? work? school? fam? illegal surgery?
 
Hello every one
 
1:54 PM
@BenjaminGruenbaum So:
import rethink from 'rethinkdb';
import Promise from 'bluebird';

export default config => {
    return rethink.connect(config.database)
        .disposer(connection => connection.close());
};
 
right, but what's connection?
I don't know the rethink api very well
 
It's weird
 
Is that io.js?
 
I need to check date is not 120 days later .. How could I do this in javascript ?
 
1:55 PM
Where do you guys use es6??
 
Anyone have a link that defines non destructive, in terms of programming? I'd like to link to it in an answer I just gave
 
user2620028
@rlemon illegal surgery
 
@HatterisMad coming home a missus?
 
user2620028
@rlemon thats not an illegal surgery
 
user2620028
@rlemon nah the only surgery i have had is 7 teeth pulled
 
1:57 PM
when you come home bring me fireworks
thanks.
 
@Simmant Subtract and then divide by 1000 / 60 / 60 / 24
 
user2620028
@rlemon to be completely honest i came here to sort my life out a bit and recover physically from the horrific race car crash i had last september. Still trying to finish up schooling and find work in the programming field.
 
user2620028
@rlemon you are thinking china, they are the ones that play with fire works for every holiday. Thailand plays with water guns, prostitutes, and beer.
 
@HatterisMad and caning
 
user2620028
@rlemon just like my grandmother... except she had a hardwood yard stick that she drilled holes into
 
1:59 PM
well I hope you're having a good time there. I like thai food. :P
 
I really appreciate and it will be a great help for me @Catgocat if will you give me an code example.
 
@Simmant Ops I forgout about date.getDate() - 120
 
user2620028
I hate thai food. I miss being spoiled on North American food
 
@HatterisMad kinky
Thai food is pretty good. American food is lame
 
user2620028
The thai food you get in the states (american thai food) tastes awesome, actual thai food has an overabundance of spices to the point it is revolting to eat
 
2:01 PM
:(
 
user2620028
imagine dumping the salt shaker into your meal every time you wanted to eat... thats what it is like eating here.
 
user2620028
And they say our food has no taste lol
 
user2620028
I am also quite certain that a lot of Thai have mistaken the taste of beer for the taste of water.
 
oh it worked
 
2:02 PM
Well, to be fair, us Norwegians evolved on bland foods.
yes, I said evolved
 
@HatterisMad good thing I don't get my thai food in the USA :S
thai food here is pretty accurate. I know thai people who say it is close
 
user2620028
@rlemon I know you are Canadian. go speak to a polar bear about igloos
 
I'm Minnesotan, we're the Canadians of the US. Actually, the town where I'm from is called "White Bear Lake", and we have statues of polar bears everywhere
 
@rlemon Where do you guys use ES6? Is there anything on node.js for that or in chrome?
 
@Catgocat okk let me check...
 
2:04 PM
@Catgocat use Babel.io
 
What about io.js
 
user2620028
I have tried to tell someone from Minnesota that they were Canadian by proxy and they could not grasp the concept that they had a different accent than non Minnesotans
 
or just use io.js and the --es_staging flag to enable classes
 
@NickDugger I'm further south than all of north dakota
 
Does node.js have that flag too ?
Or some equivalent
 
2:05 PM
@Catgocat just use io.js
 
^
 
It's just Node with an updated V8
 
Babel is your best bet
 
Or use babel
 
just use both
 
2:06 PM
babeljs.io
 
@BenjaminGruenbaum Seems to work.
using(db, connection => rethink.dbCreate(config.database.db).run(connection));
 
well sorry for that @Catgocat .. I need to check two date .. there is two dates A and B.. So i need check date A is not more than 120 days later and same with date B
 
^ no need to be rude, if you don't want to help someone just don't.
 
Why you gotta be so ruuuude; don't you know I'm human toooo?
 
2:14 PM
I wasn't that rude ^
 
lmgtfy is very passive-aggressive.
I should know, I'm from Minnesota
 
Don't worry about it, I'm just letting you know.
 
Alright guys
 
A kiss smiley would've been appropriate if we had that in chat
 
Minnesota nice is the stereotypical behavior of people born and raised in Minnesota to be courteous, reserved, and mild-mannered. The cultural characteristics of Minnesota nice include a polite friendliness, an aversion to confrontation, a tendency toward understatement, a disinclination to make a fuss or stand out, emotional restraint, and self-deprecation. Critics have pointed out negative qualities, such as passive aggressiveness and resistance to change. == Social norms == Playwright and corporate communications consultant Syl Jones suggested that Minnesota nice is not entirely about being...
 
2:16 PM
Luckily, we don't
 
woah... self deprecation...
that rings home
oops
Well, at least I get to blame it on Minnesota next time I put myself down, lol
 
how do you record user interaction via script and then playback in browser?
 
What don't they implement smileys? Humm.. it might be due to the code that often have smiley codes ":);("
 
Code should be posted in a block anyway, which isn't parsed.
 
No, it's because smileys are stupid
 
2:21 PM
:^)
 
@Simmant okay, so you understand how the date object works right?
var now = Date.now(); // get the current date in milliseconds.
var oneDay = 24 * 60 * 60 * 1000; // figure out what one day is, again in milliseconds.
console.log( new Date(now + ( 120 * oneDay )) ) // create a new date object based on 'now' + 120 days
 
@BenjaminGruenbaum Does a disposer close after each database call, or at the end of a then chain?
 
when the promise returned to the using resolves
 
So I'm guessing I can't do
using(db, connection => {
    return rethink.dbCreate(config.database.db).run(connection)
        .then(rethink.tableCreate('channels').run(connection))
        .then(rethink.tableCreate('users').run(connection))
        .then(rethink.tableCreate('log').run(connection))
        .catch(error => console.log(error));
});
Since it's closing the connection after the first call
 
First answer on main in a long time, and I get it accepted as answer against 4 others. So pro.
 
@BenFortune no it's not
Why would you even write it this way?
what's .run? It runs on a specific connection?
Also, then takes functions, not promises
 
According to this, yes
 
so stupid :D
 
Oh, derped on that bit. :/
using(db, connection => {
    return rethink.dbCreate(config.database.db).run(connection)
        .then(() => rethink.tableCreate('channels').run(connection))
        .then(() => rethink.tableCreate('users').run(connection))
        .then(() => rethink.tableCreate('log').run(connection))
        .catch(error => console.log(error));
});
I'm guessing that's still not the best way to do it?
 
user2620028
Ok well i am done hanging my clothes outside to dry. what were we talking about lol
 
2:31 PM
using(db, async (c) => {
    await rethink.dbCreate(config.database.db).run(c);
    await Promise.all(['channels', 'log', 'users'].map(rethink.createTable).map(x => x.run(c));
});
this @BenFortune ?
 
user1596138
@rlemon Hey don't tell @HatterisMad how I feel about him he doesn't know yet
 
I'm getting close to 1337 rep
 
user2620028
@jhawins no its ok i needed to hear it. I didnt get the operation anyways.
 
@Jhawins well he does now :P
 
hi ^_^
 
2:32 PM
Answer one right and then get 5 down votes
 
@BenjaminGruenbaum That makes more sense, thanks.
 
@LittleChild hello
 
user1596138
lol but no we talk on Facebook often :P
 
And then never win rep again :d
 
@rlemon new here and to JavaScript. got a few questions. (:
 
2:33 PM
shoot
 
user1596138
@NickDugger I was at that for so long haha
 
@BenFortune the idea is that we're not waiting for all calls in advance so the db may perform them in parallel since they don't depend on each other.
 
@Jhawins I'm gonna stop there for good, hopefully
 
naw
Answer questions, answering shit is important, srsly
 
@rlemon I am reading "Eloquent JavaScript". The aim is to get started with node.js as quickly as possible. That's for my internship.
 
user1596138
2:34 PM
@NickDugger That's what I said. I randomly get upvotes though on old shit
 
Well, you can stop repping and just answer in CW
 
the book has node.js section
 
Then just give out a bunch of downvotes to put yourself back down
 
@LittleChild okay, what is your concerns?
 
but is it required to read the "Browser" section of the book?
 
2:35 PM
@LittleChild I have bought two books about node.js which helped me a lot Node.js in Action and Node.js the right way
 
@LittleChild depends on what you wanna do
 
JSHint doesn't like await.
 
@LittleChild no, it is not, but it's really useful. It's really useful to know this sort of stuff
 
@rlemon pure server-side
 
@BenjaminGruenbaum That's very true. I don;t know how to CW though
 
2:35 PM
@LittleChild what benji said then
it is helpful to have an understanding
 
alrighty! (:
 
Wait, I see a CW checkbox
 
Also, what is a good way to practice node.js? I come from an Android background so all I do after learning smth new is to make an app
 
@LittleChild write an app :D
 
webapp :D
 
2:36 PM
also, check out io.js
it is node with newer v8
 
@LittleChild you can read my new tut series that I'm writing: tech.pro/tutorials
 
wow I am starting to like you guys already :D thanks a ton
 
@LittleChild lots of people start with a simple todo app, or a chat script
 
@rlemon duly noted
:)
 
<- tag wiki's also contain a lot of information (sometimes) just pop over to the info tab
 
2:38 PM
@NickDugger Umm.. first thing I see on your NodeJS post is that "NodeJS is faster than .NET"? In what universe? :-/
 
@RoelvanUden I referenced the post that I grabbed the graph and info from
Feel free to read them
 
1267
Q: How do I get started with Node.js

Joneph O.Are there any good resources to get started with Node.JS? Any good tutorials, blogs or books? Of course, I have visited its official website http://nodejs.org/, but I didn't think the documentation they have is a good starting point.

 
@NickDugger Well, they are wrong. Sorry. I wouldn't include that bad reference.
 
!!resources
 
2:39 PM
Hi, why would <noscript> not work with IE9? Is there some setting to enable even that?
 
goldmine!! :D @rlemon
 
@RoelvanUden Feel free to offer a counter source
 
@thePetProjectProgrammer afaik noscript works everywhere
 
user1596138
@BenjaminGruenbaum I gots job. I figured I should tell you because you're kinda like the room's Dad
2
 
@NickDugger It's easier to make IO-heavy apps on NodeJS perform better than .NET, but it's certainly not possible for an optimized NodeJS IO-heavy app to be faster than an optimized .NET IO-heavy app. If you google around you'll find sources on either side of the fence, both loving their own specific technology. If you reason about it, though, you'll know .NET is faster (albeit slightly).
 
2:40 PM
In mongodb, is there a way to create a data list type which is limited to x items?
 
@RoelvanUden The only thing I googled was nodejs vs .net performance.
It's pretty unbiased
 
@rlemon but it isn't. What should I look for? I'm new to web programming.
 
unless google gave me what I wanted to hear lol
which I wouldn;t put past them
 
Of course it did.
Search bubbles and all that.
 
@thePetProjectProgrammer can you show me the code? because "noscript doesn't work in ie9" doesn't really make much sense
 
2:43 PM
Well, as I said, feel free to offer a counter source
 
as in, there is no reason it shouldn't work
 
and I will address it
 
@rlemon hope this makes sense
<!DOCTYPE html>
<html>
<head>
<title>Trial</title>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
<script>
</script>
<noscript>
Javascript not enabled.
</noscript>
<body>
Java script is enabled for this page.
</body>
</html>
 
Every benchmark, ever, utterly fails. You'll have to dig into the VMs/JITs and the way they handle asynchronous operations (that includes OS'es, versions, etc). In the end, though, V8 can't make the same optimizations as .NET and therefore is slower. It's nothing something you can prove, really.
 
@thePetProjectProgrammer noscript needs to be in the body
 
user1596138
2:45 PM
@thePetProjectProgrammer control+k to format your code (same markdown as on StackOverflow)
 
@Jhawins Awesome, congrats :D
 
user1596138
@BenjaminGruenbaum Me and Loktar are the new Benj and Mosho
 
user1596138
We're the American version
 
user1596138
Or something haha idfk. I'm excited!
 
this is my code : var node = document.createElement("script");
node.src = "http://example.com/test/test.js";
document.head.appendChild(node);
 
2:47 PM
@Chris 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.
@Chris 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.
 
Geez, cap.
bad day?
 
@rlemon still doesn't work in IE. works in Firefox 33 though. FYI IE version 9.0.8112.16421 on Windows 7.
64 bit
 
user1596138
@Chris What's the problem?
 
how to make code run immediately, not after page load
?
 
@Chris I'm glad that you have code, but so what? Are we supposed to read your mind?
put in the head
 
user1596138
2:48 PM
@Chris put the code in the head
 
-2
A: noscript tag isn't working on internet explorer

BlaisePlease avoid using <noscript> tag. There have been discussions before: Reasons to Avoid Noscript. Instead, using feature detection like Modernizr.

@thePetProjectProgrammer I was looking for reasons why it would fail.
your example code should always work as expected
now, HWAT?! DAT ANSWER?!
 
posted on April 15, 2015 by admin

Hovertext: "AAH! I STEPPED ON A CAT!" "Is it dead?" "I don't know." "THEN KEEP GOING." New comic! Today's News: Thanks for a glorious run on the monocles :) We can't wait to get these into your hands. The final tally was roughly 20,000 monocles sold. Pretty neat! 

 
@rlemon yes, I did read all posts google showed me but nothing helped and am still stuck. what's wrong?
 
@Jhawins you're working together :D ?
 
@BenjaminGruenbaum you really are like the Room Dad lol
2
 
2:51 PM
lol
 
user1596138
@BenjaminGruenbaum Yeah he and the boss interviewed me Friday and I got my offer yesterday afternoon lol
 
user2620028
@Jhawins Wait shit benji's the dad? I have said too much already.
 
@Jhawins Can you discuss it here or is it confidential?
 
He was hired as a "PHP Ninja"
 
user2620028
bahahaha and he has to wear a ninja suit to work every day
 
user1596138
2:52 PM
I've been given no reason not to talk about it. I have some forms to sign in my email right now but I don't think there was anything about confidentiality
 
@Jhawins put "Expert at Java.jQuery" on his resume
 
javaQuery
 
@Jhawins sign all forms first and let's discuss it when it's settled and you have a signed contract.
Otherwise, you can message me on FB
 
user2620028
Sterling aren't you working primarily in Java now? wouldn't you be the JavaQuery room expert?
 
@SterlingArcher Hahaha that's perfect. @BenjaminGruenbaum Can I call you dad?
 
2:53 PM
how the hell do you even disable js in IE?
 
javaQuery(whatIsDrugs).show()
 
user1596138
@BenjaminGruenbaum Yeah I don't have time to go through all the forms right now (it's new hire stuff like w4, direct deposit, background check shit) but I've electronically signed and accepted my offer :D
 
@Jhawins code is added to the head
 
user1596138
@Chris Hell fuckin yeah that's amazing I'm so glad
 
@Jhawins Oh you signed already! Congrats then!!
Is the pay good? Are you moving someplace?
 
user1596138
2:54 PM
@BenjaminGruenbaum May 11 is my start day
 
user2620028
@zirak make an alias within cap to the name dad when pinging to force it to also ping benji
 
Awesome, that's two days after my bday
 
@Jhawins you start before I even move. and I bought the house before you knew about the interview
I'm just bitching because I now hate my appt
 
user1596138
@BenjaminGruenbaum The pay is retarded to me ;D I finally feel the need to not specifically disclose. I'm moving to Omaha ish area in Nebraska
 
@Jhawins Congrats, man!
 
2:55 PM
I might have to stay an extra month in my apt because the timing has been bad
 
I close a week and a half into the month
 
user2620028
the hell... is everyone moving? i am moving across the street next month :/ does that count?
 
user1596138
The cost of living is identical to here too!!
 
so I have my appt two weeks longer than I need it
 
@Jhawins but still runs after the page is charged
 
2:56 PM
@Jhawins that's awesome and working with @Loktar sounds amazing
 
good morning ladies
 
He's a cool guy :)
 
user2620028
morning other lady
 
He's going to troll you so hard.
:D
 
user1596138
Yeah well I don't know if I'll actually be working with @Loktar, but we can hope!
 
2:56 PM
Doesn't matter, you could still beer with him.
 
Spoiler Alert: By this time next year @Jhawins will rival @Loktar's steam collection
 
I'd beer with Loktar
 
I'd beer Loktar
 
user2620028
@rlemon i bet when hawins gets there he is going to have 29" CRT monitors that he will have to remove from his desk to clear space.
 
!!s/with//
 
2:57 PM
Oh, that reminds me. New EA humble bundle
 
@SterlingArcher I'd beer Loktar (source)
 
Dammit
 
@SterlingArcher Way ahead of you. ;)
 
@Jhawins Also, you'll have a job where you're respected in, and the organization values professionalism. Which is really nice.
 
2:57 PM
@HatterisMad @Loktar check it. @Jhawins needs CRT's
 
Did you quit yet?
 
@Shmiddty ninja'd
 
user2620028
@rlemon hi-five
 
and an old IBM keyboard if you can find one
also fill his desk with packing peanuts
 
@Jhawins don't forget to update your budget
 
2:58 PM
all the classic office pranks
 
user2620028
@rlemon and wrap all of his christmas presents with several layers of packing tape :D
 
this is my code : var node = document.createElement("script");
node.src = "http://example.com/test/test.js";
document.head.appendChild(node);
how to make code run immediately, not after page load
?
 
@Chris is this your first time here?
 
@rlemon I love the classic cement shoes in the river prank
 
user2620028
@shmiddty his budget is going from eating bread every day to eating bread with other stuff too
 
2:59 PM
yes
 
Ahhhh the classics
 
user1596138
@BenjaminGruenbaum Yes, very happy about this. They were almost flattering at the end of the interview ;P
 
@Chris This code doesn't wait for page load.
 
@Chris oh odd, the bot was supposed to greet you. Anyway, please format your code (by pressing control+k or indenting it four spaces).
 
@SterlingArcher it's almost as good as a crowbar to the head prank. ohh the laughter, ohh the good times.
 
user2620028
2:59 PM
@sterling where did you learn to prank? new york or chicago?
 
user1596138
Hahaha CRTs yes. Can I bring my own?
 
@SecondRikudo you know what he means :P
 
@HatterisMad detroit actually!
 
the 'ol knife in the neck prank. Ha, so much blood. good times.
 
@rlemon oh the head trauma <3
 
user2620028
2:59 PM
@sterling fair nuff
 
@SecondRikudo Unless it's in a $(function(){...});
 

« first day (1642 days earlier)      last day (3309 days later) »