« first day (1748 days earlier)      last day (3200 days later) » 

3:00 PM
Well, I've gone and done stupided. I have a hierarchical routing/handler library. Works like a dream. But because it's hierarchical, the "bootstrapping" happens recursively; such that I have to... pass the injector around.
 
@Duikboot it doesn't look like there is much to it. What do you think a framework would provide you except for a router?
 
@kelunik oh, here's an example
https://github.com/mindplay-dk/benchpress/blob/master/src/Benchmark.php#L84
 
@mindplay.dk Just return ['elapsed' => ..., 'iterations' => ..., '...' => ...].
 
...........................
 
@DanLugg All tests passed.
 
3:05 PM
Thank fuck.
 
@DanLugg that's what you get for lumping routing and dispatching in a single thing =P
 
@kelunik Same. PhpStorm infers basically everything except values sent with yield. Maybe if they support my @resolve and @reject annotations it will... but I'm probably dreaming.
 
@kelunik that's not what arrays are for :-)
@kelunik or maps for that matter.
 
@tereško TBF, I segregated them, it just happens recursively.
 
@tereško ... indeed the router thing. Are there alternatives for a 'seperate' option with only a router?
 
3:07 PM
@kelunik also note, those return arguments are optional - some callers do not care about the extra information they can get from the optional extra return values.
 
@Trowski They would have to support promises or generics, yes.
 
@Duikboot if you need something to be done quick, pick a system that you already knoe
 
@mindplay.dk This pattern is used for several functions in the engine. Not necessarily the best, but it's not without precedent.
 
there is no point in investing additional time
 
@Trowski what engine?
 
3:07 PM
The routing responsibility kicks back a callable, then it's dispatched by the containing "module". But it could be invoking another module, and thus that module'll need to call whatever callable it resolves to. The dispatching needs injection, because params are arbitrary.
 
@mindplay.dk That's not what function arguments are for, lol.
 
@tereško ^^
 
@kelunik Yep. I also use the same notation for Coroutines (which are promises in my implementation).
@mindplay.dk The PHP engine. error_get_last() springs to mind.
 
@Trowski Yes, I already thought about creating a plugin for that, but I don't have time for it.
@mindplay.dk or imagegetsize.
 
@kelunik but those are not function arguments, they are return params - just happens to use the same syntax. Those are not arguments for the function - they are "output only".
@kelunik where it gets really fucked-up, is if people use return params for input as well as for return values; I don't do that.
 
3:11 PM
I thought for a short time preg_match_all might be a valid example, but it's actually not. It should just return the array.
 
@kelunik It totally should...
 
dig.
 
@DanLugg sounds like you tried to do something like the fabled "hmvc"
 
@tereško Basically.
 
wait, shit, I *have* done that.
https://github.com/mindplay-dk/implant/blob/master/src/AssetManager.php#L91
 
3:14 PM
/me pokes head in
 
@tereško And.. well, it works. Pretty well, actually. But I the cargo cult in me hates passing the injector around.
I don't think I've done anything "wrong" because each "module" could logically live as an application itself.
 
wait, or have I? this example is actually passing something by reference, for modification, it's not really taking a value and returning something else.
 
So it should be responsible for bootstrapping shit via injection.
But I dunno, I'm torn.
 
@mindplay.dk If you have to try and decide what your own code is doing, that's probably not a good sign, lol
 
@Trowski heh, sometimes there are more than one way to look at the same thing :-)
 
3:16 PM
@tereško put your answer here, I will accept it as solution.
 
@ircmaxell I been playing with php-compiler, but nothing good came out yet ... I have a question, possibly questions ...
function test(string $a, int $b) {
	return $a < $b;
}
given this
 
@Sajad I guess I should .. there is already an answer there
 
PHP_FUNCTION(test) {
	zend_string* v1;
	zend_bool free_v1 = 0;
	zend_long v2;
	ZEND_PARSE_PARAMETERS_START(2, 2)
		Z_PARAM_STR(v1)
		Z_PARAM_LONG(v2)
	ZEND_PARSE_PARAMETERS_END();
	zend_bool v3;
l1:
	v3 = v1 < v2;
	RETURN_BOOL(v3);

}
is that intentional ?
 
I was kinda in the middle of Mass Effect
 
if it's not intentional, how should it work ?? I was looking at implementing some more stuff but I dunno how this should work ...
 
