« first day (880 days earlier)      last day (4051 days later) » 

4:00 PM
@Ocramius where did, where did you go? :)
 
Lol
Oh I forgot, you also need 10k in the bank to get into Canada like that
(But obviously you just take out a loan in your country then repay it)
 
Sigh do you think my girlfriend would mind if I went over there to scout out potential Canadian marriage opportunities?
 
Anonymous
@Gordon well that speaks in volumes, specially given if that person had much influence on the employers.
 
Anonymous
Man if everywhere was as free and diverse as Dubai. You can actually, decide to be a barber tonight, and start a chopping hair of, tomorrow. :P
 
4:03 PM
Warum heißt Kanada Kanada? Weil es gibt keiner da.
^^ the only German joke I know
 
Anonymous
I have a sister in Marburg, she sends me text in Germany, to help get a grip of the language, so far I can only understand .'Broder, Wo bist du ?,'
 
Is that the German title for "Oh brother, where art thou?" :)
 
@Jack Why are you still awake?
 
@DaveRandom it would be Keinerda though if it was a pun on nobody. We usually say Kanada Kanahier, e.g. Kann (can) er (he) da (there), Kann er hier (here)
 
Can't sleep ... thinking about asynchronous Gearman workers ;-)
 
4:08 PM
@Jack yeah. though its Bruder. not broder
 
@Eugene sorry, rather busy today, so I'm hopping in and out
 
@Ocramius sure sure
 
@Eugene you don't need to define both a column and an association. An association is enough
you will get a reference to the associated object directly in your entity field
 
Isn't there a Doctrine chat room somewhere? ;-)
 
I hate vacations. It's always an excuse to destroy me the friday before they start
@Jack yeah, there's one on IRC eventually
 
4:10 PM
eventually? or actually? ;-)
 
@Gordon I was under the impression it was a pun on "nothing there", as you can see my German skills are not exactly brilliant
 
@Ocramius Okay, should there be some spacial annotation for that to work?
 
@DaveRandom it sounds somewhat like "Keiner da" if you say it quickly. It just sounds more like "Kann er da" :)
but admittedly both are lame puns :)
 
@Jack if it bothers you that I help people with D2 here, I can also leave and forget the chat :)
but that's what I do in my free time, not much else
 
Huzzah! I have just learned how to merge users
 
4:20 PM
@Gordon Cool, can you now merge Jon Skeet with my account? =D
 
ha
 
@igorw I am here to help, my friend. Sorry that I am late. You want to iterate over a HashMap in a foreach loop but can't? Is that the problem?
 
Love this way, it's better than accepted solution, as simple as possible, but you should optimize it minimally by removing $count-1 from loop and putting it above: $count = strlen($charset) - 1; — s3m3n Jul 30 '12 at 19:35
^^ Observe how well pple read code :) check out the accepted answer.
 
@LeviMorrison yes, because I have object keys. so providing a different way to access the keys would be great.
 
4:25 PM
@LeviMorrison Sorry I haven't been able to test your code yet .. I was kinda hoping it was simple, but it's a lot of code to go through and understand =S
 
@Jack The hotplate code itself is a simplified reduction of a 2D temperature plate with respect to time.
 
I guess the take-away was that you're using php arrays for the wrong thing ... well, not that it's your fault ;-)
 
And no, it's not the wrong thing. PHP arrays ARE what should be used.
There is nothing else TO use if I can't use an array.
 
SplFixedArray?
 
Slower, amigo.
I tested.
 
4:27 PM
what?!
 
Go ahead and change it if you want to prove it to yourself.
It uses less memory but is slower.
 
I wonder why that would be? Is it the object wrapper around the native C structure?
 
I'm not sure.
 
Browsing the source.
 
huh? SplFixedArray is slower than array?
 
4:33 PM
@igorw depends on the amount of items iirc
 
Well, the basic structure is effectively zval **elements, an array of zval * ... doesn't get more basic than that.
 
I've seen major speedups for a small array.
interesting
@LeviMorrison let me know when you have time to discuss the Ardent things :)
 
@igorw Now is fine.
I have a toy library called Sunrise that will probably be merged with Ardent sometime.
It's a series of iterator classes that make certain things quite nice.
 
is it available somewhere? I'd try not to bloat ardent too much and make separate libs if possible. the streams stuff from @rdlowrey also belongs in a separate lib imo.
 
what is Ardent? Is it a word play on Arthur Dent?
 
4:39 PM
@Gordon My github library previously known as PHP-Datastructures.
 
