« first day (2126 days earlier)      last day (3050 days later) » 

00:10
@LeviMorrison looks pretty much straight forward… you may want to integrate spl_fixedarray struct directly into the object struct, but this way it's fine too :-)
@bwoebi Yes, but that's more work and more risky.
This is very safe and not a lot of work.
^_^
@LeviMorrison hence "this way it's fine too" =)
Hey, to be fair I've been trying to ping you about partial function application
:D
Me?
00:20
Yes :D
Okay, pong!
lol
Okay, your |> proposal that I like but don't like the $$ part?
If we have partial function application with _ then it becomes:
yar?
$ret = scandir($arg)
    |> array_filter(_, function($x) { return $x !== '.' && $x != '..'; })
    |> array_map(function ($x) use ($arg) { return $arg . '/' . $x; }, _)
    |> getFileArg(_)
    |> array_merge($ret, _);
|> is simply evaluating its left and right hand sides then doing $rhs($lhs).
No more need for $$.
But what about constant abiguity?
00:23
It's a BC break.
!!eval define('_', 'oops'); echo _;
Okay, I'm actually (mostly) fine with the argument that anything with a leading underscore counts as reserved
Though I'd lean towards the perl end of that route with $_ rather than _ alone
Defining it again will not cause any harm - constant redefinition warns and leaves the original value.
But maybe I don't have the full scope on what you mean by "Partial Function Application"
00:26
array_merge($ret, _)
That is equivalent to:
@Sara cough.
function($_1) use ($ret) { return array_merge($ret, $_1); }
It will close and accept parameters with the correct referencey-ness.
Ooooh
So in the Pipe implementation, rhs is a callable, not a straight expression
Correct.
@Sara Tell me which solutions the voters will approve with a two-thirds majority and I'm going to implement one…
00:28
Also, in that particular case of using |> and _ together we can probably avoid actually making the closure.
@bwoebi I saw make the vote have four options: [No][Yes-byvale][Yes-byref][Yes-idgaf] And if you get 2/3 between yes-X and yes-idgaf, then that wins
This also means you can use |> with arity 1 functions: |> 'strlen'
@LeviMorrison Yeah, I'd want to optimize that case for use, since it's a single-use closure
@LeviMorrison See though, that looks bizarre to me.
Just because it's stringly typed.
@LeviMorrison In that scenario, I'd do: |> strlen(_) and trust the compiler to optimize it :p
00:31
But if you want you can just write |> strlen(_), yeah.
For the readability
@Sara And then people are complaing about the short aspect, about that use($*) and use(&$*) would be much better and bleeeh.
That's exactly what I was getting to as well: you can avoid a lot of the stringly typed ness with partial function application.
@bwoebi How about implicit capture (whether by val or by ref), and allow explicit capture when you want the other form?
@Sara That's what we did last time and yeah…
00:32
@LeviMorrison I'm not convinced that's solving a problem, but I'm willing to meet halfway on it.
It also has uses outside of |>.
As to partial function application by itself, that sounds like a potentially useful thing...
Although, what about PFAs where you want multiple args, potentially in different orders?

