« first day (1035 days earlier)      last day (3910 days later) » 

since it's been a while since I posted a question... does SO actually suggest alternates while you type the body of the question?
 
@Ocramius title
and tags
 
Anonymous
@Gordon @rdlowrey ehh, thanks for the feedback. I got disconnected mid-night
 
iirc
 
I'm still unsure whether Gravatar was a useful thing.
 
1:04 PM
@Fabien I think it's good in theory
 
While it is nice I always forget it exists until my picture mysteriously appears next to my name.
BattleField uses it.
 
@Fabien I have dozens of profiles around the web... gravatar saves me from editing them each time I fix my avatar
 
Indeed.
Wonder how they profit.
Or If.
 
@Fabien Increase the profile and traffic of Wordpress.
 
1:11 PM
Looking for an English word for people who work under me (as in, I am their boss)
"underling" sounds a bit, condescending :D
 
@MadaraUchiha useless underlings lol
@MadaraUchiha Hmmm what about my "employees"
 
Hmmm, not really the word I'm looking for... :P
Any more ideas?
 
@MadaraUchiha pick one of these translate.google.com/#nl/en/medewerker
 
@HamZa These all mean "people who work with me"
I'm looking for "people who work under me"
 
@MadaraUchiha minions >:]
 
1:14 PM
@CarrieKendall subordinates was the one I was looking for
Thanks anyway :D
 
@MadaraUchiha "assistant"
 
This one is amazing xD
 
@MadaraUchiha no-fun friday
 
@dragon112 hahaha
 
1:15 PM
@dragon112 lol
 
I haven't really followed internals/RFCs; has there been alot of opposition to return-type hinting for class types?
public function FooInterface makeFoo() { }
 
Hey guys, what's the url pattern for ip websites like http://~username/ip something like that?
aa done, it was reverse.. ip/~username
 
That made no sense. Try again. Different words .. oh, i think i got it
You are talking about XRI, right ?
 
@CarrieKendall no-fun friday
 
@dragon112 :P
 
1:24 PM
@tereško cool yea, didn't knew that word to describe, learnt something new again ;) though it hates my htaccess
 
@Mr.Alien Oops! Google Chrome could not find ip :<
 
@dragon112 that was bot a real url, just a pattern which i was lukin for ;)
 
@Mr.Alien I know.
 
replaced ip with the real ip and username with the real cpanel username
 
But SO chat told me that it's a real url
so I clicked it
but it wasn't
 
1:26 PM
@AlmaDoMundo Sorry, didn't see your answer there. :P
 
@dragon112 ohhh, yes, their regex failed :p
 
SELECT * is nearly always wrong when trying to optimize queries.
 
@Mr.Alien no, XRI is not what http://~foo/site is
 
@tereško than :-/ ?
 
@SweetieBelle I disagree. In some cases it helps performance
 
1:27 PM
@SweetieBelle where?
 
@AlmaDoMundo That SQL question.
 
@Bracketworks yes yes :D
 
@dragon112 It never helps performance.
 
@Mr.Alien It's a Unix convention; read the Wiki.
 
1:28 PM
@SweetieBelle It does on REALLY high traffic websites. Caching is pretty cool then
 
URI           = scheme ":" hier-part [ "?" query ] [ "#" fragment ]
hier-part     = "//" authority path-abempty
                 / path-absolute
                 / path-rootless
                 / path-empty
authority     = [ userinfo "@" ] host [ ":" port ]
userinfo      = *( unreserved / pct-encoded / sub-delims / ":" )
unreserved    = ALPHA / DIGIT / "-" / "." / "_" / "~"
his is the part of RFC that would describe that URL
 
@Bracketworks in office, I just booked marked that in my cell, but I did gave a read, turns out it's a unix stuff
 
@dragon112 SELECT * does not help performance on high traffic websites unless you actually need to cache the contents of every column (this is rare, usually some columns are only used as foreign keys or as internal comparison operators).
 
@tereško where did you got that, any article you picked up that from?
 
1:31 PM
@SweetieBelle SELECT * FROM categories <-- has id and category_name columns
 
@tereško thanks again :)
 
@dragon112 That's a fringe case but sure
@dragon112 I did say nearly always. :P
 
Yea, when SELECT * yields 28 columns, you're doing it wrong.
 
@SweetieBelle Yeayea, I just wanted to sound smart. Can't you even give me that? :p
@Bracketworks That means your db isn't normalized :p
 
@dragon112 That's not necessarily the case, however it can mean that.
 