3:18 PM
@JoeWatkins no, I just don't handle the types in the compiler
 
@DanLugg Seems like you are just doing a higher level of abstraction I don't feel like that is a hell worthy sin but I'm not the best architect
 
basically in the BinaryOp compiler you need to look at the types of the arguments and generate the necessary code
 
@mindplay.dk That method seems like it should be returning $packages.
 
@tereško nope. your answer has the code of unique error 23000
 
@Trowski it can't because the array is being built progressively using recursive calls.
 
3:20 PM
@mindplay.dk array_merge()?
 
@ircmaxell necessary code could be putting primitives in tmp zval containers and invoking ZEND_API stuff like is_greater_function, or needs to be something else ?
 
look though, there is a difference between pass-by-reference and return params in PHP:
http://tehplayground.com/#LFnyCFpn9
in the second example, there's no local variable defined for $world, so it's a return param only, you're not passing any existing value.
 
@mindplay.dk return array_merge($packages, $this->createAllPackages($missing));
 
@JoeWatkins well, I think we can short-circuit some of it (if both are primitives just compare directly, otherwise wrap in containers)
 
yeah, primitives where possible ...
 
3:21 PM
@Trowski Why do you yield here twice? github.com/icicleio/Icicle#example
 
@tereško will you add a answer or I do ?
 
@Trowski yeah, won't work, because createAllPackages() needs the result for further modification before it returns.
@Trowski besides, what would be the point in copying all those arrays? when the end game is one resulting array.
 
but won't that mean compiled code will behave differently to native code sometimes ?
 
@JoeWatkins not really sure in general how to handle that though. Could get dirty quickly... Perhaps add to typeInfo convertToZval() which you pass a tmp variable name and the source variable name...
@JoeWatkins possibly...
 
@mindplay.dk Mostly to avoid returning through a reference parameter. Array copies aren't terribly expensive anymore.
 
3:23 PM
@Trowski same price if you modify them.
 
@mindplay.dk Exactly. It doesn't look like createAllPackages() really needs the result, it just needs to know what's missing.
 
@JoeWatkins Yup, if we need to compare HashTables, the gains we get from not having to compare types become minimal.
 
@kelunik The first yield waits for the string to be written, the second yield is the return (or resolution) of the coroutine. This will be much better in 7, as the second yield would be return.
 
@Sajad the use who added the answer already wrote exactly the same as what I told you
 
@Trowski That doesn't make sense. You can't wait until the body is written and send headers after that. ^^
 
3:26 PM
@Trowski is that right? I'm not sure. Would need a bigger test-case to determine if that works or not.
 
@tereško ok, I accept his answer.
 
the "which code corresponds to UNIQUE" would have been up to you
 
@kelunik It writes it to the stream that is then used as the body later. Maybe this is what I get for making the interface PSR-7-like.
So it's not actually sending the body of the message at that point, it's just writing it to a buffer (which could be a file, in memory, whatever).
 
completely off-topic, how do you pick a Markdown library for php? I've seen at least 3 that all look fine to me - I really feel like I'm missing a common test-suite for all of them, for comparison. I've seen performance comparisons, but I would cache the result anyhow - much more interested in seeing what they do than how quickly....
 
Morning peeps.
 
3:31 PM
@mindplay.dk I'd take a glance through github.com/ziadoz/awesome-php#markup and pick out the one that suited my needs
 
@kelunik Maybe I'll flip that example around so it adds the header first, then just yields the response. Probably clearer that way.
 
@cspray yeah, it was down to three of those, but it's hard to compare the precise feature-set and rendering differences
 
Actually, you can do that in Aerys, too, but ->stream doesn't use promises there.
 
maybe I should whip up a comparison thing.
if there isn't already one around...
 
I guess the first thing I'd do is see if you need a specific flavor of markdown and weed out those that don't support it
 
3:34 PM
TBH, your Loop\run() is a bit too magical.
 
@kelunik Isn't that how Amp works as well?
 
@Trowski Nope, in Amp you pass a function to run:
run(function() { /* this is automatically a coroutine */ });
 
user895378
You don't have to. You can just as easily do this:
 
@kelunik That's optional though.
 
This is php and all, and not wordcrap chat, but I have a function that breaks my advanced custom fields plugin, anyone care to take a look? It must be something stupid simple, but I'm just clueless with wordpress.
 
user895378
3:36 PM
immediately(function(){});
run();
 
