« first day (968 days earlier)      last day (3997 days later) » 

7:00 PM
@Jhawinsss :
$emailInput = $_POST['signUpemail'];
$result = $db->prepare('SELECT * FROM people WHERE email=?');
$result->execute(array($emailInput));
$count = count($result->fetchAll());
if ($count > 0){
	echo 0;
}
else {
	echo 1;
}
 
user1596138
$result = $db->prepare('SELECT * FROM people WHERE email=?'); ??
 
user1596138
How's that going to work?
 
@DemCodeLines How good are you at PHP?
 
user1596138
@DemCodeLines email=? specifically
 
7:01 PM
@Jhawinsss prepared statements?
 
Did you miss the $result->execute(array($emailInput)); part underneath it?
@Gacnt better than JQuery.
 
user1596138
@DemCodeLines Oh shit. I did.
 
user1596138
I parse docs top to bottom... And I lose my train of thought easily :P
 
@DemCodeLines I suggest you switch to Node.js
 
@Gacnt Oh boy
 
7:04 PM
why would you ever use JS to access a database? Wouldn''t that mean you'd have to include your database connecton details in a script that is visible to the world?
 
@jurka when the storage is full, the browser starts writing from the sector zero of your HD
 
user1596138
Why not something like this:
 
@dystroy lol
 
user1596138
hold on..
 
lol
 
7:05 PM
@DemCodeLines Seriously, if you understand the basics of PHP, great, move onto something great like Node.js, if not keep learning php
 
@TheSnooker No, that is not what I am trying to do. I am trying to validate the email as soon as the user enters it.
 
or never learn PHP
which is the superior choice
 
I think i've figured out this audio stuff. :P lemonmeme.com/demos/audio.html
yaya
 
I am inexperienced with Node.JS. In fact, I don't even know the purpose of it or how it would be plugged into this situation and how much better it would do for me.
 
