« first day (677 days earlier)      last day (4260 days later) » 

7:00 PM
i think i will take a nap
 
me too, but 21h is kind of odd time for nap
 
its 22h here , but yeah ... i want a nap , otherwise i will end up awake all night
there is this small period when you get sleepy , and if you go past that , then the brain goes "oh, fak this , lets just work till we start passing out" .. which is like ~ 16 hours later, in the middle of day
 
exactly, at one moment brain says, funk dat and pixels start to melt... and you pass out wildly waking up disoriented...
I'm always tired but can't sleep...
 
the fun begins when you go over 60h mark
 
hahaha
dat
 
7:08 PM
the autonomous functions start malfunctioning and the fist artifacts in vision are experienced
i have never gone over 80h though
 
dat is like impossibru (unthinkable)
 
let's put it this way , i have experimented on that part of my limitation extensively
 
Can't believe that got thru the cv filters... ^^
 
too late =P
 
ok then:
?
It is just a repeat on a million different questions!
idk why the fruit it got so many upvotes...
 
7:13 PM
also , WTF ?!? 150+ votes in 3 days ?
 
DAFUQ
 
I KNOW!
wth....
 
I take a nap, too :)
sounds like a great idea.
 
Is this answer still up-to-date and viable?
8
A: Is there a call_user_func() equivalent to create a new class instance?

VolkerKReflectionClass:newInstance() (or newInstanceArgs()) let's you do that. e.g. class Foo { public function __construct() { $p = func_get_args(); echo 'Foo::__construct(', join(',', $p), ') invoked'; } } $rc = new ReflectionClass('Foo'); $foo = $rc->newInstanceArgs( array(1,2,3,4...

 
@LeviMorrison why not?
 
7:18 PM
@LeviMorrison yes it is
 
Seems unnecessary to have to use reflection.
Where is array unpacking?
new Object(*$array)?
 
you can also assign name to $class and then do $object = new $class().
However not if you have arguments of variable size.
 
@Neal i actually flagged it for mods , because 150+ upvotes (100+ in a single day) with 5 comments seems like someone has been gamiming the system
 
@tereško I flagged it as well.. idk whats goin on with that one...
I stated:
> This is just a repeat of many many questions on stack overflow. I know it already got closed, but it sets a bad precedent for questions on stack overflow if it does not get deleted.
idk if that is good enough wording, but ... whatever.... :-\
 
@tereško @neal It's #3 in the top 5 questions in the last 7 days, and it has more views than the others as well i.imgur.com/LwlM3.png
 
7:21 PM
no , i flagged the answer , 'cause of suspicions of rep-abuse
 
@tereško or the question was posted somewhere like reddit or hacker news, thats prob what boosted it....
 
@MikeB Is being #3 a result of abuse or is it so heavily upvoted because of being #3? So hard to tell . . .
 
And this this one was closed dv'd majorly: stackoverflow.com/q/9919291/561731
i dont get it...
 
Dunno, but it could be interpreted as evidence that the question and/or answers weren't being artificially inflated with votes
 
idk
odd...
 
7:23 PM
If you see a question/answer with a high number of votes and low viewership it's suspicious
 
anyway .. flagged , let the mods decide whats going on there
 
I got a lot of views here: scifi.stackexchange.com/q/22400/3383 ... but it did not translate to a lot of upvotes....
 
@Neal lol, SO is so fickle
 
:-(
 
@rdlowrey Traits would work for parts of Vector impls, but so would inheritance.
Actually, no.
That would have a side-effect to use inheritance, methinks.
 
7:29 PM
hi all
 
Wow. Maybe my first use-case for traits.
 
ah, you're implementing Vector?
 
A mutable and immutable version that share MOST of the same API.
 
@LeviMorrison I saw you talking about something like foldLeft earlier
I don't think it's a good idea ;)
 
7:30 PM
Such functions should go outside any datastructures and work on arbitrary traversables
 
. . . probably true.
Good point.
 
I.e. min, max, sum, reduce, map, filter...
 
However.
No, not filter and not map.
 
@LeviMorrison It depends
 
One of the problems with array_* is that they sometimes work on the array itself and sometimes they return a copy that has the result.
 
7:32 PM
map and filter would have to return a copy. Or rather a lazy mapper / filterer
E.g. that's what Python (as of 3) does
 
