« first day (1278 days earlier)      last day (3661 days later) » 

1:00 PM
@DaveRandom Yeah, I fuck things up on "other" repository, clean it, and commit to origin after.
> + c205526...fffe204 master -> master (forced update)
YES.
 
@RonniSkansing have you seen: flickr.com/photos/ircmaxell/10524737154
 
> Files changed (114)
 
@ircmaxell nope, thanks =]
 
@bwoebi Yes, yes I did. I am of the opinion that it would be better to get it in so people can start using it and then cleanup can be done afterwards. However I am in the minority there (as evidenced by vote result)
 
I like it
 
1:01 PM
One commit per task/feature is bad, m'kay.
 
@TOOTSKI one commit per significant change
 
@TOOTSKI git reset HEAD@{number} where number is the one you find in git reflog and force push again :>
 
    Hey guys - super quick question (and I'm probably just in need of more coffee in order to figure it out). I have a specific algorithm, transforming the following:

100.00 =     1
 10.00 =    10
  1.00 =   100
   .10 =  1000
   .01 = 10000

    What's the algorithm for this? As of now I have the following horrendous piece of code:

        ($x < 10 ? ($x < 1 ? ($x < .1 ? ($x < .01 ? 10000 : 1000) : 100) : 10) : 1);
 
1 / $x * 100
@h2ooooooo ^ should do the job…
 
1:05 PM
@ircmaxell no, it always works^^
 
I hate order of operations. Please use parenthesis to clarify when ambiguous like that
(1 / $x) * 100
 
Looks like... bwoebi knows shit.
 
order of operations is simple: always left to right
 
left to right as usual?
 
lol
 
1:06 PM
Apart from ** of course, where people made the genius decision of completely fucking with the order ;)
 
@bwoebi Yeah, that's perfect. I just couldn't wrap my head around it. Thanks a lot! :)
 
@NikiC yes, but doesn't alleviate grouping concerns
 
@bwoebi Beaten, but not stirred.
 
@h2ooooooo but 100 / $x would have been better…
 
Agreed.
 
1:12 PM
I have a Java Doclet that produces a JSON file (usually more classes than in this one). A PHP script produces the wiki markup (sample). This PHP script is currently in development, but it's ugly code because of all the strings and arrays. Does anyone know a clever strategy to produce the pages and to organize the code in such a script?
 
Anyone have a Vimeo Plus account?
 
@ircmaxell not a big fan of superfluous parens, personally
I only put them on bitwise ops usually, cause that's the only place where prec is not commonly known
 
Superfluous parens would be (((1 / $x)) * (100))
 
@salathe both are.
@NikiC and around assignments in if constructs to shut up the compiler…
 
@bwoebi that's only c
not gonna do that in php
and not a fan of that warning for c either
 
1:15 PM
@bwoebi I beg to differ. ;)
 
and yes… on ternaries we put parens too...
 
@NikiC I am when they enhance readability
 
@ircmaxell Just saying that people have different views on what is readable there ;)
I get confused by too much lisp.
 
@NikiC Do you think it harms readability to do (1 / $x) * 100?
 
@ircmaxell yes. Because you should write 100 / $x.
 
1:18 PM
@ircmaxell Personally I would prefer like this because that's how your brain (probably) learned to function in math class.
 
@ircmaxell what @bwoebi said
 
@bwoebi ($x / $y) * $z, better?
@TOOTSKI which is my assertion
 
@ircmaxell no. just write $x * $z / $y which is just as readable.
 
@bwoebi disagree on the "just as readable" side, which is the entire point of the discussion
 
@ircmaxell erm. Mine is more readable I meant.
 
1:20 PM
(($x/$y)*$z)
 
@bwoebi If that's the case, then ($x * $z) / $y is even more readable. Based on my assertion at least...
 
@salathe E_NOT_SUPERFLUOUS_ENOUGH (((1)/($x))*(100))
 
@DanLugg supersuperfluous!
 
ultrafluous?
 
not quite...
 
1:21 PM
gigafluous!
 
@ircmaxell that's your assertion… Agree to disagree?
 
@bwoebi do you think ($x * $z) / $y hurts readability?
 
I'll agree that @bwoebi is in the minority when it comes to considerations of readability. :)
 
@ircmaxell well… it's just superfluous. I have to read more code to just understand the same in a same amount of time. It just feels natural to read left to right.
 
