« first day (1439 days earlier)      last day (3506 days later) » 

3:00 PM
@CSᵠ yes
 
@ircmaxell psr-1&2 ?
 
fuck PSR
because otherwise you could seriously screw yourself up, and make code that looks correct, but isn't
 
lol, then what standard/rfc?
 
Apple learned that the hard way: imperialviolet.org/2014/02/22/applebug.html
Oh, it needs to be a standard/rfc to be good practice... I see
 
meh
I don't use braces if it's on the same line
 
3:02 PM
the reasoning is sound, but since the manual allows both, then both are valid usages, if a standard proposes/mandates it could make a difference
 
the manual also allows goto and eval
and echo $var is all over the place
but we know that's not good practice
 
user895378
@CSᵠ I believe so. A unicorn cries every time you don't use braces.
 
user895378
curly_braces_all_of_the_things.jpg
 
@tereško btw, why Yoda conditios ?
 
because does it matter?
 
3:06 PM
@ircmaxell I do think you are overreacting here. If it's on the same line, there isn't really a danger for goto fail style bugs. I still wouldn't do it tho
I reserve brace-less ifs for cases where it's followed by return; break; continue;
 
@NikiC yup, typically where I use them
 
even in those cases, it's too easy to insert a line before. turning if (foo) break;, whoops, forgot to free bar: if (foo) free(bar); break;
 
especially for guard clauses...
if (!validate($stuff)) return FALSE;
if (!validate_other($thing)) return FALSE;
 
@ircmaxell sorry, must add compiler/interpreter to that :) but yeah, question is about good practices, and there are so many out there along with the ones that were before good practices and not they're not
 
personally, I try to never use braceless if statements. Too easy to screw up, and for what gain. To save 1 bloody line of code? 1 line for increased clarity and ease of comprehension
 
3:09 PM
two lines :P
 
user895378
@ircmaxell I agree. My small brain does better without special cases.
 
Ok, two lines. big whoop
 
user895378
Just do it. All the time.
 