That's where you are wrong.
 
And I think it's a very reasonably behavior
 
What if you want to delete certain things from the array you already have?
What's the function for that?
 
That's not what map / filter are for ^^
 
Says who? Python? Please.
 
7:33 PM
@LeviMorrison Those functions have a functional background. They are expected to return a new structure
E.g. like they already do in PHP ;)
Or Python
Or any other language ;)
 
Hear me out.
 
I will :)
 
If you have an immutable and mutable version of a vector.
map on a mutable version applies it directly to itself.
map on an immutable one returns a new vector.
 
filter on mutable deletes the elements from itself.
 
7:34 PM
@LeviMorrison I don't think that makes sense
It's the kind of API where the same function does two different things ;)
 
I think it makes wonderful sense, but maybe I'm just being crazy.
 
I think you're being crazy :D
 
@NikiC But acts in accordance with its nature.
 
If I have two datastructures, both with a map method I highly expect map to do the same thing in both cases
 
Okay, what are the names for functions map and filter that work on the same array instead of a new one?
 
7:36 PM
@LeviMorrison They probably don't exist ;)
Because functional programming (which uses map / filter more extensively) doesn't have mutable structures ^^
 
@NikiC Then you can give me some great names or I'm keeping the ones I've got.
 
But if I were to give them names, then it would be mapMutable :P
Or mutableMap
But not the same ;)
And generally I don't think that it makes sense to have them
 
MutableVector->map
ImmutableVector->map
 
As I said, that would be confusing
It would give you a subtly incompatible API
 
This is PHP, who cares about subtly incompatible API?
By the way, I'm not really sold on my idea either.
 
7:38 PM
And would e.g. prevent you from passing a MutableVector into something that accepts an ImmutableVector
And I would expect this to work
 
I was just playing advocate to try to get a better idea out of you.
 
Because one should always be able to add const qualification (though not the other way around). (If you think a bit C++ here)
 
But all you did was criticize. Plan didn't work.
 
My better idea is to take them out of the API and have them as standalone functions ^^
in particular allowing them to be used on everything
 
. . . you can't move something that deletes in-place outside of the API.
Well, I suppose you can.
It just doesn't make sense
It's one reason I hate the array_* functions.
 
7:41 PM
I don't want anything that deletes in-places ^^
 
@NikiC Generally speaking I don't either.
 
But if you feel it is necessary, then you can add that to the MutableVector as API functions
 
I'll use immutables all over the place.
 
But keep the "normal" variants as standalone functions outside of it
though I honestly don't see the need function callback-style mapping / filtering
Imho there should be just one (mutable) vector structure, but without any of those functional-y things
Another interesting approach is the one C++ took
But that would need a different iterator model ;)
 
I think it would be nice to declare something immutable.
I would LOVE const in PHP.
Since we don't have it, you can only enforce it via inheritance and visibility scoping.
 
7:45 PM
@LeviMorrison I've recently come to the conclusion that I would probably prefer working in a strictly typed language. And I get the feeling that you'd like that too :P
 
@NikiC I honestly like C++, it just didn't evolve to the web very well.
 
@LeviMorrison yes
 
Java did a bit better, but it's still not as nice as a DSL.
 
I wouldn't want to work in Java
 
I wouldn't either, but I don't mind the JVM.
 
7:47 PM
And it's not a strictly typed language
 
Scala and Clojure are way nicer than Java.
 
I complain about boilerplate in PHP from time to time but Java is boilerplate hell.
Also, Java doesn't have first-class functions.
 
Yes
 
You can't pass around a function in Java.
 
7:49 PM
And Java doesn't have proper generics, which would be something important to me
 
By the way, Scala is more strict about types than Java is.
You might like it.
I'm not sure if its generics are different.
 
Generally C++ is a much more mature language
@LeviMorrison Yeah, I heard
 
It's also nice because it can support type inference.
Dart is nice because you can optionally static type.
Type-inference allows pseudo-dynamic typing for strictly typed languages.
 
Not really ^^ I just saves you a bit of typing ^^
 
// Is this static or dynamically typed?
var i = 1;
i += 1;
 
7:53 PM
@LeviMorrison Depends on what happens when I write i = "Foo"; in the line after it ;)
 