@salathe :-D
@bwoebi so you don't feel it hurts readability (at least significantly). I feel it helps (significantly). Therefore, the compromise would be to do it, since it doesn't hurt you (significantly) but it does help me...
 
1:26 PM
@salathe I like to have my own opinions…
 
Which you're totally entitled to... even if they're wrong.
 
rotfl
 
Wroooooong.
 
@ircmaxell depends. The deeper parens are nested the more it hurts…
 
1:27 PM
@salathe you forgot to finish your sentence. "... in some rare cases"
 
I'm pro parenthesis. I am almost irked without them.
 
@bwoebi I'm not talking about ((($x) / ($z)) / ($y))
 
@ircmaxell He's the best.
 
7 mins ago, by Dan Lugg
@salathe E_NOT_SUPERFLUOUS_ENOUGH (((1)/($x))*(100))
IMHO, even superfluous parenthesis don't often hinder readability to such a level that it'd warrant mention/change.
 
@ircmaxell I'm talking about real code where there might be more parens… like ((size_t)func((void *)((size_t)addr + size * 8))) + 1 … adding here parens around size * 8 would just make it harder to read
there are already so many parens… adding more parens just helps confusion…
 
1:31 PM
@bwoebi then you should extract that out to a separate line to clarify
 
@bwoebi Disagree. The first thing my brain did when it encountered that expression was a rewind
 
the problem there isn't the extra parenthesis, but simple density of operations in one line
^^ Give that book a read. It'll completely change the way you view code, readability and how to write it
 
^ I can 100% agree with this. That book is probably my biggest text influence.
 
@ircmaxell there are not so many operators… Just many operators which need parens to match precedence…
 
@bwoebi ummm... you're casting an address to a size_t, then adding an amount to it, then casting it to a void pointer, calling a function on it, casting that return to size_t again, and then adding 1
that's a lot of things to be doing in one line
 
1:35 PM
usually when I read code I don't look at the type casts… they're usually just there to tell the compiler that we're doing legal things
 
they are for humans
the compiler will compile whatever
 
@bwoebi Any fool can write code that a computer can understand. Good programmers write code that humans can understand. - Martin Fowler
 
@JoeWatkins I hate it when compilers complain on the types for printf ...
these are just technical typecasts…
 
user895378
morning
 
yeah, but it compiles it all the same, very rarely will something like that prohibit the compiler from creating objects from whatever you have written, even if it's wrong, they'll exist ... parens are rarely for the compiler, they are actually for humans ...
moin @rdlowrey
 
user895378
1:38 PM
@ircmaxell your recommendation to read Code Complete revolutionized how I write code about 2 years ago :)
 
@rdlowrey gerd mernern errderrlerrer
 
@rdlowrey is the revolution over, and you've gone back??? :-P
 
user895378
@ircmaxell Nah, I just was thinking out loud about how I've been benefiting from room 11 for over two years now :)
 
Ah, just checking :-)
 
hi all
 
1:40 PM
@HimanshuJoshi not yet, working on it ...
 
user895378
Code Complete definitely wields more influence over how I write code than anything else I've ever read.
 
@rdlowrey have you ever read GEB?
 
user895378
@ircmaxell I've had the ebook sitting around in my queue forever but haven't gotten to it.
 
user895378
Should I bump it up to the front?
 
that one changed not just how I write code, but how I think about it
 
1:42 PM
i have to make a webservice in PHP, that will send me the list of file name that are in particular folder in server
@JoeWatkins ??
 
all of this functional OOP stuff I've been pushing on about is almost a direct decendant from me reading that book
and I never realized that until right now...
hmm...
 
So write it already :P
 
I haven't read a book for ~ a year ...
 
If I get my leg surgery I plan on reading while I am there. Assuming I stay a night or two.
 
/me is out ... lata
 
user895378
1:44 PM
@JoeWatkins later
 
laterz
 
yeah must get some books together .... lata ...
 
user895378
@Ocramius Well TBH the only hard deadline is the PHP 5.6 release. Most of the SSL/TLS things I did for 5.6 were specifically done because I needed them for the server. At this point I've ripped out many of the extraneous features in order to lock down the essentials -- I realized all the "extras" were preventing me from finishing. Anyway ... I hope to have something by the end of next week you could use.
 
@rdlowrey what for extra features?
 
user895378
1:53 PM
Things like reverse proxy and fast cgi support, server "mods" like request rate-limiting, logging, etc.
 
user895378
Those are all useful things, but they can be added after the core functionality is complete.
 
