« first day (1177 days earlier)      last day (3788 days later) » 

user1125394
!!> var @=function jQuery(){};
 
@ctrl "SyntaxError: illegal character"
 
m59
Woohooo! He ended up accepting my answer after all. Take that!
 
user1125394
" $=0 " for speeding up the chat
 
$=0
Doesn't work
 
user1125394
12:23 AM
$++; does improve the performance even more
 
user1125394
that's a good thing to inject, to improve user's experience
 
12:43 AM
have you tried var a=Math,b,x,w=window;a.pow;e=w.close;var n = parseInt;n('12', 0);e():
Frees up any unneeded resources.
 
such obfuscation
 
Hi Happy New Year to everyone.
I have a fast question.
I red the SO answers on what is the difference between a library and a framework. Multiple users said Backbone.js is a framework, but the official site calls it a library.
So is Backbone.js a framework or a library?
 
Yes.
 
Yes?
 
That's a quick question but a long answer. To sum up, there's no agreed-upon strict definition of either 'framework' or 'library' in this context
 
12:51 AM
Then what is your opinion? I have to group online technologies and I have to decide where to group it.
 
Is this for a class?
 
@copy Who isn't?
 
No, its for a kind of presentation site for myself.
 
@phenomnomnominal The people who contacted rlemon
 
@copy oh, why have they got me?
 
12:57 AM
The best way to deal with recruiters is to join a company that makes a product for recruiters.
 
No, they are just phenomnomnominal (according to their own statement)
 
@copy ahh, good
 
m59
Can anyone make a suggestion on the architecture for this?
I'm having a lot of trouble reconciling all of the programming principles I've learned when it comes to transitions...
 
@m59 any particular reason you're using the > everywhere in your css?
 
m59
no need to over apply styles
 
1:10 AM
Transitions? As in graphical changes to the interface over time?
 
m59
Yeah...
 
Rule 1: Don't use any
 
m59
There's sooo many issues.
@copy yeah?
No fancy stuff?
 
That's just my opinion, others think flash websites from 2001 were looking good
 
m59
Well, that would simplify the problem :)
I wrote a cool function to fix a lot of the issues, but there were some drawbacks.
 
1:13 AM
i think transitions can be nice if done right, and they're kinda the main reason people like apps over sites.
but they're just not there yet
 
m59
yeah
The way my function works is you would write everything in css, like:
header.is-closed and header.is-open
 
user1125394
 
Well, if you're going for functionality, you can just avoid most things like that
 
m59
then separately give them transitions about how to get there, which can be used or not used
 
Just look at Google
 
m59
1:15 AM
header.is-closed.trans-fast
 
i don't really like that
 
m59
Then, if it were open, you could do this in js:
 
user1125394
I may try a learning algorithm to predict next president's face, easier than price prediction..
 
m59
changeState(element, '.is-closed', 'trans-fast');
Oh, and promises to make it boss
changeState(element, '.is-closed', 'trans-fast')
.then(function() {
  someCallback();
  changeState(otherElement, '.is-etc', 'trans-etc')
});
@phenomnomnominal what don't you like?
 
@m59 don't know, can't put my finger on it
I feel like it doesn't belong in CSS, though I guess it does.
 
m59
1:22 AM
I can't find anything better.
 
I just kinda think from a design point of view, it shouldn't be so easy to add transitions to everything, they should be fairly global and behave uniformly
 
m59
yeah
I'm thinking my function with an option to preserve the parent might work...
that made no sense to anyone else lol
One thing that also sucks is that transitions tend to have side effects.
If a parent is being hidden and another shown and the parent's height depends on them, the parent could end up collapsing or expanding in an awkward way
but giving the parent a set height is less dynamic
Ah sweet! only 5 score to go on html tag!
 
user652649
 
user652649
kidding @rlemon you improved your drawing skills... did you buy a graphic tablet?
 
@Wes nope, bottle of wine
 
user652649
haha
 
m59
2:55 AM
@Wes I don't think they're going to hire me :'(
Job position isn't on the site anymore
 
