« first day (1681 days earlier)      last day (3250 days later) » 
00:00 - 18:0018:00 - 00:00

12:06 AM
funny site :D
@rlemon how do I win the supervisor game? I burned everything but nothing seems to be happening :/
 
burn everything in the room and the elevator opens
took me a while
want an even better site?
 
shit the elevator did open but I burned myself before that :(
yes
 
12:30 AM
:D
 
Is there a good database design tool, that looks good for a screenshot
 
@rlemon the algersoft thing is a joke right? right?
they put it way too much seriously :/
(or you)
 
I don't understand why this code is producing an Unexpected Token error:
function range(start, end, step) {
  var arr=[];
  if (step==null) {
    step=1;
  }
  if (step > 0) {
    for (i=start; i<=end; i+=step) {
      arr.push(i);
    }
  }
  else {
    // Unexpected token )
    for (j=start, j>=end; j+=step) {
      arr.push(j);
    }
  }
  return arr;
}
 
Shouldn't that , be a ;?
 
AAUGH!
Always nice to have a second pair of eyes.
Works perfectly now.
Thanks.
 
I'm bored. :/
and I forgot how to loop and function
I didn't forget how to copy and paste the same loop over and over tho
:D
 
Code re-use!
 
My windows phone app looks
better than my android app :-/
 
1:23 AM
sleep time
 
1:39 AM
HAAHAHAHAHAHAHAHAHAHA ^
DNA --- ACID - Acid dissovles so we can't have it
 
I'd laugh if it wasn't so sad
Well, actually not. This is funny too: skepticmoney.com/wp-content/uploads/2011/04/water.jpg
 
2:03 AM
@ivarni i just laughed
 
2:47 AM
@Abhishrek Heh, I was asleep
 
3:06 AM
Right, so I've cracked the jetlag problem when travelling west. Leave in the morning, don't sleep on flight. Stay awake untill evening local time and get up early morning. Next evening get hammered. Jetlag gone in morning. But travelling east fucks me every time. How fix?
 
don't travel east?
 
Wait, are you saying the earth is round? preposterous!
 
US to UK with pit stops in Japan, Nepal and Oman
 
I'd make that Hawaii, Singapore and Dubai but I get the idea
 
Great choices, too
 
 
3 hours later…
5:45 AM
I was trying to make an online code collaboration site, a google doc kind of thing , but for coding. I have some incomplete code gist.github.com/argentum47/4511f8a7867587da9e16 , (which works :P ) but I am not being able to figure out how to show the user editing the code, like multiple cursor in different colors
 
6:06 AM
anybody can please tell me how can i get value from this json?
Object { picture="/Upload/225743_564835133537020_1509910106_n.jpg", name="Punjabi Suits", price=1000}
 
That's not JSON
 
ops please tell me I am new to json then what is this and how can I get values from this
 
Ideally, convince your data source to give you actual JSON
failing that, find out what format it is, and look for a parser for it.
worst case, write a custom parser or hack together something that will work in your specific case
 
basically i am getting data from database and inserting the data to angular cookie and fetching it for further process
i am doing all this in angular
anyways thanks I will try to find solution..
:)
 
 
1 hour later…
7:12 AM
Guys, I have a question
Let's say your site admin is set to accessible only by your company ip-address to enhance its security.
However, as an site-admin, you've decided to leave a dirty way to access your admin just in case of the site lock-out your company IP (You were typing in password while heavily drunk and blacklisted yourself because you've entered wrong password for 5 times). Do you think this is a good idea?
 
7:31 AM
does reactjs use any regex to parse the props like id className and styles?
 
@EnglishMaster no
 
@JanDvorak Then what would you do?
 
@EnglishMaster admin access for employees is fine, but I would never opt for anything undercover
 
@JanDvorak What would you do if you lock yourself out by accident like described above? Just delete entire system and reinstall? You obviously have your DB regularly backed up so DB is fine.
 
7:42 AM
@EnglishMaster this looks stupid:
> Let's say your site admin is set to accessible only by your company ip-address to enhance its security.
There are too many ways for it to break
Just use a standard authentication scheme
 