user895378
So I'm just trying to "compartmentalize" and finish the highest priority things first.
 
How easy is it to put mods on top of Aerys?
 
user895378
You can attach callable "mods" at several points in the request-response cycle. Also, applications are nothing more than callables, so you could chain several callables together to mutate requests/responses however you like.
 
user895378
So, to answer your question: easy.
 
2:03 PM
@rdlowrey And what's when I need to prioritize some callback over others? (because of side-effects: e.g. I have a callback which modifies request for further processing and a logger which wants the raw request to store) And the dumb user doesn't want to care about order.
 
user895378
@bwoebi mods have a priority 1-100. Default is 50. Any registered mods are ordered by priority when registered.
 
Hard not to make that my wallpaper.
 
@rdlowrey nice :-)
 
user895378
2:05 PM
@DaveRandom "I hate to, but may I? May I?"
 
@rdlowrey I cannot read that word without thinking of that sketch
> Hold the newsreader's nose squarely, waiter, or friendly milk will countermand my trousers.
 
user895378
English comedy vs American comedy ... I'm ashamed of my culture.
 
@Fabien bastard... It was cloudy here in NYC
 
@rdlowrey Meh, most of ours is terrible these days as well. Besides, you do have some genius comedy writers, Arrested Development is still one of my favourite shows of all time
 
user895378
Arrested Development was amazing.
 
2:13 PM
Plus most of the world thinks Hugh Laurie is American, even if they aren't aware he's a comedian
 
@webFarto
 
@DaveRandom property names.. numeric? like 1, not '1' ?
 
@AlmaDo '1' is numeric
They can't be stored as integers
but var o = {}; o[1] = 1; works just fine
 
ehm.. I mean it can not be numeric literal
well, didn't know that. As far as I remember it failed for me
@DaveRandom but will we be able to define them like {1: 'foo'} ?
(/me can't check it now)
 
@AlmaDo Yep, works just fine, actually {01: 'foo'} works fine as well
 
2:25 PM
ok, I will notice that
 
@AlmaDo beware of that though, {077: 'foo'} is octal
I think that one thing that gets people confused about this is that it's not valid JSON
 
ah, well, I thought it's syntax error to use plain numbers there. If that's octal for 0-started property names - it's out of the issue :)
yeah, may be JSON is the reason
 
@iroegbu yo
 
hmmm
I do my VCS without any plugins
 
oh
I made my project now locally
it's a bsic setup
but I would like to have it on bitbucket
 
2:40 PM
CLI - that's the way to go
 
So I have to remote add origin
Should be more easy for me to do it via CLI.
 
yep yep
if you aren't comfortable with that PhpStorm already has those
 
to set the project to bitbucket I have to. ... push it to the master
 
I love this video
 
2:47 PM
user image
5
@ircmaxell That's a shame. Would've been a great shoot for you.
 
@Fabien what do you mean?
 
@ircmaxell I enjoyed the one for Unit testing too
 
@iroegbu everything Misko did is quite good
 
@ircmaxell the blood moon
 
@Fabien Ah yeah. Too bad it would have taken hours... It was from 2am to 5am here...
 
2:55 PM
hmm
I am currently @ my project but I want to add it to my bitbucket repo
 
Ignore -_-
 
user895378
@ircmaxell Agree. That video is a classic.
 
2
Q: Find which one of the WHERE clauses succeeded

user3200085I have a query where I use an OR after the WHERE like this. SELECT * FROM blah WHERE id='$id' OR name='$name' The query is successful but I need to know at made the query successful, the id or the name. Is there a method that can do this?

Hmm, interesting question.
 
@Duikboot when you create repo in bitbucket there is a short tut on how to migrate your work from your local machine :p
 
Yes there, I followed that tutorial but only the readme is showing up I just find out that my silex folder was not synced
But i did but still it's not yet there.
oh now it is :)
Awesome.
 
3:02 PM
o/
 
\o/
 
/o\
 
/o
 
@iroegbu I tried sharing my repo with you, did you saw a message of that?
 
3:08 PM
nope
bitbucket or github?
 
Bitbucket
usrname iroegbu
 
Kill me now :(
 
@Duikboot seen
 
Allrighty
 
@Fabien bang
 
3:15 PM
@Duikboot on a side note: don't use twig :|
 
@iroegbu What's wrong with twig?
 
correction: don't use any 'templating engine' what so ever
 
^ +1
cv-pls: Docs, Backlog | Tools: Explain, phpdbg, devdocs.io | Addons: [cv-pls], PHP Manual Linkifier | Snippets: ext/mysql | Reference: QAs
12
 
@rdlowrey yeah, got that clarified by the peeps here, thx :)
 