@NikiC just 1 if you put the first brace after the if(){
 
also, don't confuse verbosity with readability.
 
3:10 PM
@NikiC I'm not, braceless (even single line) are less readable
if ($foo) return bar;

vs

if ($foo) {
    return $bar;
}
the second, even at a glance without reading it, tells you there's a branch
 
@Naruto no. it's if ($foo) foo(); vs if ($foo) {\n foo();\n }
 
@tereško's example is perfect, multiple simple if's with code blocks don't look so nice, at least to my eye
 
the first requires you to read the line to interpret what it does
not to mention if you scan for return statements, it's far easier if every statement starts a line, rather than being able to be "tacked on to the end" of another line
 
@FlorianMargaine ow, okay!
 
@ircmaxell You consider them less readable, yes.
 
3:13 PM
@NikiC studies have shown they are less readable, yes.
 
lol
 
@ircmaxell it also make the diff's much easier to read
 
I'd like to see those studies
 
I personally practice a mix of braces+braceless, and if there's code to be added i'll add the braces, no biggie
 
3:14 PM
@ircmaxell that's not a study
 
@ircmaxell I did it like @NikiC in past, but since some time I just do it like you. It's not just about readability, but because I just often have to add the braces anyway when adding other statements to the if. It's easier this way and is more consistent if everything is in brackets.
 
@FlorianMargaine it cites several, and discusses the issues around it
@bwoebi exactly
 
@ircmaxell Can you directly link to the relevant papers?
 
you guys never have to write guard clauses?
6 mins ago, by Florian Margaine
if (!validate($stuff)) return FALSE;
if (!validate_other($thing)) return FALSE;
 
@FlorianMargaine nto like that I don't. And even when I have a single line branch, I wrap it in {}...
 
3:16 PM
@ircmaxell preferably a free/open available accepted study
 
@NikiC I don't have the book handy here with me
 
@FlorianMargaine you often can drastically reduce the returns by just or'ing the conditions.
 
but... I like the returns
a big or condition is ugly to look at
 
@tereško i must disagree a bit here, if on one line also tells you the if's condition besides the code you modified, may be a plus
 
@CSᵠ no, it tells you that EITHER the condition was changed OR the statement was changed
 
3:19 PM
@tereško maybe, but that's really the least benefit…
 
Hello
 
@bwoebi ohh, of' course, or's are great
 
@bwoebi no, it's actually a very big benefit
 
@tereško may be harder to scan, but you have the WHY information too
 
@ircmaxell only if the highlighter only highlights the line and not the specific changes inside of the line.
 
3:20 PM
is list($day,$mon,$year) = explode('/', $param); something usable or would you discourage using it?
 
the problem is that automated merges can subtly break if statements without braces. And do so in a way that even looking at a diff can be really hard to spot. Using braces would make the merge issue a compile error. So even if it was hard to spot, you'd still be better off...
 
Oh that's something I want to read about - anyone recommend a book on refactoring those if statements to classes... or something like that? I remember watching a youtube video on it but can't remember what it was
 
@CSᵠ no, the "why" is EITHER ... OR ...
 
@Naruto definitely a good idea. $date[1] is far less readable than $month.
 
@bwoebi I don't know why, but I don't like it
 
3:21 PM
@Naruto I would discourage using it. Instead, I would use DateTime::createFromFormat()
which would return you a datetime instance, which better represents dates...
 
I have a question, are you guys busy
you seem to be
 
@ircmaxell Yeah I'm using datetime objects, but this code wasn't written by me.. So I was wondering if it was something I should tell him to change or not..
 
@Naruto yes, it kinda is. Also you would have to write it as list($day,$mon,$year) = explode('/', $param . '//');
 
@ircmaxell that's a really good reason
 
@Deep just ask the question, and if someone has time, they will answer
 
3:22 PM
@ircmaxell depends on what you do with it. If you just need the three vars to pass it to somewhere else, it's less clumsy.
 
@ircmaxell The reason why I'm very skeptical about your statement that omitting braces for trivial cases hurts readability is that I've written a tad of Rust code recently and I'm very certain that wrapping certain returns in unnecessary blocks clearly makes the code less clear.
 
@NikiC how does it make it less clear? Can you provide an example?
 
@ircmaxell DateTimeImmutable :P
 
@ircmaxell sure
 
@tereško talking like somebody who messed a lot with date() :)
 
3:24 PM
"Replace conditional with polymorphism"... "Move each leg of the conditional to an overriding method in a subclass. Make the original method abstract." - anyone do this with a few ifs or a switch?
 
I think Go does the right thing with if statements and just requires {} at all times ;)
 
let jmpz_pos = match backpatch_stack.pop() {
    Some(p) => p,
    None => return Err("Too many ']'")
};
// vs
let jmpz_pos = match backpatch_stack.pop() {
    Some(p) => p,
    None => {
        return Err("Too many ']'");
    }
};
// and now imagine that you have a large number of these match expressions in your code
 
@NikiC I usually assume that after an if ( the whole line will be a condition. When ever if use braceless ifs, I put the statement on the next line for better readability. (which then suffers from the goto-fail issue)
 
I have a strange error, header location is not working at all, is not redirecting anywhere, there is no any headers sent before that
 
I think there is a benefit to keeping code compact if it's simple
 
3:25 PM
@Jimbo I do it, when I have same IF repeating
 
@Stol3x what is the strange error?
 
I'm using a HTML form to save a block of text, along with some other data to a JSON file. The problem is, while the PHP escapes double quotes, it doesn't escape single, is there a way I can force it to escape single quotes, and also, if I do

`<script> var foo = <?php echo $bar> ?></script>`

will the quotes in `foo` be escaped?
 
@NikiC in that case, I think the braces are extremely important
 
@NikiC In this specific case you're right to do it that way, but in most cases (especially in PHP, where these things are all statements and not expressions), no.
 
@ircmaxell uh, why?
 
3:26 PM
@RonniSkansing is not redirecting anywhere lol
 
@Deep you need to escape much more than that
 
@RonniSkansing is that maybe because laravel?*
 
writing it with the braces would certainly be non-idiomatic
 
@Stol3x what is the error, could you put a minimal example in a pastebin =]
 