1:33 PM
A lot of developers, even very good developers, know very little about RDBMS and how to optimize queries.
 
@Bracketworks That's true. I should say in many cases that's the case.
 
Moreover, sometimes database de-normalization is a strategy.
 
I deal with tables that have 400,000,000 rows. We have to have good queries here. :P
 
"SELECT * FROM `lots_of_rows`"
// ...
echo reset($rows)['one_column'];
 
1:34 PM
@dragon112 Quite often 3NF is not the best database for optimization, it's the best database for logical readability.
Another database pet peeve:
 
@SweetieBelle Logical readability = optimization in many cases. If a dev doesn't understand what's happening in the db he can't optimize the queries very well.
 
SELECT * FROM `some_table`
WHERE `unique_id = 5`;
 
Or write good queries to begin with
 
^ This makes me cry
 
That shouldn't happen. in 99.9 of the cases
 
1:36 PM
i hate applying online
 
@SweetieBelle What's wrong with that? Apart from the *
@CarrieKendall Have you quit yet?
 
@Jimbo
SELECT * is wrong with it
 
@SweetieBelle here is one for you ... ORDER BY RAND() LIMIT 1
 
Ah, okay, just the all
 
So is lack of LIMIT 1
 
1:36 PM
@Jimbo nope, going to get another beforehand
but tough pickin' for the LAMP stack where i live
everything is .NOT
 
@tereško I smell a timeout happening.
 
@tereško Eww :D
 
@SweetieBelle You are doing it wrong if you have to use LIMIT 1
 
@CarrieKendall Oh wait, you're not UK are you
 
@dragon112 If you're selecting a unique row, you should always use LIMIT 1.
 
1:37 PM
@Jimbo i have seriously considered moving now :[ that's how bad it is
 
every time I see that way of selecting random row, it makes me want to defenestrate the author
 
@SweetieBelle Oh yea for optimization :p
 
Anonymous
@tereško didn't you used to tell people not to use RAND()
 
@tereško +1 for defenestration.
 
@tereško Me too, that's one of my pet peeves. :P
 
1:38 PM
I was thinking purely functionality
 
@tereško I had to google that word, and you're from Latvia.
 
@Simon_eQ You shouldn't use RAND() ever. It's horribly inefficient.
 
fml
 
@Jimbo even google translate doesn't know it lol
 
1:39 PM
@Jimbo HAHAHAH
 
@tereško Another particular pet peeve of mins is people who don't use FOREIGN KEY constraints on their FKs.
 
What is the best way to select a "random row" from a table; I assume there's multiple strategies depending on row-count, etc.
 
well .. there is also "every primary key is called 'ID'", which makes me flinch ... but most of people do not share that one
 
@Bracketworks Meta data helps.
 
@SweetieBelle Elaborate?
 
1:42 PM
@tereško I personally dislike it, but it's not among my top few.
 
 
@HamZa now I have to star it.
 
@HamZa What if there is no id = 4 row?
 
@Bracketworks lol
 
@tereško I share that to some degree, however I've see too many arguments for surrogate keys to really go against the grain.
 
1:43 PM
@Bracketworks read this: stackoverflow.com/a/9946238/727208
 
@dragon112 you get empty result lol
 
@HamZa Then you are f-ed in the a:)
 
user895378
@Bracketworks +1 for gratuitous defenestration usage.
 
@tereško Great answer
I was typing a much simplified version.
 
@rdlowrey It's a funny word; at first glance, I find you immediately associate it with disembowelment, or something equally horrifying, merely by the way the word looks.
 
user895378
1:45 PM
@Bracketworks lol you're right.
 
@Bracketworks I use this usually:
 
En architecture et construction, une fenêtre, châssis en français canadien, est une baie, une ouverture dans un mur ou un pan incliné de toiture, avec ou sans vitres. Sa différence avec la porte réside dans le fait qu'elle ne descend pas jusqu'au sol mais jusqu'à l'allège. Dans le langage familier le mot fenêtre désigne de façon générique les diverses menuiseries permettant de fermer la baie. Fonctions Une fenêtre assure plusieurs fonctions pour le local concerné : l'éclairage, la vue intérieur-extérieur ou vers l'extérieur seul, l'aération, auxquels s'ajoutent parfois la commu...
@tereško I like that.
 
@Bracketworks I will assume that you are not afraid of heights and are not aware that glass in real life does not break like in movies
 