@cspray yep, need something with Github flavor, which narrows it down to 3, now 4, with one one that list I didn't know about ;-)
 
user895378
passing the optional function to run() is just a shortcut for manually creating an immediately() event prior to calling run()
 
@rdlowrey As long as we do not decide to error those when not in a loop.
 
@mindplay.dk I remember choosing github.com/erusev/parsedown for my last project because of GFM requirements
I seem to recall liking it but it has been a while
 
user895378
@kelunik yeah -- I haven't been able to think of any real drawbacks to allowing it though
 
3:38 PM
@Darius My mantra is to never work on WP for free.
And charge a lot when you do work on it.
 
:D
 
@kelunik I see what you mean. Since the initial events are set up without being in a running event loop.
 
Not trying to run you off or anything but this room is not very WP-friendly
 
Nah, I know.
I dislike it myself.
 
@rdlowrey Yeah, not really.
 
3:39 PM
But I agree with @rdlowrey, I don't really see any drawbacks to allowing that.
 
I think I might pull my shit together and waste and evening pulling them all together with a diff library so you can compare their output. At least three of those libraries have a set of matching *.md and *.html files I could pull together for testing, then run it through each engine and diff for comparison.
 
but sometimes clients are dead set on it, and hey, a job is a job :p
 
@cspray It doesn't have a safe mode, unfortunately.
 
user895378
I always kick things off with run(function {...}) just because conceptually it reinforces that everything is actually happening inside an event loop
 
user895378
That's the only reason I can think of to disallow event loop things when the loop isn't running (that conceptual distinction from regular synchronous code).
 
3:40 PM
@rdlowrey That's something I could add to Icicle in about 5 minutes.
I just might, because I too like the reinforcement it provides.
 
user895378
I think that helps people who may not be familiar with non-blocking code to better understand what's happening.
 
@kelunik Ouch. For my project it was just my own input so I didn't even look for that. If it was a user-facing app that would definitely mark it off the list.
 
@Trowski I think the reason is more when I stumbled over the coroutine example, because the constructor does the things there. It's basically the same with Amp's Amp\coroutine, but that's at least a function instead of a constructor. It somehow feels saner in my head, I don't know why.
@cspray I couldn't find a really good solution, so I just went with client side rendering.
 
user895378
The other reason is it's a pain to remember to add a run() call at the end.
 
@rdlowrey Unfortunately with the way I wrote Icicle, it really shouldn't be a coroutine, just a callable, since the loop doesn't know about coroutines.
 
user895378
3:44 PM
Easier for me just to put the entire thing inside the run call, even if it's only run("main");
 
@kelunik What client side renderer do you use? I write a lot of JS for work
 
user895378
@Trowski Yeah that was a decision I made early on that I wanted to tightly integrate coroutines as first-class citizens.
 
user895378
I can appreciate the merits of keeping them decoupled, though.
 
@cspray remarkable, currently.
Additional reason to render things client side is less load for my server.
 
@rdlowrey Yeah, unfortunately it means things like timers are not automatically coroutines (though it's trivial to make a coroutine timer with Coroutine\wrap().
 
user895378
3:48 PM
I was this || close to changing my coroutine wrapper function to be named wrap() the other day but everyone I asked was against it :/
 
@rdlowrey What is it called?
 
user895378
it's just a namespaced function coroutine(callable $f): callable;
 
I didn't even come up with the name wrap(), I think I took that from a JS lib.
@rdlowrey Oh, so Amp\coroutine(). Yeah, that's better than Amp\wrap().
Icicle has a Coroutine namespace, so it's a little different.
 
user895378
Yeah I was considering putting it in a static method Coroutine::wrap() along with Coroutine::resolve() as a faux namespace but ended up just sticking with the regular function
 
Does a coroutine act as a promise in Amp?
 
3:52 PM
On OSX, if a git pre-commit hook is picking up the wrong version of PHP, how do I tell it to use the correct PHP executable? Without hard-coding the path in the git hook.
 
@Danack It's probably using /usr/bin/php?
 
@kelunik I guess, but I have a ports install in /opt/local/... which I would prefer it to use.
 
user895378
@Trowski no, there was a time where we did that but not anymore
 
@Danack You might be able to use /usr/bin/env php and change the default version that way.
 
@Danack it uses whatever it finds first in $PATH env var
 
user895378
3:54 PM
You can "promisify" a coroutine like this:
 
@rdlowrey Most of the time it doesn't matter in Icicle, but there's been a few situations where that's been handy.
 
@Danack Just make sure the path you want is before all other versions you have installed and then use /usr/bin/env php.
 
user895378
// promise resolves to $bar on completion
$promise = resolve(function () {
    $foo = yield somethingAsync();
    $bar = yield somethingElseAsync($foo);
    return $bar;
});
 
alright, I'm off - if I build this Markdown comparison thing, you'll hear about it ;-)
 
