« first day (2288 days earlier)      last day (2665 days later) » 

2:05 AM
@ssube no
mobx is actually super straight forward
the code is really readable
most of it is type definitions for TS lol
 
@ssube no.
but using them together is trivial w/ or w/out the existing libraries for such a thing
 
yeah using mobx with anything is pretty trivial.
it's nice
 
they don't mention knockout.js in that comparison :(
 
it got knocked out
 
^
 
2:09 AM
people mountain people sea
 
people dance people flee
 
people crap people pee
 
lol
rofl
 
crab people and pea people
 
magic people voodoo people
 
2:11 AM
meet people meat people
 
beet people beat people
 
2:28 AM
Is there a way to use a newer version of node with Electron? Turns out I can't use EventEmitter :(
wait, that's not the problem, is it
ignore the fuck out of me please
 
I add new user to array on socket when they come. its been added to
var users = users[];

Now, on disconnect event, I do this to remove disconnected user from array

delete users[socket.nickname];

However, I have understand that it not completely removes, instead, it puts "undefined" itself to the disconnected user. How can I remove user from list completely ?
 
user6820627
@user3304007 It's one of the homework I have to do everyday.
 
you shouldn't be deleting from an array
 
@ssube , then they will be there forever ?!
 
user6820627
var numbers = [1, 2, 3, 4];
var index = 2; // remember, JS count from 0, so this is the third element
// remove the third element
numbers.slice(0, index).concat(numbers.slice(index + 1, numbers.length));
 
user6820627
2:33 AM
@user3304007 here ^
 
@learn thanks, let me try
 
@user3304007 if you want to remove and release them, use a map rather than an array
 
user6820627
@ssube wtf is map?
 
It just needed to be removed in a proper way.
 
@LearnHowToBeTransparent the correct collection here
 
2:36 AM
@user3304007 You're not using a series of values, so there's no reason to use an array. Use a plain object {} or a Map.
 
it is purpose built to store key:value pairs and let you remove them
 
In most of the scripts, they are using var users = users[];
using users{} is a better way ?
 
neither of those is legal JS
or at least they're both broken
!!> var users = users {};
 
@ssube "SyntaxError: missing ; before statement"
 