$x = iconv(_, _, 'UTF-8'); $y = mbstring_convert('UTF-8', _, _); But the closures need the same signature
@Sara Just because you can do ('strlen')('bar') === 3 currently, you shouldn't necessarily.
@Sara We could find ways to solve that but I honestly don't think it is necessary, especially if we also get short closures :D
@Sara iconv($2, $1, 'UTF-8') ducks
00:34
@bwoebi Right, which is why I don't like the quoted string as Callable global func look
@LeviMorrison Truth.
@bwoebi Well, that actually was my thinking...
iconv($2, 'UTF-8', $1) ???
I DON'T EVEN KNOW WTF THE RIGHT SIGNATURE IS!!!!!!
(=> iconv($2, $1, $1))('UTF-8')('ISO-8859-1', "föö")
So.... wrt |> I think the PFA discussion is slightly orthogonal to it, though if both are implemented, then they should certainly share a consistency of syntax. So in that regard, I'm fine making the token be _ instead of $$ so that they can look alike, even though that means a BC break in using _ as a constant
00:37
(if we mix this with numeric parameters for short closures … toooootally unambiguous.)
@bwoebi You. Out. Get your coat.
uh wait…
perhaps we should just prefix symbols… like…
(=> $2($!2, $!1, $1))('UTF-8', $1)("iconv")('ISO-8859-1', "föö")
That's unambiguous now!
Though I will say, disambiguating _ as Constant/PFA-sub/PO-sub could get ugly...
@Sara My point is if you drop $$ and simplify |> to just be:
operator |>($lhs, callable $rhs) {
    return $rhs($lhs);
}
Then it's a much better situation.
Sure.
00:48
The fact that we don't actually make a closure when you combine |> with _ is a detail.
o/
Well, it's a fairly complicating detail, but yes.
(Or might be, hoping it will be)
How likely do you think passing PFA would be?
More likely than passing pipe, if you ask me…
though, with PFA, I also could see pipe passing, but not the other way round.
00:50
:p
I think PFA improves the chances of |>.
I agree.
Because it's $$ that a lot of folks are objecting to
And we could start Pipe Op as a dumb, unoptimized caller, then add in simple string->callable-global-function op, then work on more complex optimizations for multi-arg callables.
Is there a PFA RFC yet?
I did a really quick brain dump is all it is, really.
00:54
the issue I see with PFA is that it potentially makes hard to follow (especially if used subsequently) what exactly has been pre-bound
Example?
@bwoebi That's actually my biggest complaint about PFA atm as well. I think _ is too easy to miss while scanning a line.
Also, the way PFA is designed, it only allows for binding when parameters are lacking, but does not allow for fully binding without immediate execution
It's literally "fill in the blank" operator.
Why do you think it's the underscore? :D
Yeah, I get that reasoning, but it doesn't help that it's SO missable
00:56
I think a construct like => foo($1, $var) is just as expressive and much more powerful in general
I'm not going to bikeshed the replacement char, I'm just saying I don't care for it.
I still want to see an example.
Also fully binding all args but not executing could be fulfilled with Nikita's theoretical ... binding.
foo($a, $b, ...)
$isEnabled = (=>ini_get('feature'));