@staabm where should I set it for all users? Which presumably is different from my actual login, which is using the version I'd prefer.
 
3:56 PM
@mindplay.dk Awesome. Definitely interested in seeing what you come up with
 
@rdlowrey Ok, so you made the promise resolver coroutine aware. Makes sense.
 
@rdlowrey I still don't like resolve, should probably be promisify, but I'm not sure.
 
Just edit /etc/paths ?
 
@kelunik Usually I've seen promisify used to convert a callback style function to a return a promise instead.
 
Oh, that seems dangerous....there's a huge number of ports programs in the directory /opt/local/bin/
 
user895378
3:57 PM
@Trowski That's the context with which I'm familiar when it comes to "promisify"
 
user895378
That's why I didn't like it there ... it usually means something else (most frequently in node where you constantly want to turn callback things into promises)
 
@Danack in ubuntu its /etc/environment which is used for all users
 
ah home =] morning yo [=
 
user895378
@RonniSkansing o/
 
@rdlowrey \o INTERCEPTED
 
user895378
4:08 PM
O/H SNAP
 
Promisification. A word it shall be.
 
^ I need to sneak that word into the docs somewhere.
 
Promisification is accomplished by calling ...
 
why would my foreach loop only return 1 result
 
4:12 PM
I think I'm going to do some UI stuff, so I can throw through an IWindow and refer to it as defenestration.
 
@kelunik and @staabm Thanks - just renaming the wrong version of php made it find the correct version instead.
 
foreach(['one'] as $value) { .. } // 1 time
 
foreach (['one', 'two'] as $value) break;
 
@DanLugg Promisification of things that are not asynchronous is a waste of resources and you should be smacked for it :-)
 
@DanLugg nice
hehe
do { .. } while(false)
 
4:14 PM
@Trowski Promisification of synchronous operations should be rectified with defenestration
6
 
@RonniSkansing I wrote that once. That's when I learned continue checks the loop condition.
 
My anal-retentive tendency toward character count in names has matured; they don't need to be identical if they're more than three characters longer or shorter, because it doesn't look as weird as one or two.
 
As much as you all hate wordpress, I need help. If I get this working, I'm done with this nightmare project (and client) wordpress.stackexchange.com/questions/196152/…
 
$action  = ...; // bad
$context = ...;

$executable = ...; // good
$context    = ...;
@Darius The nightmare never ends, it's like Inception.
 
@Darius I know nothing about wordpress, but I would have imagined that doing a join would mean that get_field now needs both the table name/alias and the field name.
 
4:20 PM
 
@Trowski @DanLugg promisification of sync things can be useful when you want a unified api (such as caching)
 
@DanLugg Still bad, because renaming breaks git diff and git blame due to alignment.
 
@kelunik Nah, s'all good.
 
@FlorianMargaine Yes, I agree. There's some sync stuff in Icicle that uses promises for just this reason.
But I've seen "Promise all the things!" libraries in JS that make me sad.
 
Yeah, if it's full sync, there's no reason to add promises
It's just stupid
 
4:34 PM
@Darius how is get_field() related to the code?
 
get_field() is formed by a plugin for wordpress Advanced Custom Fields, I edit the main wordpress query to get the results I like, but get_field() apparently uses the same query.
So, looking for a conditional statement of some sort to keep my inner join from happening if get_field is called.
 
Did you overwrite a core function or is it filter, which you know is also used by the plugin?
 
A filter
 
hmm is this really right? geo.lat BETWEEN '$minmax[min_latitude]' <--
 
My answer is, it works :p
and it's not user input, so doesn't hurt?
I saw it online like that, and just used it.
 
4:43 PM
=]
have you trigged changing the priority of the filter?
*tried
 