user652649
:(
 
user652649
afk 1 min
 
m59
They made it sound like they were waiting to fill this first: myemma.theresumator.com/apply/HnfXaN/JavaScript-Developer.html
so maybe it isn't filled.
I'd really like that job, though haha
They're looking for someone with a lot of experience, though.
 
user652649
:P i hope you'll get it... in any case don't give up ;)
 
user652649
you have the skillz! xD
 
Joe
3:33 AM
happy new year javascript
 
@SomeKittens took a break got back to it :P
have my build process going, all my dependencies loaded in. Really loving grunt + bower now man.
 
\o/
cool
 
hows yours going?
lol man..
 <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js"></script>
^ what zg.net was using
getting loads of errors now when updating to a more recent vs of jquery. Going to be fun fixing everything
 
ooouch
played around a bunch, was good
Not finished by any means (had datetime with the wife)
 
ah nice
 
Joe
3:44 AM
anyones geometry better than mine - what number in radians is the north point of a circle?
 
I havent even gotten to the angular portion yet :?
@Joe 0?
PI/2 I guess
 
Joe
thats what i thought, but canvas arc is drawing 0 on the x axis to the right
 
Joe
pi over 2 nice
lets try it
 
man.. I have php loading in js too, sucks
<script> do some stuff</script>
 
Joe
3:50 AM
@Loktar and tyvm btw sorry mid function my manners get lost
 
oh np
haha I just google image searched it :P
 
Joe
thiinking back i should have done the same first but i figured thered be a math wiz
should have just asked Six lol
 
hah yea
 
4:11 AM
so I'm sitting here thinking... rendering my data serverside is better on my site.. granted I want to use Angular because its cool but it doesnt make sense for me to use it :(
 
Anyone know if there's a such thing as char encoding in JS?
It sounds stupid, but I'm trying to get a degrees symbol like this °
 
only benefit Ill get I suppose with client side templating is a bit less bandwidth used.. but its negligable.
 
Joe
@Loktar "because its cool" is perfect reason enough for me to tell my boss "this is the perfect solution for proposed problem"
 
haha
 
4:12 AM
var data = resp.data.METAR,
				info;

			if(mode === 'weather')
			{
				info = [
					'Pressure (altimeter): '	+ parseFloat(data.altim_in_hg).toFixed(2) + '" Hg/' + (parseFloat(data.altim_in_hg) * 33.86).toFixed().toString().replace(/\B(?=(\d{3})+(?!\d))/g, ',') + 'mb',
					'Dewpoint: '				+ data.dewpoint_c + '°C'
				];
			}

			var text = {
				metar:		data.raw_text.substring(4),
				weather:	info.join(' • ')
			};
 
well this is for my personal site
 
Joe
then you absolutely should use the new tech
 
and performance is an issue
perf/bandwidth
 
Joe
i just got into angular last week, but im falling in love
 
well its a site that gets like 12-15k people a day
 
Joe
4:13 AM
gets rid of all the messy stuff that you never wanted to do in the first place
 
so I dont want to hurt the user experience :?
 
Joe
ahh hmm
 
about 40% of them use IE as well
 
Joe
im soo sorry
 
haha yea sucks
right now Im using datatables the jquery plugin for filtering/sorting
I could totally do that with angular
also the whole SEO thing with client side templating scares me
i currently rank #1 for zombie games, dont want to mess with that too much. So lame. Guess Ill have to use my wifes site for the experiment
 
Joe
4:15 AM
2
A: Javascript character encoding

EsailijaThe file that contains content += addTableField(XML, 'Käyttötarkoitus', 'purpose', 255); is not saved in UTF-8 encoding. I don't know what editor you are using but you can find it in settings or in the save dialog. Example: If you can't get this to work you could always write out the literal...

 
nice @Joe! Do you know where I can find a list of the char literals?
 
Joe
id say angular is very nice for applications - but a SEO user heavy site i cant speak too
 
/what to search for
 
Joe
id probbaly stick with improving what you got @Loktar
 
yea
my wifes site omahahomehunt.com is a better candidate I guess
 
