« first day (1428 days earlier)      last day (3534 days later) » 

Hello fellows, my very first time hereā€¦
 
@JeromeJ 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.
 
I've got a prob, but I'm a bit confused whether which one is the X problem and which one is the Y problem, so I'll just say both quickly.
I'm trying to launch a MEGA download automatically
Easy enough, just need to "downloadButton".click()
But I wish to do so automatically,
I tried with an user script (greasemonkey) but the problem is that, the said-button doesn't show up immediately, so I've been using setInterval to check if it is already there or not
but greasemonkey seems to kill the setInterval (triggered only once)
I also tried to proxy through PHP (it worked very fine to do the same with adf.ly and mediafire) but it raises another problem with MEGA: I'm guessing it is because MEGA relies on LocalStorage and, using MEGA through my local proxy, the domain name is not the same
so it does download but get stuck at 99% and never show up the save dialog
(no error in the console log though)
Thanks in advance
 
6:22 PM
@JeromeJ no problem
!!tell JeromeJ google auto start MEGA download javascript
 
@SomeGuy thx!
 
@FlorianMargaine Yes, I smiled
 
hehe, only things I googled were about the Y problem I guess, like "setInterval greasemonkey"
I'll have a look. Thanks a lot
 
@JeromeJ If you want to go down that path, look into MutationObserver, you can check when something is added to the DOM
 
6:41 PM
@Zirak Do I need to observe the direct parent of the div button I want to know when it is created?
 
@JeromeJ Google is your friend
 
I'm trying to make it work, as far as I understand it from the documentation. If I would need the parent to exist, that won't do
 
In related news, @FlorianMargaine, @BartekBanachewicz (and others), compare and contrast: i.imgur.com/0S0FGMr.png vs i.imgur.com/FYMKVrP.png
 
@Zirak oooh I like 0S0FGMr
 
I'm already on that page thank you :)
 
6:44 PM
less vertical space taken, but very well done
 
(Still got my question, aha)
 
Look carefully at the options
@FlorianMargaine Neat, doing that, then
 
@Zirak you should be a designer
 
Totally. See how I nailed that save button?
 
well, except that button.
why didn't you change it btw?
take the same html as the other button
there, done
 
6:46 PM
Because I don't know what to change it to ;-;
There are no other buttons!
 
take the start button in the profile tab or something
or a button in the dev tools settings
 
@FlorianMargaine That's a better idea
 
Must be too technical for me, I read it again and again. I don't give up though (making more research) but still have my question. Thanks a lot.
 
@JeromeJ subtree option will answer your question
 
@Zirak do you think you should contact paul irish w.r.t. the "design stealing"?
did you increase the font btw?
I don't remember the url
 
6:52 PM
@FlorianMargaine When I get a decent domain, I don't dare going anywhere with this now
 
maybe before it gets too far would be better, no?
 
It should be okay, I left all the attributions in place.
 
codewise, yes. Design is another matter imho
 
Hi guys, Iam currently working on javascript plugin to asp.net mvc web site. I would like to know if it is possible to download binary of image using c# and use it in the JS script. Thanks alot for response.
 