user895378
@FlorianMargaine yup, I take this approach to expose the same API if I have to fallback to synchronous operations (lets me develop using the same code in any environment even if I'm missing the extensions to do things asynchronously).
 
or you could add additional arguments to the filter, if the get_field calls the same filter, but not with the same number of additional args, it will be called
(and pass the extra args via the apply_filter)
 
I agree with you Ronni, the question is how can I place the conditional statement.
or what terms to use :p
 
5:00 PM
Does anyone know of a rich text editor that allows you to add widgets (chunks of html that are then managed as a unit)?
 
what is socket connection? what is it for?
 
@rdlowrey I plan to do this with the filesystem API. I'm guessing that's what you're talking about.
 
@NeelIon Ask Google these questions and you will get far more comprehensive answers.
 
@Charles i did, i want to know about socket connections advantage. Google has some really elaborate answers.
 
@NeelIon What does "advantage" mean in this context. They're sockets.
 
5:12 PM
@Charles what is it actually for? why we need socket?
 
Morning, room.
 
Morning, cat.
 
@LeviMorrison Mornin'
 
morning @levi
 
@NeelIon If you did even the most amazingly basic research on Google, as you claim you did, then you would have the answer to this question.
A network socket is an endpoint of an inter-process communication across a computer network. Today, most communication between computers is based on the Internet Protocol; therefore most network sockets are Internet sockets. A socket API is an application programming interface (API), usually provided by the operating system, that allows application programs to control and use network sockets. Internet socket APIs are usually based on the Berkeley sockets standard. A socket address is the combination of an IP address and a port number, much like one end of a telephone connection is the combination...
 
5:14 PM
I knew this trick already but it came up again: replacing fmax with std::max in C++ is significantly faster in many situations.
 
@NeelIon Go read that wikipedia article and every single thing it links to and do not come back before you have read it all.
 
@Charles okay
 
@Charles You forgot to say recursively
 
I'm seriously beginning to believe that "advantage" is a freaking dogwhistle word, in the same family as "doubt" and "the needful."
 
@NikiC but with recursion protection, I hope. Else you'll stack overflow :-)
 
5:17 PM
@NikiC Now that's just cruel.
 
hello
 
@ScottArciszewski I'm going to have to find a way to integrate that word into a work discussion somehow.
We've had an endless series of dick jokes that I must 1-up somehow.
 
I think I need to do some shopping
I'm out of water again
 
5:29 PM
@Charles I've also been trying to find a way to squeeze that one in
 
5:40 PM
That's what she said.
 
Hey guys. Quick question. Would it seem ridiculous to convert the HTML ID of some form input to an exact getter/setter method on an Entity? For example,
`<input type='text' id='person-address-city'>` would be loaded into
`$personEntity->setAddress()->setCity($formInputHere)`?
Address is a Value Object, btw
The idea is to find a nice way to map form input to entities (for CRUDy situations)
Didn't want to use Reflection. And of course I could just hydrate the Entity specifically in code. But a nice short cut like using the naming of form input IDs would be cool?
 
yes that seems quite strange to me
 
template<typename T, std::size_t size>
auto max(T const (&array)[size], T const & initial) -> auto {
    T const & (*maxer) (T const &, T const &) = std::max<T>;
    return std::accumulate(std::begin(array), std::end(array), initial, maxer);
}
I wrote that today. Some of you love C++ I know, and thought you might enjoy it. /cc @Andrea
 
screams
 
5:58 PM
@LeviMorrison std::array :/
There's also a built in max_element btw
 
I am aware of both of those things.
 
Then why did you write it?
 
@DavidGraham Yeah, but ids don't get submitted, names do, and you'd be far better off using the input array syntax, so name="person[address][city]"
 
@BenjaminGruenbaum I don't have control of the input. I am given a basic array.
As for max_element:
I'd write a wrapper even still because I don't want to do begin() and end() in the calling code.
 
Oh, I'd probably convert it to an std::array but I can see scenarios where that's not an option because of existing coding style or other constraints.
 
6:00 PM
It would just be a different wrapper.
 
@DavidGraham And even then, there's a hypothetical danger of users performing code injection if you trust the input too much (by tricking you into calling methods). Just because you're automating it doesn't mean you're validating it. Time to up the paranoia level of your code.
 
I guess I could do max_element instead of the accumulate stuff.
 
auto max = *std::max_element(arr, arr + size); // I guess
 
I think accumulate is just more known.
 
I hate C++ iterators, I don't buy the whole "raw" bull either. So I definitely sympathise with not wanting to work with them from calling code though. I think the C++ iteration protocol should be higher level and the existing iteration protocol should be kept for performance where it's relevant.
 
6:02 PM
Bjarne himself writes wrappers to avoid the begin() and end().
 
@DanLugg lol. You realize that's a thing right?
 
I can't remember from which talk that was.
 
They're just an API that should go away, a stain on how nice C++ got.
 
Or maybe I'm thinking of Herb. Can't remember.
:/
In any case, some prolific members of the C++ committee are aware of the iterator pain and want some easier APIs in the future.
 
Just think of how much of the above code would be written if C++ was new today
auto max<T, std::size_t size>( T& arr[size], T& initial) {
    return std::accumulate(std::max<T>, initial, arr);
}
Or even:
 
6:06 PM
Well, the const stuff probably still needs to be there.
I actually like the const aspect of C++. I know many hate it.
 
Not if immutability is the default and you need to opt out of it (rather than opt in).
 
Oh, I see.
 
Wait, there's rust, lol.
 
I enjoy Rust, but have only written one actual program in it.
(like, not toy program – actual program used)
I think interpreter VM's would be good to write in Rust.
Some pieces would be a royal pain since it forces you to work out lifetimes of things.
 
I wonder if C++ compilers make std::higher_order_iterator_stuff fast.
In JS it's significantly slower than a for loop because no one bothered to improve it and it's a pain to get a pull request in engines so people don't bother.
 
6:11 PM
@BenjaminGruenbaum Some of them are fast.
Especially in this case since it's just array access it has zero overhead.
 
The environments where I got to write modern C++ and the environments where I got to write performant C++ have been pretty exclusive.
 
I actually proved it to myself by writing both versions and doing performance tests.
 
@LeviMorrison Well, it's function application, does it get inlined 100%? If it does, does it get converted to a simple check at compile time?
What I love about C++ is that performance tests are so much simpler than some other languages because of how deterministic it is. Writing performance tests for a JITed language is really painful :/
 
@BenjaminGruenbaum In this case all of the inlining takes place.
 
6:13 PM
I guess I could compare the generated assembly for differences.
But if there is any difference it wasn't observable at runtime.
 
Yeah, then it's all good
 
The program is computation heavy with no IO, so it's pretty nice for testing performance :)
(no IO during the expensive part, I should say)
 
Yeah, I miss well-behaved code
 
There are three potential cache misses when there is a virtual method call. Basically every time you do a -> on a virtual method (not a static method being called on a pointer) you are destroying performance.
I really hope that abstraction is worth it to you.
Some things require it, sure. It's just way overused :/
 
@LeviMorrison Bjarne argues the exact opposite position - he said that when you -> and a vtable lookup happens it has a 25% tops performance penalty.
 
6:18 PM
Morning again
 
This is an example of JITs being useful btw, JS and Java would just pick the right overload and opt out on cache misses. C# took the easy route like C++ (not virtual by default) so I'm not sure it's as fast in optimizing it.
Although I'm starting to hate inheritance again, it comes in periods.
 
Maybe you don't measure your programs in the same time frames I do.
25% on a program that runs for 7 days is a lot
Pushes it to nearly 9 days…
(assuming the virtual call is in the critical, bottlenecked region)
 
@LeviMorrison we have code that runs for months at a time, but it's written to scale on dataso we'd rather pay 25% more than optimize 25%. It's reasonably fast but it's not really bound by vtable lookups to say the least.
 
That can be reasonable.
As long as it's an educated, informed decision.
I guess my attitude mostly comes from the training and teaching material I've seen for beginners.
C++ is a wonderful OO language!
 
Yeah, C++ tutorials are terrible
 
6:22 PM
Virtual calls for everyone!
 
s/C++//
 
How were your classes that taught parts of programming languages, @NikiC?
 
They don't really teach programming languages around here
 
Are you doing Computer Engineering? Can't remember.
 
You're assumed to know C and Java and whatever languages individual courses may use
@LeviMorrison Computer Science
 
6:25 PM
They teach C++ here, they do a horrible job.
 
How much theory stuff do you do?
Is it really science or more software engineering?
 
@LeviMorrison mostly theory, assuming that was for me. 3 courses on practice and the rest theory. To be fair a lot of the theory is at a very high level.
 
I know everybody hates references, but would it be too big a breaking change to make by-ref params implicitly nullable?
 
@LeviMorrison now you are just being mean
 
@DanLugg why?
 
6:27 PM
@BenjaminGruenbaum Any courses on parallelization?
Or concurrent programming of any kind?
Type theory?
I can only see what universities claim in their learning objectives, which often doesn't reflect what was really taught.
 
@bwoebi Because they're "out" params, and typically null is passed with the intent of assignment in the function body.
 
So it's fun to ask people enrolled or alumni.
 
And if the param is typed, then it has to be optional to be nullable.
 
@DanLugg not necessarily?
 
@LeviMorrison There is an OS course where we learn semaphores, mutexes, readers writers locks, dining philosophers, monitors etc. It's very low level though. There is a course in distributed computation but that's more fault tolerance, PAXOS, byzantine faults etc. There is a course in supercomputing algorithms which is also very low level - mostly linear algebra. There are some more niche courses too. I know most of what I know from practice and reading a lot.
Like, the OS course is mostly actually using linux kernel locks and CPU primitives for building them like compare and swap and all that.
 
6:29 PM
function f(C &$o) { }
$o = null;
f($o); // boom
 
Eh… I think you already know what I will say, Dan.
 
@LeviMorrison DID I ASK YOU!?
;-)
 