@Stol3x have you tried turning off and on again ? .. or you could provide the code example
 
3:26 PM
what do you mean @RonniSkansing ?
 
@Stol3x I would like to say yes
 
it indicates that something different is happening. That a branch is happening
 
@Deep I was guessing you where trying to avoid XSS or etc
 
@ircmaxell uh, that sounds like you'd talk about C or PHP, but not Rust.
 
@Deep Don't try to do this yourself imo. Use an existing, tested module that is aware of context-specific escaping. Something like... github.com/zendframework/Component_ZendEscaper
 
3:27 PM
@RonniSkansing all code i have is $url = 'http://example.com'; header("Location: $url");
 
I don't even know what that is. My PHP knowledge is minimal
 
otherwise, at a quick glance, it looks like the patterns all simply return a position. But with the braces, it tells your brain "wait, a branch is occuring, let me look closer" which then lets you imediately understand that there's not just one possible occurence, but two
 
@Stol3x I am sure laravel has some GlobalStatic::redirect() or somethimg, have you searched abit?
 
I just wanted the easiest solution.

Would some context be useful?
 
@NikiC then I consider the idiomatic way of doing it incorrect.
 
3:28 PM
@Deep $escaper->escapeJs($jsVal) ... doesn't get much easier than that imo
 
okay...
then keep thinking that
 
oh ok.
 
@RonniSkansing I am just wondering why native function is not working... I didn't know that is possible to rewrite native function
 
which file do I want to import? Ive never used a library with PHP before
 
so 3 things: 1. diff, 2. merge, 3. user error
 
3:30 PM
@NikiC just because a lot of people do something doesn't mean it's the best way of doing it.
 
IMO only #2 has some weight and it will/should be corrected in good time
so.. prefference?
 
@NikiC Also, there's a difference in that a pattern match isn't a statement list. So you can't just add another random statement before/after and have it compile (like you could with an inline if statement).
 
@ircmaxell In Rust these things are all expressions. And if you consider it an expression… It's like you'd write in PHP:

[
    "some" => $a,
    "node" => (
        $b + 3
    )
]

which looks weird too.
 
@Stol3x do you have any output or other headers set before calling it? Or maybe laravel sets something up before or after.. anyways it should be in laravel::manual
 
but note that you have to add an operator in there. You can't just add an arbitrary statement before/after $b + 3
 
3:33 PM
@RonniSkansing Now I tried with Redirect::to() and it works, but, header() is not... thx
 
@ircmaxell that's just PHPs language semantics which force that.
 
Guys, which PHP version are you using? Or, if you work in some company, which php do you use?
 
@ircmaxell just consider return as an unary operator.
 
@Stol3x 5.6 here and production box is 5.5.9
 
For the record, I don't have a strong preferences for leaving off braces (actually I pretty much never do it). I just think that you are taking this "issue" way out of proportion
@RonniSkansing nice
 
3:39 PM
@NikiC I'm taking it out of proportion because it shouldn't be something we have to discuss in 2014...
@bwoebi no, it's deeper than that. In areas where a single statement is all that's allowed (like in ArrayItems or Rusts pattern matching) then a number of the reasons for requiring braces all the time disappear. And I think it's fair to have different rules in those cases. I also think that the cognitive load of having an indent to signify a branch (that something different is happening) is good...
 
@ircmaxell uh, I think it got, gets and will get discussed through ages…
 
guys, we all know that the only really important CS rule is that indentation must use spaces
Everything else is inconsequential in comparison :P
 
@NikiC
 
:D
 
:P
 
user895378
3:42 PM
@NikiC We hold these truths to be self-evident.
 
