« first day (2009 days earlier)      last day (2946 days later) » 
00:00 - 16:0016:00 - 00:00

12:56 AM
Computer less for the next few days. At least there's the new mobile chat interface..
 
Ekn
It is quite useful, I found out the last week
but somehow the fixed font'ed texts didn't fit in, overflow-x:hidden kinda look I mean
so it'd show me only about half of the codes :/
 
Onoes! SHOW ME TEH CODEZ!
 
Ekn
1:20 AM
uh.. I'm too tired to realize if that was an actual request
just give a try... ie. this is shown until "reg" on first line on my note 3 chrome
(not that transcript link though)
 
 
1 hour later…
2:51 AM
@tereško but how? can you give me any idea?
 
 
2 hours later…
mrnging
 
posted on April 16, 2016

New Cyanide and Happiness Comic

 
morning.. i am in a terrible issue....
In short I have just created a shortlist system.. so that can add products into the short list and remove products from the short list.. have implemented using session....major problem is cant add the products again if it has been already removed from the short list until i close or clear the browser data. can anyone suggest any idea so that.. can use the above shortlist without changing much...?
 
5:20 AM
'nin
 
@JoeWatkins is there a way to remove a value from a particular array index which may be from the middle or end or from the first..in short anywhere. and after removing it the gaps should be sorted so that it will be a normal array again..
 
don't ping random people with questions
 
Ohoh..sorry i thought you were free there..?
Hello anyone here...why eveyone is silent here?Didnt wake up yet?
Waht the hell!!!!!!!!!!!no one responding
 
5:55 AM
Mornings....
 
Ekn
mornin'
 
hello guys, how to add another array to an array? say there's $arr1 : abc, cde, $arr2 : efg, hij. How to append arr2 into $arr1? so $arr1 : abc, cde, efg, hij ?
 
Ekn
$ab = array_unique(array_merge($a, $b));
 
thank you very much @ekn
 
Ekn
6:06 AM
@RidleSambow you want to merge array right? ^ array_unique() there is to dedupe
 
yeah, gonna google the array_unique meaning
 
Ekn
it just removes duplicates when two arrays are merged, in above code
 
oh okay, so if arr1 : a, b, c and arr2 : c, d, e. It will remove c? if i don't use it, it will be arr1 : a, b, c, c, d, e ?
 
Ekn
correct
 
thank you
 
Ekn
6:13 AM
yw :)
 
@RidleSambow you can use array_push()
 
morin
 
Ekn
with array push you would "push" items to the end of an array like:

$stack = array("x", "y");
array_push($stack, "z", "t");
print_r($stack); // Array( [0] => x [1] => y [2] => z [3] => t )
mornin
should I answer or flag this ?
 
i have two dimensional array, seems the array_merge is better or easy.
 
'nin
 
6:21 AM
i'm doing a file sharing code. The file shared by permission assigned by user, whether it is for himself, group, or specific user. i saved the shared list in an array, then serialize it to be saved inside database. now, when i need to get and filter the permission, i grab all the files inside database then unserialize the shared list field. Is it alright? need some advice
the user account is about 70 people.
morin
nah, its noon here
 
Ekn
well... it's 3:22am here :p
 
1.22 pm here
 
11:54 am here..
 
@astrosixer where you live? i thought the time difference is rounded
 
I am in India
And you?
 
6:32 AM
Indonesia
 
Really?
 
No, he's just kidding. He lives on mars.
 
yes man I am from mars..
 
uh, okay. Glad to know mars occupant speak english.
 
6:58 AM
Yes,I have just learned english..next i am going to learn php guys.. who is going to teach me?
 
7:21 AM
@pinepain technically it should be possible to allow it, practically we have no means to notify Server of changes and manipulate VHostContainer at runtime (yet). But the big problem is that we cannot really just reload a class' implementation at runtime with PHP. Thus we have a graceful restart mechanism for the production mode (see CommandClient)
 