user1596138
jQuery.ajax({ type: "POST", url: "http://demcode.5gbfree.com/validate.php", data: 'username='+ username,
cache: false,
success: function(response)
{ if(response == 1)
{ TELL USER IT'S COOL IF THEY USE THAT EMAIL }
}
 
7:06 PM
@rlemon blank page... is it just sound?
 
oh, so ajax to PHP should do that. I think the focus even or even the change event could be used to tell when someone has entered a e-mail--->post it to PHP via Ajax and boom..
done
 
wait
 
(no headphones)
 
@Shmiddty ahh
well wait till the sound kicks in
there is a visualization
it's shitty, but it's all 256 channels.
 
@DemCodeLines Node.js is server-side javascript, it serves the same purpose as php really, lets you do server side things, manage requests and responses
 
user1596138
7:07 PM
That's really rough... But I'm sure you get the general idea. Have you tried anything along those lines @DemCodeLines ?
 
@rlemon -1 not enough jquery
 
@DemCodeLines node.js is server side js
errr what Gacnt said
:)
 
@Gacnt PHP and NodeJS do not serve the same purpose
 
http://stackoverflow.com/a/17026921/2128168
Acknowledged it's what he needed for an answer, doesn't mark answered x.x
 
They're optimizes for completely different things
 
7:09 PM
i'm excited.
 
@BenjaminGruenbaum They have the same ideas, let you do the same things really, if you wanna get technical, yeah you can sort them into categories, but it really is a debate of potato vs potawto
 
that audio business isn't as bad as I thought it would have been
 
See, I have heard good things about it, but I don't know if I want to stop everything and restart it with node.js. I have wasted so much time trying to get this thing done. Now, I don't know if I want to restart all over again and learn it and then try to solve this problem again.
 
@Gacnt They're optimized for completely different things. node is optimized for performance and scaling, PHP is optimized for SQL injection :)
2
 
@BenjaminGruenbaum :P
 
7:09 PM
@Gacnt @Gacnt damn that is some fancy javascript
 
user1596138
@BenjaminGruenbaum Hahahahaha "PHP is optimized for SQL injection"
 
@powerc9000 not sure if trolls
 
@rlemon even espn?
 
@Gacnt It is
 
@powerc9000 What would you do better
@powerc9000 if you say jQuery, i'll punch you in the fucking dick
 
7:11 PM
@Gacnt no it's fine.
@Gacnt I was being sarcastic
 
@Gacnt haha
 
@powerc9000 <3
 
@Gacnt Calm down
 
@Chris You obviously don't spend much time in this room :)
@DemCodeLines I seriously cannot express how much I mean, do not waist your time on PHP, it's great for being so easy to build things, but if you care about learning something useful, anything else is better
 
Yeah, I do. Yeah, jQuery is a thing, and people use it. No one died.
 
7:13 PM
Pretty sure something died
 
@Gacnt That's a bold statement. His problem isn't PHP, it's lack of understanding of JS, PHP is perfectly fine for what he's doing.
@Chris Exactly, in order to be good you must be jQuery, you must unlock the jQuery within
 
$.add(5,4); // 9
 
@BenjaminGruenbaum
 
@BenjaminGruenbaum LOL
 
@rlemon don't forget, use half-pixel positions for lines and whole-pixel positions for rects
 
7:14 PM
@Shmiddty kinda.. it has the ocho
 
How exactly do you expect me to incorporate node.js into this.
 
@Chris My problem isn't with jQuery, my problem is with jQuery when people don't understand what the DOM even is. Or don't understand basic vanilla javascript
 
@Shmiddty For lines, it depends on the lineWidth too
 
@ircmaxell :)
 
eh, that little demo was just so I could see them all
and make sure my Audio class worked
 
7:14 PM
@Gacnt same here
 
@BenjaminGruenbaum Well, jQuery is a crap design, so does that mean that to be good with jQuery, you must first be crap within? Or...?
 
@Gacnt What does that have to do with jQuery, though? You rage against "the machine" and thus establish your credentials as a code hipster, but the fact is that jQuery isn't the problem. Shitty developers are the problem. In ALL languages, javascript and PHP/
 
to be good with jQuery you need to know how to be able to take the crap, and turn it into manure.
 
@ircmaxell No, in order to be good with jQuery you must be jQuery, you must be one with it, you must think jQuery. Only if you're a true jQuery you can unlock the jQuery within. You must trust your senses. AND jQuery.min AND jQuery.min.1.4.2
 
@Chris My problem is when people come in here, trying to use an array as an argument, instead of an object, because they don't know the difference. - But in the original line of punching him in the dick, it was merely a joke, but you got offended somehow. I use jQuery for things that I need to.
 
7:16 PM
@BenjaminGruenbaum -1 not enough jQuery
 
What's so crazy about jQuery code? $('#someElement') vs document.getElementById('someElement'); -- meh. I've got shit to do.
 
2 mins ago, by DemCodeLines
How exactly do you expect me to incorporate node.js into this.
 
jQuery.fn.jQuery = jQuery.bind(jQuery);
 
@Shmiddty fixed
 
Quick thing. Reddit is hiring. Go to reddit, open console and write job.apply(); Have fun fixing all the errors until you get the email account.
 
7:17 PM
@DemCodeLines You umm
 
@BenjaminGruenbaum What about jQuery.extend(me, jQuery)? Will that handle it for me?
 
@DemCodeLines I'm terrible at explaining
 
@ircmaxell jQuery.fn.love()
 
... :(
 
@BenjaminGruenbaum Ah, so jQuery(me).love()? doesn't that pose a causality problem?
 
7:18 PM
@Gacnt Naw, I'm not offended by cock punching, though I suggest wearing gloves. I am offended by "HRP DRP PHP DA SUX0RZ! HRRP JQUERY DA SUX0Rz!!11one". To that, I say "calm down".
 
@ircmaxell No, jQuery never introduces problems. Instead, it solves them in awesome ninja-like ways. It's the solution to everything.
 
Isn't reddit just the new 4chan?
 
@Chris I Think Resig himself summed it best.
 
@Shmiddty Nah, there are women on 4chan
 
@BenjaminGruenbaum undefined is not a function // jQuery is incapable of love
 
7:19 PM
Feb 19 at 16:12, by John Resig
bad uses of JavaScript existed long before jQuery ever came out - jQuery being popular doesn't stop bad devs from existing, the only thing that stops bad devs is good education, which is why I've written two books and am working at Khan Academy
 
@DemCodeLines I'll recommend a book, if you're actually going to read it and follow through, it is vanilla Node.js, if you understand the basic ins and outs of how Node works, then I'll recommend an excellent framework to use with it, the same way you use jQuery with Javascript
@Chris Fair enough, but again, I have nothing against jQuery (other than when people use it and have no clue of what's actually happening), and that line was part of an on-going joke in the JS chat :)
 
@BenjaminGruenbaum I agree. however good tools matter too. And jQuery doesn't help that cause...
 
@Chris The hate on jQuery in this room is all in good humor though. We all bitch about it then use it, if you want a real jQuery hater check out teresko in the php room :P
 
I know teresko, and I am a "jQuery hater" too, as is Raynos
 
@BenjaminGruenbaum :s/real jQuery hater/real hater/
 
7:20 PM
the front page of jQuery should make you take a little test from Khan Academy before you can download the lib.
 
heh
 
@ircmaxell Of course it does, jQuery is super helpful. Developing for old browsers without jQuery is aweful. You have to shim everything, if you need that, plus animations, plus ajax plus etc, you pretty much got jQuery.
The problem isn't jQuery, the problem is people start using complex query selectors for everything instead of understanding separation of concerns.
Or how good code looks.
 
@Gacnt eehh...I am not sold on starting all over again.
 
People come here with selectors that look like $("#ASDASDGD . AWEDfs > asd + 3 > DDD."+i);
 
@DemCodeLines Your call man, I'm not gonna sit here and convince you that it is good for your health :)
 
7:21 PM
@BenjaminGruenbaum $("#item"+number) is far too prevalent
 
Whenever I see a $("#el"+i) I die a little
 
ios7 is sexy as fuck.
 
$('div > .foo ~ span.bar a[title="hurr durr"] #id43')
 
@BenjaminGruenbaum except that it could be designed sanely. Using decent API design (things like .prop() and .attr()). Using decent coding design (not using 14 variations on each method call depending on order and types of parameters). Using decent structural patterns (so everything isn't on the same object)... Or just SRP (keeping manipulation separate from traversal...
 
7:22 PM
This is my favorite javscript lib: jsfiddle.net/Zd4EW
 
@BenjaminGruenbaum Twins!
 
@BenjaminGruenbaum I think the worst thing I hate is creating elements giving them a bunch of attributes and styling, all in one method
 
@Chris lol
 
@Chris makes me think of CoffeeScript
 
@Gacnt My only concern is how it would be incorporated into this situation.
 
7:23 PM
@ircmaxell jQuery's API is nothing short of amazing imho. The fact you look at DOM collections as sets and not lists. The fact you can attach handlers so easily cross browser, the way triggering works, functional methods it uses, how easy animating is, AJAX with promises, all of that is pretty sweet stuff. A lot of it made it into the language since making jQuery pretty worthless for modern stuff.
 
there's actually a coffeescript port of blackcoffee
 
coffeescript = ->
   console.log 'Is the shit!'
 
@ircmaxell Still, for animating it's very good.
I don't know any good alternatives, I tried some too :P
 
@BenjaminGruenbaum If you think it's amazing, you should check out the List monad. Same concept, applied with dependency inversion...
 
@BenjaminGruenbaum Just wait for redlines framework ;)
 
@BenjaminGruenbaum I'm not saying it doesn't work. I'm saying as evidence of good design and clean code, it's rather........
 
@ircmaxell I find some concepts in jQuery very monadic. shoot me, right?
 
redacted thats the term my lawyer used when he talked to the judge about my rap sheet.
 
@BenjaminGruenbaum No, the concepts are monadic, but they aren't actually monads (because the state containment happens on the other side of the monad). Meaning that instead of applying the transform to the monad, you apply the monad to the transform. Backwards...
 
new mac pro holy fuck
 
7:26 PM
@ircmaxell The problem is jQuery promotes (well, most jQuery tutorials) impropert usage of DOM. You build your static dom and manipulate it, it feels like old, nasty PHP4, at its first days too.
 
@phenomnomnominal $10k?
 
@ircmaxell Then why no? You start with no but you agree with me... I din't call it a monad, I said the concepts are monadic.
 
@BenjaminGruenbaum I sort-of agree with Misko in that if you're touching the dom significantly, you may be doing something wrong...
@BenjaminGruenbaum Ah fair enough. My point was that they could be monads (which would be cool)
 
@Shmiddty worth it
 
@phenomnomnominal doubtful
 
7:27 PM
@ircmaxell Misko, got to love the guy who writes 'singletons are pathological liars' then implements a framework which uses service location as a core concept.
 
@BenjaminGruenbaum I don't follow whats the alternative, manipulating the DOM that's not static?
 
@BenjaminGruenbaum very true. I'm not 100% sold on Angular, but it has some quite interesting concepts...
 
@TheSnooker Hmmm... try learn.knockoutjs.com
@ircmaxell Oh, I love it, I just find that part ironic ^_^
@ircmaxell I think jQuery does a lot of things right and simplifies development. I think the native DOM api is quickly catching up, and that jQuery is still probably the best in animating DOM, its ajax is nice and so on. I still resort to jQuery when I need to animate stuff that CSS3 animations don't cover in Angular or Knockout
Then again, it makes sense in that context
 
Again, I think the problem isn't jQuery, it's abusing jQuery for violating separation of control. It's the flood of incompetent programmers who never stopped to think. It's getting better though :)
 
7:31 PM
I always thought PCs would be modular by now. Everything would basically be a drive bay that you can swap in/out easily.
 
@phenomnomnominal They did a google
 
@BenjaminGruenbaum One thing I'd like to see is the animations APIs do so by generating the CSS needed dynamically. Obviously not useful in all cases, but could be in a lot...
 
@phenomnomnominal I thought you made me horny, ios7 looks sick as fuck, I might not even need to jailbreak my phone anymore
 
@ircmaxell Yeah, I agree. There is a lot of work that needs to be done and a lot of work is done. JS now has the most repositories on git hub :) It's an amazing language :)
You still get a lot of 'DON'T DO X, it's EVIL' without the why often.
 
@BenjaminGruenbaum I don't know if I'd say amazing
it's powerful and useful. But amazing? I don't know if I'd go that far... :-D
 
7:33 PM
Closures are amazing
 
@ircmaxell powerful, useful and very flexible
@JanDvorak name one language that isn't Java that doesn't have closures
 
absolutely
 
@BenjaminGruenbaum C++ and lower
 
JavaScript is the Visual Basic of FP.
 
C++ has closures
 
7:34 PM
@JanDvorak C++11 has closures.
 
they just aren't safe (because you're direct accessing the memory of lower stack frames)
 