@NikiC Yes, but most of the nice parts about dynamic typing go away if you have good static analysis.
Saying i = "Foo"; when i was formerly an int is probably harmful to write even in a dynamic language.
 
@LeviMorrison yeah. that's the problem. the dynamic language will blindly allow it ;)
a statically typed won't
which is nice, in my eyes
you always keep your type clear
 
Agreed.
 
and php is definitely going in that direction
at least when we get scalar typehints
 
There are some things about dynamic languages that are flipping awesome, though.
Consider the PHP autoloaders.
Amazing.
 
7:55 PM
sure
 
Compiled languages can't deal with that (at least not yet, nor do I see it foreseeable anytime soon).
 
sup guys
 
on the other hand that prevents most optimizations ;) Because in PHP in many cases you know the class type (due to typehints), but you still can't do anything with it, because it could resolve to a different class every time ^^
 
any PHP developers looking for a job in the NYC area?
 
7:57 PM
And dynamic languages tend to take up more RAM than compiled ones.
Which reminded me of something: @NikiC why does the PHP source have inline assembly in it?
 
@LeviMorrison For speed?
It only has it in a few places
 
Yes, but it prevents it from being compiled into LLVM.
 
it does?
I thought people were compiling php with clang too
 
No LLVM compiler can currently deal with inline assembly.
Actually.
I think that information is outdated.
 
@LeviMorrison I don't know about that, but in any case PHP has #ifdefs around the assembly ;)
 
8:00 PM
> In general, Clang is highly compatible with the GCC inline assembly extensions, allowing the same set of constraints, modifiers and operands as GCC inline assembly.
 
so if clang defined GNUC then it will do the assembly, otherwise not ;)
 
I'd like to compile to LLVM and then to Java-Script.
Interactive PHP shell in the browser.
 
sounds reasonable
do it
 
does anybody know what _ means in terms of a conversation. I see somebody in a php comment stated "web", and I don't think they were making a code reference?
*correction they stated "web"
 
8:05 PM
damn it corrects _ to "
 
You mean __ web __ ?
 
no just one underscore, which is weird
 
@NikiC How do you feel about allowing binary operators to be used in function form?
 
@stevebot You can use backticks to prevent parsing of texts
 
fold_left($array, 0, '+') <- that's array_sum
You might be thinking . . . but how is that better than array_sum?
 
8:08 PM
i think I realized they were using _ to imply underlining and not something code related
:P
 
Basically you can define all accumulative functions in terms of a simple fold_left.
 
@stevebot btw... you used Wordpress and cutting edge in the same sentence :)
 
array_max($array) => fold_left($array, NULL, 'max')
array_min($array) => fold_left($array, NULL, 'min')
array_sum($array) => fold_left($array, 0, '+')
This means we can optimize the bejeebies out of fold_left and we can get easy performance boosts for some function calls.
 
@stevebot I've seen people surround a word with underscores to make it bold when that formatting option isn't available
 
@LeviMorrison If I am entirely honest, then I'd say that in PHP at least fold_left is just unnecessary and all we need is min, max and sum. Simply because folding operations come unnatural in PHP and those three cases are pretty much the only uses
 
8:11 PM
When something is _really_ important
 
E.g. Python also wanted to drop reduce at some point (I'm not sure whether they did it) for the same reason
Simply because nobody was really using it, as the common uses were covered by min, max and sum
the only thing it was used for was computing the product ... so instead they added a separate function for that
(which PHP also has, btw)
there was an article on it by their BDFL
 
I'm not saying we should drop the array_* functions.
 
@LeviMorrison I'm just telling you what came to mind because I read that article recently ;)
 
Ah, array_reduce seems to be fold_left, actually.
 
yeah, sure
you didn't know?
php has everything :P
 
8:16 PM
Never came across it.
Never seen it used.
 
pce
@LeviMorrison hej, i just talked to someone at a phpunconf who talked about a PHP VM in JavaScript that already exists, i think its this one: phpjs.hertzen.com/console.html (but im not 100% sure)
 
@LeviMorrison Which is my point ;)
folds are often strange to use for a non-functional mind
(Unlike map and filter)
 
@pce Only one I've seen
 