SELECT `some`,`bunch`,`of`,`columns`
FROM `table`,
(SELECT FLOOR(MAX(`table`.id) * RAND()) AS randId FROM `table`) AS someRandId
WHERE `table`.id = someRandId.randId
 
well .. the original question was a bit more complex then "select one random row"
 
1:47 PM
@tereško True fact; disembowelment is completely plausible, especially post-impact.
And for the record, I am aware how glass breaks; refer to my nose in the avatar to the left of this message.
;-)
 
You guys ever work with Cassandra?
 
@Fabien Yea, she's at the front desk. Nice gal, sorta quirky.
(had to be done)
 
I am following this tut for SCORM vsscorm.net/2009/05/31/getting-started-the-rte-frameset , from the post does it means refering to the index.html page and opening it in a frame is a scorm player, please let me know if anyone played with SCORM earlier?
right now I am working with SCORM player in php
 
Damn this user is crazy ...
He added the tags so that it corresponds his answer
 
Wow that's bad
 
1:57 PM
Writing (yet another) JSON serializer: should I escape forward slashes or not? What do people generally prefer?
 
@HamZa Good one
 
@HamZa Fixed.
 
@Bracketworks ah lol thx
 
mmm ... today's lunch is solyanka
 
2:07 PM
Wow, this guy REALLY doesn't understand how locking works.
He thinks a SELECT statement prevents the operation of another SELECT statement.
 
Ah, nothing like the panic that ensues when you lock a major DB for a live site.
 
@Fabien Most modern db engines have very good defaults for locking.
 
@Fabien Ah, just drop it all and start again
 
2:26 PM
ctrl+alt+del
 
I don't know, whenever something is wrong with anything just press ctrl+alt+del
 
since I'm under linux, that's useless for me :p
 
I don't care just keep pressing those buttons till the problem has been fixed
That's what we call debugging:p
 
@Mokkun
 
2:30 PM
i need to be root so problem'd be solved
 
Well I'm going home, see you guys next week!
 
@dragon112 have a nice weekend then, bye!
 
@dragon112 did you see the different cuts?
 
@AlmaDoMundo actually, it works on most NIX'es
 
@dragon112 they also sell dragon meat thinkgeek.com/product/1144/?srp=2
 
2:43 PM
Hey, I have a php page with a mysql request, I load this page with XMLHttpRequest, I'd like to do a count on my MySQL request to show it on my main page, how can I retrieve the variable with count from the page with my request on my main page?
 
@tereško in general. i've configured system that it does not works :p
in my case, init 6 is required :p
 
@Gordon Busted
 
@Mokkun with php
 
but now, i'm going home, see you next week!
 
@tereško yeah?
 
2:46 PM
what have you tried ?
 
I like this ^^^ new teresko
 
I tried to put it in a variable, and to load that variable on my main page
didn't work
 
@Mr.Alien I hope you are aware that this sentence is banned in main site.
 
@tereško am kinda bored reading that, but that comment is common with users under 1-2K, even I used to comment ;)
 
@SweetieBelle Modern DB engines?
 
2:48 PM
@Mokkun XHR request see the output. Just because you assign a variable, does not create an output (unless you cause an error/warning)
you have to output the result to read it via XHR
 
@Bracketworks $bar->addFoo(new LazyFoo(function () { return new ActualFoo(); }));
 
2
A: Better way to retrieve data

griffinIf you want to do algorithmic evaluation of your data in your application code (which I think is the right thing to do), you should not use SQL at all. SQL was made to be a human readable way to ask for computational achieved data from a relational database, which means, if you just use it to sto...

Would you add anything to my answer?
 
3:04 PM
@SweetieBelle "stop concatenating queries and learn what prepared statements are"
 
@tereško Ahh yes.
 
That is configuring, not programming. Unless you also call setting the timer on your oven programming ;-) — PeeHaa 4 secs ago
 
We're up to 4 pinned messages again. Sigh . . .
 
@igorw Funny you say that; I was just about to ask a further question about it ;-)
 
This should be pretty cool when it's ready: thephpleague.com
 
3:15 PM
@Fabien Eh, I think it's not really going to be a big deal at all.
 
But I think that solves it; thanks @igorw :-)
 
Maybe a few people will clean up to to meet the 'standards' but most good projects already have most of that stuff.
 
@LeviMorrison At least it'll be a place to find the best though
 
@Fabien No, it just means they've been accepted. I promise we'll have bad projects there that meet the standards.
 
Really, the PHP ecosystem is brimming with disparate sub-communities that follow their own standards; only when core begins enforcing behavior is it going to find it's way into Bob's Big Framework ,and Timmy's Shitty Webpage.
 