Warning: include(): https:// wrapper is disabled in the server configuration by allow_url_include=0 in /home/action/workspace/www/addproduct.php on line 11

Warning: include(raw.githubusercontent.com/zendframework/Component_ZendEscaper/…): failed to open stream: no suitable wrapper could be found in /home/action/workspace/www/addproduct.php on line 11

Warning: include(): Failed opening 'https://raw.githubusercontent.com/zendframework/Component_ZendEscaper/master/Escaper.php' for inclusion (include_path='.:/home/action/.parts/packages/php5/5.5.11/lib/php') in /home/
What did I do wrong?
 
@NikiC that one I agree with :-P
 
$d2 = $_POST["desc"];
	include 'https://raw.githubusercontent.com/zendframework/Component_ZendEscaper/master/Escaper.php';
	$d;
	$d->escapeJS($d2);
 
@Deep please put it in a pastie or pastebin
 
which?
 
3:44 PM
The errors and code
 
user895378
@Deep You should never include an http resource directly like that. It's terrifically insecure. It is disabled in your php.ini file because it's a terrible idea.
 
@bwoebi it will. Because we still don't treat programming like engineering.
 
user895378
@Deep If you really want to do it you need to set allow_url_include=1 in your php.ini file. But you shouldn't. Because it's a terrible idea.
 
I have no Idea what Im doing. Any links that I can read up on?
 
user895378
@Deep what are you trying to do, first of all?
 
3:46 PM
@ircmaxell Such things should really be part of the language. That's why I like that Rust requires {} for if's etc, and instead leaves out the parentheses :)
 
Escape both single and double quotes in a string to save in a JSON file
 
@NikiC that's something that Go did as well. And python took the other road by requiring indentation
 
@ircmaxell which is the less good road, of course
 
@Deep json_encode
 
I forgot that existed.
That'll escape quotes, right?
 
3:49 PM
@NikiC I don't know about that ;-)
 
I had Delphi in school. The ifs there don't require parenthesis there too… but I've always put them there because it disturbed me…
 
Correction* I have used that
I just forgot
It wont escape single quotes
 
@NikiC what are you using Rust for?
 
@RonniSkansing nothing ^^
 
3:55 PM
@bwoebi if .. then begin :D
 
Question for you twig users, do you just hint for Twig_Environment or do you write an adapter/something else?
 
@Leigh :-(
 
and arrays [0..1] of Integer
 
uh
 
3:57 PM
=]
 
@tereško may I suggest xmonad.org also
 
@ircmaxell yea saw it on IRC, already forwarded to all our sysadmins
 
@CSᵠ what about it?
 
$d2 = $_POST["desc"];
include 'escape.php';
   	$d = (object) '';
    	$d->escapeJS($d2);
Whats wrong with this?
 
@ircmaxell interesting tiling window manager for linux
 
4:00 PM
@Deep a lot. what are you trying to do?
 
Escape all the quotes in a string ($d2) before encoding them in a JSON file

escape.php
https://github.com/zendframework/Component_ZendEscaper
 
@Deep The question is: What is not wrong with it...
 
Yes, I know that I know no PHP
 
@NikiC It isn't using any supplementary ideographic plane characters in it - which is good.
 
4:03 PM
@Deep JSON_HEX_APOS
 
I am having an issue using xdebug with a framework. It breaks because of the xdebug session param being appended to it. Any way to circumvent it?
xdebug session param being passed in url
 
get rid of the framework
 
get rid of xdebug too
 
posted on September 24, 2014 by kbironneau

/* by Juninho */

 
get rid of the idea of circumventing issues too.
 
4:08 PM
@ircmaxell thats something i cant do. its used at my workplace. all apps are build on it. its a custom framework.
 
Thanks @CSᵠ It worked
 
and therein lies your first problem
 
Will JS convert it back to ' when I do innerHTML?
 
@Deep yw
 