user6820627
@user3304007 oops, copy-pasting is :(
 
2:39 AM
yeah, those are both bad
 
user6820627
@CapricaSix it's repmraterto js
 
you want var users = {} and then users[name] = socket or users[name] = null
 
8
A: Node.js: socket.io close client connection

Himani AgrawalFor socket.io version 1.4.5: On server: socket.on('end', function (){ socket.disconnect(0); }); On client: var io = io(); io.emit('end');

Is that also removes from array ?
 
users[name].disconnect(); users[name] = null;
 
user6820627
@user3304007 it depends on what's inside your code
 
2:41 AM
karate done!
 
what belt?
 
@LearnHowToBeTransparent it doesn't, though
 
is there less than white belt?
cause that'sm e
 
yes, pink belt
 
rainbow belt
 
user6820627
2:42 AM
@user3304007 yes. black belt.
 
pants belt
leather belt, pleather belt, and hippie woven belt are the lowest 3
 
so if I make it null, its same as none ?
 
well im not wearing a belt i have leggings on
 
@user3304007 if you disconnect it and perform any other cleanup, then release any reference to it, the garbage collector will destroy it
 
that disconnect() not worked.
Can I use;
delete users[socket.nickname];
users[socket.nickname] = null;
 
2:44 AM
nope
 
It removed first, than nulls it. whats wrong ?
 
you haven't disconnected
 
1 message moved to Trash can
@user3304007 Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and see the faq.
 
oh, in that case, those are redundant
you only need one version, they do the same thing
 
Learning pre-standard C++ at college. Painful.
 
2:46 AM
 socket.on('disconnect', function() {

delete users[socket.nickname];
users[socket.nickname] = null;

});
 
why set it to null?
 
it needed to be removed from array
There is a
var users = users[];
Above it.
 
that is not valid JS
 
I have used only this on disconnect
socket.disconnect(0);
and it seems to be working correctly.
how can I make sure it deosnt leave something undefined ?
 
user6820627
@user3304007 what the ... why var users = users[];? ah let me guess... that's a C array? double balance[] = {1000.0, 2.0, 3.4, 7.0, 50.0};
 
2:51 AM
C ? nope. javascript
 
That's definitely not javascript
 
I've done some more refactoring, now I have a game logic file that contains some generic utility functions, a large setup function and related utilities, and a somewhat large render function and related utilities. How can I make it easier to navigate among different sections of my code?
 
thats nodejs
 
That's definitely not nodejs
 
user6820627
here: i run in nodejs repl
 
user6820627
2:53 AM
> var users = users[];
...
...
> users
ReferenceError: users is not defined
    at repl:1:1
    at REPLServer.defaultEval (repl.js:252:27)
    at bound (domain.js:287:14)
    at REPLServer.runBound [as eval] (domain.js:300:12)
    at REPLServer.<anonymous> (repl.js:417:12)
    at emitOne (events.js:82:20)
    at REPLServer.emit (events.js:169:7)
    at REPLServer.Interface._onLine (readline.js:211:10)
    at REPLServer.Interface._line (readline.js:550:8)
    at REPLServer.Interface._ttyWrite (readline.js:827:14)
 
user6820627
see ^
 
one sec,
this is my full server.js code
 
There is no instance of users[] in that file
 
when I am emitting data, I am using
users[hangi].emit("whisper",{message: data.message, nick: data.name, kimden: hangiden, kime: hangi});
 
user6820627
@SterlingArcher so that's a chat app
 
2:57 AM
yes
 
3:12 AM
thats impossible
on a FaceTime video call cause my connection is 4 megs
so I guess my ISP is playing dirty tricks right?
 
so I got one of these for a random project
totally forgot I did..
plugged it into my primary machine and have another windows desktop lol
so tiny
lol so tiny
no idea wtf to use it for though
 
3:38 AM
A picture of your wife
Nice porn bookmark, by the way
 
porn bookmark?
lol there is no porn
 
Ha, you had to check
 
I admit to nothing! :p
 
reddit has good porn
 
3:59 AM
we can see the importance of SO chat for you, ffrom the size :)
 
4:13 AM
I am using this to remove user from disconnected users array.
 
1 message moved to Trash can
@user3304007 Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and see the faq.
 
However, when I do typeof users[hangi]
It tells that the type is object
My code:

socket.on('disconnect', function() {

socket.disconnect(0);

});
 
@user3304007 That would make a great stackoverflow question! stackoverflow.com/questions/ask
 
Chinese New Year is drawing near. It's a festival for family union. But I'm dreaded about my parents grabbing me for a talk about the girlfriend thing. I don't blame them for that because they don't know I'm gay. And I feel struggled letting them down and not knowing how to approach telling them that.
I decided not to tell them until I have a long term relationship with a boyfriend and become well off. Until then, they may feel a bit relieved knowing my situation. It's really like a pain in the ass having to be confronted with such an issue.
 
but your ass also in pain right
 
4:25 AM
I'm not that into that sort of thing. So no.
 
yeah, CNY is on the 28th
 
@jacobian Do you celebrate it?
 
I always wonder why CNY date always changing? why they can't be like christmas on 25th december
I am a moslem. I only celebrate idul fitri
 
haha
Because CNY is based on the lunar calendar instead of the gregorian calendar.
 
4:48 AM
@jacobian Isn't it Muslim ?
 
yeah it's the same thing. because I live in indonesia that means I am sunni muslim.
 
Can anyone help me on nodejs ?
http://stackoverflow.com/questions/41756282/nodejs-removing-user-completely-on-disconnect-socketio
 
