« first day (1537 days earlier)      last day (3636 days later) » 

user1596138
17:05
(typeof val === "string" && JSON.parse(val.toLowerCase())
user1596138
Well then....
user1596138
!!> JSON.parse("a string")
@Jhawins The truth hurts, I suppose
user1596138
Wait... Nevermind that's not enough info to explain this.
user1596138
Maybe I'm returning invalid json..
user1596138
17:21
Issue was that my changes weren't actually being saved... Because who knows.. Restarted and fixed it lol
Has anyone ever noticed when you add a class that already exist to an element, it creates a Postback to a page when it adds that duplicate class?
user1596138
wut
user1596138
@Greg I on't believe you
I have <embed> embed a mp4 file, and it autoplays the video. Anyone know a way to fix this with javascript?
user1596138
@wyattbergeron1 probably autoplay = false
17:29
in javascript or html?
@wyattbergeron1 Video tag?
Im using the embed tag
let me try video
@wyattbergeron1 Use the video tag
user1596138
@wyattbergeron1 that's not a valid question
user1596138
17:30
You can change HTML attributes using JS if you'd like, either way
@Jhawins Well, that is why I'm asking.
It won't play at all with the <video> tag
Now I can't pause it
user1596138
@Greg I'm intrigued, can you setup an example? A Postback to me would mean a post to the same page you are on, I can't think of any reason that could even be possible from changing an html attribute
there's no video controls now
17:33
and now I get to set up pagination for the nth time.
@Jhawins Well, it is hard because it is a legacy web-form application.  But, we have a field:

<asp:textbox ... class="ValidateSecond" />

Then when the JavaScript hits a button, it basically does:

$('#<%= PO.ClientID %>').addClass('ValidateSecond');

Then once you hit another button, the page does a Postback.  As soon as I comment out that JavaScript that does the second validation the Postback disappears when I hit the button again.
user1596138
14 mins ago, by Greg
Has anyone ever noticed when you add a class that already exist to an element, it creates a Postback to a page when it adds that duplicate class?
user1596138
So what you're saying is you lied :P
I don't believe I'm lying. It is adding the same class to the same element, which causes the problem.
@Jhawins I've never seen that though, I didn't think it would be impacted that way.
17:50
In preparation for my new years resolution (learn Angular.js in January) can anyone suggest books, tutorials or other reference materials to help me get familiar with the framework?
@JRulle The Angular tutorial (through their website) is a great introduction, if a tiny bit dense.
3
Thanks @SomeKittens - I'll check it out.
user3949359
Is "dependency" in JS synonymous to a file import?
@nosille No. It could take many forms, including code in the same file.
18:07
@nosille Depends on how you define dependency, doesn't it?
user3949359
@Neil I don't know how to define it.
@nosille I don't think "dependency" has an official definition
user3949359
@Neil how do you define it then?
But I would assume if a developer told me there was a dependency for this library that there was a secondary library to include before it would work
So yes, in general, I would define dependency as an additional script include
user3949359
@Neil why does one put the dependency as an arg in a function in require.js?
18:10
So that you can include that library in your scripts I suppose
user3949359
but why in the arguments? It bothers me.
user3949359
It's like I'm passing the whole library
@nosille That's what require.js does
If you don't want to use a function to include a library, you could simply do it the old fashioned way and add a script tag to your html page
The advantage to using require.js is being able to dynamically include libraries depending on the situation
I'm familiar with requireJS but don't understand the questio, yet. Are you asking why you list the names of your dependencies or do you have scenario where the CODE for a dependcney is inlcuded?
user3949359
@Neil I've included the library as a module in the "data-main" file in the HTML already, so the file should be required.
18:13
@nosille So, it is not being included as you would expect?
user3949359
@Luggage I just can't get my head around passing the whole library as an arg in a function.
@nosille You're clearly not passing the entire library
user3949359
@Neil it is, I'm just wondering why include it twice?
You're passing the name of the library, and require.js does the rest
@nosille Who told you to include it twice?
user3949359
@Neil but it is required already from the data-main
18:15
When you say it's in data-main, you mean that somewhere in data-main you have:
define("someDependency", [], function() { ... }); ?
user3949359
@Neil Why do I put it in "data-main" and then pass it as an arg?
m59
m59
Would JS be better if objects weren't passed by reference?
objects ARE passed by refernce
@nosille No, you're asking require.js to load the library for you, and pass it as an object so that you can do something with it
user3949359
:20723203 "data-main" is passed the file that has all the modules (including the libraries)
user3949359
18:16
@Neil ok, got it now
m59
m59
@Luggage Right. I think you misunderstood my question.
It is being only loaded once I assure you
user3949359
Thank you
m59
m59
pass by reference, aka, SIDE EFFECT ALL THE THINGS!
I did. I misread it is a"if objects WERE passed..."
18:17
@m59 It's an old debate
@m59 because copying is expensive
m59
m59
So, dev sanity vs performance?
since JS has almost turned into a 'functional' language, then yes, immutable objects is somethign i have sometimes desired
i've ended up cloning things for that reason.
Make objects immutable and pass by reference, pass by value and let you do whatever the hell you want (at the expense of optimization), or pass by reference and fuck what you want
copying is also problematic, particularly deep copying
18:18
Or the JS engine/compiler can copy-on-write sso that you get the best of both.
and yes.. deep copying is a problem
I don't even think copying is so problematic for sparse cases
in my case they are objects full of basic values, so i'm good
The real problem is deep copying for everything
double your ram usage in an instant
The only way deep copying presents a serious optimization problem is if you do it in a loop or you have 3 MB of data stored in an object
m59
m59
18:19
Well, I have an object being passed around that has some functions. I need to overwrite those functions and pass it to some modules, but then I need the other functions other places
so. phail.
user3949359
Does anyone know why I'm getting this error when trying to update the composer?
user3949359
Failed to clone http://example.git, git was n
ot found, check that it is installed and in your PATH env.
'git' is not recognized as an internal or external command,
operable program or batch file.
I clearly have git installed
.extend or _.extend or $.extend
I played around with the idea of passing function to eval in workers
Can anyone tell me .how to add simple to button to iframe?
18:20
but you'd have to copy the function code and using eval sucks in general
hi
nosille that program is trying to use git commandline and dons'nt know where it is
do you have git installed?
user3949359
@Luggage absolutely
and it's in your normal path?
@Avis No.
user3949359
18:22
@Luggage yes. Something worth noting is that I'm using the PHPStorm terminal
Sometimes when I'm alone I use comic sans.
so, i'm unfamilar with composer or phpstorm, but if you open a new command propmt (or terminal) and type 'git
and it works, then you should be good. was it just installed recently?
user3949359
@Luggage no
@nosille Welcome, this is the JavaScript room
You're looking for the PHP room
m59
m59
heh, goodness.
Everything is always so wrong.
18:23
ok @SomeKittens. im trying.. but wanna go home..asap. just a bit work left..
user3949359
@SecondRikudo I'm asking about composer.json, which qualifies for this room.
@nosille No, it does not actually.
user3949359
@SecondRikudo PHPStorm was just a side note
Composer is a PHP tool
the error is pretty clear that it's using your PATH environment variable. It must be getting a differnt path than you. If you are in windows, is it opned as a differnt user (admin)?
18:24
And your problem has nothing to do with composer.json
Hey.. we only talk about Javascript here, buddy. We're serious. Dead. Serious.
user3949359
@SecondRikudo It's not updating.
and git
@nosille Your problem does not originate from how JSON works, but rather how a PHP package manager works.
@nosille Which, again, has absolutely nothing to do with JavaScript, whatsoever.
JSON != JavaScript
18:25
Happy
New
Year
JSON is a string in some format the resembles JavaScript
user3949359
Ok, we cut the discussion then.
JavaScript Object Notation. No realtion to Javascript at ALL. :)
None
it's more related to javascript than javascript is to java.
18:26
@Luggage A JSON question does not imply JavaScript question
If you were dealing with malformed JSON, that'd be another matter.
And I'd be happy if you didn't contradict me with (false) technicalities in front of someone who is obviously learning/confused.
agree, but this channel often goes off topic into areas like git and json and css, etc. Anywho.. your git path problem should be easily searchable.
but I an not familiar with those PHP tools, specifically.
Do anybody knows a javascript MVC library which will result in less code ? (angular is too complicated , with reactjs i feel i am writing too much code , ... )
@amin No.
You're trying to solve the wrong problem.
18:27
@SecondRikudo !
Writing more code !== bad
@amin Checkout KnockoutJS, ot's an MVVM librarary.
Your time is not wasted on typing more characters
Your time is mostly wasted on finding bugs and fixing them
You should look for a solution to help you with that :)
but it does a lot less than angular, it's erally just for taking data and represrnting it as html. No routing, etc, that angular (i think) does.
@SecondRikudo less code === less bug ( right ?)
18:28
@amin Not necessarily.
Less bad code === less bugs
@amin Right, which is why I never write any code at all! If I never write code, I'll never have bugs!
soimtimes ugly code is to deal with edge cases. In that case, more code = less bugs.
@SomeKittens Oh, I just don't write bugs.
It's much more efficient.
@Luggage i am a knockoutjs user, maybe if i have leaned another library first , i did not have hard time learning these huge libraries :(
@amin i'm pretty sure the declaration of independence has quite a few javascript errors
18:30
@Luggage That is simply not true.
@Neil i am not a english guy . i don't understand you !
@Neil Just plugged it into JSHint - only scanned 3%
ok, maybe not ugly. But sometimes some added complexity has a purpose. It's one of the risks or rewriting software. You may loose years of bug fixes.
My application deals with 3 different (crappy) APIs, and juggles information between them constantly, with plenty of obscure edge cases and lots and lots of code to deal with them.
@SomeKittens Hah
18:31
Hi, I have a strange question. I noticed that the radio button I have the cursor is hand when the radio button is checked but if I move my cursor to a radio button that is not checked, the cursor is an arrow. Why is that? How can I fix that behavior? is it just css for unchecked?
The Declaration of Independence is the usual name of a statement adopted by the Continental Congress on July 4, 1776, which announced that the thirteen American colonies, then at war with Great Britain, regarded themselves as thirteen newly independent sovereign states, and no longer a part of the British Empire. Instead they formed a new nation—the United States of America. John Adams was a leader in pushing for independence, which was unanimously approved on July 2. A committee of five had already drafted the formal declaration, to be ready when Congress voted on independence. The term "Declaration...
I get like 3-4 exceptions per year
It has nothing to do with how much code you write, it has everything to do with the quality of code you write.
It's that simple.
@KalaJ Probably
I don't think it is reasonable to tell programmers to "just program better"
@Neil i bookmarked your link , i will read it ... tnx
The proper approach imho is to anticipate problems
18:32
Couldn't agree more, Neil.
There's the :checked pseudo selector that selects only checked checkboxes and radio buttons
@Neil I think it's reasonable to tell programmers to strive and program better than they have yesterday.
ok so I have something like this: input[type=radio]:checked
what would be unchecked?
fail fast and log it
is it just unchecked to set the cursor ?
@SecondRikudo Absolutely, though that works about the same as your boss telling you to just "try" harder
18:33
Depressed? well.. be happier.
You can't ride a bike for the first time because you tried really hard.. you ride a bike because you learned from your mistakes. Trial and error and such
@Neil like
There was I time where I looked at code I wrote last week and asked myself how the hell I wrote that piece of crap.
Every week.
@Neil Well, that's why I hang in chatrooms like these and on Stack Overflow
To not only preach about getting better, but helping others (and myself) to apply it in practice.
@SecondRikudo Definitely, but in the meantime, you shouldn't expect to write code without bugs
or ever.
18:34
I think that is folly in of itself
@SecondRikudo i am looking at my code right now and i am saying the same sentence . what did you do ?!
@Neil If you're referring to my "I simply decided to not write bugs" joke, it was a joke.
Even my perfect code has bugs :P
@SecondRikudo Ah, then I retract my comment
"It has nothing to do with how much code you write, it has everything to do with the quality of code you write.
It's that simple." - Second Rikudo
It's not that I'm a better programmer, I follow battle-tested workflows and methodologies because I know I will write bugs
So if writing bugs is inevitable, the next best thing you can do is detect them as soon as possible and squash them while they're small.
18:36
the truth comes out. you don't write perfect code every time :)
@Luggage Everything I do is perfect in every possible way.
Just ask my mother.
I did.
Well, she died like 100 years ago (Have I mentioned I'm 124?)
Alright, before the Naruto jokes get too far, I'll just stop it here XD
Must be one impressive resume. 123 years of perfect code.
@SecondRikudo + for being a Naruto fan :)
18:38
@Luggage I wasn't always coding.
So, I tried to merge and ended up with a big, fat, messy conflict. One of the problems is that the two branches had different systems, so I need to write ~5 lines of glue. Should that be in the merge commit?
@SomeKittens There's nothing wrong with more information and documentation
Sure
I gave you a year for perfectly poopin in diapers
@Luggage Before coding I was slaughtering and conquering anything I wanted.
@SecondRikudo It's not more info, it's new code.
18:40
(You forced me into this! Now you'll sit through and listen to my long rant about my arch-nemesis Hashirama!)
@SomeKittens Oh, you mean if it should go on a separate commit
I think that 5 lines of code to make a merge work is OK to include and call 'conflict resolution'. It's purely opinion, though.
@SecondRikudo right
Well, if the whole purpose of these lines is to resolve the conflict, and nothing more, then yeah, in the merge commit is fine.
Wow, keeping my laptop with me under the blanket is the best heater I've ever had
Otherwise, bring the banch up-to-date with master (or whatever), make the fix, THEN merge.
It also depends on who you work with, what patterns you follow, if a known broken commit to yout target branch is allowed or not..
our rule here is that trunk (master) commits should always intend to compile and work. branches are your playgournd for commit half-finished junk. We make the branch mergable withotu conflicts before mergin back into trunk.
@Luggage You mean, git checkout branch && git merge master && vim conflict && git commit -Sam "Resolve conflict" && git checkout master && git merge branch?
18:44
basically, yes.
missed a commit, there.
wow !
ohh, there you go
Gotta love git commit -Sam
Sam is awesome. We love Sam.
Sam is basically the only reason why I don't use my IDE's git plugin and just go CLI commando.
@SomeKittens yes, put in the merge. A commit is supposed to be buildable. Both branches histories are kept anyway, the merge commit is for the case you described
@SecondRikudo my IDE can do -Sam
18:46
Is that like doing a git add --all first?
@FlorianMargaine Which IDE is that?
Although the a is done beforehand while checking manually...
Emacs
@Luggage -S = pgp sign, a = git add --all and m = message
@FlorianMargaine What do you mean?
18:47
The m is done in its own window too...
Yeah, I was mostly referring to -S
Intellij (and the entire family) don't support it.
Which makes me sad.
@SecondRikudo there is an emacs package called magit that lets you manage a git repo in emacs... Pretty much everything an IDE does, and it supports pgp signing
@FlorianMargaine I prefer the CLI anyway
I think it gives you that much more control over everything
Well my CLI is in emacs too...
But that nice, I'll have to have a look at emacs one day
@FlorianMargaine Real programmers use butterfly.
18:51
@Luggage Still too unstable
I've been using it for real work for 6 months, now.
but yes.. a few things do crash here and there. like renaming files
and it can't handle very large files
but.. it's like sublime in all the right ways.
I use sublime for casual editing, and Intellij for heavy lifting
I find the automatic refactoring tools that Intellij has to be invaluable
And the fact that it supports Java, NodeJS, JavaScript, HTML, CSS, Less, and PHP only makes it 7x the fun
refactoring in JS? interesting.
how about coffeescript.. (waits for onslaught)
@Luggage I hate the syntax
I liked TypeScript, but I realized that my bugs are never in the types anyway
19:00
Right on schedule.
@Luggage But yeah, they have tools like "extract into a variable" or "extract into a method"
That actually goes and looks for the same code throughout the scope and replaces with the correct new form
And also the reverse of those (inline variable, for example)
the value in typescript is that it can have the data for Intellisense™
@Luggage True, but Intellij at least is smart enough to figure most of it out by parsing the code, and the things it doesn't understand I can add with comments
ain't none of that in coffee. humans can't even figure out what you are doing.
19:04
well, i gotta run.
user4202350
run faster....
user4202350
with luggage
@ShaU why
user4202350
19:20
i wil tesl u tomo right now im sleeping
@AwalGarg @SomeGuy Happy New Year
erm wtf what a typo.
@Shau was there a reason for you inviting me here :P
@ShaU Okay, stop inviting people randomly or I will kick you.
OK... bad grammar, random invites... kick imminent
And it is a repeat offense
19:35
@JanDvorak It is?
(Sorry I was down, Zirak is a retard)
Does that mean I'm not welcome here? :/
@SecondRikudo Yep. Kicked thrice so far.
@Gemtastic No. Go away.
19:36
I'm kidding, you're welcome here :)
@KendallFrey (@rlemon) Network was down, forgot to install greasemonkey so bot didn't respawn
Kicked ShaU.
Lol, you just beat me to it
@SecondRikud Started watching Steins;Gate. Only at ~episode 5, good shit.
19:37
Fair enough. I would have waited for one more message from him.
I am a ninja.
@Zirak It's at the top of my watchlist
@BenjaminGruenbaum Bot does what browser does.
btw, I'm fairly certain it can be run on top of slimer, and I was just too stupid to check
@Zirak right, and the browser can do traceur, just like we have CoffeeScript
So run everything through traceur?
Not everything, just the evaluated script
19:52
That's it - I give up on this.
Sick and tired of squashing square pegs in round holes.
@SomeKittens Hmm? Still the git thing?
Why don't we stick every piece of functionality it it's own directive with isolate scope?
It's not like we'd ever need to put two directives on the same element - we'll just use replace: true! What's "Deprecated" even mean, anyway?
What performance hit? We're agile!
@SecondRikudo Sorta. I'm trying to improve a system built by someone who overestimated their Angular architectural knowledge (read: "I don't need to check this, I know what I'm doing!").
Sounds like me :D
@SecondRikudo emacs can redactor js code smartly too
@FlorianMargaine aggressive indent looks nice, haven't tried it yet
20:06
@here I'll be online tonight. Well, it's already 9pm, but I'll be there from 10-11pm to... later
@Zirak I use it... It's nice on well formatted codebases, but fucks you up when you work on codebases that are not so good and you have to do PRs
Like everything else on the planet "It works well on codebases written with best practices"
Protip: Nothing is ever written with best practices.
Except the code you just wrote
It's always the best
Human brain: it works well on codebases written with best practice.
Plenty of things work well with ugly codebases :P
pay-per-LoC works well with ugly codebases :-)
20:10
@JanDvorak Does that exist?
There's no other explanation for certain levels of WTF.
@SecondRikudo for the record btw M-x butterfly is implemented in emacs
20:27
But more importantly, github.com/vermiculus/sx.el
20:39
guys, this might be a dumb question, but is it possible to add command line arguments when running a node application? Eg, node app.js --config=myconfig
Are you asking if you can use command line arguments when calling node from the command line ?
thank you good sir
np :)
(star would be appreciated)
@RoyTinker No, it would not.
sigh
in Java, 1 hour ago, by Unihedro
Attention Hat Hunters We are aware that the hat exists, and you need to post a message that gets starred. However, do not beg for stars, you can head for the sandbox where you won't upset anyone.
20:43
I thought the rules of rooms were not to star things which were answers to questions? At least in the python room
ah thanks
apologies
Hey, for anyone working with Node + Jade, how do I get multiple data objects within ONE render?
@Phil define multiple data objects?
for example
I want to make a profile and I want to get friends information AND personal information
20:58
one data object that has popreties for each other object
that is two different data streams I guess I could call it
@Phil Have the two objects property on the same larger data object
{ friends: friendObject, personal: personalInfoObject }

« first day (1537 days earlier)      last day (3636 days later) »