@ircmaxell hmm. so the only way is to get rid of it and use a framework which can do a major portion of my work currently and use phpdbg with it. Am i going the right way if i do this?
 
4:12 PM
@aaron no, because phpdbg isn't going to do what you're trying to use xdebug to do
the only way to do it, is to move off the legacy framework which is doing stupid things
 
@ircmaxell hmm?
 
@bwoebi use it to interactively debug an ongoing web system. Considering you don't support a debugger protocol yet, you can only debug from CLI right now, correct?
 
@ircmaxell Ok Thanks for your help! I think its time to have a team discussion with my co-workers.
 
@ircmaxell The functionality for that is still spread over two branches which aren't yet finished…
 
@bwoebi right. I'm not saying it won't be there. Just that it isn't there yet (for interactive debugging of web requests, or ide integration)
 
4:16 PM
(well, they already work (the debugger protocol and the taking over of web requests), but not yet all functionality in there)
 
they work in the dev branches, just not in the live production versions
 
yes
 
cool :-)
 
I'm targeting 5.6.2 for the taking over of web requests and 5.6.3 for the debugging protocol (so that I'll still have some time to make last-minute changes in the protocol when the PHPStorm guys implement it and don't like everything.) \cc @JoeWatkins
 
user895378
That joyous moment when you find and address the cause of a very pernicious bug
 
user895378
4:23 PM
\o/
 
4:37 PM
very cool
 
evening
 
$ sapi/cli/php -i | grep -A 3 OpenSSL
OpenSSL support => enabled
OpenSSL Library Version => LibreSSL 2.0
OpenSSL Header Version => LibreSSL 2.0

Directive => Local Value => Master Value
openssl.cafile => no value => no value
$
cc @ircmaxell was pretty painless
 
nice :-)
 
FAILED TEST SUMMARY
---------------------------------------------------------------------
Bug #55646: textual input in openssl_csr_new() is not expected in UTF-8 [ext/openssl/tests/bug55646.phpt]
Bug #65729: CN_match gives false positive when wildcard is used [ext/openssl/tests/bug65729.phpt]
 
4:53 PM
@Leigh the second failure is "normal"
since recently at least
 
yep, and first one is OpenBSD specific
doesn't have a [v3_ca] section in it's /etc/ssl/openssl.cnf
Only issues I had were
1) Had to upgrade bison to > 2.3
2) Had to export a couple of things for LD and GCC to pick up pthreads support
oh, and maintainer-zts just kinda fails
 
GUYS/Gals can I ask for one of you to validate my answer to my own question pretty please......
 
I have a pretty interesting question. I have a Wordpress theme that adds a whole bunch of custom functionality to Wordpress. My question is, how much work would you guys say it is to convert the Wordpress theme into an independant PHP website?
 
s/interesting/unanswerable
 
anyone out there have two minutes to spare?
 
5:02 PM
@Danack Anything in particular that you would need to know in order to give your opinion? Just want to know if it's worthwhile or better starting off from scratch.
 
@DJSquared For that type of project, I'd probably spend the first 33% of the total time just analyzing what needed to be done, and then the other 2/3 doing it - even with a reasonable specific description of what your theme does, the details will be where the time gets taken up.
 
@Danack you would have to follow all there codex unless you manually changed all of theirs. That would be a mess XD
 
@Danack And if I have a full spec document and presentation? But I get what you mean, it's always a mission picking up where someone else left off.
 
Could end up being like Apollo's first flight. If you landed you would get lots of praise for sure.
 
@DJSquared Same difference......even with a spec written, whoever does it needs to analyse what code can be re-used, what needs changing, and what needs implementing e.g. because it relies on functionality in wordpress that wouldn't be there in an independent web site.
 
5:07 PM
Alright, great, thanks. So it would probably be more worthwhile doing it from scratch?
 
@DJSquared I'm actually just about to do something similar - change a symfony 1.4 website to be not shit. Basically my plan is to spend two days setting up the tools and classes needed to 'be' a website without symfony, and see how much of the site I can port in that time. After that I'll have a much better idea of what code can be re-used, and how much time it take per 'feature'
@DJSquared Try to avoid re-writing anything from scratch if at all possible...you can always re-use some code.
 
