« first day (635 days earlier)      last day (4539 days later) » 

19:04
heh
Can someone help me understand how to implement the drag and drop file upload system in this guide http://www.thebuzzmedia.com/html5-drag-and-drop-and-file-api-tutorial/

I'm good with PHP and shit with everything else... But I can usually hack at stuff enough to make it work. I get that I start by making a div element that functions as the drop area. Then it jumps into stuff like this:

var dropbox = document.getElementById("dropbox")

// init event handlers
dropbox.addEventListener("dragenter", dragEnter, false);
Thats Javascript
19:10
okay. So i should go do the w3 class on javascript?

or is it simple enough to do this particular task that someone could give me a quick 5 step idiot guide
@user187680 Are you averse to spending money on books?
yes. But im in barnes and nobles as we speak.
w3schools.com !== w3c
i see that. They still seam to teach fairly well. its how i got started on php
19:12
@user187680 That explains why you don't recognize Javascript when you see it
uh yeah i def dont
@user187680 They DON'T teach PHP "well", they teach stuff that has security holes. Just because code works doesn't mean its GOOD code.
you should read the w3fools.com link I linked you and stop using w3schools as a resource...
lol, they teach a really basic lesson on php that takes about 3 hours to work through. of course you wont know shit when its done
but it helped me for sure. It was readable and since then ive learned enough to get going
@user187680 The problem isn't that they chose to teach PHP its that everything on the site is outdated by years...
at any rate. whats a better resource if i want a quick javascript rundown
user895378
19:15
@user187680 A better resource? Learning javascript and not trying to find the cliff's notes version :)
user895378
I suggesting that if you want to use a language you should know it beyond learning the few lines you need to perform the current task at hand.
I would say tizag.com but I don't know how recent it is and haven't used it in a while.
so wait, your all hating on w3 schools which is fine, but nobody can offer something that they suggest is better...
that google thing is 2 17 minute videos. I'll watch them for sure but its not really comparable to whats on w3
Its not about quantity but quality (including up to date information)
user895378
@user187680 w3schools is a terrible resource. Peruse w3fools.com if you don't believe the people in this room who know.
Knowing everything about PHP from 3 years ago isn't going to do you any good.
yes it is
its going to help me quickly have a shitty grounding from which i can learn
19:19
No, its really not
as upposed to jumping into a big text where im goign to be lost and give up
what happens when PHP 6 comes out and all of your code that connects to a database doesn't work? You will have to recode everything
yep
absolutely true.
well have fun wasting your time then
not the point
tell me a comparable resource that isnt frowned upon then?
19:20
Yeah that is the point, if you want resources use the good ones, don't waste time on ones that are shit and outdated.
Here's the best programming resource you'll ever encounter:
http://en.wikipedia.org/wiki/Humility
user895378
More likely scenario: what happens when I hack the f$%& out of your server because you learned how to interface with an SQL database from w3schools? I'll tell you what happens: I laugh.
way to dense. i get lost.
user895378
Well, something is certainly way too dense ...
19:22
So as i take it, this room, basically thinks people as dumb as me shouldnt be allowed to learn to code.
6
user895378
no, they're suggesting you learn to code.
no, we say don't learn code the stupid way
uh and dont suggest a non-stupid way that i can handle.
already did, like 5 times now
listen, its not that im being lazy with php manual its that i literally couldnt just juump into it
19:22
@user187680 almost everything on w3schools has been answered (and reviewed) on StackOverflow
and if not, is only a google search away
yes and then tehy organize it nicely so i can learn from the very begining with ABSOLUTELY no coding background
AND THEN, i can move on and learn from more credible sources
i dont get all the hatred
Feel free to ignore what everyone here is saying, but if you learn through w3schools you will only know how to code ineffectively and without proper security
user895378
3 mins ago, by rdlowrey
More likely scenario: what happens when I hack the f$%& out of your server because you learned how to interface with an SQL database from w3schools? I'll tell you what happens: I laugh.
user895378
19:24
It does you no good to learn from bad sources.
@user187680 You are being lazy, because if you read the Language Reference section from start to finish you would actually have learned what the hell you are doing. Read to learn PHP
or even half
would be better than going to w3schools
your all babbling on, not responding to my point. IM NOT SAYING ANYONE should learn to code from w3. I am saying it gave me enough knowledge to move into reading other things. I can read something cautiously knowing its out of date.

