« first day (1311 days earlier)      last day (3631 days later) » 

okey so
lazy.js
 
@Jules999 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.
@RobinvanDijk 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.
@Goosebumbs 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.
 
Hey guys anyone know about dojo UI i need a little assistance

http://stackoverflow.com/questions/23724827/dojo-filteringselect-struts-application
 
user1596138
@DrogoNevets Badges are cool tho. Especially gold ones with the new instant close privileges.
 
2:17 PM
meh
 
user1596138
Eh. I lost interest in Main a year ago.
 
user1596138
The good and broad questions have been asked. The only things now are things that can be solved with a/a combination of current questions.
 
good morning javascripters
 
user1596138
Oh how I've missed watching green on black text frantically bounce around in the terminal while my bash scripts do my first hour of work for me
 
2:19 PM
@Jhawins just wait till ES6 comes out. So many potential questions to ask and answer :3
 
user1596138
In 5 minutes lol
 
user1596138
@RUJordan I'm on board lol.
 
@RUJordan we'll grow old before that happens
also all the cool stuff happens in ES7 and up
 
Is that a joke or is there already ES7 speculation?
 
user1596138
I'll probably be doing a lot more python by then. Tired of waiting on js to catch up
 
user1596138
2:20 PM
@RUJordan pffty
 
@RUJordan there are numerous features proposed for ES7
mostly stolen from Haskell
 
user1596138
There's speculation on es8.
 
I've never seen a single line of Haskell so I wouldn't really know
 
@RUJordan f x = x + 1 now you have
 
2:21 PM
What's the f?
 
Num a => a -> a
 
Yeah that's over my head lol
 
a function that takes a value of some numerical type and returns a value of the same type
 
user1596138
Oh in light of my new residency conditions... I will officially move anywhere I can get paid :). Time to start answering the phone calls instead of singling out my potential employers lol. Because I clearly do no good with actively pursuing individual companies.
 
since I didn't specify explicitely what x can be, it guesses it basing on the fact I am using + 1 inside
and of course f "foo" won't compile
because adding numbers to strings doesn't make sense... right?
okey I'll stop now.
 
2:24 PM
@BartekBanachewicz can you make String an instance of Num, though?
 
Well they could just concatenate but as for being right that's more speculation I don't know enough of lol
 
Best way to obfuscate javascript tbh: jsfiddle.net/uLB9E
 
@JanDvorak you would probably need -XTypeSynonymInstances extension for that
 
what about [Char] being an instance of Num?
 
user1596138
lololol
 
2:28 PM
@JanDvorak That would be -XFlexibleInstances I think.
 
oh. Thanks :-)
 
user1596138
> Web Developer / Programmer : . . . Must have bachelors in computer science . . . Compensation: $8-10/hour
 
@rac 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.
 
user1596138
@Meredith Why do you think that's good?
 
i dont it was sarcasm
 
user1596138
2:30 PM
...
 
@JanDvorak There's no instance of Num for Char, though, so it would require a bit of fiddling to make it compile
instance Num [Char] -- Defined at <interactive>:2:10
instance Num Integer -- Defined in `GHC.Num'
instance Num Int -- Defined in `GHC.Num'
instance Num Float -- Defined in `GHC.Float'
instance Num Double -- Defined in `GHC.Float'
 
no extension needed, then?
 
nah, it's an incomplete (hint: empty) instance. You can create one, but you'll get tons of warning and it obviously won't work
 
@Meredith just a heads up, sarcasm isn't as detectable in text as it is in speech <.<
 
Anyone wants to do some proofreading/factual correctness? Would appreciate it greatly.
 
2:31 PM
context clues though
 
<interactive>:2:10: Warning:
    No explicit method or default declaration for `+'
    In the instance declaration for `Num [Char]'
and so on.
 
user1596138
@SecondRikudo Eww that needs to be half as long and waste half as much space as it does :P
 
@BartekBanachewicz is there any problem trying to implement the necessary functions?
 
@Jhawins How so?
 
2:32 PM
except for the tedeity inherent in trying to implement a number
 
    (+), (-), (*)    :: a -> a -> a
    negate           :: a -> a
    abs, signum      :: a -> a
    fromInteger      :: Integer -> a

        -- Minimal complete definition:
        --      All, except negate or (-)
@JanDvorak not really ^. Altough making it really meaningful is another story obviously.
 
user1596138
@SecondRikudo Titles take up ~4 lines worth
 
true.
 
user1596138
For no reason and the ones that wrap take up almost 8
 
@Jhawins No more than 2 lines on SO. I checked.
 
user1596138
2:34 PM
@SecondRikudo Ah ok cool. Didn't know how the markdown was :P. tl;dr for the most part but nice.
 
@Jhawins All canonicals are TL;DR, which is why I added a TL;DR at the end :D
 
user1596138
I always just leave the duplicates of that because there isn't a good resource to point people to. Now I can
 