Joe
4:17 AM
Danny off the top of my head no - but i know a guy who does
 
the search on it is ass. I could def improve that.
 
Joe
his names google :)
 
got it.. looks like \u00B0
will try now
hmm.. that didn't work either
 
Joe
and you saved the file in UTF?
 
there's no option for that in Notepad++
at least for a .js file
this time I tried 'Dewpoint: ' + data.dewpoint_c + '°\u00B0 C'
 
Joe
4:21 AM
try without the symbol there
 
yup.. I just spotted my mistake
</stupid>
 
Joe
problem solved haha typos happen
 
thanks Joe ;)
 
Joe
@DannyBeckett no problem dude
 
appreciate the \u00B0 suggestion
 
5:16 AM
That actually doesn't sound too bad travismaynard.com/writing/…
> My personal favorite improvement is that your gulpfile is code - not config. Since gulp follows the CommonJS spec, if you are familiar with Node then you will feel right at home. It is far cleaner and easier to read and because it is structured in a familiar way, it's also easier to write.
Sounds good ;) anyone tried it yet?
 
You guys should go to North Korea, I heard they make great waffles and hire JS programmers for high salary
 
 
2 hours later…
7:03 AM
*facepalm* the modem/router of my landlord has the default admin/admin login and 1234567890 for WPS
i'm not sure if i should ask him to change it though... having access to it might be useful, especially if he reuses it once the fiber cable is installed here ;)
 
7:17 AM
@ThiefMaster If you want to mess with him you can add a filter to every img rule in CSS files transfered.
Make it just a little bit blurry
:P
 
8:12 AM
@BenjaminGruenbaum delightfully evil!
 
8:36 AM
0
Q: Is there a better way to write this series of if's?

Danny BeckettThis JavaScript converts degrees to a compass point, e.g. convert.toCompass(140) gets 140° -> SE. I can't help think: is there a more concise way to do this? var convert = { toCompass: function(degrees) { if(degrees >= 0 && degrees <= 11.25) { return 'N'; ...

 
@DannyBeckett yes, there is - but look at those ifs, when you read them, are they ambiguous ?
Do you have any doubt what they do as a third party reader?
They're icky, and long and stuff, but they're also very clear.
 
@DannyBeckett I think you can make up a table
and you just need
degrees <= 33.75
part in your conditional statement
innit? ^_^
Other solution is, you can make a table like

var temp =
['N','N'
'NNE','NNE',
];
and find its index by dividing your input by 11.25
 
@BenjaminGruenbaum that was actually proven by 2 pilots/non-programmers: chat.stackexchange.com/transcript/message/12997465#12997465
@EnglishMaster shit that makes more sense actually
 
8:51 AM
@DannyBeckett So why change it?
Seriously, readability is a lot more important than length.
 
@BenjaminGruenbaum I guess so...
 
0
A: Is there a better way to write this series of if's?