3:31 PM
@Duikboot what in Christ's name are you doing here?
 
oh I was trying to learn it from the fapbot exmaple
 
Hi guys...
 
if you have 50 routes, what will that file look like?
 
I'm having array like this
I want to convert it into this
 
@Duikboot that's not how autoloading is supposed to work
 
3:34 PM
any idea....?
 
try using php, @CJRamki
you can even use a foreach loop
 
@CJRamki yes.
 
any sample?
 
foreach ($array as $item) { /* your code goes here */ }
currently you are giving the impression that you are just another incompetent developer who's partly to blame for all Indian developers having reputation of incompetence, unwillingness to learn and backsourcing all the work
 
error_reporting(E_INDIAN);
 
3:42 PM
within foreach i should check the orderID and push into new array. right?
 
@Jimbo sigh
You will be blamed in E_RACISM.
 
There's an E_RACISM room?
 
I doubt.
 
learn to use the magical var_dump($anything); function, @CJRamki
 
@tereško do you have a reference any of your best "Why CI sucks" replies?
 
3:47 PM
Oldest open PHP bug report I could find: Parameter for dns functions to select different DNS
 
I really need one now :D
 
It dates back to 1999.
 
@tereško You are right but don't blame all developers...
 
@Ocramius no , I usually just use code
 
:D
 
3:49 PM
@Ocramius you code always just google "codeigniter tereško"
 
@tereško yeah, that gives me links to some silly "UNION" query things
 
Indian educational system is just theory oriented...
but you peoples doing project while you are studying...
 
actually, it is "memorization oriented"
 
please don't blame all Indian developers...
@tereško
thanks for your guidance...
I don't know about other developers from India... but I just come here for learn... I just asked idea to do that... I don't asked the complete code to you...
don't look into user from which country... please look into their learning interest...
 
4:06 PM
@tereško Quite an entertaining thing to do, yielded (amongst other gems) this
 
@CJRamki theory oriented means?
 
@Leri there is no live project practice in universities...
they just teach in examination view....
they don't consider our career.
 
@CJRamki You just said "I have this, and I want this". The important thing that you missed is "I have tried this"
 
@DaveRandom Well, I thought you peoples can show the starting point...
i don't ask i want code to do this...
i just asked idea to do this...
 
Well yes but "use foreach" is the only possible answer then, and if that is the answer then the question shouldn't need to be asked, because RTFM can tell you that much.
 
4:13 PM
I'm cleaning out old PHP tickets: thoughts on this one? bugs.php.net/bug.php?id=8595
@NikiC @bwoebi ^
 
@DaveRandom Hmmmm... ok...
thanks guys...
 
@CJRamki I study in the largest and the only technical university in my country. I don't even know what to call it (piece of sh*t with illiterate arrogant staff and stuff is close to what it actually is...). Do you know what causes that? Students!
 
if i said anything wrong... sorry... sorry... sorry...
 
@LeviMorrison Stupid request, IMO. Far too many question marks over how that would behave.
 
The most part of them don't realize that they pay for their education.
 
4:15 PM
@LeviMorrison That'd be initializing a temporary hashtable and assigning by ref and then pass it…
Actually feasible and looks not a so bad idea
 
@bwoebi Really?
 
Does the name call_user_func_array() bother anyone else?
 
@DaveRandom I'm serious
 
(I'm sure it's feasible, but it looks like a terrible idea to me)
It's just avoiding writing a loop, and reducing readability in the process
 
I hate it when I'm not interested in $match[0], but only $match[1]… then I could write just &list(, $match)
 
4:16 PM
Barring compat, would anyone be opposed to renaming call_user_func to call and call_user_func_array to apply?
 
@DanLugg No, because I don't use one. :D
 
@DanLugg It won't soon, because I won't be using it much if ever
$f(...$args);
 
Okay, $this->f(...$args) (if not clear, where $this->f is dereferencing a property, not a method)
Whoops!
apply($this->f, $args) vs. call_user_func_array($this->f, $args)
*shrug* Whatever I guess.
 
@DanLugg Given that this is unlikely to get fixed (which fucks me off, a lot), need to make [$this, 'f'](...$args); work
Which also sucks balls but better than cufa
 
There isn't anything to fix, at the moment.
It's by-design.
 