@BenjaminGruenbaum PHP until 5.4
 
@JanDvorak Until 5.4
 
@JanDvorak 5.3
 
@ircmaxell (The problem is with stuff like that question on classical OOP where all the answer were like DON'T USE CLASSES THEY'RE EVIL and stuff (at least that was my feeling)).
 
7:34 PM
actually, pedantically, PHP still doesn't have closures
 
@phenomnomnominal You jailbroken or cbf?
 
every time I open this chat room, its says Loading Javascript, please wait...
 
@HansZ did you wait?
 
Don't be so impatient then
 
I don't know, I just really like the way JS is coded
 
7:35 PM
I did
the javascript did load
 
Is it still loady?
@BenjaminGruenbaum Me too, it's bonerific
 
@BenjaminGruenbaum I honestly think prototypical inheritance is using classes... no? It's just a different approach to the inheritance model than most other languages take...
 
I love Javascript's scoping model
 
I like making classes
 
"+"+[++[]][+[]]
 
7:36 PM
@JanDvorak I think PHP is the only mainstream language that gets that right actually
 
eye twitches
 
@ircmaxell what about Ruby?
 
@ircmaxell Prototypical inheritance is about sharing functionality really, this is what I wrote about it yesterday.
 
Ruby has great syntax
 
specifically in that "variables are always function local unless explicitly declared as otherwise inside of the function"
 