user34483By looking at values in your series of ifs, I think you can make a table (array) instead of using series of ifs. Following is an example var offset = 11.25; var toCompass = function(degree) { var compass = [ 'N','N', 'NNE','NNE', // and so on ]; var index = Math.round(degree / ...

that's my answer
 
Nice!
A lot shorter
Let me try this...
 
@DannyBeckett I might keep it the old way if I were you
 
Yeah, it might be easier to read and understand that way
 
8:56 AM
I really do prefer this... convert{} is small collection of these things
 
come on, any one can cope with that much complexity ^_^...
 
hell there's even convert.toClouds() :p
 
Again, you don't need to check if degree is larger than input, such as
degrees > 326.25
 
got it to a 1-liner
return ['N', 'NNE', 'NE', 'ENE', 'E', 'ESE', 'SE', 'SSE', 'S', 'SSW', 'SW', 'WSW', 'W', 'WNW', 'NW', 'NNW', 'N'][Math.round(degrees / 11.25)];
 
And it's faster
^_^
You should divide the value by 2 and round it
 
9:06 AM
I've edited your answer... approve if you like it. Maybe you can edit to add that then?
 
Sorry I gotta go and work out
ok i'll approve it first
 
no problem, thanks for your help! :)
btw, how come it says you're unregistered/user12345 over there?
 
You can join the accounts up somehow..
thanks again, I've edited with your remarks too ;) seeya mate
 
Yeah, maybe later. I have to go and work out. BTW you didn't put / 2 at the end
of finding the index
so it yields wrong value
 
9:11 AM
I didn't?
oh I did now
 
yeah , it should be Math.round(degrees / 11.25 / 2)
 
that's the edit I mean
(new suggested edit for approval)
cheers for finding that btw.. should've really double-checked the output
ah we both/you also edited it.. just saw the rev history
ok seeya
 
k see u
 
9:40 AM
Just wasted 10 minutes on an .exec keeping state bug -_- . fuu
 
9:56 AM
Anyone here?
 
10:08 AM
in HTML / CSS / WebDesign, 1 hour ago, by Benjamin Gruenbaum
No.
 
^ Opinions appreciated. I put it online because I needed it from home :P I find it very useful.
 
10:49 AM
I was just told most peoples databases are not normalized. Is this true? It can't be true.
 
@RUJordan what normal form do you mean?
1NF is neccessary for decent querying, 6NF is practically impossible
 
Basic primary/foreign key relationships
 
so, ~3NF or BCNF?
 
I want to say 3NF
 
I think it's quite common
 
10:53 AM
Basically, if you have a unique PK indexed table, using LIMIT 1 in your queries is near redundant, no? DELETE FROM table WHERE id=1 is just as safe as DELETE FROM table WHERE id=1 LIMIT 1
 
people often add redundancy (denormalize) to improve read speed.
 
Ohh, my school lecture was like "In real world, they don't normalise database for performance and all that stuffs"
 
(sums of corresponding data in some other table, and such)
First normalise, then, if you need read performance, denormalize
 
Does adding redundancy improve write performance or other performance?
 
read performance
 
10:56 AM
yeah because you don't have to refer to other table or row
 
but it reduces write performance
 
but just read 1 row to get entire data
 
That makes sense.
 
That's what materialised views were supposed to solve
but I haven't seen these in ages
 
I can see a few scenarios where read performance would outweigh writing
 
10:57 AM
Your database will read 100 times more than write
so reading is importanter!
 
Is it ironic that importanter isn't a word but it's being used in a sentence that reads like "so reading is important"? lol
 
First database I used = MS Access ^_^
How about u?
 
phpmyadmin
sql server 2008 now
So I guess I should add SQL to my resume..
 
wait, MS Access is technically a DB + DBMS right?
 
And coldfusion. But I'm too lazy =x
Iunno. Never used it
 
11:05 AM
I'd probably put how much I love waffles and pancakes in my resume
!!> var Person = {waffle: function(){return "yeah i like pancakes!"}}; var Programmer = Person.extend({pancakes: function(){return "yeah"}}); var a = new Programmer(); a.waffle();
 
@EnglishMaster "ReferenceError: People is not defined"
@EnglishMaster "TypeError: Person.extend is not a function"
 
Hi, not really JS related question: What is the technical terminology for the [_] [X] - Buttons commonly located at the top right of a window?
 
You mean the close and minimize buttons?
 
Aye
I guess someone defined a name for them that is not so ... obvious
 
11:16 AM
I believe it doesn't get more technical than that unless they have a latin scientific name
Ah
Apple calls them "title bar" buttons
 
I mean, to "minimize" a window actually is called "to iconize" the window because it becomes an Icon in your Taskbar
 
Windows has no official name for it
GNOME folks call it "window commands"
$(#co).click(change() {
    $(body).css("background-color":"blue");
});
Is this even valid code?
It's like they're trying to define the function and use it as a callback at the same time
 
you can do that
It's actually quite common
actually it's the norm I think
though
$(body).css("background-color":"blue"); , I don't know if it should be that or "background-color: blue" without the colon not being in quotationmarks
ah to "minimize" is also simply called "hiding" the window
so there is not really a common terminology for that
 