5:36 AM
@jacobian Because Chinese New Year is based on the Chinese Lunar Calendar, which is different from Gregorian Calendar.
@ZhengquanBai You have my sympathy.
 
6:18 AM
We have a corrupted file in our git-repo and one of our branches (not master, thank god) is FUBARed. How do we even fix that? We've tried making a patch file with the changes on the branch but that patch refers to the broken commit so that didn't get us much further.
 
if you have a copy of the file content, just overwrite or delete it
then put the right file
or use git reset on that file only
 
the corrupted file is on the repo, not locally
basically everything that inherits from that hash is fucked
 
if you can fix the corrupted file, just overwrite the old one and push it to your repo
 
^--
 
user6619012
There is Text "Black, green, blue".... etc in website, what we need is we want to replace Black text with Black icon ,
green text with green icon , like we want to replace text by that particular color icons as here : http://codepen.io/shahil/pen/PWWdRY
is this possible ?
 
6:33 AM
those text are being colored by a CSS property (high likely it's wrapped inside <span>. Just check its color property
err ... I read "green text" as text in green
 
Could someone give me a good reason to learn Python, something that will motivate me
 
user6619012
@KarelG Thanks , we dont want to enter code for each color individually, dynamically we need to replace "text" by color icons, is this possible ?
 
do you know why python always live on land?
 
its too heavy to swim ?
 
@FlyingGambit if you can get hand on a rasperry PI device (or something similar such as BBB) you can play with it by a python script
 
6:36 AM
because python is above C level
 
@FlyingGambit Again, it's not like main.js is corrupt. It's a corrupted object on the disk at the central repo. Imagine for a second git tells you ./objects/bd/26cf02348831f2c39f233c7d696917a2852f is empty error: unable to find bd26cf02348831f2c39f233c7d696917a2852f error: object file ./objects/bd/26cf02348831f2c39f233c7d696917a2852f is empty fatal: loose object every time you try to fetch, pull or push
 
@jacobian XD
 
Now tell me which file you want me push
 
@KarelG Thanks
@ivarni that looks bad
 
Oh it is bad :)
 
6:38 AM
@user5348fh8y5 yes why not? Just scan the text for color names. The main challenge is to have a good list of color names ;)
 
our git repo crashed yesterday and corrupted a bunch of files. We're actually lucky it's on a feature branch. One of the other teams has a corrupt master
I'm leaning towards thinking we can't fix this locally and that the IT guys will have to do it :/
 
You should post this as a question so its get more attention
 
(And I'm fully aware of the irony of calling them "the IT guys")
 
what does the log say about the current master
eg git log | head
 
git log worked fine. I don't have that branch on my box and I don't plan on pulling it. It was on a colleague's branch
@FlyingGambit possible dupe of stackoverflow.com/questions/4111728/…
I was hoping we could do some magic trick locally rather than instructing the people running the repo server to randomly delete files
 
6:43 AM
well, the problem is at the server :-)
 
Yeah, I guess :/
 
you have to fix it there
 
user6619012
@KarelG is there any chance can you give me a refrence link to follow that i required......
 
:|
co-worker entered, but he was still sleepy, closed the door and started to enter the alarm code on the panel due of habit. But since I am here already he ... activated it.
 
Quick, give him coffee
 
6:54 AM
Yeah, got a call from the surveillance company with "there is something wrong". I responded with "Ah, if you can deliver coffee, it's solved"
 
^^
 
it was my fault too
forgot to disable the access button. If you press it again and enter the code, it activates the alarm
but you have to press it to be able to enter the code :)
"failsafe" design
 
IMHO that's a stupid feature. I can see the usecase for manually activating the alarm but that shouldn't require more than one keypress and certainly not use the same sequence as deactivating it
It's like a webpage allowing you to cancel an inflight submit by filling out the form again
 
the CFO made the sequence similar so that we only have to memorize one code
if there are two codes, then it's a good design
but those panels are being replaced later
 
I still don't think you should need a PIN code to activate an alarm. Fire alarms don't have that, why should other alarms do?
 