A master key for company employees is perfectly fine. A master key for whomever happened to be coding the back end is not.
 
A backdoor would also probably be a valid reason to fire an employee
 
Well, what if your are the guy who developed and started the company like in Silicon Valley (Pied Piper)?
 
Then just use a standard authentication scheme, don't add IP restrictions
(you know companies are started out of Silicon Valley too ?)
 
@dystroy gone
 
good
 
Is it bad practice to create list of elements in jquery id's by their position in an array?
 
@FrickenHamster 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.
 
Anyone else here fan of books like CODE, 7 Languages in 7 Weeks, Computational Fairy Tales and Learn yourself some Erlang / Haskell? Easy on your brain and explain things in intriguing way?
Can you suggest me any other books like this?
 
8:00 AM
@FrickenHamster Are you talking about generated IDs? Not a fan.
 
As in if I had an array and for each item, I'd loop through the array doing something like id = "baseid" + I;
It seemed messy to me, but I don't know the correct way of doing it, something like ng-repeat, but with just jquery
 
It is messy. Sure you can store the elements in an array?
 
That seems like a better way to do it, thanks
 
I'm not sure what you are trying to achieve but why don't you just wrap those elements in a parent element, such as div, which is practically acting as an array on jQuery side
and do whatever you want with it?
It should be easier than programitically allocating +1 to baseID crap
 
I'm not sure I'd like to access the elements inside the div. I am creating a div with spans, textareas etc inside that I would like to edit and parse at anytime.
 
8:09 AM
and you should probably use class than ID in that case
 
Is there anyway to clone from an html template using jquery? Or maybe I can use the default javascript functions and use jquery functions on the cloned elements? I don't believe there is functionality in jquery similar to the template tag without using plugins?
 
before allocating +1 to IDs, they will have duplicate IDs
 
What if I saved the elements created to members of the object it belongs to, and edited that way, forgo ID's altogether?
 
@FrickenHamster jQuery doesn't have a templating engine but you can clone elements just fine, or if you have HTML you can pass it to the jQuery constructor.
 
The downside I think being I wouldnt' be able to access individual elements without the variables using just $("#idname")
 
8:12 AM
You should just show us summary of your damn code than telling a bed-time story about it
 
Sounds like you have duplicate IDs
 
@JanDvorak perhaps I can keep the template html I am trying to clone hidden or something?
I haven't written what I'm trying to make now, but using id + i was just the way I've done it previously
Just looking for the better way :/
 
8:29 AM
Do you normally learn about SWOT in college btw? (You probably know what I mean if you watch Silicon Valley)
 
8:41 AM
!!google SWOT
 
hey, does anyone know a lodash method to remove deep values from an object? like _.has and _.get but to remove the key?
 
I don't think there is one. Why not simply write the function yourself ? It's 10 lines of (vanilla) js.
 
10 lines is a lot, I hate creating "utils" files because most of what I need already exists
but yeah, I'll do it if I have to
 
@BenjaminGruenbaum hey Benji, I just stumbled over "you gotta love Frontend" and saw that you're a speaker there. Will your talk be recorded and made public?
 
THE
9:10 AM
why receving error here - jsfiddle.net/csv09pk3/1
when it works perfectly here - codepen.io/alettieri/pen/WbdRJw?editors=101
same with this one - https://jsfiddle.net/csv09pk3/3/
when works perfectly here - http://codepen.io/alenaksu/pen/eNzbrZ
 
probably because the order of the external resources is messed up, can't be sure though
 
Works if you do no-wrap - in body. Scoping issue...
One more reason to hate angular
 
THE
not sure what that means but let me check if i could fix it, just starting to learn it
 
Angular relies on your controller residing in the global scope
 
THE
@GNi33 don't think we change change order in jsfiddle it sorts them out alphabetically
 
9:29 AM
@EnglishMaster that scene was great
 
does anyone use babel with mocha?
can it pick up .es6 files in the test dir?
 