0/
 
Ekn
7:46 AM
does it ping one n times when you @ someone in comments? n being edits
I hope not x_x
 
@bwoebi Could be useful for the ACME tls-sni-01 challenge as well.
 
@kelunik true
@kelunik btw. yes, 100k is with a hello-world handler, what I measured. I said given a sufficiently strong machine.
 
@bwoebi thanks! Are there by chance any examples of vhost usage you know? Just for a reference.
 
@pinepain as said, wer currently have no ways to notify server at runtime of it
or do you mean Host?
 
Hello
 
8:01 AM
@bwoebi I mean Host, e.g. we are listening for example.com, but for some reason we received Host test.example.com, how's such case currently handled?
 
@pinepain You'll get 400 Bad Request, because of a unknown host.
 
@kelunik are there any plans to catch host lookup and implement it in some user-defined way?
btw, you all did awesome job with all that amphp projects family, many thanks!
 
@PeeHaa what do you mean with raindance?
 
anyone advice me any tutorial for php advanced?
 
@pinepain well, you can implement a wildcard Host currently
that's weird…
 
8:11 AM
heeelp
 
@kelunik uhm, is that intentional that we have localhost as default host instead of wildcard?
 
I dont know how to use git
3
 
@tereško rm -rf .git (j/k)
 
I'm trying to fix the commit author, but it ends up all fucked
 
@tereško on top of history or rewriting the whole?
 
8:12 AM
there is that too
 
hm?
 
I fucked up two commit - they ended up with my home credentials instead of work credentials
and I already pushed the damned thing
 
1 min ago, by bwoebi
@tereško on top of history or rewriting the whole?
 
the answer is: "kinda"
the rewriting history part is clear
 
but?
 
8:14 AM
@bwoebi that's what i came up to
 
my problem is that console tells me I am " M�~Arti�~Fš" instead of "Mārtiņš"
.. for some reason "š" is working just fine
 
@tereško aren't you by chance on OS X standard Terminal?
 
@pinepain if he were, it wouldn't be an issue
 
I have tchs . and, yes, it's not the reason
 
i just had a similar weird problem when run ssh from os x terminal without proper LANG set
 
8:28 AM
anybody around?
 
Wes
8:42 AM
Mrmiiierng
 
@bwoebi Yes, wildcards are bad. It's intentional.
 
@kelunik are they? why?
 
hello everybody, i have $arr1 = array(array('a', 'b', array('c', 'd', 'e'))); how to foreach the array('c', 'd', 'e')?
 
@bwoebi Duplicate content for example. There's no reason to default to wildcards.
 
@kelunik sure, if you put the same content on each wildcard
 
8:53 AM
@bwoebi As long as you don't handle it explicitly, there's no reason to have a wildcard. So it makes sense to not default to it.
Often you don't need a wildcard anyway.
 
@kelunik The weird part is that you currently need to set name to "" and interfaces to 0.0.0.0/::
 
@bwoebi You can simply set the interface to *.
 
We should rather have "*" for wildcard and allow different wildcards depending on interface
though
 
@bwoebi Different wildcards?
 
can file_gets_content function return null?
 
8:57 AM
@kelunik yeah, we should match not only against 0.0.0.0/:: but also against $ireq->client->serverAddr
(the IP address the client contacted the server on)
and force "*" for wildcards instead of empty string
 
mcaturday
 
Fil
9:14 AM
Good day
 
hi
can we include php classes from folders?
 
Fil
@FastSnail You mean you'll put classes in your project folders?
 
not in a one folder but in different folders.
yes
 
Fil
9:30 AM
@FastSnail Yes of course you can include classes even it is downloaded from the internet.
 
i have added autoload function
spl_autoload_register(function ($class_name) {
include $class_name . '.php';
});
but how can i load a class in a different folder/not in current folder?
 
Fil
use include "path to the function where your spl_autoload_register() returns a path of the classes"
 