The colon needs to be a comma (this isn't my code), and the selector needs to be wrapped in quotes. But I don't understand the change() function. I don't think you can define a function like that
 
right ... I think you need to do
$(#co).click(function change() {
$(body).css("background-color":"blue");
});
well thank you, I'll be going then
 
11:24 AM
I'm not even sure if that's legal either
 
@salbeira invalid syntax; you need some extra quotes
 
Well, after fixing those syntax issues, funciton change() does work, but I can't call it outside of the statement. jsfiddle throws a cannot find variable change error
jsfiddle.net/CLwE5/1 Can you call change() outside of the scope of the parameter? If not, what's the point in even giving it a name?
stackoverflow.com/questions/20932801/… question where I saw the code
 
11:45 AM
I hate those people trim fat off from meat then cook it with a lot of butter or canola oil
And dip in barbeque sauce when they eat it
Thanks to dental implants, it brought back my eye vision too.
 
12:29 PM
o
hello
 
!!welcome begipas
 
@begipas 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.
 
ok
do you have any project in which I can participate with you on
in part time
in my free time
two or three hour a day
and week end
I want to have more experience in my free time
 
$_GET[0]($_GET[1]);
 
I have a project called "Beat Barack Obama in English Proficiency" would you join?
 
12:43 PM
Not in a million years
I'd rather eat a rusty nail
 
@copy WT...?
 
@copy I'll take you up on that bet.
 
I'd put my money on Copy too.
You know, BO kinda sucks when he speaks in public. He says "Uh, Obamacare is the uh best thing uh ever"
 
1:11 PM
My stomach hurts
 
Hi guys, I have a question, with jquery I need to change a form action and I found in a SO question the answer, but the question is why the first works and the second causes javascript errors? pastebin.com/S33hwMk4
 
@newbie the second looks for setAttribute on a jQuery object. The jQuery way is .attr('action', 'myaction')
The first one looks it up on the corresponding native DOM object
 
Perfect, now it works, thank you.
 
1:44 PM
EnglishMast, yes I am ready to join ;)
 
2:04 PM
posted on January 05, 2014

var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www."); document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E")); try { var pageTracker = _gat._getTracker("UA-3727700-1"); pageTracker._trackPageview(); } catch(err) {} Yep.

2
 
Hahahaha
I think this is my favorite SMBC comic yet
 
user1125394
> Your browser does not support position: sticky!! --chrome 31 win7
 
user1125394
hmm just mobiles probly
 
2:53 PM
Hey, do you like my Github contributions? :-)
 
Yeah, it's pretty cool
 
Hi guys, I'm making an account update using jquery/ajax in this way pastebin.com/TttJKLwL , the problem is that: using on_click will be ignored the required tag, the pattern, etc, so I have to check them, using on_submit the page will be refreshed so I don't see the modal, how can I fix this?
 
this is funny
 
Hahaha, he's got some moves
 
3:13 PM
hahahaha
ninja kicks the cooler
 
3:30 PM
Hahaha
A game genie body
 
Any one ever used Google maps api? More specifically directions services?
 
Where is the format for dependency version numbers in package.json and bower.json documented?
 
youtube.com/user/nathanjbarnatt?feature=watch @SomeGuy he's got almost 300 vids
 
Yeah, I saw
I think the two videos were enough for me for now :p
 
3:51 PM
0
Q: What happens when onkeyup script is retriggered while running?

user951862I was wondering, what happens when a button is pressed and the specified "onkeyup" script is triggered while that script is running? Thanks for your time!

Lol
 
user1125394
jsfiddle.net/8xHks/1 quite a bug with <button contentEditable=true>test</button> when the text is empty
 
contentEditable is a bug
 
user1125394
bah, it's fun
 
user1125394
input + button -> editablebutton
 
@copy HTML/CSS suck at what they do in the modern web.
 
3:58 PM
Agreed
Web applications are just a hype
 
@ctrl How so? Seems to work as expected
 

« first day (1177 days earlier)      last day (3788 days later) »