9:49 AM
In my python class, I learnt that all objects in javascript are just dictionaries
In python below is the code define account abstraction using dictionary
def account():

    def withdraw(amount):
        if amount > dispatch['balance']:
            return 'Insufficient funds'
        dispatch['balance'] -= amount
        return dispatch['balance']
    def deposit(amount):
        dispatch['balance'] += amount
        return dispatch['balance']
    dispatch = {'balance': 0,
                'withdraw': withdraw,
                'deposit': deposit}
    return dispatch
Does javascript provide the objects in similar manner?
 
@overexchange look up "javascript constructor"
 
python class == oop class using python
 
You can do that in javascript.
 
wht am tryin to understand is, does javascript stores the attributes of an object like this?
dispatch = {'balance': 0, 'withdraw': withdraw, 'deposit': deposit}
 
9:59 AM
You can do this
 
this can have methods as well
apart from atributes
 
Usually you store these in the prototype
 
How do you generally create an object in java script?
How do you generally create an abstraction account(say) in a bank using javascript, as I did for account in python above? so that I can understand the meaning of statement all objects in javascript are dictionaries
 
10:15 AM
Account = function(){/*constructor*/}
Account.prototype.deposit = function(amount){...}
...
 
ok
how will add balance attribute?
 
The exact same syntax for dispatch also works here and creates an object of anonymous type
dispatch.balance or dispatch["balance"] both work, the former is preferred
 
If you can provide balance atr and deposit/withdraw skeleton in javascript, that would help me
check this conversation
1
Q: Why is this not "object-oriented" programming without the class keyword?

overexchangeSay we want to provide an abstraction of an "account" in a bank. Here's one approach, using a function object in python: def account(): """Return a dispatch dictionary representing a bank account. >>> a = account() >>> a['deposit'](100) 100 >>> a['withdraw'](90) 10 >>>

this is where I come from
 
g2g now, may cheeck out later
 
11:03 AM
@GNi33 yeah everything is going to be recorded in YGLF, thanks btw :)
 
11:32 AM
@BenjaminGruenbaum awesome, your topic is brilliant. Congrats on the spot, looks like a nice conf overall.
 
Thanks, speaking at the same place as Crockford is a big honour :D
 
11:47 AM
wuuuut? on canvas, shadowColor can't be set to a gradient????
this is stupid!
I should be getting a black to green shadow going downwards....
I was trying to recreate this gif, and wanted to use shadowBlur for the focus of the orange border lines, setting it to a gradient which changes the alpha, so that I'd get a nice effect...
but nope
I would have gotten away with just 2 lines, but nope, I have to make a lot of other lines and individually setting the alpha for those
basically manually integrating the gradient system for shadows
can that be consdered a bug? Should someone report it? I'm using chrome 43
 
@argentum47 to tokenize, yes it does.
(also I assume you are talking about the JSX transformer)
 
yeah, misread, sorry
 
no prob
 
I need to update my main chrome instance, still on 42 :/
 
nvm, I'm on 42
42 :D
didn't even notice it
 
12:05 PM
yeah but 43 is out. Should upgrade.
In the next few years, we will have chrome version written like 7k and 8k.
 
12:48 PM
Haha, I'm on 44
Dev build, though
 
1:09 PM
Anyone here uses Passport?
 
@MadaraUchiha I do
 
@dystroy How do I use the flash message feature?
 
(a little, only on Miaou)
@MadaraUchiha I don't know what that is
 
@dystroy When you have an error
wrong username or password
How do you get that message back to the client?
 
As I only use OAuth, I'm not sure that applies
Isn't it this ?
7
Q: nodejs + passport + express 3.0 + connect-flash no flashing?

DredokI'm using a passport-local strategy for authenticate users. I followed the guide given by Jared Hanson and installed connect-flash in order to give flash method to the req object. So one of my request handlers is the following: app.post('/login', passport.auth...

 
1:21 PM
@dystroy No
I get a TypeError: undefineed is not a function
TypeError: undefined is not a function
    at allFailed (/home/madara/projects/test-meister/node_modules/passport/lib/middleware/authenticate.js:111:15)
    at attempt (/home/madara/projects/test-meister/node_modules/passport/lib/middleware/authenticate.js:160:28)
    at Strategy.strategy.fail (/home/madara/projects/test-meister/node_modules/passport/lib/middleware/authenticate.js:277:9)
    at verified (/home/madara/projects/test-meister/node_modules/passport-local/lib/strategy.js:82:30)
    at Strategy.localStrategy$ (/home/madara/projects/test-meister/src/routes/login.js:43:20)