Fil
@VamsiKrishnaB You are down voted in that post because you're not asking but seeking a help.
 
9:57 AM
That question. Oh my. I had to login just to downvote it.
 
@Fil don't do stupid stuff and use PSR4 or at least PSR0 autoloading, Composer will do everything for you
 
Ekn
mwrning
well, here's a similar one stackoverflow.com/questions/36621888/…
 
@Ekn Ugh, yeah great.
 
Fil
@sergey I'm aware of that. but how will you call /vendor/autoload.php if you your not using require "/vendor/autoload.php"?
But yes that's right. thanks for that
 
@Ekn You'd think that after several years on SO I'd stop being surprised by people coming along saying "Hey, I need X. Please help me create this.". But I don't. Every single one still makes me facepalm.
 
Ekn
Heh right @Oldskool, I feel the same after about 2.5 years
Some of them are really to avoid kind, specially morning time
Still early and rainy here, I'll go for a nap :p laters
 
10:58 AM
\o
 
what all things should i take care while implementing a shortlist using session?
 
@bwoebi As in how does one set it up?
Mornign all
 
@PeeHaa Why are you asking me? I don't even know what you mean with mention bot on twitter.
 
Did I say twitter? I meant github :P
yes I said twitter :|
 
Fil
haha
 
11:03 AM
hiiiiiiiihiiiii
 
@PeeHaa oh ask @kelunik
 
@PeeHaa nin'
 
@kelunik halp
 
@PeeHaa @bwoebi github.com/facebook/mention-bot, you can add it to a single repo or globally to an org.
 
plz someone tell me how?
 
11:06 AM
@kelunik uh, we don't have a .mention-bot file in aerys?
 
Exactly :)
is it org wide?
 
@bwoebi Nope, why?
@PeeHaa For amphp, it's installed org-wide, yes.
 
@kelunik oh, didn't notice that config is optional
 
tnx
 
1
Q: How to set the line width of line in fpdf uniquely throughout the document