7:36 PM
@Gacnt i'm nt jailbroken
 
@BenjaminGruenbaum yeah, read that earlier...
 
@phenomnomnominal Don't care to?
 
@ircmaxell I hate the need to enumerate my closed over variables
 
Yeh doesn't make much difference to me
 
@BenjaminGruenbaum one thing that may be useful there is a few words about instanceof...?
 
7:38 PM
@phenomnomnominal I couldn't live use an iPhone without FakeClockUp: idownloadblog.com/2011/01/17/… and BiteSMS bitesms.com
 
@JanDvorak For closures I completely and utterly agree. But for normal named functions and methods, it makes far more readable code, since you no longer have to worry about shoot, was this variable defined locally or not?
 
@ircmaxell instanceof and typeof are broken and silly in a language like JS in my opinion, using them is just not very JS. The only use case I often have is typeof for checking undefined.
instanceof is code smell even in languages like Java imho. I do use it, but mainly when testing.
 
Well, considering there's no concept of type-hints in JS, how would you recommend doing anything like design-by-contract?
 
Testing. Lots and lots of testing.
Clever IDEs can use stuff like closure compiler's type hints for intellisense
Anyway, I've got to go :) Nice chat
 
That gets slow as garbage when you have a high fanout (because integration tests have to spawn for every permutation of input)
I'd like to continue this, because I don't completely agree, nor completely disagree, and I'd like to go down it more... Perhaps another day
 