Ah, I see. Well good luck with that! Sounds like a rough two days ahead of you. Thanks, I'll be sure to keep that in mind. I first need to find a PHP developer for the project though.
 
@Danack
 
5:10 PM
@DJSquared it really depends on which features of the system are being used.
 
@DJSquared Good luck finding a developer who's up to the task....I would suggest rejecting any candidate that claims they have to start from scratch. Even if that might be the right choice (depending on the code) anyone who says they have to start from scratch is possibly not the right person for a refactoring project.
 
@DJSquared I say Yes, because you can changes things as you go and make things better. Use there code as reference. It will take some time but time well spent. Plus you may end-up creating something that everyone wants.
 
@RonniSkansing themeforest.net/item/… - Pretty much everything in there. The listing feature as well as the individual booking. It's different as to what it lists though; It's a specific niche.
@Danack Thanks. Okay, great, thanks for the tip!
@JonathanBellavaro Well, it's not for me, it's for a client. He's planning on selling the site in the future, hence staying away from Wordpress. I just don't see the need to "re-invent the wheel"
 
Could be a legal issue if your client plans on selling something that has already been written by another Co.
 
@JonathanBellavaro No it wouldn't.
Just sell it as a managed service.
 
5:15 PM
^^^
That is by far the best advice
 
<-- goes off to check gpl2...
That would be a problem.
 
@Danack Hmm, so I'd have to go with a custom solution anyways? The reason the client prefers that is because they say they won't be able to sell the site if it's built using Wordpress.
 
can someone take a look at my post and validate that my code is correct?
 
I never knew that - what stops people from buying one copy of a theme, changing a couple of lines, and then re-selling it at a discount?
 
-2
Q: Can someone help me clean up this php mail() Function script without loosing its functionality?