3:18 PM
@tereško Actually, I feel bad for telling him to use prepared statements there because he's just passing in a parameter from an internal query, not user defined variables.
 
For instance, how on earth is there a Twitter (WIP) on the list? It's a work in progress for crying out loud!
 
It's Phil Sturgeons site though, him and others.
 
@Fabien So?
 
Fairly reputable
I understand that everything is subjective but it's not really a bad thing.
 
More like fairly repudiable.
 
user895378
3:21 PM
@Fabien I don't agree with that even a little bit.
 
I agree with your disagreement.
 
If it was named "List of packages that meet some minimum standards" that would more accurately reflect what it is.
To be in a League of Extraordinary Packages should be quite an achievement, but their requirements are far too easy to be such a thing.
 
So the problem lies with their standards being too low?
 
No, even if such a league really existed I'm not sure it would really benefit the community.
 
Or they're not the right people for the job?
 
3:24 PM
For instance, PHPUnit isn't on that list but it's one of the greatest pieces of PHP software there is. And it doesn't need to be on such a list because everyone knows it and recognizes it.
 
The site is still in development
 
My question is: how does that list help the community?
 
user895378
@Fabien It's more of an "Anyone who thinks they're qualified to dictate what everyone else should do almost certainly isn't" situation.
 
user895378
For example Phil Sturgeon worked on CodeIgniter for years. That thing is a horrific example of how not to write code.
 
heh true
 
3:27 PM
At least he has the sense to not put it on the list.
 
What about the principle idea behind the site?
 
1 min ago, by Levi Morrison
My question is: how does that list help the community?
 
22 hours ago, by ircmaxell
http://www.thephpleague.com/ I love the concept. I hate the elitist attitude. Can't we all be reasonable and inclusive?
 
@Fabien Another online circle-jerk?..
 
@LeviMorrison That's partially what I am trying to understand. From my limited perspective a resource for high standard packages was a good thing.
Maybe I am wrong, that's fine, I am just learning as I go.
 
user895378
3:29 PM
@Fabien But their "standards" are arbitrary, subjective and have little bearing on code quality.
 
So the subjectivity of the standard is the issue.
 
And standards that are inclusive to work-in-progress are pretty loose; sounds more like back-scratching.
 
is there a php function which performs the same operation as line 2?
$int = 10;
$percent = (10 * $int) > 100 ? 100 : 10 * $int;
 
Do you think that someone should set a standard or leave it solely down to the person using the package?
 
@Fabien Even if their standards are higher, how does that help the community?
 
3:32 PM
@Fabien I think the platform or language should set the standard, or at least a precedent.
 
@Bracketworks Then don't look inside any PHP infrastructure projects >.<
 
Isn't that something PHP gets hammered for?
 
@an1zhegorodov php.net/min
 
Honestly, I don't care how high your standards are; if you don't actually follow them it doesn't matter. Look through some of their packages on GitHub and they violate some of the very same requirements they dictate.
Or at least dictated before the site was updated to remove the list of requirements
 
@LeviMorrison And that's the problem; we have a sea of disparate pseudo-standards, idioms, conventions, etc.; by enforcing many of these behaviors natively, we lose the opportunity to fuck it up.
That's a great opportunity to lose if you ask me.
 
3:35 PM
Or set up everyone for failure if you pick the wrong standards, idioms and conventions if you screw it up in core.
And that's precisely why I'd recommend against such an approach.
 
@LeviMorrison Sure, but at least now everyone else is screwing up similarly.
 
@Bracketworks That's not a good thing lol
 
Well, similar looking garbage (while it is garbage) at least reduces the mental load.
I'd rather work with convention-adhering poop across the board, than 12 more ingenious but different strategies.
But perhaps that's where we differ.
 
user895378
Also, I get really annoyed because people just assume it's better to follow these "standards" and submit PRs like this:
 
user895378
3:38 PM
> Removed submodule strategy. Composer now loads all dependencies. This is good for many reasons.
 
user895378
Uh. No. It's not better for many reasons. Don't roll up in my repo and change the fundamental structure. It's a lateral move.
 
@Bracketworks I'd rather we leave ingenuity open than set a standard and fail to spot a better solution. Let the standards which achieve adoption on merit succeed, not the ones core like best at the time.
 
Another characteristic of good packages comes from the maintainers: how do they respond to genuine criticism of the package? How can you even hope to quantify and measure something like that in a list of moderated packages?
 