@FlorianMargaine But what if he says "no"? :(
 
6:55 PM
Hey gang
 
@Incognito Hullo!
 
@Marek Better pass a URL to the javascript
 
I'm working on a presentation and wondering if I can get some examples of pain points when integrating JS code with other code bases like a PHP site
 
@Incognito People are stupid? Nobody knows how to write javascript? People don't understand how the web works?
 
Ah, yes, indeed, I need to observe something already existing, otherwise document.querySelector will return null anyway, I thought It would return its "selector" and be used later
 
6:58 PM
All of those things!
 
@Zirak I don't think he will, but if he does, you could just redesign it?
 
@Zirak I'm trying to give actionable advice in this set of slides
 
@Incognito The pain points are found if you need to know that the server is running PHP to work with it.
 
@SomeGuy Just redesign it?
Have you met me?
This is my design ability
 
@SecondRikudo Funny, my first point is that attitude is important. If you think you're building shit: you're going to build a mountain of it.
 
7:00 PM
@Incognito A good server is completely stateless. It doesn't know who you are before you make the request, and it doesn't care who you are and how the request was made.
A good client doesn't care about the server architecture. It makes a request and gets a response.
 
@SecondRikudo "good".
 
If you start mixing the responsibilities of the two, you get shit.
 
@SecondRikudo Nope
 
@SecondRikudo Maaaybe
 
@copy Elaborate.
 
7:02 PM
And API design that's stateless can be great. Having to authenticate and send sessions around all the time is not something I want to do.
 
@Incognito I don't see why not.
 
@SecondRikudo Sessions, for example
 
You save your "token" on the client, and send it with every request.
 
What you wrote sounds like someone trying to justify that PHP actually isn't so bad
 
@copy Sessions is pseudo state.
@copy PHP is good for certain things.
 
7:03 PM
You still get state on both sides
 
I have things like: managing vendor deps (ie, bootstrap, angular, etc), manage complexity of your code base, don't have your template engine write JS, etc...
 
Ok, fellows, be my plastic duck, there must be a way to see how a page is formed, right? (looking for a way to make the search by myself, if only I can manage to explain what i'm seekin, so I try to explain it to my plastic duck :)) mmh maybe "javascript DOM building progress" (Google isn't much relevant when i ask that)
 
@SecondRikudo That's not stateless.
 
"step by step DOM construction HTML" mmeh
 
@copy It isn't so bad. Every language has shit in it.
 
7:05 PM
I think the debbuger might be able to do something like that, but I almost never used it ^.^
 
@Incognito And some have less than others. For example, Python has less than PHP
 
@JeromeJ Firefox has a 3d dom viewer built into its dev tools.
 
@JeromeJ Chrome dev tools, Elements section, right click on element, "Break on..."
 
Could that help to see step by step what is created in order? eh? checking it again then, ty
 
@copy I'd rather use Symfony2 and the community around it than django
At the framework level I don't care about the language as much.
JS permits so much that not having a style guide is a huge pain point. PHP has the same thing to a lesser extent, and the PHP community even has php-fig.org which IMO makes the code produced by people who know what they're doing "better".
 
7:08 PM
somuchpain, is there a way to set break points at the very beginning of a page, derp i'm not getting anywhere: )
(i'm using firefox, btw, i don't think it should be a prob)
 
Did I mention I'm delivering this presentation at Microsoft? I feel like that's funny for some reason. I just don't know why.
 
breakpoints, afaik, has to be set on a script, right
 
you can break on DOM with chrome.
 
@Dystroy now i get why your mascot is a cat
 
(i'm gonna kill a panda)
 
7:14 PM
for miaou
 
Would that snippet works? MutationObserver(function(muts){console.log(muts);}).observe(document.querySele‌​ctor("#startholder"), {childList: true, subtree: true}) so that I know if it isn't working, or if it is because of me
ah nvm
i've finally some answers from my browser, alelujah
 
^ Agree or disagree?
 
Agree (you are a troll)
 
@Incognito disagree on mac
hell yes on pc
 
@Incognito on iPad was better than chrome
@Incognito it still hurts
 
7:18 PM
It's caused me to swear more this year than IE.
 
IE11 is decent vOv
 
Anyone here ever look at the source for the original WWW client?
 
So, a buddy helped me and managed to make a setTimeout to work with greasemonkey. I've no idea why this work and my version didn't: window.setTimeout('function wait() {if(document.getElementsByClassName("new-download-red-button").length==0){setTim‌​eout("wait()",1000);}else{document.getElementsByClassName("new-download-red-butto‌​n")[0].click();}}wait();', 1000);
 
m59
I wonder why $http requests don't work as normal in a jasmine test.
 
One "major" difference was that mine didn't use a string as callback (to be eval'ed) but the function directly
 
m59
7:24 PM
Not that I would do it, but I just want to know why.
 
@JeromeJ Your buddy writes crappy code. Tell him to stop passing strings to setTimeout (you can pass a callable/function directly!)
 
At least it works nowā€¦
that's (black) magicā€¦ :/ I don't understand why
Note that he gave not only the callback function if you notice
but function d(){}; d()
(Might it be what make it work?) Also, I'm using a context, greaseMonkey, what I wanted to do is fairly simple, but didn't work IN the greasemonkey context, ā€¦ that does though
 
Hi guys, do someone know a tuts where I can learn to make sticky header nav like twitter ? i'm searching to make a menu that stick on scroll and change my logo from full-width to half-width when. There's awwwards that have that kind of menu too.

thank for your help !
 
@JonathanLafleur They use their own CSS framework called Bootstrap.
 
7:39 PM
hai
 
@JonathanLafleur yeah, Bootstrap is nice
 
@SomeKittensUx2666 Yeah I know that, but can't find how they do it with bootstap, don't know if it's builtin or something they keep for them :P
 
Bootstrap can limit you sometimes and be a bit finicky to do things with, but if you don't have design time to throw at a site it's nice because it will at-least look presentable (even if it looks the same as a lot of other sites).
 
I was thinking using Foundation at first, that's why i'm searching for a tuts for the menu ;)
I'm good at PHP and Javascript, but when it come to design and css damn i'm bad -.- !
 