Jonathan BellavaroThe html/php works great except I echo an entire html page which is horrible using heredocs. Also I am receiving one good email from the form but also a blank email at the same time when the end user is filling out the form and clicks the send button. Heres My Mark Up <? php /* Subject and...

 
5:18 PM
@Danack That's actually a pretty great question. And a great business opportunity.
 
user895378
@Danack any idea how to tell packagist to delete rdlowrey/artax? Because it won't let me do that and it won't let me add an amphp/artax package because it says rdlowrey/artax already exists :(
 
@DJSquared They could sell it - just they also have to distribute the source code.....sorry too busy to think about legal questions. There may be ways around by selling it as a service - but yeah....re-writing it would be safer.
@rdlowrey Fuck packagist?
 
@DJSquared I got a addition (wordpress.org/plugins/uninstall/) to your blog post about wordpress.. x3de.com/just-installed-wordpress-whats-next
 
user895378
@Danack I want to, but if I do that then people can't include artax easily without adding stupid repositories manually into their composer.json :(
 
user895378
packagist blows so hard
 
5:20 PM
@rdlowrey Also change the name in composer.json - that's where packagist picks the name up from I think.
 
The only thing is that ThemeForest prevents you selling themes that aren't solely your own code - According to their TOS.
@Danack Alright, I think a custom solution is best anyways.
 
user895378
@Danack aha! thank you. I failed to update the name there.
 
@Danack Great response!
 
user895378
(eureka!)
 
@rdlowrey yep - composer tip of the day, packagist only reads the default branch of a project for composer.json. Which is annoying but probably the correct behaviour.
 
5:21 PM
@RonniSkansing Thanks Ronni! Mind adding it as a comment, please? That site is heavily neglected but the new one is actually due for launch tonight (Just waiting for the designer to finish the logo and mascot)
 
I was jk @DJSquared =]
 
@RonniSkansing facepalm Can't believe I fell for that.
 
well time to make some foooood =] Good luck with your project @DJSquared
 
@RonniSkansing Thanks! Take care.
 
5:46 PM
Buongiorno!
 
Hey Chris
 
buon pomeriggio!
 
It is never afternoon here, only morning and evening/night :p
PHPStorm... I'm switching to this now. I shunned IDEs for a long time, but the Sublime-esq multicaret stuff got me interested.
 
IDE's are evil ...
 
if any of you want to play a practical joke on me, this would be ok
 
5:52 PM
One thing... they say that you can't buy a personal license if you'll be reimbursed -- they want you to buy a site license in that case. I don't get it. 1) how is it any of their business if I am getting reimbursed, 2) how can they tell?
I don't see how that could be legally binding software terms and conditions, like if Apple said you can't wear blue jeans and use an iPhone.
@JoeWatkins I am definitely of that school of thought. Prior to this, I used a standard text editor with highlighting and built-in FTP, that's it.
 
Hi room 00001011 people!
 
word
Hi room 1 people!
I think in base 10
 
It should be called room 10, since our base is 11.
 
no, the base is 10
all bases are base 10 when represented in that base
it's base 1+1+1+1+1+1+1+1+1+1+1
Oh no ... Don't put your MacBooks in your back pocket either !! http://t.co/GOw3sstdSA
 
@ircmaxell heheheheh :)
 
6:04 PM
:-P
 
@ircmaxell hahahahahaha :-D
@JoeWatkins why?
 
@ircmaxell GREAT STUFF!
 
@rdlowrey @Danack just fork composer and directly use github as a base instead of the way through Packagist…
 
@bwoebi Or even better, fork Satis and build an actual package management tool around it - bastionrpm.com (not ready for release).
 
6:14 PM
Then you're not dependent on either packagist or github being available.
 
Is there really no validation library where I don't have to litter my code with new or static calls? :*(
 
I won at voting
@bwoebi they lull you into a false sense of security ... what happens when you are stuck ... I dunno, lets say at sea, all by yourself, with only an x86 processor, gcc and a text editor ... you'll be sorry you relied on an IDE ...
 
@JoeWatkins That's a very odd reason
"Don't use this useful tool, because it may not always be available"
 
@JoeWatkins does that happen to you often?
 
all. the. time.
in truth I don't mind IDE's, what I do mind is when you're going for a job and they try to force an IDE on you ... I hear a lot of this, makes me sad ...
 
6:18 PM
"Don't program in C, better directly write machine code. I mean, what if GCC is not available?!"
 
I've actually never found a good one is the reason I don't use one ...
 
@NikiC machine code? What if the HDD is not available. You should program with dip switches directly on the motherboard.
 
@ircmaxell But, but ... what if there's no motherboard?
I recommend doing all calculations in your head.
 
@NikiC but what if your head isn't there?
 
If you do not have a head, then you likely have larger problems.
 
6:20 PM
except for writing GUI's (which I avoid because "I am a C programmer") there's nothing I can't do in a text editor ... there is no ide that offers me the same flexibility, I need to be able to switch from PHP to C, to Java, to C++, to C# ... none of them have all of those covered, eclipse has a good go at it, but becomes unusable when you install everything required to support just those limited set of languages ...
 
Is that usual on SO… the newer the answer is, the more unnecessary complex it is:
1
Q: Compare two arrays and remove array from array in PHP

user3375344I have two arrays and I need remove from bigger array smaller $a = array(223 => 6, 381 => 6); and second arrays is: $b = array(array('id' => 45, 'username' => 'rock'), array('id' => 223, 'username' => 'pop'), array('id' => 381, 'username' => 'stock')); With print_r() they looks like this A...

 
@NikiC pedantically, if you don't have a head, you don't have any problems :-P
QA Engineer walks into a bar. Orders a beer. Orders 0 beers. Orders 999999 beers. Orders a lizard. Orders -1 beers. Orders a sfdeljkn #QALOL
 
@ircmaxell saw that one too, but I don't get it… someone would explain it to me?
 
user895378
@bwoebi It's lots of data elements for test cases :)
 
@ircmaxell ;)
 
6:24 PM
@bwoebi QA is Quality Assurance. Their job is to break software
 
… that question above… I'm crying… already 5 answers… sigh.
@ircmaxell oh, he's testing the bar… okay, got it now, thanks.
 
oooooh
 
:-)
@bwoebi could you make yours a muti-line, for clarity (rather than a one-liner)?
 
@ircmaxell better?
 
much :-)
 
6:28 PM
I always tend to put such single-statement solutions in one line, just to show that it's really just a simple one-liner…^^
 
yeah, that's fair, but it also hides what it's doing
 
> is what you search:
 
@Andrea I checked ECMA-334 and Swift docs, both have same ?? precedence as we do. So +1 on the RFC.
 
> is what you are searching for:
 
@bwoebi honestly, I think that hurts readability a lot more than the thing about if braces...
 
6:31 PM
@ircmaxell true…
@NikiC no, not in real code, but in such stackoverflow answers…
 
at least with php's verbose closure syntax, I think it does
would be a different matter were it array_filter($val ==> isset($a[$val['id']]))
 
If it makes sense in your production code, it seems like it would make double-sense on Stack Overflow, where the intent is teaching. All the reasons you do it in production are magnified when the context is educational.
 
we can see you trying to poison us with hack features @NikiC ...
 
Like, if you speak English clearly and properly in life, you wouldn't jump in front of your English class and say, "Sup daaawwgs!?"
 
super glad it's not just php programmers that ask stupid questions about threading ...
0
Q: New thread for every element read in from text file in python

aaron billOk so i have a program that is fully functional but i would like to multi-threaded it to make it faster, what it does is updates a box. Right now it does one box at a time i would like to do all at same time. i done some research on it but nothing is really helping me much. here is my code below...

 
6:35 PM
Hello @JoeWatkins
 
yo @Baba, how goes ?
 
@Baba hey
 
ping @PeeHaa
@bwoebi Long time .. how are you doing ?
@JoeWatkins Not bad ... :)
 
@NikiC well… there I prefer the verbose function syntax ^^
 
netstat @peeHaa -f
@NikiC Why are Booleans constants ?
 
6:40 PM
@Baba Why should they not be constants?
 
@ircmaxell using array_map so often, that I always disrespect parameter order on other array_* functions with callback.
 
(But yes, it would have been better if true/false/null were keywords. Even if only because then there would be no need for case-insensitive constant support)
 
@NikiC don't you think it would be less efficient to loop up all constants just because of true or false ? or am i missing something ?
 
@bwoebi whoops :-P
 
@Baba why would it be less efficient?
 
6:42 PM
fuck, I am still at work
7
 
Happens to the best of us, tereško
 
@tereško go home =]
 
@NikiC that is the only reason FETCH_CONSTANT is called when accessing it in namespace
 
@Baba no, the reason for that is just a bug in the implementation
 
@NikiC Oh ..... guessed as much ...
 
6:44 PM
@ircmaxell typical error when using php. I can't tell you off my head what parameter comes first for e.g. in_array. That leads sometimes to bugs I cannot easily locate e.g. when both parameters are arrays…
That's also one of the main reasons I use IDEs… they display function prototypes to me…
 
@Baba E.g. we do resolve true/false/null in constexpr contexts.
I wanted to fix the const ct subst code for a while
 
@NikiC Thanks for the clarification ... can you explain here so others can benefit ... Thanks
 
So, it's about time I asked, what do all the TSRM* things mean? I guess _D is for definition and _C is for call?, what about DC and CC?
 
@Leigh CC == call with comma
TSRMLS_CC == thread-safe resource manager local storage call with comma
 
madness
 
6:56 PM
@Baba sure
 
question 2, after our discussion yesterday about inline being only a hint, how come inline functions don't need to define TSRM* ?
 

« first day (1439 days earlier)      last day (3506 days later) »