4:19 PM
@DaveRandom Well yea, I'd like to see the language not bork on [$a, 'b']()()()[0]
 
@DanLugg Now that one should be reasonable, but it would call a function, not a property.
 
@DaveRandom actually I'd prefer ($this->f)(...$args) work…
 
^^ Sure, that's not bad better.
 
@LeviMorrison I realise it's not technically broken, but it practically it is totally broken
@bwoebi I would also prefer than but I figured the array literal would be easier to implement
 
I'd expect at least notice here: 3v4l.org/YP6JF
 
4:21 PM
PHP Y U NOT STORE ALL MEMBERS IN SAME NAME TABLE?
 
@DaveRandom actually for the one with the parens, a patch already exists…
@DanLugg hmm?
 
class A { public $b; public function b() { } } should be a fatal.
 
no oO
 
Uh, yes.
 
No, really not...
 
4:22 PM
@bwoebi yes. See my example.
 
Very much yes.
(Something tells me this'll be an "agree to disagree")
 
@Leri we all know that only methods are accessed via direct $this->name()
 
^^ $f = $this->name; $f(); should be valid.
 
@DaveRandom I shouldn't have suggested that qoogle query
 
@bwoebi And I don't see why $this->property() should not work. Besides that ugly thing about having method and property with the same name.
 
4:25 PM
btw @LeviMorrison the solution to that DNS bug report is for someone to create a PECL extension for it, it's beyond the scope of the PHP DNS functions IMO
 
I'd like someone to cite a real benefit to property and method names not colliding, as is currently the case. I, honestly, cannot think of any.
 
@Leri just as much as static::$var() should work…
 
^^ Yes, it should.
 
any idea why the following htaccess file throws 500 server error?
 
@DanLugg I can think of a few, but none that aren't serious code smell if you need them
 
4:27 PM
#Deny access to batik dir.
<Directory "/batik-1.7">
DENY FROM ALL
</Directory>
 
@DaveRandom Do they involve __call?
 
@DaveRandom I did that...
 
@billmalarky Check the error logs, should give you a clue what the problem is
 
checking
 
@DanLugg That, and dynamic hydration of business objects by DB layers
 
4:29 PM
i get "<Directory not allowed here"
so does that have to be nested in something?
 
@DaveRandom There's plenty of other ways to manage that.
 
14
Q: htaccess <Directory> deny from all

KeverwI've been cleaning up my project lately. I have a main .htaccess in the root directory and 6 others. 5 of them ran Options -Indexes which i didn't see anypoint of allowing any Directory viewing so moved that to the main one. so now i only have 2 .htaccess files. the main and one in /system which ...

 
@tereško Good question but belongs to codereview
 
gotcha
 
4:31 PM
@tereško Yea, that's kind of a "AM I DOIN IT RITE?" question
 
fuckin bad tutorials online... I mean COME ON
 
/me is going out to get drunk
lataz
 
@billmalarky lol, welcome to the internet.
Bye @DaveRandom
 
@billmalarky Stop reading tutorials. :)
 
4:33 PM
Eh I don't like to ask questions from ppl without checking it out online myself first, and reading actual documentation takes to long for something simple I just need a snappy answer for :=P
aight thanks guize!
@tereško last time I dropped by here you had left, glad to see you're back.
 
tnx .. i guess
 
user895378
Docroot -or- DocRoot ... don't think, just answer.
 
4:49 PM
please answer to @rdlowrey! It's an essential question!
 
DocRoot, imho
 
5:27 PM
docroot
 
Kittens
 
docroot, but in the shape of a kitten...
 
^ that
 
mooooooorning
 
@ircmaxell ah, something where you agree with me :-D
 
5:37 PM
so which idiot revoked the SSL cert for wiki.php.net and then didn't put the real one in place?
hah, even worse, it's a wildcard cert...
 
That's still not fixed? :\
Nope.
 
So you are looking to grab the value inside href and src ? — Shankar Damodaran 1 hour ago
 
evening guys.
can anyone tell me how its like the php developer market at the moment
 
no
 
are you in the industry
 
5:50 PM
I'm totally in the industry but that was also going to be my answer.
 
yes
 
@shine do some more searching. That question has been asked a lot of times
 
but can't get correct one
 
:) ok. if have no experience but coding for 6months can i find i job/
 
5:55 PM
Great
 
@shine had some sample code here, I think you're fine with that.
 

« first day (1278 days earlier)      last day (3661 days later) »