im not smart enough to go straight through the manual you suggest. And im not very stupid.
The point is that the errors and fallacies on w3schools are not recognized by novice programmers - and yet you're baffled as to why we don't recommend it to novice programmers
19:27
@rdlowrey you still remember how you learned the PHP ?
user895378
@Constantine PHP Manual + Google + Wikipedia + Stack Overflow. The problem is that there are a lot of very bad resources out there.
user895378
There is a lot of effort going into improving the manual right now. Also, Stack Overflow is peer-reviewed, so you can generally bank on it being a very good place to learn.
user895378
Unfortunately, the PHP manual is difficult to understand if you're trying to learn PHP as a first language. But that's not the manual's fault, that is the result of a general lack of exposure to programming concepts.
19:30
@rdlowrey Except for really old ops stuff
user895378
@JoelESalas If you come across bad PHP advice on SO please share because I'd love to downvote it. Hell, we can usually get a chat posse together to blast bad SO advice off the face of the planet :)
@rdlowrey Though we should make an honest effort to let the user know what they did wrong and maybe edit it. wink
user895378
@Event_Horizon lol
user895378
Of course, if it's something that's really old and easily fixable I might just opt to edit ...
@rdlowrey Lots of it predates Serverfault, so it's what a developer thinks is a good operations choice. Not always good advice, but if you never search anywhere else, that's all you'd get
19:35
@rdlowrey even Wikipedia ? i hear from many that even Wikipedia is a not really trustful source :) and in Google you may find a lot of misleading tutorials. All knowledge that you poses now keeps you away from w3school alike resources because of your experience. I am sure that if you were a novice, the first thing that you will find in Google was W3School, so stop using face-palms
user895378
user895378
@GordonM omg I haven't seen that in years
user895378
19:41
so funny.
@GordonM I put on my Loincloth youtube.com/watch?v=0o9yLcJqOw8
user895378
I cast Lvl. 3 Eroticism.
Methinks a robe and wizard hat would be useful with some of the crap on SO
user895378
Lightning bolt! Lightning bolt! Lightning bolt! Sleep!
Snorlax used sleep, its super effective. ZZZZZZZZZZZZZZzzzzzzzzzzz
19:47
0
A: Draw dice results in ASCII

BracketworksPHP 5.4 107 bytes <?$r=rand(1,6);$d=[' ','o'];$o='+---+ |'.$d[$r>1].' '.$d[$r>3].'| |'.$d[$r>5];echo$o.$d[$r%2].strrev($o); 102 bytes* <?$r=rand(1,6);$d=' o';$o='+---+ |'.$d[$r>1].' '.$d[$r>3].'| |'.$d[$r>5];echo$o.$d[$r%2].strrev($o); *Unfortunately, the 102 byte v...

