« first day (1007 days earlier)      last day (3944 days later) » 

5:00 PM
@rdlowrey That's the question, answer it!
 
@rdlowrey I know you didn't
> It does exactlydocs what you're looking for, including retaining the array keys:
 
user895378
> Iterates over each value in the input array passing them to the callback function. If the callback function returns true, the current value from input is returned into the result array. Array keys are preserved.
 
user895378
I deleted it because I just don't care but I still have no idea what @ircmaxell and @salathe are talking about.
 
> Why are you appending to the same array as you're iterating over
 
@rdlowrey Great, thanks! :)
 
user895378
5:02 PM
Seriously, WTF are you guys talking about? array_filter does exactly what the OP code is looking for? I'm so confused?
 
@salathe @ircmaxell @rdlowrey Guys, let's just all be friends and DELETE THAT QUESTION! :)
 
user895378
I'm legitimately hornswoggled on this one. What you're saying makes no sense at all. Your obtuse semantic objections deprived that noob of the only solution that makes any sense.
 
@rdlowrey the OP's code is confused
 
-2
A: php ternary operator push nothing to array

TroThe problem is you are pushing NULL into $data[]. If you are wanting to use ternary operators you should rewrite it like so: (isset($tmp) && !empty($tmp)) ? $data[] = $tmp : NULL; Note: it doesn't matter what NULL is.

Oh god
 
@BoltClock haha
good one
 
5:05 PM
@Eugene not as far as I know
 
/me looks away
 
Anonymous
There you go. I closed it for y'all :p
 
@NikiC I might be friends after some beer. :)
 
Anonymous
$data = [];
foreach($data as $tmp)
{
$data .= (isset($tmp) && !empty($tmp)) ? $tmp : NULL ;
}
 
Anonymous
5:07 PM
But, as always .. I don't know what I am talking about ...
 
the title is supposed to say, what i have issues with right? .... — Pakk 2 mins ago
.. user for 3 month, written more then 20 questions
 
> MD5 is still fine for password hashing and basic security needs.
> You could try using salt+md5, and store the salt in the database to add more security.
I .. don't want to live on this planet anymore
 
@LeviMorrison When will you finally push your working version to the php.net site? (you told monday me sth about your site (chat.stackoverflow.com/transcript/11?m=10615559#10615559) but it is still down?)
 
@bwoebi It's been up a lot since then, but yeah, it's down atm again >.<
 
@NikiC: why can't generators be rewindable :-(
 
@LeviMorrison exactly when I want too look at :-/
 
(I know, I'm just bitching)
 
@ircmaxell Step 1: Win lottery. Step 2: Obtain masters of engineering. Step 3: Be this guy.
 
5:15 PM
@bwoebi The source is available, pretty-much up-to-date (bar Levi's work-in-progress)... host your own?
 
@NikiC eih, I'll just wrap it in a CachingIterator...
 
> @ircmaxell Having seen your previous posts on the subject I will take this statement as gospel. I was only trying to increase the hash key space and further minimize the chance of a key collision (which is probably already astronomically improbable as is without doubling down on the hash)
 
@NikiC huh?
link?
 
@salathe a bit too much work just for seeing the site… and btw. how would I do this? just cloning source and finished or how?
 
5:18 PM
Does anyone know any opensource projects that are willing to take on somewhat amateur developers
 
Yes, yes you are... — Neal 1 min ago
hehe
@Melbourne2991 Anything on github....
 
!!php-method IteratorIterator::__construct
 
Server error (status 500) occured (message probably too long)
 
:-(
 
5:20 PM
@CapricaSix lol
 
@ircmaxell the mixin lib is really interesting =)
 
@salathe thx… will look at
 
Wow @CapricaSix is everywhere.
 
@Neal if you add a really cool feature to an existing product what is the likelihood of it being forked
 
@Ocramius ;-)
 
5:21 PM
@Melbourne2991 I would say a 7
 
*merged!
 
You can edit chat messages @Melbourne2991 Silly, Duh, DING
 
hm is OpenCart on github by any chance, oh right cheers
 
user895378
@Melbourne2991 When I google "github opencart" the very first result looks promising.
 
@rdlowrey LOL
 
5:23 PM
@rdlowrey ... and deleted =)
 
I wrote a CSV to product upload script for opencart a while ago, how has one not already been added yet
Could it be down to security issues or other considerations
 
@Melbourne2991 Did you even look at the network of commits?
 
26
Q: PHP Optimization Tips

JrgnsI'm looking for PHP Optimization tips. Coding practices and other methodologies which will make my PHP execute faster. One tip per answer, please, and include why it makes the code faster! This is not about HTML or Javascript execution, but purely server side PHP execution.

Hmm ^^
 
@Neal looking around now, still familiarizing myself with Github
 
5:28 PM
> If a method can be static, declare it static. Speed improvement is by a factor of 4.
o.0"
 
user895378
@Jack Sorry my intervention squashed your shamelessly acquired upvote rep from that question :)
 
^^ wrecks me.
 
@ircmaxell @NikiC posted.
 
@rdlowrey Meh, it was a bit shameless I suppose ;-) I would have wanted to know what the use-case was though.
 