This happens when I call done() in my Strategy callback
 
why doesn't $watchCollection check for object equality :|
 
Basically, it says that req.flash is not a function
 
I never looked at those things, I guess the passport handler, coming before yours, is supposed to add it
 
@dystroy The passport docs are so freaking horrible.
 
@MadaraUchiha True. But it's the same for most node packages
 
1:27 PM
@dystroy Needs the connect-flash package for this feature to work
Why the hell is that not documented?!
They docs have just gone under a revamp
 
Use the source, luke.
 
wow, I never knew about iframe.contentWindow.document.write 0.o
 
nothing is documented in the node world, you're just supposed to look at an obsolete tutorial, then search the web and fall on horrible blogs, then at least look at the sources
 
@AwalGarg I did...
 
And yes, finding the relevant source is often hard as they cross import themselves like mad
 
1:30 PM
people have the right to write bad code
and you have the right to not use it
or deal with it :P
 
@towc iframe.contentDocument.write works too, ftr.
 
@Mosho passport deals with hard to set up things
 
@AwalGarg uuuuh
neat
I never learnt about those things XD
 
contentWindow is basically the window property of the iframe.
with a few weirdo getters etc :/
 
that's a phrase to remember
> people have the right to write bad code, you have the right not to use it - Mosho
 
1:32 PM
> I have the right to write bad code, you have the right to not use it - Awal
@dystroy the guy who answered that is the author of passport js :D
 
@AwalGarg Yeah, I noticed
 
@dystroy oauth is not hard to setup
 
@FlorianMargaine for many providers ? They all follow their own rules and poorly document them
(especially SE)
 
They are like... browsers.
 
Uh? Oauth is standardized
Although I'll admit I haven't done it for many providers
 
1:38 PM
Endpoints etc. aren't.
 
lol, how do I fix this?
http://jsfiddle.net/TH48e/90/

I have a *</script>* enclosed in a string, but that actually closes the inline script from jsfiddle. Using *\<* doesn't do anything, and *&lt* actually writes *&lt*, not *<*, so that doesn't work. How do I correctly implement that?
 
oh...
thanks
also, I'd also have to be sure that nothing inside of the script I created has </script>?
this already breaks it... so... yeah, I guess
oh, I didn't close the quote -_-
breaks anyway
 
@towc The HTML parser runs before the JS parser. If you have </script> anywhere in your inline script, the script element will be terminated.
 
@MadaraUchiha this still breakes, even if it's escaped 0.o what should I do? jsfiddle.net/TH48e/94
I sound like a vamp, right? -_-
 
1:51 PM
@towc just wrap in cdata section.
@MadaraUchiha ^
 
That works too ^
 
what would be the best way to display an animation on a canvas?
I basically want some form of transition between stages of my game, and so i've done this:

function update() {
     if(animating) {
         animate()
     } else {
          //run game code
     }
}

what should go in the `animate()` function? I was thinking of having an array of "frames", and simply drawing the item at [0], incrementing animationPosition, and then drawing the frame at [1] next frame, and so on.

Is this the best way to do it, or is there a much more simple way?
 
@AwalGarg this strange thing or do you mean something else? <![CDATA[]]>
 
I'm using reqAnimFrame with the update function
 
!!tell towc mdn cdata
 
1:53 PM
 
@AwalGarg so now I have to escape all ] and >, great -_-
wait, actually only ] I think
 
@towc then write your string as it is, escape it with dom, then pass to doc.write.
also, use template strings ffs
we are living in mid 2015 ._.
 
@AwalGarg es6?
 
yes.
!!> `I work
just fine
ok?`
 
@AwalGarg "SyntaxError: unterminated string literal"
 
1:59 PM
well...
 
I have no backtick on my keyboard :P
@AwalGarg lol
 
@AwalGarg Not with cap you don't :P
@towc wat
 
@MadaraUchiha italian layout and things -_-
 
if I have a string, that isnt user input, can I eval it safely?
 