Anyone wanna make it shorter?
O.o I get a syntax error in writecodeonline.com/php
it doesn't support square bracket arrays , mother of god
@Event_Horizon For my codegolf?
Hy!
Does anyone knows why my WAMP needs 343.078125 Kbyte for rendering an empty page?
what is WAMP
user895378
windows apache mysql php
19:52
@Bracketworks The website doesn't support square bracket arrays (found with your codegolf)
windows apache mysql php
yeah but what exactly, all of them?
xammp
*mpp
@Bracketworks also, linebreaks?
@Event_Horizon Gotcha, yea; it's 5.4+; Also, it doesn't print formatter correctly (for that exercise)
user895378
19:53
@webarto It packages them all up so you can install one thing on windows ...
Linebreaks are literal `'
'`
^^ You get what I mean.
no, never seen those
user895378
But why you'd want to develop with open source technologies in a windows environment is completely beyond me ...
@rdlowrey understand, but what exactly is taking 343k of kb... it can't be windows apache mysql php...
@Event_Horizon run it at command line.
user895378
19:54
Wait, are we talking 343kb? or ~340Mb?
kb
and i got fatal errors, it cant allocate memory withput inc. the limit
user895378
well that's perfectly normal ... a php process has to fire up to serve the page, regardless of whether the page has any content.
user895378
php can't very well run on zero memory
@rdlowrey Challenge accepted.
;)
user895378
lol
19:56
@Bracketworks I'm not on my server computer
user895378
And if you're stressing about a wasted 343kb in your windows environment I have concerns that you might be a time traveler from 1983
@Event_Horizon Ah, very well. It works though :)
Plus don't let anyone know but I've never done PHP from commandline I mean, good day chaps...
Im not stressed
i got fatal errors
user895378
well then post your error output ... clairvoyance is not a strong suit of mine ...
19:57
Apache can't run with 343kb of memory...
Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 40 bytes) in D:\Dropbox\Proj\WebTagger\system\core\router.php on line 108
that is 128MB... you have a bug somewhere...
user895378
yup.
user895378
well, not necessarily
user895378
19:58
You're probably working with large files -- try upping the memory limit in your php.ini file to something > 128M
try increasing to let's say 1024MB...
user895378
It's an arbitrary limit, so if you're only working on your local machine feel free to allocate as much memory as you want to your php processes :)
Fatal error: Allowed memory size of 1073741824 bytes exhausted (tried to allocate 40 bytes) in D:\Dropbox\Proj\WebTagger\system\core\router.php on line 108
have fun guys time for me to go fix my car
user895378
later
20:00
@rdlowrey a bug? :)
Hm, my follower code went up rather much today. I remember it being 280 in the morning, and it is 350 now
@EventHorizon your car has a bug :P
the question, how can i found this bug
user895378
@appl3r what are you trying to do? are you working with really large files?
that error happened me once when i forgot break a loop
with playing files
20:01
@rdlowrey not relly
@rdlowrey just started to code, the whole folder of the project is 160kb
check your codes maybe you had something missing
user895378
@appl3r Well, you're doing something that keeps all the smaller files (mp3 ?) in memory at once inside of a loop most likely. This is fine until you max out the available memory.
user895378
Just guessed mp3 from the "WebTagger" name in your dir structure.
@NikiC you were contacted by FB you know :P
@rdlowrey it is a temporary name, there is not a single large file
user895378
20:03
There's no way to know without seeing code. The error message is very clear, though.
a bug
user895378
~pseudo-afk ... need to stop goofing off in chat and get some real work done.
I haven't heard from my boss for 4 days... don't know if fired, or he is in vegas or something...
@webarto lol
I think I found the error,
note to myself, never use xml to array functions from crappy site.
20:09
erm, (array) $xmlObject ?
@appl3r note to myself, never use xml to array functions from crappy site.
:)
but maybe it is okay, and I made a stupid mistake
You know, I'm coming to the conclusion that Zend's db interface is kind of silly.
It's not made of fail like forms are, but ... You can only use certain fetch*() methods on certain classes of DB object? You can do fetchPairs on an adaptor but not a table? Really?
can you give an example
And then if you need to do stuff like INSERT IGNORE you have to do it with raw SQL anyway.
20:13
oh god,
$count = count($xmlarray);
for ($i = 0; $i < $xmlarray; $i++) :
><
LOLOLOL
Whoops!
using debugger apps for php would be awesome
@GordonM for how long are you working with ZF?
20:14
About 10 months or so.
How long I've been working with it, at least.
How much does it suck?
Seeing as how pretty much every PHP job lists Zend as a requirement these days I guess I should just suck it up. But blech.
There's no reason for being able to do fetchPairs on an adapter but not on a table, other than the developers simply forgot it in the table.
I've been working with it for a month, and I miss Kohana more every day, but... like you say, in my example, it is 2x in money than my previous Kohana job...
Now if they'd coded to an interface...
@NikiC pretty much :D I just hate that I have to use e.g. Doctrine... I would rather write plain SQL...
@GordonM open up an request :)
20:19
I'm thinking if Reefknot gets any DB related stuff at all, it's just going to be little utility helper objects and the like, like stuff to automate the generation of parameterized IN() clauses.
I've not really seen any real advantage to zend_db, and some of it seems quite silly to me.
I don't know, maybe PHP devs are less scared of SQL if you disguise it in a fluent interface instead or something?
@GordonM I'd say I'm personally more scared of 42 levels of abstraction and mapping.
user895378
@LeviMorrison After all my bluster about the "StdRequest should be an immutable value object" I'm considering switching it back to using getters/setters because otherwise it's very difficult to make it pluggable. I want to be able to create a plugin to automatically decode request message bodies arriving with a Content-Encoding header. For example, POSTing JSON data to an API and encoding it with gzip to save on transfer time/bandwidth.
@GordonM writing SQL is fun (for me), I just don't like repetitive things, and like to use ORM for that, although I don't like that ORM does SELECT * which can become real problem... otherwise, plain SQL...
@rdlowrey You can just have another class that extends StdRequest that is not immutable.
Huh, automatic decoding of the request body based on Content-Encoding header... adds to list of ideas to steal
20:22
Has anyone here worked with SVG files before?
@SomeKittens I'm not sure what you mean by 'worked with', but I'd say I have.
$userDidNotProvideCesUnitAndCesUnitIsDefault = !isset($_POST['CESUnit_id']) && $CESUnit_id == 1; <- I couldn't find a better way to convey what it is . . .
0
Q: SVG colors not loading in Firefox