user895378
@igorw I assume coalescing the functionality in with the existing use would have been a PITA vs. adding the extra use function token? Regardless, super-duper +1 for attempting to make functions more of a first-class citizen in PHP.
 
5:34 PM
@rdlowrey yeah, there's issues because of global fallback.
 
Because array_filter() wouldn't have worked either afaict. OP was appending elements to the array from which they were iterating ... didn't make all that much sense =S
 
and use foo; could import both a class and a function.
 
GitHub - Your one stop source for eBook warez! github.com/FelixRovinVincent/reference/tree/master/…
@Bracketworks that's a nice one. it's the only one I know, but it's a good album.
 
Trying to think of all the creative way I could use strpbrk() :)
 
No. No I cannot @user2588490. Read up on AJAX on the internet -- there are examples all over. Including on this site... — Neal 4 secs ago
Rrrrg
 
5:39 PM
@Gordon Its hard to even call it music; that song is really just the ambiance of the end.
 
o7 guys.
 
Damn good album too.
 
@ircmaxell Last comment on stackoverflow.com/questions/17563303/…. Found it funny ^^
 
user1125394
!!c> c for c in [1,2];
 
@cx "SyntaxError: missing ; before statement"
 
5:39 PM
@Neal I'm surprised you even answered that lol
 
ah yes
 
@Jack Thought I'd throw the OP a bone...
 
user895378
I really need to unfollow Bill Gates on twitter. All his tweets make me feel guilty because I don't live in a third-world country or have polio.
 
@rdlowrey Well, seeing as the alternative is contracting polio, I'd recommend you unfollow him.
 
user895378
5:41 PM
@Bracketworks Can't argue with that logic!
 
@Bracketworks Migration is the other.
 
@cx 2
 
user1125394
a js bot in php..
 
@Jack Wait long enough; when the US devolves into permanent martial law, the aftermath will be comparable to that of 3rd world living.
;-)
 
@Bracketworks I can't wait :)
 
5:42 PM
@Jack Your close vote reason is wrong
 
PhpStorm isn't very stable on Mac for some reason =/
@Neal Feel free to choose another reason.
 
@Jack ehhh
@Jack PHP storm is just an amalgom of Eclipse, is it not?
 
I'm not exactly sure ... Zend Studio is Eclipse based and that runs just fine, albeit slow.
 
I've only used PHP Storm in Windows so idk...
 
@Jack That's true of most all Eclipse Java based IDEs.
 
5:45 PM
But the storm is actually fast .. so therefore it can't be Eclipse lol
 
@Jack ahhh, but it is.
 
I found that especially when it comes to Git and Code coverage testing, it's prone to crash.
@Neal Link or it didn't happen :)
 
@Jack What didn't?
 
Nvm.
 
@NikiC why do people think that md5(md5(0)) has less collisions then md5(0) ?
 
user1125394
5:48 PM
can I have your opinion about a system I do: we have stats per user, I putted all that in a json in a mysql column, but for updating it, I'd maybe put a date field in it also, and force update when it exceed some period (reactive updates)
 
is there some stupid tutorial floating around the internet which claims that ?
 
> I got an F in Art. Mainly so it would say "fart" on my report card.
 
@tereško uh cuz. The internetz said so
 
but did it really ?
 
Because if the chance of collision with md5() is 1/X, then md5() applied twice obviously must make the chance 1/(X^2) :) </troll>
 
5:53 PM
@cx nothing wrong with that, what would you be updating exactly?
 
@Neal Hmm okay, Wikipedia says Storm is built on IntelliJ IDEA. Doesn't sound very Eclipsy.
 
user1125394
@Melbourne2991 users have stats for different financial broker accounts, the stats are mostly monthly, so this system is fine, just hesitating Vs a cron thing
 
Same setting menu (sort of) in intelliJ vs eclipse
 
The article is from 2012, so I don't think much of that applies .. in fact, I'm moving from Eclipse to Storm because of speed.
I can't tell in exact terms, but I experience less moments of waiting.
 
6:11 PM
posted on July 19, 2013 by Evert Pot

I just released version 1.0 of sabre-event, a simple event management library for PHP, heavily inspired by both nodejs' EventEmitter, and Igor Wielder's Événement. This library has a few extra features not in Événement that I really needed, and Igor had no plans adding it to his library, so I wrote my own. In a nutshell, this is how you use it: <?php use Sabre\Event\EventEmitter; incl

 
user895378
@Feeds If that's all you're doing then WTF is the point of reinventing @igorw's wheel?
 
@rdlowrey I have a wheel?
 
user895378
Re: event emitters
 
$add3 = $primitives['curry']($primitives['operator']('+'), 3);
var_dump($add3(4));

$subtract3 = $primitives['curryLeft']($primitives['operator']('-'), 3);
var_dump($subtract3(4));
 
Anonymous
@DaveRandom thanks...
 
Anonymous
6:26 PM
 
Anonymous
YAY!! :p
 
$set = (new Set(array(1, 2, 3)))
        ->append(array(4, 5, 6))
        ->append(array(7, 8, 9));