@LeviMorrison ah. that one
 
And Ardent is a real English word :]
 
Sounds like a pastasciutta cooking state O_o
 
@Gordon so that's why the name sounded so familiar!
 
@igorw Do you specifically want an array of all the keys?
Or just for iteration purposes?
Very different goals, imo
 
4:44 PM
@LeviMorrison iteration
 
Well, it's not nice, but in the meantime:
 
->each() would be acceptable, but also bloats the lib
 
for ($iterator->rewind(); $iterator->valid(); $iterator->next()) {
    $key = $iterator->key();
    $value = $iterator->current();
}
 
@Ocramius referenced entity var_dump is huge.
 
This non-scalar key problem is actually fixed in PHP 5.5.
 
4:45 PM
@Eugene that's because it's a proxy :)
 
@Ocramius Ou. Okay.
 
@LeviMorrison awesome. I didn't even think of that. ok, I can work with this
 
@igorw Yeah, foreach will work in PHP 5.5.
 
yup, I saw that
 
Sad that it's taken so long to move that direction.
Anyway, the iterator API I've been working on is quite nice.
I think I'll merge it in somehow.
 
4:51 PM
one thing I noticed when working with ardent is that constructing the data structures can be quite a nuisance
 
@LeviMorrison Odd, I'm getting a steady 20% improvement when SplFixedArray is used, across several array sizes: 100, 500, 1000, 2000
 
im off to my usergroup. laters folks
 
@Jack Perhaps it's because I'm on a Mac or something.
 
I'm on Mac too
 
@LeviMorrison or at least it would be nice to have some kind of shortcut. here's an example of what I'm talking about: github.com/igorw/edn/blob/master/src/parser.php#L256
 
4:54 PM
Oh wait: what flags did you compile PHP with?
 
Errrr let me check that right now.
 
Also, how long does it take you to run the PHP tests total?
@igorw Indeed it can be.
 
@LeviMorrison in particular Vector should really take a single array arg.
 
@LeviMorrison Total run time is about 20 seconds for the whole bench mark
 
@igorw actually . . . you are aware it takes varargs, right?
 
4:56 PM
Let me gist it for you
 
new Vector(1, 3, 4, 5, 6, 9, 0);
 
cURL can't send multipart/form-data if there is no attachment? (PHP API)
 
@LeviMorrison yes, and that's exactly the problem, since I'm not hardcoding the values. so I need to use either reflection or a loop just to create the vector.
 
@webarto Yes it can, why?
 
@webarto Have you tried just passing array as postfields?
 
4:58 PM
IIRC it does it automatically if you pass an array ^^ that
 
@igorw Or we need @NikiC to allow us to do something like new Vector(*$array);
 
No, no . . .
Those are faked tests.
 
@Jack Take my hotplate code and use SplFixedArrays instead of array and watch it be slower.
Real code only.
 
4:59 PM
@LeviMorrison I wouldn't say no to that, but until PHP 5.7 we need a way to deal with it
 
None of this hypothetical benchmark crap; I'm sick of that stuff.
 
Pardon me, there is attachment, but it's empty, and it has error code 4.
 
@webarto That's adding a 0-byte file that's talking about though, and it probably should error out because that makes no sense
 
@LeviMorrison are you aware of any projects using ardent?
 
@igorw I used to have an appendAll which took a Traversable which would have worked like $vector->appendAll(new ArrayIterator($array));
 
5:01 PM
@DaveRandom That scenario, I know it doesn't make sense, but browsers do it? (they send multipart/form-data, and empty attachment post field)
 
@igorw Some of my own projects as well as some that @rdlowrey has.
 
Content-Disposition: form-data; name="attachment"; filename=""
Content-Type: application/octet-stream-----------------------------
@DaveRandom ^
 
Some others have expressed interest, but I don't know of any that actually use it.
It's officially unstable, so it's use at your own risk.
lol
 
@webarto wtf did you do to make it do that? What browser, as well? (let me guess: mozilla)
 
@DaveRandom Firefox :) I'm using Zend_Form, and validation actually expects empty (0 byte) attachment (I removed that nonsense naturally), I was like... WTF. Couldn't POST a form for acceptance test. But browser on the other hand, does it...
 
5:05 PM
I don't think it's a standards violation (although it should be) but it definitely makes no sense. I mean you could easily do it manually by building the request body and setting the content type yourself but I can't see a use case tbh
 
@LeviMorrison it fits my use case extremely well, so I'd be interested in getting it more usable and more stable
 
