« first day (1523 days earlier)      last day (3417 days later) » 

12:11 AM
i thought the narrative was that the elves built things on every other day
during which santa was the brutally efficient taskmaster
working santa inspires me every day of the year
 
12:30 AM
hello everyone
 
@crazymoin 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.
 
"Do not Help Vampire... " but i thought vampire doesn't exist!
 
Is that the best "if" in the JS world ?

https://gist.github.com/janl/45fd5b10c3c9e158ca9d
 
Nope
 
When a JavaScript date has gone bad, "Don't call me, I'll callback you. I promise!"
 
12:39 AM
Hello!!! Could I ask you a question about Radixsort?
We count the number of occurences of each value and then the counts are accumulated..
How do we use the latter, in order to sort the array we are looking at?
I haven't understood the general idea.
Could you explain it to me?
 
Can we see code?
 
int countSort(int arr[], int n, int exp)
{
int output[n];
int i, count[n] ;
for (int i=0; i < n; i++)
count[i] = 0;
for (i = 0; i < n; i++)
count[ (arr[i]/exp)%n ]++;
for (i = 1; i < n; i++)
count[i] += count[i - 1];
for (i = n - 1; i >= 0; i--)
{
output[count[ (arr[i]/exp)%n] - 1] = arr[i];
count[(arr[i]/exp)%n]--;
}
for (i = 0; i < n; i++)
arr[i] = output[i];
}


void sort(int arr[], int n)
{
countSort(arr, n, 1);
countSort(arr, n, n);
}
 
Not in the good room.
 
@evinda Format your code - hit Ctrl+K before sending and see the faq
 
`int countSort(int arr[], int n, int exp) `
`{ `
`int output[n];`
`int i, count[n] ;`
`for (int i=0; i < n; i++)`
`count[i] = 0; `
`for (i = 0; i < n; i++) `
`count[ (arr[i]/exp)%n ]++; `
`for (i = 1; i < n; i++)`
`count[i] += count[i - 1]; `
`for (i = n - 1; i >= 0; i--) `
`{ `
`output[count[ (arr[i]/exp)%n] - 1] = arr[i]; `
`count[(arr[i]/exp)%n]--; `
`}`
`for (i = 0; i < n; i++) `
`arr[i] = output[i]; `
`} `