All have a good evening/night/whatever-is-appropriate-in-your-time-zone
 
7:42 PM
Bootstrap > Foundation
 
@JeromeJ you too ;)
 
@JonathanLafleur Research the box model a bit if you haven't yet.
 
@SomeKittensUx2666 ho yeah ! ? I was sure it was better to use foundation !! :O
 
@JonathanLafleur I've used both. Bootstrap's just easier.
Also, it's far more popular, so it's much easier to find support
 
7:42 PM
@SomeKittens Has your entry been approved yet?
 
Nope.
has yours?
 
@SomeKittensUx2666 thank for your sharing, i'll give it a try, the designer at my office use foundation that's why I was going too, but, i'm pretty sure that Twitter model is more efficient
 
@SomeKittensUx2666 Amazing
 
@Incognito the box model what do you mean ?
 
Good night all (UGT)
 
7:43 PM
@JeromeJ night
 
@JeromeJ gnite
 
m59
Bootstrap drives me crazy :(
 
m59
maybe just because I don't know something I'm supposed to.
 
m59
7:46 PM
mainly just padding/margins
It's always doing something stupid with those.
 
@JonathanLafleur It's just a concept that people usually have a hard time with that causes them to struggle with css.
 
@Incognito I know what CSS is and I can make CSS i'm just bad at it :P
you're probably not good at everything :P
 
@JonathanLafleur I'm not attacking you.
 
no I know :P
lol
sorry, something my humour in english is not good as in french :P
 
Just found out that the chat works well on a smartphone
 
7:56 PM
"well" might not be the best word there
 
More functionality is not necessarily better
 
@SomeKittens Nope!
 
Hello everyone. Quick question: does anyone know why jQuery's clone() method isn't copying all children of the selected elements?
This is the variable which is being cloned:
var divShell = $( "<div>" ).append(
$( "<h2>" ).append(
$( "<a>" )
)
);
 
@SomeGuy did you submit?
 
But when I clone, the <a> element appears to be missing;
var newElement = divShell.clone();
 
8:00 PM
It may be because clone doesn't work on lists of elements, but just the first
 
That's why I thought, but the <h2> does get cloned
 
Hmm, try adding the h2 tag to the page first, then add a tag
In other words, maybe the issue is that you aren't cloning an actual dom element
 
Well - the plan was to "make" the elements I need, and then clone them.
It's just weird that the h2 works but the nested anchor doesn't..
 
Well, try it for the sake of trying it
 
I'll just have to rewrite the way it works I guess.
 
8:06 PM
You could attach to clone, then remove afterwards, but still, what a pain if that is the case
 
I'm even more confused now: this shows no anchor tag either. It seems to work outside the $.each loop but not inside;
 
@Zirak if he says no, it's probably better to know it now than after you put in another dozen hours
 
var newElement = $( "<div>" ).append(
	$( "<h2>" ).append(
		$( "<a>" )
	)
);

console.log( newElement );
 
@FlorianMargaine So email him now with the weird url, or first find a decent place to host it (GAE is a bit quite annoying)
gggrrrr
 
I'll email him the weird URL then
 
8:16 PM
Fiiiine
 
But I'm just trying to tell you this is a good idea... It's your project though, so you choose
 
...after the introduction patch. FF is being a bitch about stack traces.
 
@Zirak GAE is pretty nice :P
You just have to get deployment right once. After that it's pretty simple.
 
@BenjaminGruenbaum GAE is good, but they got on my nerves
 
m59
Angular testing: more wisdom welcome! stackoverflow.com/questions/25826516/…
 
8:22 PM
@m59 One question regarding using promises and $q
 
m59
go for it
 
Should promise be used in service or controller ?
I mean whats the better practice ?
 
m59
that seems awkwardly worded, but service
the controller is only for associating logic with view, not logic itself
I mean, that would be logic also, but my meaning should be clear enough...
 
Seems perfect !
Thanks
 
m59
So yeah, the controller doesn't care how data gets to it. It just binds it to the view when it comes in, or sends it to a service when the view says so. That's the kind of thing it cares about.
 
8:25 PM
hmmm.. Makes sense.
And one more thing. I want to learn angular testing... Whats the best path ...
Any online tutorials...
 
m59
Pray to Jesus.
 
LOL !
 
m59
;D j/k. I recommend that for spiritual reasons, but uh... testing is something I struggled with for a long time. It finally just clicked to me one day.
@user2962766 actually, if you have a service/filter/directive you want to test, show it to me and I'll help you.
I think that would be the easiest way.
just know that it will probably mean writing better code first :)
 