Me neither, it just took me a while to figure out where is the . @DaveRandom
 
@igorw I worked hard on it for a few months but I don't get to code in PHP much anymore, though I still enjoy it.
I'll see if I can clean things up.
It's definitely more stable than it was a few months ago though.
@igorw can you explain this one: github.com/igorw/Ardent/commit/…
?
 
@LeviMorrison yes, it means that I can target 0.6.*@dev and if dev-master ever changes to be the dev version for 0.7, my constraints still get the tagged 0.6.x versions
 
@igorw Also, I wish PHP had multiple constructors like Dart. This would completely solve the varargs vs array issue: new Vector.fromArray($array); new Vector(1,4,5,9,0);
 
5:10 PM
@igorw: OK (23 tests, 35 assertions)
I just bugfixed Process.
It now runs (all the tests).
 
@Jack Also, keep in mind I'm using a 2D array, not a 1D array.
 
@LeviMorrison static factory method works for me.
@hakre yay!
 
@igorw yes ;)
now I need to make the pull request.
 
@igorw Factory method maybe, but it won't be static, that's for sure. If you ever subclass Vector you might want fromArray to, you know, actually return your subclass.
 
@LeviMorrison that's perfectly feasible via new static($foo);
 
5:14 PM
@igorw It's still a no. :]
No static.
 
@LeviMorrison if you make a factory class, I will refuse to use it. ;-)
 
@igorw Don't worry, no factory either.
Let me play around with a few options.
I'll report back on what I like, don't like in a few minutes.
 
btw, IMO a static factory method is perfectly fine. the new operator might as well be considered a static method like it is in ruby. you get zero additional coupling by using a static factory method over new.
#justSayin
 
I'm off, have a good evening all
 
@webarto Yeh it's definitely not a violation of RFC2046 (that I can see), so technically cURL is wrong in throwing up about it. However I think they are probably right in enforcing that restriction, it's such a weird thing to do that it's only right you should be forced to do it manually. Interesting side note that I just discovered: MAX_FILE_SIZE is a thing completely made up by PHP. Browsers don't understand it, and obviously it's useless anyway because it's client side.
 
5:19 PM
@igorw You can certainly believe what you want. :]
 
@LeviMorrison It's still running =/
The previous run was 173 secs
 
@Jimbo later
 
@Jack Yeah, no worries, it does end.
And yes, that's about the performance I am expecting.
 
Let me extend my benchmark to test a few other scenarios
 
@webarto Also related and something I never realised, multipart MIME boundaries are allowed to have trailing LWS after the boundary and before the CRLF /cc @rdlowrey
 
5:20 PM
The object -> data structure mapping now becomes highly suspect.
 
@LeviMorrison feel free to convince me otherwise
 
google down?
 
@igorw I'd rather spend my energies on an API that will accomodate both of us.
 
@ircmaxell which one?
 
yay multiping
 
5:21 PM
@DaveRandom Agreed, regarding MAX_FILE_SIZE, you can't "turn it off" in Zend_Form, it is such a crap, and it's validated by PHP (ZF specifically), browser don't care what it is.
 
fair enough
although I would be interested in other opinions on the matter
 
@igorw I think @LeviMorrison is smart about having a categoric no-static policy ;) It removes the need to think about "well maybe in this particular case static could be maybe potentionally not really bad" :)
 
seems search is down for me
 
@ircmaxell search is fine here.
 
@DaveRandom It's easier to learn Bible, Kur'an and Torah together, than RFC.
 
5:22 PM
now is a proud owner of a Kindle Paperwhite
 
@webarto Guess you never read the RFC of the Bible.
 
@NikiC Congrats, now put it on a shelf to collect dust :P
 
@igorw: Reviewed your changes, didn't see anything really, just two more minor things: github.com/igorw/CgiHttpKernel/pull/5
 
@NikiC that's a fair approach, although it may lead to avoiding functions where functions are appropriate.
 
@igorw If a function is appropriate then you should use a function and not a static...
 
5:24 PM
@webarto Indeed, though that's a fundamental and pretty basic flaw in every MIME parser I've ever written :S
Obviously no-one ever actually does it or I'd have noticed before now
 
@NikiC I don't disagree, but a static method is really just a function.
 
Should we call IETF police?
 
@igorw Sure
 
@LeviMorrison Say, when you ran with SPL ... how much slower did it become?
 
No don't, they will take me away for repeated and flagrant standards violations
Who said that? Not me. /hides
 