@towc map caps lock to backtick
@Deep you can eval user input safely as well
 
2:00 PM
@Deep not always
 
@AwalGarg that's genius :D
 
the string is " ctx.globalAlpha=0.2; ctx.fillRect(0,0, width,height); ctx.globalAlpha=1;"
 
twss
 
@Deep sure
 
so eval-ing here is ok?
 
2:01 PM
why do you need to eval it?
 
@Deep perhaps you want to store a function?
 
can't you just use it?
 
basically, I'm having mulitple versions of that string in an array, and drawing a different one each frame
 
O_O
just use SVG
 
yeah, not elegant
It has to be on a canvas
 
2:02 PM
@Deep just store multiple functions or use parameters
 
OH
DUHHH
[function () {}, function() {}] and so on?
 
also that
or use parameters if you can
 
You are going to waste a ton of memory this way
 
would probably be much much better
 
jsperf.com/find-vs-filter-smx why is _.find faster than filter ?
 
2:03 PM
what dyou mean by "use parameters"?
 
@argentum47 because it only finds one element?
 
@JanDvorak evaling it multiple times should waste even more
@Deep what is it that changes in your strings?
 
@argentum47 I think number of arguments matters here. Not sure though.
 
in this case, the globalAlpha, but there will be multiple types of animations, in which I'll probably just draw images
 
ow..
 
2:05 PM
such. waste. of. memory.
 
I haven't done this before, I dunno what I'm doing to be honest
 
ctx.globalAlpha = globalAlphaParameter;
if( images ) ctx.drawImage( imageParameters );
else ctx.doOtherThings( other parameters );
 
and instead of executing different functions, I pass in different parameters to the functions?
 
@Deep exactly
 
meh, a scope and function object is created everytime you invoke a function, whether same function or different.
performance wise, the point is pretty much useless.
 
2:08 PM
if I don't want a linear change in opacity, should I use an array of values to pass in?
 
@Deep perhaps use a function float->float?
 
alright, i'll look into it
what should I google?
 
keyword: easing
 
thanks :D
function animate(x) {
    frame = 0
    animations = [
        {
            frames: [0,0.05,0.1,0.15,0.2,0.3,0.5,0.7,0.8,0.85,0.9,0.95,1]
            draw: function () {
                ctx.fillStyle = "#000"
                ctx.globalAlpha = animations[x].frames[frame];
                ctx.beginPath();
                ctx.fillRect(0,0,40*units,40*units);
                ctx.closePath();
                ctx.globalAlpha = 1
            }
        }
    ]
    frame++
}
is that what you were saying?
I've used a method instead of a function, but besides that,
 
yup
 
2:17 PM
awesome, thanks :D
 
well, I don't really understand your implementation...
frame and animations should be set outside of the function
function animate() {

    ++frame;
    animations.draw();
}
 
jsbin.com/loqawobici/1/edit can haz confirmation of working? @everyone (should copy the text to your clipboard, try pasting elsewhere)
 
what difference would it make?
 
@Deep memory waste. Also, at the end of the function frame would always be 1
 
oh yeah, oops
cause I keep redefining them
 
2:23 PM
@AwalGarg it only works for chrome 43+ I think
@Deep yup
 
@towc did you test in chrome 42?
 
no
 
so.. reason?
(I mean why do you think it won't work in chrome < 43?)
 
webmidi sounds awesome
 
2:27 PM
@towc that guy needs to stop overacting :/
execCommand is DOM2.0 function
 
I agree, it's kinda annoying, probably wants to be clear to who doesn't know much english
 
> Make an awesome file for your project
> Change font to times new roman cause its specified .... cry deeply
@AwalGarg ^ just happend :-/
 
eeww
 
lol
but hey, atleast it's not comic sans ms :P @Abhishrek
 
@rlemon POST or GET? If the former, what's the payload?
@Ahmad Looks like you don't have phantom 2 running; can you verify?
@SomeKittens Oh, uhm, this is awkward. Sorry for everything.
 
THE
anyone ever worked on windows 8 app ?
I want this in my app
but it looks like this
I changed no code at all and only exception I get is this,

'WWAHost.exe' (Script): Loaded 'Script Code (MSAppHost/2.0)'.
Exception was thrown at line 1774, column 11 in ms-appx://bb15376f-5ebb-445d-bd1e-39ae51fedf91/scripts/angular.js
0x800a139e - JavaScript runtime error: [$injector:nomod] Module 'ngLocale' is not available! You either misspelled the module name or forgot to load it. If registering a module ensure that you specify the dependencies as the second argument.
errors.angularjs.org/1.3.15$injector/nomod?p0=ngLocale
which i think is not realed ?
 
3:10 PM
@THE hey brother
you aren't loading the stuff properly
 
THE
this is how I added links to scripts
 
take a top good sir
use browserify :-)
it will help you a lot.
 