Alright I'm postin'. Let me know if you find issues/typos/facts wrong/whatever in it
 
user1596138
@SecondRikudo I suggest explaining it is for this purpose in a comment. Because some people are just that stupid.
 
@Jhawins Here's the question:
> I have a variable in PHP, and I need its value in my JavaScript code. How can I get my variable from PHP to JavaScript?

><sub>This question is intended to be an information source and a duplicate target. You are free to post answers but please don't post one liners. There are questions on this subject with highly voted answers, but most of them aren't great, and the questions themselves are very old. Time to freshen up!</sub>
 
user1596138
2:37 PM
I know I have like 1.3K rep or some shit but I've been here more than 60% of days in the last ~20 months :P
 
user1596138
Nice.
 
0
Q: How to pass variables from PHP to JavaScript?

Second RikudoI have a variable in PHP, and I need its value in my JavaScript code. How can I get my variable from PHP to JavaScript? This question is intended to be an information source and a duplicate target. You are free to post answers but please don't post one liners. There are questions on this subj...

 
@SecondRikudo the 1 way i think you can do is to put the variable in a invisible div and then use javascript pref jQuery to grab the contents of that div or span tag
 
user1596138
 
user1596138
Except I'm never here on the weekends XD
 
2:38 PM
@Wandile That's approach number 2
 
ok cool
 
user1596138
@Wandile That's pointlessly slower. You're going to simply echo it somewhere. Why not echo it in a variable definition from the start
 
@Jhawins (somewhat) separation between JS and PHP
 
user1596138
That's an option but if you think about it it just causes you to do 3* as much work for no reason :P
 
@Jhawins Right, you might as well use AJAX.
 
user1596138
2:39 PM
I do everything with ajax
 
upvoted, editing @SecondRikudo
 
@jhawins yes thats better, that was just at the top of my head
 
@BenjaminGruenbaum Muchas Gracias.
 
please dont kill me :)
 
user1596138
@Wandile You are an avatar.
 
2:40 PM
LMAO :D
 
Regex questions attract the WORST answers. I swear everybody thinks "try using regex" explains what the actual regex does...
 
user1596138
@RUJordan A lot of these same people seem to not realize there are potentially hundreds of regexp that will achieve the same result either.
 
I hate regex
 
@SecondRikudo I made an edit, feel free to revert it.
I'd start the answer with what's clientside and serverside and the difference.
 
user1596138
"No mine is right because I posted it first and it works" -> "well yours breaks on a million edge cases" -> "the OP only asked for this specific case you twat waffle dick face"
 
2:42 PM
@BenjaminGruenbaum I saw, LGTM
 
user1596138
Yeah regexp questions suck
 
@Jhawins that's the jist of it
For sure
 
user1596138
Stupid people trying to do the absolute bare minimum
 
i hate regex
 
regex is my waifu
 
2:42 PM
Let some downvotes fly gents
1
Q: replace working for only first sub element

sudharsanI don't want to use split or join. var str = "cause variety of files"; alert(str.replace(" " , "_")); The code above outputs : "cause_variety of files" The output I seek is : "cause_variety_of_files"

 
@SecondRikudo ajax requests introduce significant overhead though.
I would not use them just for data access - unless building an SPA
even then, look at what this chat does?
 
good morning gentledudes
 
The problem with regular expression questions is that if the OP were capable of perfectly describing what a regular expression should and shouldn't accept, he'd be writing a regular expression in verbose form.
 
@BenjaminGruenbaum Chat used to do an AJAX poll every second, before they implemented Websockets.
But Websockets is way beyond the scope of that question.
 
Since that's not usually the case, most times it's subject to interpretation
 
2:44 PM
why ajax when you have PHP?
 
^ oy vey
 
I hate ajax too
Except it's amazingly useful and not using it will make your users hurt themselves
which is another thing I hate about it
 
user1596138
@Wandile What...? Does that make sense to you?
 
@Jhawins I always use PHP instead of AJAX, but Mongodb works too
 
user1596138
@Meredith Also does this make sense to you?
 
2:47 PM
@Jhawins +1 to both your comments?! dafuq
 
I think it'd be really fun to have to refresh the page to see if anyone's said something
 
i love JavaScript, but i run away from ajax unless i really need to make refreshless changes, @SecondRikudo maybe i dont understand what you trying to do, @Jhawins PHP is better than ajax
 
user1596138
Right I have no idea what they mean hahaha
 