5:26 PM
But it so easily invites misuse that it's better to make it a real function. Otherwise people will start using things like Late Static Binding ;)
 
Hai.. Any Yii developers is here?
 
@Jack Approximately 20s-40s slower.
 
@ircmaxell Why yes on trailing comma?
 
@hakre ProcessBuilder::create() can be (new ProcessBuilder()) then we can lose the annoying IDE comment
 
@igorw I do like appendTraversable or appendAll or whatever you want to name it that just takes Traversable and appends items in the order the traversable supplies them. In case of an array, that does require a new ArrayIterator($array).
 
5:27 PM
@LeviMorrison Then maybe I messed up something, because it's still running :(
 
@Jack Perhaps you did :]
 
@LeviMorrison uuuuuuuuuuuuuuuhhhhhh
 
@igorw But that is PHP 5.4. The IDE comment went in there by error, I forgot to remove it. Will re-push forced.
 
@LeviMorrison a bit annoying for plain arrays, but an improvement already
 
@LeviMorrison I mean, like, seriously? Why add arbitrary restrictions?
 
5:28 PM
@NikiC Why no?
 
@hakre ah yea, I briefly forgot that this lib isn't 5.4+.
 
@NikiC I'm a bit paranoid with type safety. Sorry.
 
@LeviMorrison Bad
 
To all, any Yii developers..?
 
Paranoia is always bad
 
5:29 PM
@NikiC Would you rather have a static factory method?
 
        $this->array = new SplFixedArray($rows);

        for ($i = 0; $i < $rows; ++$i) {
                $this->array[$i] = SplFixedArray::fromArray(array_fill(0, $columns, 50.0));
        }
 
@LeviMorrison No, I'd rather not have arbitrary type restrictions ;)
 
@igorw Yes and it's really a bug in PHPStorm to not deal with it.
 
@LeviMorrison That's what I have ... doesn't seem wrong does it?
 
@Jack At a glance, no, but I wouldn't do it that way.
 
5:30 PM
it's annoying that W3C doesn't put BNF into their "specs"
 
@LeviMorrison Not allowing to pass arrays is the same as not allowing object keys in foreach. Both are arbitrary, stupid restrictions. Don't do them.
 
@hakre ok, merged #5.
 
@NikiC why not
 
@LeviMorrison Well yeah, I could cache the array_fill
 
@igorw did it refresh?
 
5:30 PM
@Jack Why use array_fill at all?
 
@ircmaxell Wrong question asked. No is the default position ;)
 
Just do new SplFixedArray($columns);
 
@LeviMorrison I dunno .. it was there in the original code.
 
"No" because useless change that is ;)
 
@hakre I got the latest version. and I always merge locally because I like to run the tests before I push.
 
5:31 PM
@Jack And then set them all to 50.
array_fill was there because it's nice for an array
My guess that the references (which are needed for the arrays) are killing you with the SplFixedArrays because they aren't needed anymore.
 
Possible ...
 
I'm not sure why but references really slow down things that are objects.
And they aren't needed anyway for this case.
@NikiC It's not arbitrary; I want to make sure I can foreach it and we don't have a foreachable or Iterable type-hint.
 
@LeviMorrison then do a custom check. but don't disallow arrays
 
@NikiC I'm not, I'm just punishing you for using them. You simply have to use an ArrayIterator.
I don't WANT you to use arrays.
 
@NikiC Not useless at all. Many is the time when I've swapped arg order round while developing and not been 100% paying attention somewhere and I get a syntax error because there is a trailing and/or missing comma (usually when I have the arguments laid out on a line each). Allowing a trailing comma "fixes" that by bringing it into line with how arrays work and doesn't hurt anything. IMO.
 
5:35 PM
@LeviMorrison Sunrise looks interesting, reminds me a lot of functional-php
 
e.g. add a small function ensureForeachable() and call it on arguments
 
@NikiC And then throw stuff when it fails? Sorry, but that's very unattractive to me.
 
@LeviMorrison okay, that discussion is done then. clearly you went crazy
@LeviMorrison why?
 
Also, I never got around to saying that I could also add appendArray. It's not like I can't allow arrays at all . . .
 
@NikiC why?
 
5:38 PM
It's just a simpler API to force you to use ArrayIterator.
 
@LeviMorrison why is is a simpler api?
 
@NikiC I'm not removing type-hint, so any argument you base on that I won't do.
To be 100% honest, I'm not sure I even want class Vector around.
 