Hehehe Ok thanks. Right now I am working on making the whole thing ..
 
m59
In order to write tests, you have to write your code well enough that it can be tested. If it's not properly encapsulated or has more than one responsibility, that gets tough.
 
8:28 PM
when I am ready, i'll show it to you
yeah.. i can understand
Right now I am in a kind of blocker..
 
@rlemon RoboCraft's that game you like, right?
 
Heres My situation ..
I have a controller A and a controller B. I want both the controllers to share the same data. For that I created a service Q.

Now the controller A calls the service Q and shows a list of data.
There is "Show Moreā€ button for each list item.

When clicked, it should load a modal window with controller B.

How do pass the id clicked from the view to the controller B ?
The controller B can modify data.
 
m59
That's too much for me to process just verbally. If you make a demo on jsbin, we can go from there
@user2962766 Here's a starting point jsbin.com/tapita/1/edit
Also, get a username and a picture so you don't look like a scrub ;D
Not having a username kinda gives the impression that you don't really want to be a part of the community. That may not be the case, but it has that psychological impact.
 
Thanks.
changed name
Oh its not updated here.
Test
 
m59
Probably if you leave and come back, but no worries. It was just a suggestion. Not something to make a big deal about.
 
8:46 PM
Tried. NOt updating. I guess some SO bug.
 
m59
It will.
 
0
Q: Would comments increase the chance of being fired?

J_StrautonI have had this burning question for a while. If I have a job and I comment my code well, to the point that anybody can now understand my hard work, would it make me less indispensable to the company? From my experience any homework assignment I hand in that is fully commented receives lower gra...

 
m59
@user2962766 If you update your answer with samples of both approaches with emphasis on promises, I'll upvote.
 
BRING ME THE TRIBUTE
 
I just learned that JSON.stringify has prettifying built in... I don't know how I never knew that.
 
8:56 PM
I don't even know what the 2nd argument of JSON.stringify is for.
 
@m59 sure !
 
JSON.stringify(obj, null, 4) anyday
 