@LeviMorrison Type theory - nothing. Learned myself. There is a Haskell course which I actually attended but the instructor didn't know Haskell so I ended up correcting him for the first two lessons until I gave up. It's a shame I had high expectations.
There is a category theory course that's very mathematical. Nothing in actual type theory. In the AI course you lean unification (but for learning, not type inference).
 
@bwoebi Well, they may not need be null, but there's no way to enforce a required by-ref typed argument.
 
Sounds like a decent program.
 
6:31 PM
It's a very decent program, it's just that everything practical was shit.
 
@DanLugg does (Foo &$bar = null) not work?
 
@LeviMorrison Not a great deal of theory. Apart from the usual math (multidimensional analysis, stochastics) we have four theory courses on discrete datastructures, language/automaton theory, logic and bisimilarity analysis / fixed-point logic
 
C++ was a terrible course where the instructor didn't know C++, so was C. OOP was in Java and was filled with singletons and serialization, the final project was parsing a java like language with regex. Had a very wrong JS chapter. Terrible. OOD (Advanced OOP) was even worse, instructor called the operating system MVC, taught serialization and singletons and UI in Java. Was awful.
Computability was all awe and wonders, and everything advanced was good.
 
@bwoebi Of course it does, but given foo(Bar &$bar = null) I can just foo()
It'd be nice if typed by-refs could be required, rather than have to be optional.
But the only way I see that working, maintaining the ability to pass a null intended for body assignment, is if by-ref were implicitly nullable.
 