7:00 AM
people can be retard and press wrong button :)
anyways, the new panel is
O <room 1 name> O
O <room 2 name> O
O <room 3 name> O
--------------------
|                       |
| panel with keypad |
|
--------------------
left button to disable, right button to enable. With colors. Green and red
 
Sounds like a better panel :)
 
it's a nice led color button tho. The left green flashes and right red is bright if you open the door if alarm is on to enter the sequence. Then the red is off, and green is bright. Now the alarm is deactivated
it's also easier to check which room is open or not
 
7:44 AM
Hi All
Does it makes sense to use angularjs or react for the apps whose pages are being already rendered by the backend? (multi page app)
no dynamic ajax calls and no JSON response
 
what is the use case then ?
is there anything specific that lead to even considering front-end frameworks ?
 
nothing
 
Then it does not makes sense to me at least.
 
yup thanks.. thought the same
but client insists for one :/
 
explain that there is no reason for it
 
7:50 AM
@Mr_Green Convince them why you should now
if they are into no-convincing mode then just go ahead and drop in the framework. You don't have much choice there, don't you!
 
Well you can render with react on the server. I'd actually prefer that over using somethlink like Jade/Pug but then I've been using react for a year now. I wouldn't pick it if I didn't already know it.
 
@ivarni Rendering on backend is not in my hand. So, I think react also doesn't makes sense here.. right?
@Shashi yup will do that
 
@Mr_Green Yeah, if you're not doing the server rendering and are only using JS for light stuff like triggering animations or showing popups then I wouldn't use a library
 
ok thanks
then going with jquery
any other preference suggestions?
 
w3schools.com/code/…
Is it possible to get the info below every button after last one
not after last one
 
8:04 AM
@Mr_Green I wouldn't use jquery personally, there are more lightweight alternatives
 
http://www.w3schools.com/code/tryit.asp?filename=FBX6GE0RVJ3U
don't want to write <div id="demo" class="collapse"> twicw
twice
 
@ivarni like?
I only know jquery
 
@Mr_Green Like not using a library for DOM manipulation and using something lightweight like a fetch shim for XHR.
But if you know and love jquery there's nothing wrong with that either
It's a nice API
 
haha I don't love it but it works though
I know it has some serious perf issues, may be those are fixed now
 
@diwakarbhatt just for the future, please don't check w3schools if you want to find out things about front-end development
 
8:09 AM
I quite like their DOM wrappers and I wish the browsers APIs were more like $. Nothing wrong with thinking that :)
 
(and back-end too * ahem *)
 
8:30 AM
What backends you guys use BTW ?
 
At work, Java. At home, Node.
 
At work PHP/Laravel. At home, Node/Express.
@ivarni +1 to that!!
 
8:42 AM
how can nodejs connect H2 database?
anybody know that?
 
At home: Node and PHP
At work: ASP.NET / Node / Java EE
we have a forum in PHP but I'm lazy to check that. So I delegate that... (which is my job :D)
 
@Shashi PHP and .Net, with an occasional Java.
 
I dunno why, but when ever I see JAVA my mind takes me to the legacy land :p I guess it will take time for me to wrap my head around the fact that JAVA is still used in building RESTFUL services I guess.
 
@Shashi Which IDE do you use?
 
8:58 AM
@Shashi Java's runtime is pretty solid so it's still quite commonly used. And just like with JS there are many other languages that use it as a compile target
 
@Sheepy Atom and Brackets (I maintain two code bases at the same time)......none of these are IDEs BTW, they are just plain text editors
I am a fan of WEBStorm though, its just that the organisation I work with is not wiling to pay for its license :D haha
 
does atom work well with PHP ?
 
@KarelG Yep
 
YES!
 
I've tried that ... it's a kinda resource hog if you compare it to ST. But ST doesn't support PHP well
 
9:01 AM
Resource hog?
 