@twiz I never knew that either. This is awesome !
 
I think the second argument is a function that is called for every item in the JSON so you can break things and confuse yourself.
 
m59
^ lol. I guess you could put it that way :)
 
8:58 PM
@FlorianMargaine It's pretty sweet, you should check it out
 
Wouldn't it be easier to just alter the object before stringifying though?
 
Useful for stringifying things like errors
 
@Zirak any use for it?
oh right, lets you stringify not-supported-by-json objects?
If a function, transforms values and properties encountered while stringifying; if an array, specifies the set of properties included in objects in the final string.
ooooh nice
@Zirak thanks.
I especially like the array argument
 
hmmm interesting
 
thinking w.r.t. strict unmarshallers
 
m59
9:02 PM
Yesterday, I went beast mode on my work. Today, just staring at the screen drooling...
is this normal?
 
@FlorianMargaine LOL
 
@Zirak It took me about 5 seconds to break it... haha
Apparently it is not fond of printing the entire document object
 
@twiz Break it in what way?
 
"the teachers gave good grades when they couldn't read the code, and nitpicked when they could read it, so I had bad grades when writing readable code. Should I write unreadable code?"
 
9:04 PM
Oh yeah, it's really not complete
 
@FlorianMargaine if I write readable code, I might get fired.
 
You can't inspect DOM nodes yet
 
@FlorianMargaine what exactly are those?
 
but its interesting, that it loads window fine
 
9:05 PM
@SomeKittensUx2666 in static languages like java, you need marshallers/unmarshallers, they take a string of json and create objects according to them (and vice versa)
some may require a list of keys in the json string they receive etc
 
Can someone help me with nvd3?
 
@ROODAY 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.
 
m59
I can kinda see his point. Like "well, he wrote such readable code that we can maintain it without him and pay someone to do that for half as much, so ditch that guy"
 
So I'm trying to use nvd3.js to create some charts for a math project
The normal tooltip looks like this: i.imgur.com/vrDK1KZ.png
 
m59
9:08 PM
So, write your whole application as obscure as possible so that you have job security LOL.
 
@m59 "yeah, let's ditch the guy who writes readable guy"
 
But for some reason, the multibar graph I have has the tooltips way off: i.imgur.com/xLmye4P.png
 
"What can possibly go wrong?"
 
m59
@Zirak some management is bad enough that it wouldn't surprise me :)
 
@Zirak I read that as "respect"
You can't respect the DOM yet, you are not worthy
 
9:10 PM
Potato, potato
 
m59
hahaha
 
@Zirak I'd fire a guy for writing readable guys when he should be writing code
 
My boss lets me write guys all day long
 
The issue here is that the teachers can't read the code without comments, so they can't give bad grades
 
m59
So, seriously, guys, do I just need to take a vacation today? I can't write anything. My brain is just dead.
Does this happen to you all?
 
9:11 PM
It does
 
m59
or just narcolepsy wrecking me?
 
@m59 it happens
 
@m59 Check this. Is it okay ? jsbin.com/bozerorakumi/1/edit
 
!!google fixing fried brain syndrome
 
m59
9:11 PM
How does your workplace think of it?
 
They don't know it
 
@m59 Yeah, we all have our downtimes
 
@CapricaSix ...that's the first time I've had my work stolen.
 
m59
heheh. I'm self managed, but I want to be good to my employer.
 
9:12 PM
I'm honored
 
m59
"I just wrote an amazing amount of code (for me) yesterday. I'm a new developer and my brain is fried. According to Code Complete 2.0, this isn't just me. How can I get my brain back in gear so I can get some good work done today? "
removed ^
dangit, that's exactly me
 
Yeah, Programmers.SE is less for Q&A and more for self-righteousness
 
m59
hahah, don't I know it.
 
> Dreams don't work unless you do
 
m59
That one guy from the other day would really have loved it :)
maybe that's where he is now @SomeKittensUx2666
 
9:14 PM
I really like this momentum extension
 