@LeviMorrison I fail to understand that line of reasoning. Could it be that you are using a shitty IDE?
 
@NikiC IDE is irrelevant.
 
I.e. one that does not support doc comments?
 
5:40 PM
user image
2
 
Why, what else would the typehints be relevant for?
if it is for typesafely, then, as already mentioned, you can easily just create a function that checks the type
 
@NikiC uh . . . what they are useful for: language enforced type safety . . .
 
@Lusitanian *kisseshand*
 
@NikiC No, I'm not doing that.
 
@webarto =D
 
5:41 PM
@LeviMorrison why, if I may ask?
 
@NikiC It's nasty when a type-hint solves the type-safety problem.
And I have more code to write, test, and maintain.
I need no more justification.
 
@LeviMorrison it doesn't solve the type-safety problem as it disallows the wrong things
 
@NikiC It isn't disallowed at all.
You just have to wrap it.
 
@LeviMorrison No, you don't have to. Do you currently test the catchable fatals that are thrown on invalid type for every single function? No, you don't. So you don't need to test the function doing the equivalent either
 
@NikiC Invalid argument if I do what you suggest and test for array or iterable and throw an exception on error.
I then have to test multiple conditions and the exception.
And believe me, I consider that a need. I've screwed up too many times in simple bits of code like that to not test it.
Anyway, back to the main goal: support arrays while not making someone do a foreach loop themself or resort to reflection.
 
5:45 PM
Hey guys, can I ask a question?
 
@LeviMorrison You may need to test the code once and exactly once
 
@LeviMorrison why not? linked vs random access are different use cases, having implementations of each makes sense to me.
 
@igorw Yeah, but I can't think of one instance where Vector is really superior to an array as things currently stand.
 
the type checking is a separate function that is tested separately and not as part of every other method using it
 
@LeviMorrison because userland is slow? I guess having an ardent PHP ext would be nice.
 
5:47 PM
hello? can anyone read this?
 
@igorw Perhaps it might be someday.
Although coding some of the stuff I do in C won't be fun, particularly the iterators and tree classes.
@David19801 Yes.
 
Signal is weak, I can't read your text, it's garbled.
 
190
Q: What can I do when getting "Sorry, we are no longer accepting questions/answers from this account"?

ArjanDo not repost the question you were about to ask until you have READ EVERYTHING WE ARE ABOUT TO TELL YOU. While trying to ask a question, one could get: Oops! Your question couldn't be submitted because: Sorry, we are no longer accepting questions from this account. See http://go...

 
does anyone know what the regex on this does? preg_replace('/([.!?])\s*(\w)/e', "strtoupper('\\1 \\2')", ucfirst($content));
 
@ircmaxell @NikiC I'll be back in ~1hr. Later.
 
5:51 PM
@David19801 Didn't I tell you before what it would do?
 
you did not
 
I can tell you it's deprecated.
 
?? really? well, the problem is it is removing all the paragraphs in the $content part too
 
8 hours ago, by Jack
@David19801 Hmm, perhaps it makes sure each starting letter is capitalized?
@David19801 There
 
sorry i must have missed your reply
yes, it is supposed to capitalize each first letter (and does) but it also removes all the line breaks/when people press enter/paragraphs
which part of that code is doing that?
 
5:54 PM
@David19801 The \s* combined with '\\1 \\2' does that
Btw, you shouldn't use /e modifier.
 
i just copied and pasted it from a stack answer...i am unsure how it works exactly...
how can i make it just capitalize the first letter of every sentence without removing line breaks and paragraphs?
 
Hi all
 
what does the /e do?
 
preg_replace_callback('/([.!?]\s*)(\w)/', function($matches) {
    return $matches[1] . strtoupper($matches[2]);
}, ucfirst($content));
 
@David19801 see PCRE Pattern Modifiers.
 
5:57 PM
would it work if i keep my version but just changed the regex?
 
Yes, but don't, because of the /e
 
like will this work: preg_replace('/([.!?]\s*)(\w)/', "strtoupper('\\1 \\2')", ucfirst($content));
 
Try it ;-)
But seriously, use a callback
 
is callback mean use a function?
 
yes
 
5:59 PM
ok last question, is the callback way more resource intense than my way?
 
What you are doing there is quite inefficient and potentially insecure
 
Has anyone ever seen $GLOBALS["___mysqli_ston"] before?
 
And deprecated, because of the above
@Jack What, as a pre-defined?
 

« first day (880 days earlier)      last day (4051 days later) »