pce
@PeeHaa nice, but that just proves javascript is the assembler of the browser ;)
but i didn't want to interrupt the functional programming discussion...
 
8:36 PM
Security issue just came up at work.
crud.
Later guys.
 
@LeviMorrison Break out the fire hoses!
 
I have 2 words to say: holy crap
 
@LeviMorrison mysql_query("SELECT * FROM foo WHERE bar = $_GET[bar]")? :P
 
@NikiC looks good - ship it!
 
@MikeB Shipped ~5M times ;)
though, that's a bit optimistic
Btw, stripe-ctf.com is really interesting
I'm completely stuck at Level 5
 
8:41 PM
I'm just happy I decided to build password-lib... I'll put it that way
 
@ircmaxell What's up?
 
I'm not going to talk about it (I don't want to jinx anything), but let's just say I'm happy
 
@ircmaxell You're evil.
You don't tell people that you won't tell them.
That's not nice.
 
posted on August 23, 2012 by Anna Filina

The next ConFoo will be held on February 25 through March 1. If you have never heard of ConFoo, it is one of the most important developer-oriented conferences. The team brings you speakers from around the globe to share their hands-on experience with various web technologies. The best news is: it’s driven by the community and is non for profit! The call for papers opens on August 27 and is

 
Because now I want to know :P
 
8:45 PM
@NikiC I will tell you. Later. In private. When I know more...
 
I don't want to know at all, and neither does anyone else. Not interested one-bit
 
@MikeB Don't pretend :D
 
This reverse-psychology working for ya?
 
@ircmaxell The only thing I can think is that you got some kind of awesome job-offer of it ^^
 
And I'll assume you got a movie-deal out of it
 
8:46 PM
Something like that :D
 
Swordfish II - Starring @ircmaxell
 
By the way, I think that copyright infringement would make a great action movie
I mean, they think of it like organized crime. Like drugs or something
 
@NikiC as long as we get Samuel L Jackson to star in it...
 
And it seems normal nowadays to do copyright arrests with heavy weaponry and a few helicopters
So, sounds great to me :P
 
8:51 PM
potentially
 
lgt
oh man how should I start I never been using this chat
 
And, what was it @Levi?
 
@NikiC No, the password hashes weren't being inserted into the database
 
DELETE FROM users WHERE id = 1 OR 2
 
@LeviMorrison Nice...
 
8:56 PM
whered all my users go :(
^ happened at my last job.. gogo junior devs :D
 
That's why I don't ever grant DELETE permissions to web users ;-)
 
foreach($_REQUEST as &$value){mysql_real_escape_string($value);}
 
winner
@webarto Clearly you should be using PDO for that
 
Fortunately we found it on the first user who made it an account.
It was an integration testing failure.
It's our only integration test and it's poor.
I'm about 7% with unit-tests for the whole project.
I had spaghetti nightmares when I started this job. 0 tests of any kind.
@ircmaxell Potentially really good.
 
Needs more thought.
 
@LeviMorrison Of definitely. It's still very young. For example: is it local to the file? or to the namespace? what about child namespaces?
 
@webarto oh dear :(
 
namespace Foo;

internal class Bar {
    public function getBar() {
        return "bar";
    }
}
----
namespace Foo\Baz;

// can I access \Foo\Bar?
@ircmaxell Exactly.
In the end it will probably end up with private, protected, and public.
private - this namespace only
protected - this and child namespaces
public - everyone
 
I'd love to see a public/protected/private. Where public is global, protected is NS and children, and private is file only
 
9:07 PM
Hasn't hit the mailing list yet.
Do I give feedback then?
 
that's what I'm waiting for
 
By the way, I don't trust the RFC creator.
Didn't have the sense to use private and instead created a new keyword.
 
eih, that I don't care about too much
 
This reminds me of inner classes in java.
Not the same thing, but creating a class that only one other class can use.
 
lgt
is there anybody could give me couple of information to a newbie?
 
9:10 PM
@lgt What kind of information?
 
I'd love first-class namespaces. Where namespaces are first-class meta-objects
 
lgt
I would like to pick up a cookie on page request fro a third party and I'm searching solutions for it
so the point would be don not leave the page
 
@ircmaxell In a language like PHP what would be in that name-space object?
You can't get a list of ALL classes in the namespace or all the sub-namespaces.
 
@LeviMorrison why not?
\foo\bar = Class {
}
 
@ircmaxell Because you can always create another one.
You can only get the ones that currently exist.
 
9:15 PM
sure
 
I'm not sure what you are looking to do with your meta-object, though.
 
\Foo\Bar = class extends \Foo\Bar {
}

:-D
 
you guys are making my brain hurt
 
Clearly wrong, anyone with the docs can tell
I have no idea how it got 5 upvotes
 
@SomeKittens there :)
 