SomeKittensIn Firefox, the rect that have been assigned the linearGradient show up black instead of blue. None of the tutorials/help sites I've visited mention gradient issues with my version of Firefox (13.0.1). <defs> <linearGradient id="enabled" x1="0" x2="1" y1="0" y2="1"> <st...

I'm stumped.
nothing to do with PHP
@SomeKittens At the moment the best I can do for you is sending you to the MDN docs: developer.mozilla.org/en/DOM/SVGLinearGradientElement
@LeviMorrison alright, thanks anyway
20:25
Afternoon folks..
user895378
@LeviMorrison Let me know how you feel about this idea for extending StdRequest to allow listener modifications (like auto-message body decoding if the relevant headers exist) without sacrificing immutability.
user895378
I'd actually say broadcasting a mutable request would be better but I just used StdClass for a quick example.
@rdlowrey It works, at least. Looks hackish.
user895378
20:34
@LeviMorrison I know I thought so too ...
user895378
I'm generally against hackish :)
user895378
I think I'm just going to MutableRequest extends StdRequest and add setter methods
@rdlowrey How I generally solve the 'immutability' problem is defining an interface as read-only, but the implementation has setters. This means I can force read-only by requiring the interface, but can change something if I want to by converting it to a concrete implementation I control.
I'm listening to that Guns 'N Roses song with Isaac Hayes doing some backing vocals. I just keep thinking WTF, Chef's on this song!
user895378
@LeviMorrison I was hoping to find a non-hackish way to maintain perfect immutability and still allow listeners to modify properties when set, but I don't really see any other way than to add the setters :)
20:38
interface RequestEntity  {
    function getHttpVersion();
}