user1596138
@Wandile Oi... You don't know what PHP is or you don't know what AJAX is :(
 
@Wandile The problem with using PHP directly in JavaScript is that if tomorrow you need to get data from a different source, you can't do it easily.
 
2:48 PM
@Wandile - PHP is better than Ajax? That's like saying sentences are better than apples.
2
 
@Jhawins and you do???
 
user1596138
@Wandile Yes actually... It's A-synchronous J-avaScript a-nd X-ML
 
@Jhawins +1
 
@JeremyJStarcher Nah you can eliminate the need for ajax entirely with php/forms
 
@Meredith ?!
 
2:49 PM
@Meredith Only if your back end is using PHP.
 
user1596138
lol this chat room is a hoot!!
 
@Meredith they are 2 completely different things
 
LMAO :D @jhwins congratulations you can spell
 
@Meredith Depends on your purpose.
Not all AJAX is used for submitting forms.
 
@Wandile congratulations, you know nothing about AJAX!!!
 
user1596138
2:50 PM
Would @Meredith and @Wandile please talk about some projects you've worked on, or maybe your opinions on some different languages/technologies a little more?
 
Sometimes you just need to get data from a different source.
 
I'm not saying it's a good idea but yeah ajax isn't necessary
 
@Meredith If you reached a point when you need to get data from the server, AJAX is the tool for the job.
 
You can always hack together a solution that doesn't use ajax
 
Might be a futile effort but...
0
Q: Improving RegExp Questions

RUJordanIs there anything we can do (besides meticulously comment and downvote) to improve answers to regular expression questions? Let's be honest.. they are terrible quality. "How can I blah blah blah?" "Oh, try this regular expression \s\g+\$" (<-- not a real regexp) This is THE MOST COMMON answer ...

 
2:51 PM
And no, @BenjaminGruenbaum it has very little overhead, especially if you're a n00b that uses jQuery for everything.
 
@Meredith agrred, but the operative word here is "hack"
 
@RUJordan You should add what's wrong with regex questions to begin with.
 
@Meredith Strictly speaking, the INTERNET isn't necessary -- but it gives us the results we want. We could carry on this converstation (much slower) over FidoNet. Ajax is a nice tool though.
 
hacks tend to be bad ideas
 
Identify the problem, offer a solution.
 
user1596138
2:51 PM
@Wandile Maybe you should replace your phone (which provides a means of communication like AJAX) with a horse (which gets shit done like PHP). But good luck holding that horse up to your ear.
 
@SecondRikudo I would, but to be honest regular expressions are not my strong suit, so I can't identify what's wrong with them
 
HOW ABOUT.....those championing not using AJAX you create this chat room, without using AJAX......
 
Like if you wanted to have a chat room that doesn't use ajax
have it refresh every second
 
> They do different things.

PHP does server-side work, while JavaScript does client-side work. Hence, PHP seems to mostly be used for business logic, while JavaScript deals with the user interaction.

AJAX is not a language, it is a combination of JavaScript and XML that can be used to update parts of a webpage without having to reload the whole thing.
 
2:52 PM
@Meredith that would be a message board then with auto refresh....
 
@Meredith Pfft, lol. Good luck with getting users for that.
 
yeah
 
user1596138
@Wandile Did you just paste a link to prove your point that was actually just another noob saying the exact same thing as you and there are people like me telling him the same thing as I'm telling you?
 
That's exactly what it would be
 
brb
 
user1596138
2:53 PM
I wish I could somehow star what he just did
 
@meredith users can not refresh all the time or the page should not auto refresh it would be a pain
 
@Jhawins Bookmark
 
user1596138
@DrogoNevets This chat doesn't use ajax :P
 
@Wandile No kidding
 
user1596138
Well it's websockets. Eh I have no interest in nitpicking you :P
 
2:54 PM
lol
 
@Jhawins no?1 then why does my onsole have a few thousand POST calls in it?
 
user1596138
lol oh god that's right
 
Actually, I don't see a thousand POST calls.
 
user1596138
2:55 PM
I thought they had switched awhile back. Hahaha this is sad.
 
@DrogoNevets My guess is that it uses websockets when it can and falls back to Ajax if it can't. Haven't looked at the source, but I cleared my network tab and there has been no new activity.
 
Only for new messages, which is understandable.
 
OH.. Posting is Ajax. Ok, that makes sense.
 
user1596138
@DrogoNevets Hey you should totally copy one of those requests as curl and paste it
 
@Jhawins huh?
 
user1596138
2:56 PM
(I got a kid to do it and changed his profile picture to obama riding a gay man/unicorn :P )
 
user1596138
@DrogoNevets Right click -> copy as cURL
 
That sounds like fun
 
@Jhawins youre a biker, i wouldnt trust you, i know biker "humour", and then you tell me this?!
:P
plus....its basically home time - yippee!
 
have to love and leave
 
user1596138
Hahaha it's 11am for me :(
 
2:58 PM
@kevin.groat 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.
 
@Jhawins 16.00 for me
 
@user3374348 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.
 
user1596138
Swap me
 
its 5pm for me
might come back tonight though will see im tired from weekend
 
18:00
 
2:59 PM
11am for me tooooo
@Jhawins where do you live again?
Are you close to DC?
 
user1596138
@RUJordan Indiana
 

« first day (1311 days earlier)      last day (3631 days later) »