THE
3:28 PM
hmm thanks
too tired for today
so may be tomorrow
laterz
 
3:41 PM
ping
 
3:55 PM
will calling setTimeout multiple times result in it being run multiple times?

setTimeout(function() {x++},1000)

if I call the above 5 times before 1000ms passes, and if x was 0 before, would it end at 1 or at 5?
 
Try it
 
@DenysSéguret :(
 
alright
 
@AwalGarg :)
 
@DenysSéguret :(
 
4:08 PM
@DenysSéguret hey
 
it might change again
 
@DenysSéguret weird username that you have there
 
change it to canop
 
!!zalgo canop
 
4:09 PM
@AwalGarg c̷̵̗̞͍̹̐ͯ̾̆ͧ̾ͣ͢͝͠a̶̡̬̜̫̅͊̒̿̓ṇ̶̸̢̦̼̞͍̆ͣͩ͒͑̀͡ǫ̛̞͕̩̆̌̀̎͜͝͡p̶͆̾ͥ̈́ͬ͏͏̱
 
@DenysSéguret ^ tis be da display name of yours.
 
next step: change my profile picture to one where I wear a tie and look serious
 
4:44 PM
hey guys !
usually if i want to get the hidden styles on an element i do the following
var elem1 = document.getElementById("sp");
var style = window.getComputedStyle(elem1, null);

console.log(style.verticalAlign);
see how its a 2 step process and also i have to add a id to the element
can this be reduced to a one step process ?
EVEN better , can i do this without adding a id to the element .
 
5:04 PM
I don't know react but I have the feeling this isn't really too broad:
0
Q: What's the most performant but full-featured styling method in React.js

rofrischmannI have been reading a lot blog posts, best practices and slides (e.g. CSS in JS by Christopher Chedeau aka 'vjeux' which I think is great). I totally understand why it is "better" to set your styling directly within your React Component, but I then found out that this might be limited as well. Y...

 
function getStyle(elem, style) {
    if (typeof elem === 'string') elem = document.querySelector(elem);
    return window.getComputedStyle(elem)[style];
}
getStyle('#sp', 'verticalAlign');
@AlexanderSolonik ^
 
5:26 PM
@AwalGarg cat?
 
5:36 PM
posted on May 22, 2015 by mattgaunt

Firstly, I apologise for that awful title, but I couldn’t not. In Chrome 44 Notfication.data and ServiceWorkerRegistration.getNotifications() are added and open up / simplify some common use cases when dealing with notifications with push messages. Notification Data Notification.data allows you to associate a JavaScript object with a Notification. What this basically boils down to,

 
@rlemon @towc codegolf.stackexchange.com/questions/50299/… can you guys do this in canvas?
@other-canvasExperts ^
@argentum47 there
 
crl
5:54 PM
well their example is broken though
 
@AwalGarg it's not impossible. Anyway, being able to render something is much different than recognizing something else
usually much more difficult
my first thought was to downgrade the hue, saturation and brightness to the closest approximation of N samples of the most common colors of the image. Then just putting points in the average clusters and you have your voronoi centers
I still don't know about an efficient way to create voronois without par-pixel calculations, but it'd still be a miracle if the first algorithm I mentioned worked
 
crl
@crl should be output.jsbin.com/xuyis/1.json in the url
 
00:00 - 18:0018:00 - 00:00

« first day (1681 days earlier)      last day (3250 days later) »