If you want to be forced into a thinking paradigm, use a strict framework.
 
user895378
@SweetieBelle That's the problem: these "standards" are the strict thinking paradigms propagated by frameworks.
 
3:41 PM
Libraries for everyone! We need more libraries and fewer frameworks. But this isn't new, so newer 'frameworks' just started calling themselves libraries.
 
user895378
It's a bunch of framework shills sitting around being dictatorial. Um excuse me, but your framework is crap, so I think I'll pass.
 
@SweetieBelle I agree that there are a number of userland conventions which should not be strictly enforced by the language core, but autoloading (for instance) is something that should be standardized in core; not left to different bodies.
 
@Bracketworks Disagreed.
100% disagreed.
 
I know, it's a touchy topic.
 
3:42 PM
@Bracketworks Totally disagree with that, who gets to pick which of the 'OK' answers becomes the standard?
 
One of the really nice things about PHP is its flexibility. We don't need to take that away by creating these standards.
 
FRIDAY \o/
 
Standards are good within companies and organizations. Outside of that their usefulness goes down.
 
@rdlowrey is the code standard for Auryn 'true', 'false' and 'NULL' with that capitialisation?
Or can is 'null' also acceptable?
 
NULL always capital, dunno about true and false. Personally I upper-case all of those.
 
3:44 PM
@SweetieBelle Doesn't matter; popular opinion; PSR-esque. The point is, when you don't leave ends open, people won't abuse them.
 
user895378
@Danack I prefer TRUE/FALSE/NULL. If I see other derivations I'll change them manually but I can't be bothered to automate it.
 
And I don't think formally the A-team projects have a coding standard because at this stage they don't need one.
They might not ever need one.
 
I use true, false and null.
 
me too
 
I think the one standard we might agree on is the usage of verbs, adjectives and nouns in method names.
 
3:46 PM
I used to prefer upper case - but I realised that it may be better to use standard spellings across different languages, and javascript has them lower case.
 
first() vs getFirst()
 
@LeviMorrison I agree, but that's something that cannot of course be enforced.
Er.
 
user895378
@Bracketworks What? You don't want to write stemming code and english grammar dictionaries to enforce grammatical naming standards!?!?!
 
@rdlowrey Fuck it, I'm halfway done.
 
user895378
What a misguided cluster-f* that would be :)
 
3:47 PM
@Bracketworks Pretty sure it could be enforced if you really cared enough.
 
E_METHOD_GRAMMAR `get_implicit` is ambiguous; did you mean `get_something_implicitly`?
 
@LeviMorrison I tend to use a $object->get($property) magic function for that. :P
 
@LeviMorrison Yea, not enough vertical rhythm
 
user895378
@Danack I'm not sure I want to implement the heirarchical dependency templates. I feel like they add a lot of complexity in order to make using the container as a service locator easier. I'm still on the fence looking for non-SL use cases, though, so the opinion is not set in stone.
 
Hello all!
 
3:51 PM
@SweetieBelle Some would consider that an abomination >.<
I'm still on the fence on that one.
 
@LeviMorrison For getting protected properties, I like it as it allows the object to control access.
If I have a method called $object->getSomething() it's probably either doing a database pull or calculating something.
 
user895378
So why add the misdirection of magic? Explicitness is always preferable.
 
@rdlowrey Ok - so how do you solve the problem of having different 'config' for classes far down in the constructor hierarchy? Or is that just a problem you don't think Auryn should be solving?
 
@rdlowrey Simplicity, I don't want 30 getSomething methods if I don't have to have them.
 
user895378
@Danack Basically the latter.
 
user895378
3:54 PM
DI is simple. If it gets complex then there's a problem in the design.
 
I don't think $tom->get('age'); is inexplicit.
 
Why not just use __get magic and do $tom->age?
 
@LeviMorrison I didnt know that was possible o.O
 
/retreats into hide-out chat room
 
You can do that with protected properties?
And then within __get set conditions on access?
 
3:55 PM
@SweetieBelle __get applies to any property not found.
 
@Bracketworks And also inaccessible.
 
Sorry, meant "not found in the calling context"
$data->tom = 'is a wanker';
 
You can utilize it to give public read access to protected and private values but not grant write access.
 
user895378
FWIW IMO you should throw if the the property doesn't exist, not return NULL.
 
@rdlowrey Yea, depends on the use case, but I'd agree 90% of the time.
 

« first day (1035 days earlier)      last day (3910 days later) »