$isEven = function($a) {
    return $a % 2 === 0;
};
$isOdd = $primitives['complement']($isEven);

$isPrime = $primitives['memoize'](function($a) {
    $sqrt = sqrt($a);
    for ($i = 2; $i <= $sqrt; $i++) {
        if ($a % $i === 0) {
            return false;
        }
    }
    return true;
});

$isComposite = $primitives['complement']($isPrime);

var_dump($set->filter($primitives['conjoin']($isOdd, $isPrime))->toArray());
 
Anonymous
I should be a room owner by now. ...
 
@rdlowrey oh wow. there's so many of those, and they're all the same. I guess it's the new "PDO wrapper", "curl wrapper", "template engine" or "MVC framework".
> It's distinct from Événement, because I needed a couple of features that were in conflict with it's design goals. Namely: prioritization, and the ability to stop the event chain, like javascript's preventDefault.
well ok then.
 
I feel dirty
 
6:30 PM
@ircmaxell Take a bath.
 
'operator' => function($operator) {
                if (!in_array($operator, [
                    '*', '/', '%', '+', '-', '.', '<<', '>>', '<', '<=', '>', '>=',
                    '==', '!=', '===', '!==', '&', '^', '|', '&&', '||', 'instanceof',
                ])) {
                    throw new \InvalidArgumentException('Unknown Operator Provided');
                }
                return create_function('$a, $b', 'return $a ' . $operator . ' $b;');
            },
 
user895378
@igorw I mean, I've done my own implementation for my own purposes but it's entirely different from yours because I had different needs. I just get annoyed how PHP devs love to more or less duplicate the work of others, change a couple things and then publicize it like they've actually created something :/
 
@rdlowrey it's not worth wasting energy on.
 
what's wrong with this: array_map('include', $dependencyFilesArr);
 
user895378
@ircmaxell I don't think it's semantically appropriate. You're not mapping anything.
 
6:33 PM
@ircmaxell I don't know, imo that one should be a function.
 
@igorw exactly
 
@rdlowrey you could, it returns something
 
@Simon_eQ are you here my friend
 
user895378
Hmm. You guys are right. I suppose that's a bad example. But I'm convinced there are some real atrocities people could perpetrate with that functionality even though I'd like to have it.
 
@igorw $configs = array_map('include', ['main' => 'config/main.php', 'aux' => 'config/aux.php']);
@rdlowrey sure. But people can do those as it exists
 
6:34 PM
@ircmaxell although scoping might get weird in some cases.
 
@igorw yeah, that's quite true
because today include happens in the current scope, where that would be the new local scope...
 
@Simon_eQ nice fake :-)
 
@Simon_eQ do not worry I do not need any help :D
 
Anonymous
Hey
 
Anonymous
Sup @Sparrow
 
6:38 PM
@Simon_eQ I am fine what about you
 
Anonymous
fine here
 
I just want to show you my school project that I was working in @Simon_eQ
 
Anonymous
Well, I'm here. @Sparrow
 
@Simon_eQ support my and sign up for free :D
 
Anonymous
Ok, let me check it out
 
6:43 PM
small problems occurred when I uploaded it but I will fix them later
also I am working on supporting arabic messages on it
 
Anonymous
Not bad, I'm Impressed
 
Anonymous
It's too basic though
 
Anonymous
I don't know much to say, but its a good start
 
it is the second php project that I worked on
I thing it was the best for the other students in my class
 
Anonymous
Its good. Just align the inputs to be centered, or to look more pro. Page width should probably be in % to make it re sizable. Not bad for a second project.
 
6:47 PM
please give me more comments and problems on my project
I want to learn and fix my mistakes
 
Anonymous
What interests you? functionality or design ? @Sparrow
 
both @Simon_eQ
profational website most has both
 
it would surprise you if you get under the hood on some of them @Sparrow
 
@Orangepill sorry did not get what you mean
 
@sparrow I mean it would surprise you how hobbled together and messy most "professional" websites are
 
Anonymous
6:52 PM
@Orangepill :) welcome !!
 
Anonymous
@Sparrow Ok, for professional designs I would recommend that you visit TemplateMonster(http://www.templatemonster.com/) or Dreamtemplates(http://www.dreamtemplate.com/) and just open one site, which is similar
to the one you are working on, I mean that by genre/theme i.e. If you are working on church site, then browse the church templates and just try to get an
idea from there. Such, as gallery, design, covers, color combinations and try to create your pages accordingly.
 
@Simon_eQ Howya doin?
 
Anonymous
@Orangepill No good, since you surpassed all my rapcaps
 
Anonymous
You are on fire dude
 
@Simon_eQ actully I used a template from another website and edited it on my project
 
Anonymous
6:57 PM
 
Anonymous
I need something like this
 
haha yes me too
black background looks so attractive
 
Anonymous
@Sparrow If you are using templates from another project, make sure that they are aesthetically pleasing, or professional looking ..
 
@Simon_eQ Not enough screen.
 
@Simon_eQ what about this design except the photos down there in the index page
@Bracketworks they are never enough
 

« first day (1007 days earlier)      last day (3944 days later) »