void sort(int arr[], int n)
{
countSort(arr, n, 1);
countSort(arr, n, n);
}`
 
12:45 AM
edit - ctrl+k
but this is no JavaScript
 
You do realize that's not JavaScript?
 
Ok, I am sorry....
Isn't the general idea of Radixsort the same?
 
it is.
 
Could you explain it to me?
 
1:26 AM
People who use TypeScript, how do you get over the weird scoping of this? I used to do var self = this in JS but TS complains about a Duplicate Identifier 'self'
 
Everyone: rlemons-12-days.herokuapp.com 4 hours left for the first draw.
 
@rlemon Shhhhhh
 
only 26 people
I am disappoint
 
@NoahHuppert Presumably you're getting that error because TS is already doing that for you
I don't know for certain, though
 
Sorta. window.self does exist but if I try with me = this then I get the same error
 
1:31 AM
_this ?
35
Q: Is there an alias for 'this' in TypeScript?

ToddI've attempted to write a class in TypeScript that has a method defined which acts as an event handler callback to a jQuery event. class Editor { textarea: JQuery; constructor(public id: string) { this.textarea = $(id); this.textarea.focusin(onFocusIn); } onFocu...

Seems to work here in the answer
 
I think that only works if the code is in the constructor
 
@evinda Still here ?
 
I bought ST finally, and downloaded ST3, and I don't even like it... worst $70 ever
 
@evinda I just looked at it. It seems that it is pretty basic
 
@NickDugger wow, really?
 
1:47 AM
It's really ineficient though
 
You do realize that Sublime has an unlimited trial?
 
yep
 
was talking to @NickDugger
 
@NickDugger :D
about the purchase, you'll learn to love it ;)
 
2:07 AM
I dunno...
is ST2 better? My main issue with ST3 is the shitty UI
and the JS highlighting is just as meh as in VS. SO far, Brackets has the best JS highlighting that I've found
 
what don't you like about the highlighting ?
(also, are you in need of library / ES5 specific stuff?)
and you're aware of the large plugin libraries
 
made a screenshot comparison of the highlighting, one sec
 
check out the plugins though before you fully pass judgement
 
Brackets is top, ST is bottom (notice how brackets highlights more things)
 
and look at a few hotkey cheat sheets
 
2:14 AM
I did get a few plugins
still like Brackets better
 
you realize those are just colour schemes
you can change those
 
I did change ST's theme already. It cahnges the colours of what it highlights, but it doesn't change what elements get highlighted
 
and yes it does suck that ES5 stuff isn't properly handled, but I've got a package for that ;)
 
It's the same in VS
 
ohh well, to each their own. but I'd say give it a week using ST3 before you fully make up your mind on it
I mean, you did pay for it
 
2:16 AM
I need someone to make a plugin that replaces the shitty file icons in ST
also, what's the ES5 plugin you're talking about?
 
Egh... I don't think I can get used to not having the extra highlighting that I'm used to with Brackets
Javascript Next did help slightly, but I'd like my variables highlighted as well.
 
@NickDugger Some of us like our code not lit up like a Christmas tree
3
 
2:48 AM
screw it. Just spent tons of time lookinf for packages that might fix my issues with it, but alas, no luck.
 
3:38 AM
@NoahHuppert => binds a function to the this or the declaration scope
 
4:17 AM
@KendallFrey There's no way that's true
 
4:38 AM
Hi, I have a div with data-role=page, I found jQuery mobile will add min-height:653px on this div, is there anybody know the reason?
 
4:59 AM
what is the goal of ecmascript
@jesse to fit 1 entire screen maybe
 
I like javascript
 
@Derek 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.
 
 
@WalleCyril yes, but the height of my device is 652...I know jquery mobile want to show a page with full screen, but it really cause a problem for me.
 
5:17 AM
quick newb question abt JSON: { "key": 1 } and { key: 1} -- are they the same?
 
@rlemon Hey, I haven't received an email yet confirming that I've won the prize today. What gives?
 
winners are listed automagically
 
oh...
o.o
T.T
 
 
1 hour later…
6:39 AM
^ though it has serious browser compatibility issues
 
6:59 AM
@Heisenberg yesh
 
@Heisenberg They are same objects but invalid JSONs
 
7:28 AM
Just put together an addEventListener helper, was hoping to use in production... Would appreciate if anybody as the time to check it out... jsfiddle.net/terry/fztdz0r1/3
 
7:44 AM
all by myself...
nobody was looking...
cuz... I was all by myself
whoo!
 
8:14 AM
@adeneo Do you use it ? Is it good ?
 
8:24 AM
hi
 
Oooh challenge is about to start O__O
 
Is it the one about fetching data using Go?
 
@dystroy Seems like it
 
So I won't enter it : I've already written a few programs doing http requests to fetch data in Go... The point is to learn a new tech
But that's a good idea to learn that : Go is ideal for that kind of tasks, especially when you want that code to be fast, parallel, bug free and clean enough to maintain it
 
which mobile simulator plugin of chrome or fire fox you are using, I am searching a good plugin.
 
8:41 AM
@jesse I use the default Chrome emulation. It's not terribly good but that's the best I know for when you can't test directly on the mobile
 
I can't make this work jsfiddle.net/2em1bLb2/1 . I have to show the messages only on 3 sec on inactivity :(
 
@argentum47 Why not use the visibility api ?
32
A: Detect if browser tab is active or user has switched away

dystroyNow we can use the visibility API. To deal with the different browser-specific syntaxes, I made this small code : var vis = (function(){ var stateKey, eventKey, keys = { hidden: "visibilitychange", webkitHidden: "webkitvisibilitychange", mozHidden: "mozvisibilitychan...

 
looking
 
@dystroy yeah, I just saw a wonderful plugin of chrome on my frind's desktop, but I forgot to ask the name, he is ooo today.
 
@jesse Did you try the default emulation mode of chrome developer tools ? It's OK for many tests
 
8:45 AM
@dystroy yeah, I am using the emulation, but I think it is not the best.
 
@dystroy cool, ok, I will use it but I forgot how to do that setInterval clear and resetInterval
 
It's waaay too early for a drinking contest people...
 
@argentum47 without looking much you just seem to forgot the timer = before setInterval(refreshInterval, 3000) at the end
@PeeHaa coffee drinking contest would be OK ? I'm winning
 
In the window.onfocus ?
 
no, in the onblur
but that's the wrong approach for your real problem
 
8:50 AM
oh
why
 
Morning
 
I changed it but still the message doesnot stop
 
HAMMERTIME!
 
no hammer
@dystroy that visibility change is getting triggered when I switch tabs. But I want something if there is no mousemovement of any kind of activity but is on the page.
 
so why did you bind to onblur and onfocus ?
 
8:59 AM
sorry for that, I changed the onfocus , I did window.addEventListener("mouseover") and "keypress"
and I changed the blur to mouseout
 
Guys, .reduce or .forEach to append all items in an array to a node?
Both will work, but which is more "semantically correct"?
 
@FlorianMargaine would say reduce. In fact he wouldn't even read the rest of the question.
If you're creating the node that way, from the items, reduce is semantically more correct, it's more pure as the call doesn't work with side effects. But in most cases forEach is more convenient and you often have to change to a forEach when evolving your code.
 
9:21 AM
is there any proper way of getting current date time from javascript or jQuery or we have to deal in Mili Seconds now !!
 
@CustomizedName Yes possible, what have you tried?
 
I'm puzzled by the various documentations on for...of Is it
for let key, value of someIterable
or
for let [key, value] of someIterable
or otherwise ?
 
I have to setTimeout not setInterval
 
Hello All
 
STOP SPAMMING THE STARS!!!!
3
 
9:28 AM
while inline edit in jqGrid I want to call a javascript function ruther then given a hard coded url, can anyone help
cellEdit :true,
cellurl : '/orphan/save', //This I want a javascript method or an remote call
 
@dystroy you know, I meant for that hat which you have.
You need to upvote a newbie's post for that, I suppose
 
@AmitJoki What hat ?
 
the hat which you're wearing. @dystroy
 
Oh, I didn't knew. That's pure luck.
 
Is there any program that could give me proper JS from a minified version
I am looking for a stand alone application
 
9:38 AM
@CustomizedName Yes what have you tried?
16 mins ago, by PeeHaa
@CustomizedName Yes possible, what have you tried?
2 out of 2 isn't really that good
 
@PeeHaa Nothing, I am a shoe seller messing around here...
 
I think you misspelled vampire
 
@AmitJoki I voted to close the question as nobody can reproduce the problem...
 
@PeeHaa You seem to be new in this room SIR
 
9:40 AM
Yes I am but I read the @CapricaSix' welcoming message
<3 @CapricaSix
 
@PeeHaa The question "Is there any program that could give me proper JS from a minified version" looks OK for this room (in my opinion)
 
@PeeHaa She's a fracking toaster, man. Incapable of loving you back.
 
@dystroy It doesn't show any effort for one just like the previous question to which I didn't even get an reply
 
@PeeHaa this is a chat room.... not SO :)
offline version of jsbeautifier.org maybe, or NotePad++ plugin
 
@CustomizedName and you have not been able to find anything?
 
10:12 AM
0
Q: How do you update npm to the latest version?

Oliver SalzburgI'm having issues with npm in a Vagrant box I'm setting up. I noticed that the npm version is somewhat old, so I wanted to check the problem with the latest release. It is my understanding that you should be able to update npm using npm install -g npm, but the command has no effect on the npm be...

What am I missing here? :(
 
@OliverSalzburg The first thought I'd have is apt-get update npm
 
@RoelvanUden That only installs the latest available package from the repositories though, which is the installed version
I want the actual latest (2.1)
 
Perhaps use the NodeJS maintained PPA? It might have the latest npm too.
(Not sure, just guessing here)
 
@RoelvanUden Yeah, I was trying to avoid that. To my understanding, the npm install -g should work, and the output suggests to be that it does work
/usr/local/bin/npm -> /usr/local/lib/node_modules/npm/bin/npm-cli.js
npm@2.1.12 /usr/local/lib/node_modules/npm
Sounds like npm 2.1.12 was installed to /usr/local/lib/node_modules/npm
 
@OliverSalzburg Your display picture just gets better
 
10:20 AM
It was my understanding that installing npm via npm results in a node_modules npm, not a root-level npm. Might be a switch for that.
 
@Sippy Thanks, the hat works really well
 
Yeah xDD
 
vagrant@box:~$ ls -lha `which npm`
lrwxrwxrwx 1 root root 38 Dec 17 09:37 /usr/local/bin/npm -> ../lib/node_modules/npm/bin/npm-cli.js
vagrant@box:~$ grep version /usr/local/lib/node_modules/npm/package.json
  "version": "1.4.28",
Makes no sense to me :P
 
@AwalGarg ready for a rapid fire ? just wanna test something (questions based on indian history)
@SomeGuy @AaditMShah ?
 
0
A: How do you update npm to the latest version?

Oliver SalzburgI still don't understand why, but I have to run npm install -g npm twice for it to have the desired effect: vagrant@box:~$ npm -v 1.3.10 vagrant@box:~$ sudo npm install -g npm npm http GET https://registry.npmjs.org/npm npm http 200 https://registry.npmjs.org/npm npm http GET https://registry.np...

Erm, okay :P
 
10:32 AM
@Mr_Green too good to be true xD
@darkyen00 lemme try
 
@AwalGarg do not google, be honest !
First President of India ?
 
ok...
forgot
 
First Prime Minister ?
 
r. prasad someting..
 
good :D Rajendra Prasad - President, Jawaharlal Nehru - PM
 
10:34 AM
no idea
 
Current PM ?
 
lol
modi
 
@AwalGarg current President ?
 
-_- mukherjee
 
:D
@AwalGarg most of my friends failed to even name the current president
 
10:36 AM
done?
 
that was really shameful :-/
 
Why are you doing this?
 
k... cool
 
Ah
 
@SomeGuy survey.
 
10:36 AM
Asking one person isn't really a survey :p
 
@SomeGuy I asked 120 students and about 10 teachers
 
Ah. I assume the results were bad?
 
on the internet, no one knows if you are a 1000 person person.
 
@SomeGuy terrible :-(
I was upset. I saw a whatsapp video of primary teachers not knowing this
 
I knew the answers except Rajendra Prasad
 
10:37 AM
:D, you are a smart lad :D
Not knowing old old history is fine, not knowing current :-x
Up for a broader questionaire @SomeGuy ? // you can ask me back :D
 
Who first opened the Indian market for MNCs?
 
the Indian Union Idk
Though :P East India Company was probably the first MNC to exist ;-)
 
after democracy, I meant. Manmohan Singh did.
 
Oh wow !
@AwalGarg Alexander was a __________ ??
(the civilization name)
 
no idea
I am not sure if that is Indian, though.
 
10:42 AM
Nope
 
Morning :)
 
Greek -> Mecedon (subregion inside greece)
@AwalGarg Name of Babar's grandson ?
 
Has anyone got experience with JavaScript :P
 
dunno
 
@JustSteveKing all of us do
@AwalGarg Akbar
 
10:43 AM
@darkyen00 I know hahaha!
I am trying to decide which JavaScript framework to use - I have been sold slightly on Backbone / marionette at the moment. The only thing bugging me atm with these are that I don't want my URL's to depend on hash changes
I'm not going to even think of using Angular until 2.0 is released - because whats the point in building something to then rebuild it lol
 
@JustSteveKing if you are learning : use react / flux
 
I didn't want to use Node either :/
<= picky one, he is
 
node is not a javascript framework
 
@JustSteveKing Any special reason not to go with Vanilla JS?
 
its a runtime environment which runs headless, and well has steriods for server tasks
 
10:48 AM
node expands v8
 
@AwalGarg I want an MVC structure as it will be easier to maintain in the long run - and for anyone else who comes along to my code
 
@JustSteveKing wrong
 
@AwalGarg please expand on that? I am new to JavaScript but not programming all together
 
morning..
 
@darkyen00 ^^
 
10:49 AM
?
Alright .. you know comics ? (DC) ?
 
noep
 
damn
node reminds me of batman
 
@AwalGarg I have my server environment nailed down - this is something that is not allowed to change. And getting Apache to behave with Node is a nightmare. So Node is off the table.
 
with node you use nginx
 
@JustSteveKing 1. You don't want to use Apache. 2. It is not a nightmare. 3. Not allowed to change is nothing.
 
10:51 AM
or run it straight , node is best as an api server
@AwalGarg if his server is done i wouldn't tocuh it
 
@darkyen00 It could be dangerous if not properly setup :/
 
@AwalGarg These are stringent instructions passed down to me. I have a PHP RESTful API which I collect my JSON data from - now all I am missing is the JavaScript MVC front to it all. I have been suggested Backbone - but I do not want to rely on hash changes.
@darkyen00 The server side is out of my control, and something set in concrete. Hense asking for alternatives to Node
 
@darkyen00 then he might as well go with crappy code, because once it is done, he doesn't want to touch it :/
@JustSteveKing you don't need the MVC thing... if you follow separation of concerns, and stick to proper design patterns.
Go with Vanilla.
 
@AwalGarg This is a site that gets rebuilt once ever 2 years - with practically no changes in between.
@AwalGarg My problem here is my lack of experience of JavaScript - hence going for a framework. Now if I was doing it all in PHP I would code it straight, however I am trying to break my bad habbits and use JavaScript more
 
@JustSteveKing If you have a lack of experience, you should "STRICTLY" avoid using any lib, and framework at all. You would repent.
 
10:57 AM
@AwalGarg Academically that works.
If he's on a timescale then it doesn't.
 
I find it much easier to learn a framework/library first - then to see what it is doing and learn how the language is put together from there. Don't get me wrong I have built in Vanilla JS before - mainly small time plugins but nothing as expansive as a whole application
 
@JustSteveKing That is good in PHP, but I tell you, not with JS.
 
@Sippy When building a site when is there not a timescale?
 
@JustSteveKing When you're doing it to learn for yourself?
 
@Sippy It is good for a long run, and 2 years seems like a long run to me, here.
 
10:58 AM
@AwalGarg This is how I learn a language and it is what has gotten me thus far
 
Oh if you have 2 years then fuck it, just learn Vanilla
That's ages lol
 
@Sippy Noo, I don't have 2 years to build. The site changes every 2 years. I actually have more sites to look after and rebuild
 
@JustSteveKing I dunno about other languages, but for JS, this is the wrong way. Sorry.
 
@AwalGarg There is no wrong way, people learn in their own ways.
 

« first day (1523 days earlier)      last day (3417 days later) »