class StdRequest implements RequestEntity {
    ...
    function setHttpVersion($version) {
        ...
    }
}
user895378
Seems to be the cleanest approach.
Hm
Does anyone know if it's possible to document a namespace with ApiGen?
user895378
never used ApiGen ...
Also, woot, netbeans 7.2 adds OSX Lion full screen mode.
only reason I like FB... 612,535 ppl liek 7h!5. Y U NO LIEK IT?!
20:46
@GordonM I've never used ApiGen but according to the information on their website ApiGen has support for 5.3 namespaces
Yeah, it does, it can generate a list by namespace. But the generated docs give the impression that it's possible to document the namespaces. If you can, I don't know how.
@GordonM Is 7.2 stable?
user895378
Why would you want to document a namespace? Just make the namespace's name descriptive.
It's to release candidate state, only been playing with it a few hours but it seems stable so far.
@GordonM yeah I don't know about that.... The example i'm looking at right now doesn't seem to document the namespace.. It displays it, but doesn't specifically document the namespace itself...
Work is overrated ;)
over rating things is work
lol... What do they say "When you do what you love, you never work a day in your life"
@rdlowrey What did you decide to do with it?
user895378
@LeviMorrison I'm still fiddling ... will ping you with the results :)
21:02
holy cr@p... 14k page views on the OOP vs Procedural post...
@ircmaxell It was a good post.
1 hour ago, by webarto
@EventHorizon your car has a bug :P
Yeah its called a bad alternator :(
@Event_Horizon Use the pipe character instead then ;)
it's #4 all time, and will be #3 soon
21:09
going to attempt this repair myself, wooh!
I had problems with starter, you can't debug that s*
I replaced a starter on a 95 (i think it was 95) ford probe, without lifting the engine out, google that and tell me its not a bitch
just 3 more page views...
And #3
The odd thing, is that I'm at 80% of the traffic level of my best month so far. Just 12 days in...
@ircmaxell I'd be interested in your response to this
@ircmaxell I had 27k pageviews today (until now). 87k for the whole past month (30 days)
21:15
@orourkek Simple: use callbacks...
@NikiC Nice!
69k for the past 30 days for me, but 57k for Jul1 to now...
and 272k all time...
Ugh, no matter what I do, ApiGen tries to document the unit test directory of the project. And PHPUnit.
user895378
Situation: a client sends an HTTP request body and specifies a Content-Encoding header which cannot be decoded by the server. What HTTP response code should be returned? I would say 415 Unsupported Media Type but it's not the Content-Type that is the problem, it's the encoding of that content type. Should I just go with 415?
Seems the only way to stop it is to move it out of the source tree altogether. Which also takes it out of Git version control.
@ircmaxell And traffick is obviously very spikey
21:22
pastie.org/4246120 Any idea how I can take the s.pitchedBy_id and add into the select something like: SUM(s.pitchedBy_id) where s.pitchedBy_id != null GROUP BY s.pitchedBy_id I'm drawing a blank
wow, analytics stats are significantly below blogger stats...
pastie.org/4246120 the link got screwed, there it is..
@ircmaxell How can that be?
adblocker blocking the analytics stats
adblockers do that?
21:24
one post analytics says 17k views, but blogger shows 27k
some...
that's a bit of a difference ^^
wow, IE is down under 2.2% of visits
Yeah, that's pretty typical for developer sites I think ^^
I have a 1.99% IE share
hopefully mostly IE9...
yeah
16.6% Linux as well
21:33
Yeah, from the IE users 63% are IE9
user895378
In case anyone feels like dropping some HTTP knowledge nuggets on me ...
user895378
0
Q: Appropriate HTTP status code for request specifying invalid Content-Encoding header?

rdlowreyWhat status code should be returned if a client sends an HTTP request and specifies a Content-Encoding header which cannot be decoded by the server? Example A client POSTs JSON data to a REST resource and encodes the entity body using the gzip coding. However, the server can only decode DEFLATE...