astrosixerI have line generating function in fpdf which will need to generate line with unique line width for all the titles throughout the document. Here is my code. function createLine($x1,$y1,$x2,$y2){ $this->SetFont('Arial','B',7); $this->SetLineWidth(.1); $this->Line($x1, $y1, $x2, $y2...

 
11:13 AM
@PeeHaa moin
stackoverflow.com/q/36663097/214577 ... why is it so hard for people to elaborate on their answers. All those 1 or 2 line answers make me feel like a poet :/
Makes me feel all Walter-y.
 
:P
 
this one :P
 
Yes, that's just the best... sigh
 
All of them are just one liners
 
11:18 AM
Sometimes it helps to ask for details though...
Code-only answers are usually not really helpful. It's better to explain what you did and why, so the OP can actually learn something from it, instead of just copy/pasting it and be on his way. — Oldskool 15 hours ago
 
They are just reputation whores
 
Answer did improve after that.
A lot actually.
 
hmm
 
Fil
That's right
 
11:43 AM
<?php
interface IFoo {
	public function fetch() : IFoo;
}

class Foo implements IFoo {
	public function fetch() : IFoo {
		return function() implements IFoo : IFoo {
			return $this;
		};
	}
}

$foo = new Foo();

var_dump(($foo->fetch())());
?>
yo dawg, I heard you like interfaces ... hehe ...
 
@JoeWatkins that looks wrong to me
 
yep
was testing a thing, it's totally pointless mess
I do like the idea in general tho ... like it quite a lot ...
 
12:01 PM
I want to say I have a confuse feeling now about sth. So which one?
- I got confused.
- I'm confused.
- I confused.
 
> I'm confused
 
ah thx
 
np
 
Are php class getters/setters bytecode get optimized in some way now in php7?
 
12:17 PM
no
 
are there any rfc/experiments about such kind of optimizations?
 
I don't know
an RFC seems unlikely, but I guess there has been experiments already?
 
yeah there was a discussion and a pr a week or two ago
for getter optimization
 
closest thing to me is to walk AST and try to do the magic
 
but there was no real world improvement, and that's when it was done by dmitry ... so I think there is nothing in it ...
 
12:20 PM
> there was no real world improvement
 
Thanks Joe. Does it mean that accessing props vs calling getter has no difference from performance point view?
 
What was the test against? Wordpress? @Ocramius could probably supply some code where getters are a huge overhead.
But it's only a problem when you're doing OO "correctly".
 
my case is just plain 'ol day getters and setters
 
@Danack it was wp and symfony I believe
the problem is that it only dealt with the very simple case, no return type, no expression at all, just inline FETCH_OBJ_R, it cost all other method calls a little bit and the improvement wasn't enough to show in real world code ...
I'm sure marcus can show me some code where getters and setters are having a real impact on perf, but that implementation wouldn't solve it, and I would guess that no implementation could
by the time you have branched to check the type, and further complicated the code for non typed returns, you have lost your micro optimization ...
 
!!xkcd optimization
 
Thanks @JoeWatkins for the explanation
 
12:43 PM
@Jeeves @PeeHaa fix the link … don't encode the whole query string… just the parameters.
 
Wes
@Jeeves /me prints
 
Raj
is any alternative framework for core php?
 
what?
 
what, in the,
 
Raj
m doing coding in core php now so i mean any framework for php so i can reduce my development time?
 
12:56 PM
what is core PHP? You mean vanilla PHP aka without frameworks?
If we talk about PHP core, we mean the C source of PHP.
 
it depends on requirement
 
Raj
@bwoebi without frameworks
so which one is best and easy to lean ...
 
it depends on you .how you learn framework and grip.
 
I've only used apigility. but Zend framework seems like something worth learning.
 
Raj
ok thanks but what about codeigniter?
 
12:59 PM
hai
I wanna implement Gift Registry in Wordpress
any one advice me!
 
@Raj Try one. Use it if you like.
 
Raj
@littlepootis thanks for ur valuable suggestion .but i want to work for mnc companies but they want php framework thats via i asking....?
 
Wes
@Raj codeigniter is old. symphony is the most popular and kind of the industry standard
 
what is an mnc company? And why haven't they chosen one for you?
 
Raj
 
1:03 PM
oh, want to um
 
Yes @Raj I have used it but not it works perfactly
Is you have implemented it? @raj
 
Raj
dont know i just given interview but at last they rejected deu to core php
 
@bwoebi I should rather prevent forum post to show up
 
Raj
@dinesh no man....yet
 
Anonymous
meh, fml
 
1:05 PM
Oh okk @Raj Thanks,
 
Raj
@dinesh welcome
@littlepootis mnc multinational compines...
 
@raj are you from India?
 
Raj
@dinesh ya .....?
 
Tamil ah?
 
Raj
@dinesh nice one but all world is our home
Developers
 
1:08 PM
Where are you now man?
 
Raj
in pune
maharastra
 
Anonymous
@PeeHaa ping.
 
Ok I'm From Chennai
 
Raj
r u web developer ?
 
Yup.. core Php
you..
 
Raj
1:10 PM
same like you ....
 
Ok man. are you Tamil?
 
Raj
@dinesh @littlepootis @vrajesh thanks bro for u rvaluable suggestion time to leave bye
@dinesh marathi
 
wtf is core php
 
Kk bye
@JoeWatkins Gud mrng
 
@JoeWatkins vanilla
 
Raj
1:12 PM
@dine
 
8 mins ago, by Raj
dont know i just given interview but at last they rejected deu to core php
 
Raj
@dinesh send me ur facebook profile link so we can help to each other
 
what does that mean ?
 
core Php means working without any MVC
 
1:13 PM
omg, I quit the internet
 
search by my Mobile number 9715019522 @Raj
 
@dinesh don't share your mobile number here. this thing is google indexed.
 
Oh sry
 
Wes
@dinesh you should be sorry for yourself...
 
Wes
1:17 PM
@dinesh mvc is an architectural pattern (ie how you "glue" classes among themselves), not a "kind of framework"
which means that you can have a mvc design even by using raw php only
 
raw php is what I write on the wall of my cave ...
Jun 10 '15 at 7:51, by Joe Watkins
why use notepad when you can carve and paint code on the wall of your cave using the bones and blood of your enemies ...
3
 
Wes
ahaha
 
I had a look at that bug earlier btw wes ...
 
Wes
raw wasnt the best adjective. "plain" is better
 
I couldn't fix it without breaking generators for some reason ... will have another look tomorrow ...
 
Wes
1:21 PM
aw how are generators even related?
 
@Wes vanilla, even more so
 
not really generators themselves, a test for generators failed
 
Wes
@JoeWatkins was my guess right tho? that compatibility is checked the inverse order
 
well it's not as simple as swap them when there are two abstract classes
because I tried that first ...
since I couldn't fix it without breaking stuff, I'll exercise my right to say nothing ...
 
Wes
haha, fair enough
kinda surprising that nobody noticed that so far
 
1:26 PM
agree
 
@Wes There are earlier bug reports about it
 
Anybody there which has some experience with facebook sdk?
 
user6116249
good morning all
 
Wes
@NikiC surprising that nobody noticed that so far surprising that wasn't fixed so far :B
 
Is Wordpress close the DataBase connection automatically?
 
1:40 PM
What bug are we talking about?
 
Ah the one from yesterday
 
user6116249
I am having a issue with the post part of this statement I it says undefined index but only in view source <select class="form-control box" id="country" name="country">
<?php $selected = ($_POST['country'] == $row["country_id"])?"selected":""; ?>
 
print_r($_POST); @William check do you have the post variable of country
 
user6116249
@dinesh its not posting here is what I am trying to do I have my countries in my db and it works I am just trying to retain the value selected in case of error with submittion
 
user6116249
1:46 PM
<?php $selected = print_r($_POST['country'] == $row["country_id"])?"selected":""; ?>
<option value="<?=$row["country_id"];?>" <?=$selected ?>> <?=$row["country_name"];?></option>
 
please do it <?php print_r($_POST); ?> on top of your page coding
after submit the form you will get the data
 
user6116249
Array ( [email] => [soldier_name] => [monthOfBirth] => [dateOfBirth] => [yearOfBirth] => [country] => 7 [password] => [confirm_password] => [submit] => Register Account )
 
@Wes @JoeWatkins well … the behavior you expect is: if we have two inherited functions being both (implicitly) abstract, it should be checked whether any of the two functions satisfies the others conditions? (also important when we ever get contravariant typehints etc.)
 
you can use this -> $_POST['country']
 
user6116249
@dinesh if I go to the page and no value in country box is selected then it give the error but if selected it goes away that's weird
 
1:59 PM
Though @Wes still not… imagine something like…
 
user6116249
my slected statememnt is wrong somewhere
 
Wes
it must be checked accordingly to the inheritance order @bwoebi interfaces must be checked in their own hierarchy, classes in their own hierarchy, then each class must be checked to be compatible against each interface it implements
 
interface Foo {}
interface Bar implements Foo {}
interface A {
    function foo(Bar $bar, Foo $foo);
}
interface B {
    function foo(Foo $foo, Bar $bar);
}
class C implements A, B {
// now there's an implicit abstract function foo(Bar $bar1, Bar $bar2);
}
class D extends C {
    function foo(Bar $bar1, Bar $bar2) { /* ok*/ }
}
@Wes ^
:29983375 hmm?
We need to figure out what the common denominator of all abstract methods is. (And whether one exists) \cc @JoeWatkins
 
$selected ="";
if(isset($_POST['country'])){
$selected = ($_POST['country'] == $row["country_id"])?"selected":"";
} @William
 
@bwoebi eh
Another weird case: bugs.php.net/bug.php?id=67270
 
user6116249
2:08 PM
@ Dinesh ok thanks
 
@NikiC I have no idea who thought inheritance were a great idea…
 
Wes
@bwoebi not needed imho, you just need to check twice, one time against A, then B
 
@Wes currently, yes. In future (i.e. with co(tra)variant types), no.
 
Wes
ah i see what you mean
 
@NikiC this shouldn't fatal in any case though … the parameter must be optional in the result then
unlike what the bug report says
 
2:12 PM
@bwoebi Not sure I agree with that
 
@NikiC Why not? if the parameter is optional it fullfils both interfaces
 
@samayo pong
 
@PeeHaa to whom? :-)
 
:P
 
What's the best way to generate a unique session token for a user?
 
2:19 PM
@bwoebi feels wrong ^^ dunno
 
I found this thing: $token = bin2hex(random_bytes(self::TOKEN_LENGTH));
What's the best length to have for tokens?
 
@HassanAlthaf 32 bytes are always enough
 
Thanks. @bwoebi
 
even 128 bit are enough today
(128 bit raw data or 32 bytes hex data I mean)
 
Wes
@bwoebi as long it's the only "default value" definition, it's ok, if you have multiple default values it should error
 
2:23 PM
@Wes why? You can override interface defaults with your own default
 
Wes
LSP violation
 
the default value in the interface only is a recommendation
@Wes nope
@Wes if you want to be explicit, just pass it at calltime
 
Wes
or rather
foo($def = 10, $mandatory) // you can change default value of this as it's not optional
foo($def = 10) // but not this, as it can be called as foo()
 
@Wes sure, if it's called as foo(), it's an impl. detail
the default value is just a hint
the default just means that something is optional
not what the actual default will be
The impl. may check isset(func_get_args()[1]) and override the impl defined default if they'd have to match
and that's why this default is non-sense
 
Wes
i don't agree, but i could agree it's subjective
 
2:27 PM
the default is not actually part of the signature
 
Wes
to me this is an lsp violation
interface A{ function baz($a = 10); }
class X implements A{ function baz($a = 20){} }
 
the optionality well is.
@Wes and you are wrong.
 
Wes
depends on the single case @bwoebi imho
 
@Wes no, never.
 
Wes
some parameters' defaults may be fine if overriden, others aren't
 
2:29 PM
@Wes please illustrate why
Just as said:
4 mins ago, by bwoebi
The impl. may check isset(func_get_args()[1]) and override the impl defined default if they'd have to match
Hence it's obvious that it's an implementation detail if it can be changed by implementation.
 
Wes
again i'm not saying that you are wrong. i'm saying that keeping things consistent is possibly better to avoid subtle unexpected inconsistencies
 
user6116249
@dinesh you
 
Wes
2:49 PM
is "organizable" even a word? i can't find example sentences using it on google :\ not helpful ones, at least...
 
@Ekn you also did produce music right?
 
3:17 PM
What browser are you using? IE? Chrome? FireFox? Opera? Safari?
 
Wes
Netscape Navigator 4
 
Why that?
 
Wes
because it's faster than firefox
 
3:33 PM
ok, but why not Chrome? As a developer, I think Chrome is the best
 
Kay
3:43 PM
Does anybody know what this means?
Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'courseID= 'Course102'' at line 3'
 
Wes
i was joking @Shafizadeh netscape is a browser of the '90s
though i wasn't joking when i said it's faster than firefox :B even my grandmother doing rendering with a brush would be faster than firefox
 
o/
 
Wes
what is your preferred capitalization style for functions? pascalCase() or snake_case() ?
 
pascal
For some reason I cannot stand snake
 
00:00 - 16:0016:00 - 00:00

« first day (2009 days earlier)      last day (2946 days later) »