m59
and people think we're elitist.
 
NVd3 makes me sad
 
> Your submission to the js13kGames contest, SPACESHIPS!, has been accepted! Your game is now available at this link. Go ahead and start promoting it to win bonus prizes!
 
m59
woot! grats!
 
@SomeKittensUx2666 WHICH LINK
 
9:15 PM
hi guys, anyone with windows and chrome that wants to help me?
I've this very simple script:
http://jsfiddle.net/mmmz8/196/

All I want that typing "'" is prevented. So I figured I needed to prevent keycode 222, but whatever I do, it doesn't work in chrome on windows...
 
Hi, someone already used private repository in GitHub ?
 
aww, there were other server entries
 
@Aymenworks 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.
 
oh it's js13k, not js1k
I played that once
13k is too easy
well... I made a snake
 
9:16 PM
Mine's only 4.6k
 
daym
the one my friends and i made was 12.8
or something like that
So does anyone here know how to use nvd3?
anyone here?
 
@Aymenworks I don't know what you're asking, but fyi, Bitbucket has free private repos as long as you only have a few people using it.
 
9:35 PM
@Aymenworks technically, yes
 
@SomeKittensUx2666 ... technically?
 
I have.
it's the same, but no one else seems them
 
@FlorianMargaine yes
 
(actually I just got an email for the billing like 20 minutes ago)
 
^ That made me choke laughing
 
10:00 PM
In other news, I managed to have a merge conflict on my second commit
 
m59
10:22 PM
Can anyone think of a way for an html file to act as though it is a different html file in a subfolder?
I'm thinking of messing with some ajax, but I doubt it's going to work out.
 
what
@m59 sounds like XY problem
 
m59
I don't think so. I'm just solving an obscure thing.
I'm still trying to work out how I want to deal with gh-pages
 
using jekyll?
 
m59
My project generates a demo folder, which I also serve up just to manually mess with while I'm developing
so, if I publish the project to gh-pages, I end up with the actual site nested
 
yeah, only push the subfolder
 
m59
10:26 PM
I'm not even sure it's going to publish anything.
 
but you have to copy everything in the subfolder
 
m59
The problem with doing that is that I have to make another git repo in it, right?
 
m59
Either this process is going much slower than 10 minutes as it suggests, or it's not going to publish it without a root html file anyway..
So, plan B. Would I make a new project with it's own bower-dependency on this one?
and just setup the remote again?
 
just use jekyll...
 
m59
10:32 PM
looking into it
@FlorianMargaine what about Jekyll helps in this case? I already have the full site built.
 
@m59 oh. Then just push the html on github
 
can md5 hash of 2 files with different content be same ? [iirc - no right ?]
 
md5? yes
 
But only if specifically generated with that intention
 
10:48 PM
@Abhishek you're looking for the word "collision"
 
for some reason a lot of "readme" files resulted in same hash :-/
and no i was not hashing the filename
 
It will never happen by chance
 
probably something bad in my code
 
567
Q: Which hashing algorithm is best for uniqueness and speed?

EarlzWhich hashing algorithm is best for uniqueness and speed? Example (good) uses include hash dictionaries. I know there are things like SHA-256 and such, but these algorithms are designed to be secure, which usually means they are slower than algorithms that are less unique. I want a hash algorit...

@copy really?
I'm being honest there, I know md5 has collisions, but not much more
 
@FlorianMargaine Yeap
The attack on md5 takes two files and generates two blocks that can be appended to the files giving them the same md5
 
10:54 PM
@copy yeah thats what i believed
working on my uni thing :-x
have to submit monday morning \o/ ...
 
@copy oh it's that "simple"...
 
We had a uni exercise to generate two SSL certificates with the same md5 hash
That was fun
 
Sounds like fun indeed
You had the algorithm to generate the blocks to append at hand?
 
Actually there's a command line program for that (with a few limitations that the files have to have the same length and be aligned on a certain block size)
 

« first day (1428 days earlier)      last day (3534 days later) »