9:20 PM
maybe when you have very high reputation, you may get more easily upvoted, whatever you post (even wrong answers)
 
@Jocelyn Sadly, you're probably right
 
@Jocelyn Another thing that helps is having an avatar of a blond firefox chick :)
 
@PeeHaa Good, I feel much better
 
see the comment: @Kolink Probably people assume that 244k must be right ;) – NikiC 25 secs ago
 
Neither is !== false — databyss 27 secs ago
 
9:24 PM
@PeeHaa: then I change my avatar now, so I reach 20000 reputation points tomorrow :-D
 
dafuq
 
!======================== There. That should be enough.
 
@SomeKittens add one more, to be really really sure
 
2 !==={I-really-mean-it}=== 3
 
@Jocelyn Have fun getting annoyed by the rep cap :)
 
9:30 PM
@PeeHaa But maybe big boobs give you lots of bounties?
Which, may I remind you, are not subject to the rep-cap :P
 
What do you suggest I use for fast inter-process communication in PHP (several unrelated PHP processes, NOT created by forking)? I am looking for something that would work on Windows and Linux. So far I thought of sockets. And maybe also an HEAP table that all processes would read regularly, but that may cause too much load on the mysql server. Any other ideas?
 
We may un-downvote stackoverflow.com/a/12099598/385378 now.
 
@NikiC :)
0
A: Detecting the use of + - " * in a string

SLaksstrpos returns -1 boolean FALSE is it's not found. If it's the first character in the string, it will return 0. (string indices are zero-based). Check should be made by !== (TRUE if $a is not equal to $b, or they are not of the same type.) operator, because 0 will evaluate to FALSE and express...

nice guy @webarto :)
 
@PeeHaa why thank you :P
 
I can't stand edits that change the meaning of an answer by people other than the OP for now CW answers...
 
9:40 PM
Time for rollback war? :P
 
downvoted by @ircmaxell
funk it, better delete crap
 
@webarto huh?
 
Let's just vote it back down and delete it ^^
 
@ircmaxell someone downvoted edit as you've mentioned you can't stand etc, jk ;)
 
@webarto I did :P
 
9:42 PM
@NikiC I don't care that much, but I just find it really annoying to have people edit for content... Just submit a new answer
 
let's write "funk you all" and it will be insta downvoted :D
 
where does the fun takes place?
 
@ircmaxell you are right of course... was trying to help out, but it's best to be deleted...
this guy @Matt loves to mix up answers from other answers :D
 
-1
Q: How do I echo a / (slash) in PHP?

Howard ZoopaloopaHow do I echo a forwardslash /? echo <?php echo $_SERVER['HTTP_HOST'] ?> . '/directory/';

Very strange question
 
10:24 PM
@webarto I left a couple of comments.
 
haha nice ... if DROP is forbidden I hear DELETE works fine too :D
 
echo <?php echo $_SERVER['HTTP_HOST'] ?> . '/directory/';
dafuq is this
we have another Christian :P stackoverflow.com/users/96295/swt83
 
mäh
 
Google "christ" inurl:users/ site:stackoverflow.com/
:D
@NikiC ah ja, a mit umlaut ist ae, ja
 
10:47 PM
ahoy hoy
 
off to home? :P
 
@webarto You're making seven too many keystrokes! "christ" site:stackoverflow.com/users/
 
I'm a noob
 
home
 
10:51 PM
Ok, it's Friday, I should make some jQuery magic, it will be an excuse for not typing a line of code this week.. good night, gute nach,
@orourkek not an easy one :P
 
Greetings my gooooooood friends.
 
@webarto It would help to understand wtf CIDR is. But it's not the time of day where I'm able to understand the wiki page for it
 

« first day (677 days earlier)      last day (4260 days later) »