@Shashi WebStorm is built with Java. As do Eclipse and NetBeans. Tried Atom twice, uninstalled in a day and a week.
 
@KarelG Both of these are Hybrid and they are bound to be less performant compared with others
@Sheepy Why so ? any specific reason
 
@Shashi I get along fine with the community edition in those rare cases where I have to touch Java-code and need an IDE. For JS I just use ST.
Or wait, is webstorm != intellij?
I always thought it was kinda like a plugin
 
@BenFortune it suddenly crunches your CPU / RAM if you're viewing a large file written in different syntax
 
@Sheepy For the long time I used to use emacs in my educational days and I loved it. The moment I started working full-time I didn't always have time to figure things out if I am stuck with IDE problem.
 
9:03 AM
i do not have this on ST. idk why
 
@ivarni NOPE!
 
@KarelG Haven't noticed anything like that
 
@Shashi It starts with "It doesn't offer setup location" and ends with "IDE has more features that make my life easier".
 
@Sheepy YUP!, I can relate to this.
I just can't brag about how WebStorm boosts my productivity when it some to writing NODE/Express
 
And I write in many languages. Both real world languages and programming languages.
 
9:06 AM
One day! One day I will force my employers to get me the licenses of webStorm :D :)
 
Aim for IDEA. It's the company who pay :D
 
@Sheepy 'Real World' XD which one to be specific.
 
@BenFortune perhaps it's my fault. I work with split screen and while left one is compiling, I open a file in the right one
 
@Shashi English, Chinese (Trad), Chinese (Simp), and limited experience with Korean, Japanese, French. One of the sites I'm working on has all of them, plus Russian which I totally have no clue...
 
@Sheepy AMAZING!!
 
9:11 AM
I don't know. It hurts when the client (not this site) trust Google Translate more than a human.
Which happens quite often...
 
@BenFortune what does "work well" mean here exactly?
 
afk back to work. got bug to fix and baby should wake up soon
 
I really like PHPStorm, but I have to switch to ST to do anything in JS, as PHPStorm just goes absolutely crazy on big JS files
 
Does not happens all the time, one of my past employers were one of the biggest in travel online booking (you must have guessed it already) and they very clearly refrained form using translate for even a single word translation.
They provided specific resources (people) for even minor translation.
 
@Shashi We are a website company. Usually, when a client hand a site for us to handle, either they don't have an in-house team or the in-house team is making a mess. :(
 
9:18 AM
Hi Guys :D
@Loktar now you must make it work with VR using WebVR :P
 
@Shashi Try vim, by the way. Spare a full day to learn and try it. :)
 
@Sheepy Been there done that!! wanna do a VIM vs Emacs...lemme know :D :p haha [EMACS FANBOY - just because wasted alot of time with it :p ]
VIM is good its just that you can live inside EMACS that VIM does not offers
 
:P
I never got used to either. I just code with a pen and paper then scan it.
 
@Abhishrek I take help from Chuck!! he stares at the screen and code writes itself!
B)
 
!!giphy Q star trek
 
@Shashi That's why I use IDE - with vim plugin. B)
 
@Abhishrek (y) :p
 
They need to bring Q in the new star trek series. At the end of the movie he snaps the finger and everything turns itself back to TNG's start, no JJ trek; TNG all over again 🖖🏻
 
Time travel level 9 thousand!!! :D
 
@GNi33 Works with no serious issues, there are a couple of quirks but nothing major. Linter works great, autocomplete works great, I think there's a plugin to run specific tests whilst you're working on a file too
 
9:57 AM
0
Q: lua-ngx ngx.redirect after sending out the headers

Gandalf the WhiteI am using lua-ngx for redis connection and operations. I am fetching value based on a header key and then redirecting the user to particular link. At the moment I am trying to put things together therefore I was just trying to redirect to google.com. Other blocks are working fine but the redire...

 
pls help me any
how to decript password using npm module
any lib is there like md5
 

« first day (2288 days earlier)      last day (2665 days later) »