if ($isEnabled()) { ... }
Since ... allows none.
@LeviMorrison ... okay. Feels like an abuse, but okay.
00:58
I don't think that it's a common use.
function foo($db, $acl, $bar) {}
$f = foo($db, _, _);
// next function:
$f = $f($acl, _);
// next function
$f(???); // uh, which parameter exactly was that … uh … tracing back, we see it was $bar…
shrug I'm not sure how common it'd be tbqh
@LeviMorrison Is that varargs binding?
I am not sure I've ever fully bound all the args and not executed it. Zero-arity functions are not common.
function (... $args) use($a, $b) { return foo($a, $b, ... $args); }
^ That's its equivalent (assuming $a and $b are by-value)
I could imagine it if the callable needs to conform to some interface's requirements.
01:01
Anyway, I think it's a very good addition.
function f(Callable $getdb) { static $db = null; if (null === $db) $db = $getdb(); ... }
@bwoebi The problem here is the reassignment of $f, not partial function application...
@LeviMorrison with next function I mean that things get forwarded into another scope…
This same dissonance will probably happen with a closure too.
@LeviMorrison with a Closure you're at least forced to name your missing params each time you PFA
01:03
If you think it would be better then write it that way.
I get that people have to maintain the code at some point.
We can make ugly code out of many features.
Let's not make contrived examples with multiple PFA to the same function within the same scope.
The fine point is whether the feature will lead to much ugly code or just some.
I trust it will be mostly good code used in combination with |> or as callbacks to things like array_map.
I sadly cannot simulate what it'll really look like in the wild, thus dunno.
Going back to arrow functions for a moment: I think we should capture by reference.
Or rather, I think we should leave it as part of the vote.
Add arrow functions? Okay, do we bind by value or by reference?
by value because it's the only sane choice :-)
01:07
Yes, but if you let the by-ref people vote in that section they are more likely to say yes to the first.
I have no problem with an additional vote if I'm guaranteed that the by-ref people will lose.
lol
I can't guarantee it but I think they would.
Also would you still want something without parameters for single arguments?
^$x => $x * 2
?
what do you mean? using => $1 * 2 instead?
No, no.
^($x) => $x * 2 would be the normal syntax.
I'm saying with single arguments do you want the () to be allowed to be omitted?
I don't care. It can always be added later on
01:22
@LeviMorrison Don't strongly care. I would say "by ref" at least gives the user the option of explicitly separating, while by-value is only ever by value (barring ValueObjects)
@Sara Which is why that is a viable choice.
@Sara It depends… If we allow blocks, then def. by-value; if it's just single expr, by-ref shouldn't do any particular harm and I'm fine with that too.
@Sara The issue with auto-by-ref is that, due to PHP semantics, you never will get notices inside short closures
(as all used vars are automatically predefined to NULL by-ref)
01:39
@bwoebi I thought there were notices on undefined variables used by ref?
@LeviMorrison no.
02:15
@bwoebi I was coming in assuming blocks would be allowed (sorry, my head defaults to HackLang syntax)
@bwoebi Fuck users who typo their variables! ((Okay, not really, and I get your point))
@LeviMorrison Sadly not. :(
 
1 hour later…
03:26
morning
03:52
@Sara Initially no. I think this helps its chances. Plus it makes sense that "short closures" should be short, and multi-line blocks don't really fit that.
I get that auto-capturing would still be nice there.
04:16
Anyone has a answer for this stackoverflow.com/questions/38653117/…
04:35
Noob question: is this opening an https connection:
$ctx = stream_context_create();
// Define the certificate to use
stream_context_set_option($ctx, 'ssl', 'local_cert', '/certificates/mycert.pem');
// Passphrase to the certificate
stream_context_set_option($ctx, 'ssl', 'passphrase', 'codular-test');
 
1 hour later…
06:03
@andho I’d guess it doesn’t. Where would it open the connection to?
sorry, that's just the stream context i guess. The next line opens the connection.
$fp = stream_socket_client(
    $gateway, $err,
    $errstr, 60, STREAM_CLIENT_CONNECT|STREAM_CLIENT_PERSISTENT, $ctx);
06:19
Hello guys, Is there anyway to parse plain text to well-structured array?
06:49
@Rozig yes if the text has some delimiter at random intervals
Below text given:
Its the title
[here is the identifier. it will be number] Here text goes.
And the array must be like:
[
"title": Its the title,
"identifier": here is the identifier. it will be number,
"content": Here text goes.
]

is it understandable?
hmm some what
$arr=array(title=>give the array of title strings, identifier=>give aray of identifiers)
you can do so
07:06
@StackB00m Can you check this out? imgur.com/a/5HbN2
got your point
read through about json_encode thorughly
wait you have the text and want to make it json ?
or you have json and want text ?
@StackB00m I got a text and want to parse it to JSON.
use json_encode
@StackB00m Yeah i know how to parse something to JSON. Only problem is i need to format text like JSON format on the picture.
@Rozig read the manual page for php.net/manual/en/function.json-encode.php which leads to php.net/manual/en/json.constants.php which is pretty interesting.
07:18
Mogorings
Indeed.
@PeeHaa is bullying allowed in the chat?
@Rozig No. Link to it?
But also, the ignore button exists for a reason.
@Rozig Bullying?
facepalm
This:
7 mins ago, by PeeHaa
Mogorings
07:26
How is that bullying?
Maybe I'm blinded because I know what it really means?
Is a play on words of how some people can't pronounce morning before they've had their coffee.
Did you think he was calling you a bad word?
Maybe he's thinking of "moron" or something like that?
@Rozig "Mogorings" is a bad spelling of "Morning"
@MadaraUchiha If so its fine. But some of people use "Mongorings" for bullying Mongolians.
Ah, you're probably thinking of "Mongorian", right?
morning
07:29
So yeah, that's not what's being said here, just a misunderstanding ;)
@MadaraUchiha so what have you been upto lately since you've been dead for a while now? ^^
@MadaraUchiha They also use few other words for bully Mongolians. Okay @Madara
So how is your fight? @MadaraUchiha @Naruto :D
@Naruto Given that everyone thinks I'm dead, I took some time off to rest, taking over the world is hard work, you know.
But you are dead :P you just don't wanne admit it ^^
Ekn
Ekn
mornin
Anonymous
07:38
Moins
mornin roomies
@Rozig Not really know
Why?
Anonymous
@PeeHaa You offended him with your mornings. Ass.
:P
lol
07:50
!!rebecca
Pro tip @Rozig: don't feel offended / try very hard to find offensive things no the internet. It makes you life harder than needed :)
@Linus Happy Prebeccaday!
@Jeeves That took you long enough
@DaveRandom wasn't really awake yet so typing it took some time I guess
Anonymous
Nah Linus can't spell Rebecca :/
oh lol
07:51
:P yeah that
:D
Asshole :P
Anonymous
;D
lol
/me needs coffee or I will keep getting trolled by you
Anonymous
<3
07:53
Just a real pro can answer that stackoverflow.com/questions/38890170/…
Sorry we only have amateurs here.
Just like @Jimbo's mom
hahha
@TheQuestionerMan BTW more serious your question doesn't have a question part
@PeeHaa Just got it about what you said :)
:-)
@Patrick you also are coming to mysteryland again this year right?
Wes
Wes
08:00
hodor
ugggghh fak damnit. I hate making typos the fact the php is such a shitty language that allows dynamic object properties on the fly with any warning
@Wes Montothering
@PeeHaa Just use Amp\Struct. Or do you mean inside the class?
@kelunik Both. Mostly happens inside the class because of private properties :(
o/
Anonymous
Yo fappen
08:06
hey fap
You packed your stuff yet?
Nah, got till the end of the month
More sale issues than anything, got a gaming PC up for £600 that i need to sell + a bass guitar thats £300
Those are the pressing concerns. Also cancelling loads of contract stuff.
@PeeHaa meh, he's going the "show me that you're a real pro!" route, I would ignore him
it's annoying.
Anonymous
It's like 10 year old psychology
@FlorianMargaine True
Anonymous
08:10
@Fabor Don't forget this either :) google.co.uk/flights/…
Also don't forget to the thing, because it's not a question
@PeeHaa its not your level like you say
\o/ For the glory of satan
@JayminsFakeAccount Once you buy them sure
08:12
@TheQuestionerMan Nope. I don't understand vampire
http://stackoverflow.com/questions/38888995/codeigniter-framework-lis‌​t-with-a-loop
Anonymous
@Fabor :P
Quick sanity check @FlorianMargaine / @MadaraUchiha. I want to properly round a string float. Is this the way to go Math.round(parseFloat('my string'))? #TooLazyToUseGoogle
@PeeHaa toFixed()
ah, misread
yeah, looks good
08:20
\o/ ty
Hey magic
I only just started in PHP, and I was told to use parameterized queries only in my company due to style guides and protection vs sql injections
Sounds sane
I wrote a little code and it works, I want to know if I'm doing parameterizing correctly. Is this the right place to ask?
08:21
@Magisch Parameterized or prepared?
Sure. Pastebin / gist it and share the link
@Fabor Parameterized
This query is made from data in a POST request
I don't think that does prepared params + binding. Let me check the docs. I don't use mssql
!!docs sqlsrv_query
[ sqlsrv_query() ] Prepares and executes a query.
!!docs sqlsrv_prepare
08:22
[ sqlsrv_prepare() ] Prepares a query for execution
Thought as much
Oh query is a shortcut
Yeah what you have looks fine @Magisch
Thank you guys :)
'nin
Anonymous
\o
08:30
@PeeHaa guide.room11.org 404's for me
morning everyones
decided to test the loudness of a mechanical keyboard at work ... seems fine
at least MX Brown are quite enough
Jan 12 '14 at 17:54, by Danack
trait SafeAccess {
	public function __set($name, $value) {
		throw new \Exception("Property [$name] doesn't exist for class [".get_class($this)."] so can't set it");
	}
	public function __get($name) {
		throw new \Exception("Property [$name] doesn't exist for class [".get_class($this)."] so can't get it");
	}
}
/dat tab tho'
mornin tereško
Wes
Wes
@tereško you wanted it to be loud, right, to piss off people? :D
!!wotd
08:34
lief: gladly; willingly.
Anonymous
@tereško I would not be able to sit next you :P
@Wes no, I just want to get a better keyboard for myself, because our stock equipment is K200 keyboards
@Magisch Yeah sorry. I cocked it up :(
wasn't sure if you knew
:p
08:37
Yea. I tried to setup a blog and somehow broke that too
Tnx for reporting though
@JayIsTooCommon .. not that you will ever get a change, but it's barely louder than the AC
Wes
Wes
@tereško i did the same at previous job. and i even brought the keyboard at home every day, because we had cleaning ladies always destroying our hardware and even other people in the building stealing from other offices. it was a 150$ keyboard :B
@Ekn Psht. Hikaru from Hikaru No Go already did the "Seemingly bad to good move" tesuji. AlphaGo just copied his style.
Anonymous
@tereško Don't say that, one day your dream will come true and we'll work together.
Ekn
Ekn
08:41
@Fabor Yet another Shonen Jump I missed it seems.
Anonymous
mornin Chris
It's actually one of my top 5, but from when I was younger. I could rewatch it for nostalgia but as a first time view, I would be skeptical to enjoy it. But I learnt to play Go as a result so very worth.
@DaveRandom ohai
euro symbol
fuck google
lol
0128 ;)
08:43
@PeeHaa not on linux
Oh :(
1
Q: How to get the € euro sign on my keyboard?

Martin ZeltinI am using the latest version of Ubuntu 13.10 with Unity, and I am wondering how I can assign the euro sign € to one of my keys. I knew how to do it on older versions of Ubuntu, but I don't know now.... when I press shift+4 it shows the $ sign. But I would also like to get the euro sign... maybe ...

> AltGr + 5
I think that works also on win
@Wes yeah, well , mine is €180
> For a sure kill use Ctrl + Shift + U, you will get a underscored u, then type 20ac Space and you will get €.
#Watisthisshit
08:45
@PeeHaa it conflicts with firefox keybindings
and , "this shit" is \u20ac
That key combo makes me think of using a mac
Wes
Wes
@tereško yeah. i would bring at home every day :B
@PeeHaa wat
my backpack is a bit too small for that
it ends up half-out
Wes
Wes
or, you can add some dirt. who would steal a dirty keyboard? :B
08:48
@Wes I am thinking of buying this one for work: daskeyboard.com/daskeyboard-4C-professional
Wes
Wes
still expensive. at my job they even stole smartphones we used to test sites that were worth like less than 50€ -__-
but they stole them in batch, like ten disappeared in the same day
@tereško I almost bought one of these a few weeks ago but was put off by the lack of USB 3 :-/
I want a compact one with USB 3, as soon as they bring that out I will be yelling "take my money!"
moin
@DaveRandom well, keyboard itself is usb3, IIRC
only the hub is for two usb2 ports
really? that seems kinda weird. The keyboard itself doesn't need USB 3, it's only useful for the hub :-P
Although I guess it means you can run 2 USB 2 devices at full speed
08:56
Better for charging too
What, USB 2 is?
@DaveRandom I suspect they wanted the bandwidth for the n-key rollover
@DaveRandom USB2.0
ahh right, that would be a lot of bandwidth I suppose
@tereško how so? I only really cared about the speed as I do a lot of transfer on and off my phone, not actually looked into the power difference
Oh I thought it was USB 3.0
@DaveRandom usb2.0 is 500Mbps, usb3.0 is 5Gbps

« first day (2126 days earlier)      last day (3050 days later) »