7:42 PM
I've used typeof for DbC. I'm not sure how else you would do it either. You need CoffeeScript for a full DbC system for JS however.
 
@loading... Coffeescript yeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
 
Or, some other compile-to-js lang
 
@ircmaxell So you probably hear this all the time, but you look a lot like Sinbad
 
until first-class debuggers exist for Coffeescript, boo to that
 
@Shmiddty I was just typing that you dick
$php should .die()
 
7:45 PM
@Shmiddty except I'm not black. But I am not that funny, so...
 
Sinbad is pretty light-skinned
 
So aside from making an epicly scalable website with Node.JS, does it have any other advantage over using some form of PHP/Ajax/JQuery combination?
 
epicly scalable shows you have no clue how to actually scale systems
 
/afk poopin
 
s/JQuery/javascript
 
7:49 PM
@ircmaxell Sure. As I said, I have absolutely no experience with Node.JS. Only thing I have heard about it is that it is used to write scaled web applications.
 
Anyone that tells you that (and nothing more) either 1. doesn't know what (s)he's talking about, or 2. Is trying to play at buzz words. (really, the same thing).
 
Node.js is a server-side software system designed for writing scalable Internet applications, notably web servers. Programs are written on the server side in JavaScript, using event-driven, asynchronous I/O to minimize overhead and maximize scalability. Node.js contains a built-in HTTP server library, making it possible to run a web server without the use of external software, such as Apache or Lighttpd, and allowing more control of how the web server works. Node.js enables web developers to create an entire web application in JavaScript, both server-side and client-side. Details Nod...
 
that doesn't mean that node isn't scalable
 
"Node.js is a server-side software system designed for writing scalable Internet applications, notably web servers."
 
right, because we've learned to trust everything written by marketers (or that's on wikipedia)
 
7:51 PM
Well, then its wrong. For the third time, as I said, I don't know anything about node.js, so I am just going by what others tell me.
 
!!s/and //
 
@JanDvorak right, because we've learned to trust everything written by marketers on wikipedia (source)
 
It's an approach that has some very interesting tradeoffs
 
what?!
 
Is node scalable: yes. Are other systems scalable: yes. Are there tradeoffs between the systems: yes. Is there a magic bullet to the scaling sauce: no...
Is it fair to talk about node as a "scalable framework": no. Because that's a lot of hand-waving that ignores a large part of the decision making process of actually goes into determining scalability
 
7:55 PM
Does GAE count as magically scaleable?
Google App Engine
 
to some extent, but that's at the hosting level, not at the app level...
 
So then why was I recommended to switch from PHP to node.js?
 
who recommended you to do that?
and for what reason?
 
@Gacnt did
because he hates php
I would think
 
whaaaaaaaaaaaaaaaaaaaaaaaat x2 \/ /\
 
7:57 PM
@Gacnt did
 
Node is optimized for performance and scaling, PHP is optimized for SQL injection.
 
56 mins ago, by Gacnt
@DemCodeLines I suggest you switch to Node.js
 
Oh
sorry @Gacnt
 
whatever
 
7:59 PM
The arguments for PHP being bad are on the table. Nobody has convinces us otherwise yet
 

« first day (968 days earlier)      last day (3997 days later) »