What were you doing with promisification before? @DanLugg
 
6:34 PM
@BenjaminGruenbaum I wasn't promisifying anything. Just making up words. Or not, apparently.
 
81
Q: How do I convert an existing callback API to promises?

Benjamin GruenbaumI want to work with promises but I have a callback API in a format like: 1. DOM load or other one time event: window.onload; // set to callback ... window.onload = function(){ }; 2. Plain callback: function request(onChangeHandler){ ... request(function(){ // change happened }); 3. No...

:D
 
@ircmaxell totally
who even thought supporting that kind of crazy shit was a good idea
 
expect? or remote entities?
 
@ircmaxell I've actually seen schema MITM exploited before
It's very cute
 
6:38 PM
@ircmaxell Everything
 
:-)
 
death2xml
 
XML isn't that bad.
The problem is what they do with it.
 
@ircmaxell The part where libxml does not make it mandatory to pass an array of allowed entity urls to every function. Maybe?
 
@bwoebi Like try to define schemas representing procedural languages.
 
6:41 PM
@DanLugg yeah, like that.
 
I love XML. It models some most stuff awesomely.
 
@NikiC that's hard. why would someone do that?
 
@ircmaxell How can this problem be solved apart from whitelisting URLs?
 
@NikiC it can't. I'm being facetious. That if something is hard but secure, PHP will chose easy and insecure every time
 
unfortunately!
luckily my proposal for 7.1 is easy and secure
which I need to work on ASAP
 
6:56 PM
is it possible to change a url from something like example.com/directory/script.php?key=abc to example.com/directory/script/abc while keeping the script working as it's supposed to?
 
Yeah, typically you use .htaccess rewrites (if Apache)
 
@SebastianBergmann I have the job :)
 

« first day (1748 days earlier)      last day (3200 days later) »