1.12% IE9
0.8% IE8
0.18% IE7
0.03% IE10
0.03% IE6
digg sells for 500k... wow
user895378
and f-ing instagram fetches $1B ... craziness.
21:38
^^
3 year salary of google engineer... ridiculous.
What? digg sold for 500k? The bubble has burst!!!
run for your lives!!!
well, matt williams did completely sell out
I'm out
later
Hi there! I would like to discuss with somebody the consequences of an "open" crossdomain.xml ? Anybody out there :-) (I know this chat is more for PHP, but as every PHP developer has to face Flash once in a time, I thought it could be worth a try)
21:42
why did you had to reminds us of Flash...
hehe, trust me I wouldn't do this if it wasn't important to me ;-)
anyone have any experience storing japanese chars in mysql? does a utf8-encoded table support it?
@AndyPerlitch should work
@webarto FLASH! Ah-aaaaaa! Saviour of the universe!
"Japanese characters take 3 to 4 bytes in UTF-8 and 2 to 4 bytes in UTF-16."
21:48
@rdlowrey 400 Bad request? (I think that's the right HTTP code)
user895378
@GordonM I think that's what I'm leaning towards ...
@rdlowrey Cool. I'll go answer the question and repwhore :)
@exaptis PHP developers normally don't say "Flash" (unless they say "sucks" in the same sentence)
user895378
@GordonM you totally should. come up with some BS justification and when I get back to the computer in a couple of hours if no one has done better I'll happily apply the +
$x = file_get_contents('http://127.0.0.1:1337/fsckin.xml');
this doesn't go "around the internet", right?
21:58
0
A: Appropriate HTTP status code for request specifying invalid Content-Encoding header?

GordonMWell the browser made a request that the server cannot service. That would make it a Client Error (400 series error code). My first instance is 400 Bad Request is the appropriate response in this case. 405 Method Not Allowed isn't right because it refers to the HTTP verb being one that isn'...

@exaptis thanks!
For all the times I've knocked PHPBB's massive database table schemas, I failed to realize just how painfully necessary it all is until I tried it...
22:13
@orourkek know the feeling from other systems
does anyone know why PHP would just start generating dates from the future via the date() function? <insert flux capacitor joke here>
I could query (with 5-6 joins) for the latest post, or just throw the id into a separate column on the forum table and save tons of time/code... sigh :P
Well, my days of closure rebinding hype are thankfully over.
@Waddler timezone settings would be my first stop in debugging
It's already set to America/Chicago, aka central
@orourkek
There are some entries on the DB table for tomorrow, and then there are others for 10/4 and 10/5.
My guess is those ones from tomorrow weren't set today.
22:28
@Waddler are we talking about PHP's date() function or MySQL's... is this the only date/time related function being used in this context?
@markustharkun here's the snippet: $register_date = date("Y-m-d H:i:s");
as far as I can tell, on that page, it is.
in what mysql datatype is it stored?
are there any mysql date related functions being used?
can you safely assume that mysql has the right timezone as well?
@markustharkun varchar #FoundItThatWay
not for this code
that variable is part of the insert statement.
Welp, see yall tomorrow
@Waddler ok, then I don't know... make sure server time is correct and timezone is actually set, try changing it at runtime to verify
otherwise, no idea
22:34
@markustharkun I'm trying to find that info in phpMyAdmin for the mysql db
system time zone is CDT
that has to be central * time; not sure what the D is for in that abbreviation
we are about to redesign the site anyway, so this may not be a big deal
it looks like it was restarted 49 days ago though.
anyway, it's time for me to punch out. thanks @markustharkun
user895378
@LeviMorrison Okay, I'm happy with the solution I settled on. It solves the mutability question in that all request properties remain immutable. I've simply extended StdRequest with EncodableRequest as you can see in the updated gist. It's a small subset of people who would want to accept encoded message bodies (API developers), so with the linked solution I'll just add a boolean config directive $cfg->acceptEncodedRequests (or similar).
user895378
If you need to accept encoded HTTP entity bodies you just flip the switch in the config file and your requests will be of the EncodableRequest variety. Let me know if you think this can be tweaked or improved upon.
user895378
22:49
(Note that I already have a fully committed but as yet unpushed Encoding package locally from working with content negotiation)
23:01
Is there any way to get the name of a variable passed to a function (the name of the variable in the calling scope)? This isn't for a hack, it's legitimately for debug; I'm assuming debug_backtrace here..
@Bracketworks did you try debug_backtrace? I'm not sure you'll get the name of variables like that
@markustharkun Yea, I maxed out all the params to see if I could find it; I trashed cygwin so no grep for me. I don't wanna go through it by hand.
Eff it ;)
23:21
hello, thanks for great answers earlier, hoping for a little more help. saw @ircmaxell 's impressive encryption class at stackoverflow.com/questions/5089841/…. It is more robust than what i'd been using, so i'm trying to incorporate it into my application.
My question (likely a dumb one) is: Can stored encrypted values be used for authentication? The basic auth process I'm familiar with is: 1) sha1($pw) 2) match uname and hashed password to a value stored in the database. Is it possible to encrypt the password, save the encrypted string in the database, then match against it during authentication? or is authentication one-way algorithms only?

« first day (635 days earlier)      last day (4539 days later) »