« first day (1801 days earlier)      last day (3138 days later) » 

user3119231
@PaulCrovella okay okay.
 
anyone else got strange so profile page today ?
 
strange how?
 
I have refreshed (nocache) many times
 
negative, all looks complete here on both our profiles
 
10:09 AM
tech hates me today, skype is all wonky too ...
 
Skype has a global outage.
 
@JoeWatkins you should clean up your mailbox :)
 
yeah
@Naruto people should shut up about a certain sadness on internals ... I stopped reading 500 messages ago ...
 
Hello, what could go wrong if i'd use +$var to remove a leading 0 from a string? Ie, $var = "01" => +$var = "1". This is certainly not a best practice, as I'd normally cast the variable to an int, which would automatically remove the leading zero, but I've always wondered.
 
user3119231
So I have a string: 12, 23, "3, 41" I need to split it be the , which are NOT in quotes. Is there a function for this?
 
10:19 AM
the most obvious thing, is that intention is unclear @user3697142
 
What do you mean? The way + works in general? Is that unclear?
Sorry, my English is horrible.
 
user3119231
@PaulCrovella yeah just found this stackoverflow.com/questions/5132533/…
 
@Maurize it's also linked at the bottom of the manual page I gave you earlier
 
@user3697142 no, what you want the code to do is going to be unclear in real world code
function mine($thing) {
	$var = +$thing;
	/* ... */
}
 
user3119231
10:22 AM
@PaulCrovella anyway thank you, sir-.
 
is that a bug, did you mean +=, why is it written so strange, is what every programmer that sees it after you is going to be asking ...
 
Ahhh. I see.
Thank you Joe :)
 
@PaulCrovella I proclaim today, 21st September to be international CSV day ... everyone is to exchange gifts, gifts should be badly formatted and split into tiny chunks ...
 
Array
(
    [0] => I proclaim today
    [1] =>  21st September to be international CSV day ... everyone is to exchange gifts
    [2] =>  gifts should be badly formatted and split into tiny chunks ...
)
I did my best
 
hehe
 
10:47 AM
Does anyone know what happens when we enable opcache.huge_code_page in php 7? i just saw this on php.net "This release provides a noticeable new Opcache feature which makes possible to move PHP code pages into the huge memory pages. It can be enabled with opcache.huge_code_page=1 in php.ini and can bring about 2% performance gain on supported platforms."
 
magic.gif
 
lmao ^^
 
well what is says, but many caveats
A page, memory page, or virtual page is a fixed-length contiguous block of virtual memory, described by a single entry in the page table. It is the smallest unit of data for memory management in a virtual memory operating system. Virtual memory allows a page that does not currently reside in main memory to be addressed and used. If a program tries to access a location in such a page, an exception called a page fault is generated. The hardware or operating system is notified and loads the required page from the auxiliary store (hard disk) automatically. A program addressing the memory has no knowledge...
 
@JoeWatkins thanks
 
thats what you wanted, or you wanted to know why it goes faster where it's supported ?
 
10:55 AM
I wanted to know why it is faster actually
 
okay
know what the page table is ?
 
A mapping of virtual and physical address ?
 
the page table is where the kernel keeps track of what is where in memory, we search the tables using a TLB (translation lookaside buffer), these are rather fast, but they are limited in size ... this wasn't a problem 10 years ago, but now everything has 50,000gigs of ram, so with a limited size TLB with a limited number of pages and more memory than the page table can track, some server infrastrutures enable huge pages, because the bigger the page, the less entries there are in the page table
so the faster it is to search ...
 
Afternoon everyone
 
Thanks now i understand the idea behind it
 
user3119231
11:01 AM
.csv suck as hell.
 
posted on September 21, 2015 by nlecointre

/* by jkflash */

 
Well that's good news. Passed my assessment exam with a score of 100%
Basicly meaning the Dutch government is going to pay me a 20k euro software engineer education
 
11:17 AM
Congrats :)
 
Thx
 
What's the minimum required test score to pass?
 
must have been a really simple exam
 
50/75% for Software Tester. 75/95% for webdeveloper. 95/10% for software engineer
100*
 
Or he's simply a genius, lol. Doubt that the government is willing to pay 20k+ for a "simple"test.
fund*
 
11:22 AM
Yo o/
 
so, @icecub, are you a genius as @user3697142 seems to think?
 
Hehehehe
 
@tereško It wasn't to hard. It were a couple of questions about mathematical equations and pattern recognitions. If I were a genius, I didn't need the education in the first place xD
 
Now that's handy, thank you duikboot, lmao
 
11:26 AM
lmao?
 
Your name.. It makes me laugh my ass off.
 
:D
So you ass if off now
 
How works foreign key fail within a transactions ?
 
Yeap :/
 
11:27 AM
table 1 ( parent ) return the ID then want to insert into the child table
after all these i want to commit
In this case
should i commit parent table before go into the child table ?
 
@Andrea Yes, yes it is. It's a Scottish prefix incidentally.
 
Imagine your application reads from a config dependant on it's environment (it knows if it's in Dev, or Production, for example). And a non-caching object is instantiated if you're in dev, and a caching one is instantiated if you're in production. Would you call this Configuration-based polymorphism?
Would a requirement of this be that both the caching things implemented the same interface, and this cache was DI'd automatically
Yes / No will suffice /cc @tereško
 
hello PHP dev's
I need a small help
can you please check that once
@Jimbo can you please help me
-1
Q: Covert multi dimensions array into key values

Pritesh MahajanSorry for Wrong described i got like that. Array ( [0] => hello[30815][183] [1] => hello[30815][291][28280] [2] => hello[30815][291][28280][custom_math] [3] => hello[30815][472][28273][comment] ) after add for loop for($i=0; $i<=count($cfn);$i++) { echo $c...

 
@Jimbo dunno .. it would seem that having different structure in different environments could come back to bite you in the ass. You can end up with unrepeatable bugs
 
can you please check this question
 
11:40 AM
I would instead use caching in both systems, but set a very small (or variable) TTL for the cache
 
o/
 
Someone sees something wrong with this DB setup?
The part of the form and form_id
 
@PriteshMahajan please stop making "write free code for me" posts
 
I would like to create my own basic version of a 'google forms'
Where I am able to setup fields with field types like text/email/... so I can save them and generate the form on the front-end.
 
@Duikboot I was always told that the name of the table shouldn't be in plural..
 
11:49 AM
Ok
 
and whats wrong with the form and form_id? It looks ok?
 
how do you mean what's wrong?
Those are the ones I would like to add.
why are DB tables always singular aand not plural?
 
For the same reason an object is normally always singular aswell?
There are some naming conventions for that :)
 
12:04 PM
Makes sense.
When generating those fields on the front-end ( Where the admin can built his own form )
Is there a reason I should not use Angular?
 
Morning
 
o/
 
Dumb question. If I have this class setup. So Foo is the parent. And I want to access properties from it in the children I call parent::construct(). But let's assume that foo has dependencies. Each time I add one I have to update all the child parent calls to also pass this dependency in the parent::construct. I assume I am doing something wrong here. How should I approach?
 
12:36 PM
@Fabor Isn't that normal?
 
I'm wondering if there's a better way
 
@samayo Then there has to be something wrong with your application. No job interview offers? How many applications did you send?
 
do I need to store the output of this $stmt->execute() to a $variable ?
 
12:54 PM
@Fabor well you could write a dependency injector?
 
I'm using Auryn
 
No clue about that, never used Auryn before...
@rdlowrey you came up first in google about fabor's question :P
 
@hakre No, but one of my employees has a different model… just a second.
Runs really well, no complaints at all. Employee installed Ubuntu without any trouble.
It is more expensive though.
 
@Fabor Are you saying your children have different constructors from the parent?
 
They do but meh. Think of the parent of containing dependencies the children need. Twig for instance. If I add another dependency to the parent I need to update all the childrens' parent::constructor($twig, $newDep) with $newDep which feels wrong.
 
1:07 PM
@Fabor yeah, inheritance sucks
 
Abe
@Fabor inject Foo rather than extend it?
A::__construct(Foo $foo);
B::__construct(Foo $foo);
C::__construct(Foo $foo);
 
Abe, that's actually the route I started taking.
 
@Fabor "favor composition over inheritance"
 
Now to get Twig to stop asking me for a Loader :P
 
1:09 PM
it's kinda hard to say what the right or better way to go is with classes like "Foo," "A," and such
 
Foo = View. A = Homepage. B = AboutMe. C = ContactUs
 
@Fabor But, the parent constructor is inherited by the child...
Interface the bastard and be done with it
In C# yes you have to call the parent constructor with :base or something daft if I remember correctly, but not in PHP :P
 
I was thinking the same thing as Jimbo, but I wasn't sure, so I just kept my mouth shut xD
 
@Jimbo he's moving from inheritance to composition, let him do it
!
 
@FlorianMargaine Fair enough ;)
 
1:21 PM
btw, @Jimbo in C# you have :base, in php you have :parent? Or am I confused?
 
@nikita2206 hey, I'm already testing the patch and I'll have time for the RFC today o/
 
@FlorianMargaine heh, yes I will keep this in mind in future too.
 
Abe
@Jimbo that's just to enforce the call of the parent constructor afaik
 
@Naruto In order to merely inherit the parent constructor you have to do something with :base
 
@marcio hey that's awesome, though I think there were some other issues I found but didn't get my hands on yet
 
1:22 PM
@nikita2206 is it related to internal functions?
 
May you recall me what RFC you were working on?
 
@marcio no it's simpler, I stupidly forgot about class inheritance checks...
callables
 
ah fine
 
user895378
morning
 
hai guys what iam wrong here its not executing $this->db->select($details);

$this->db->from('sanctioned amt');

$this->db->join('IHHT_Registration ihht','ihht.Ihht_id='.$date['Ihht_id'].',left'); $db_data = $this->db->get()->result_array();
 
1:24 PM
Morning
 
@bwoebi callable types
 
And also Danack pointed out that zend_is_callable_ex is inconsistent as shit. So it might be that I'll need to use something else instead. Or at least I need to make special case for __call and __callStatic
 
@nikita2206 doesn't it allow support for __call(Static)?
 
@bwoebi actually I think that zend_is_callable_ex is fine for my use case (I'll need to check it) but I still need to basically bail out when it's __call or __callStatic because they don't have signatures
By bail out I mean that they will never pass the callable(Something): Something check
 
> It is possible to declare the return type of a callable without specifying the call signature by substituting a literal ellipsis (three dots) for the list of arguments:
def partial(func: Callable[..., str], *args) -> Callable[..., str]:
    # Body
 
1:29 PM
We are getting that
aren't we?
 
@marcio yeah that is possible with callable: Type, input is not checked in this case
 
@nikita2206 Well, that's an issue. Especially you risk to force typing on trivial Closures whenever Closure callbacks are used. That might end up very annoying in code. And even more so as short Closures (for technical reasons) don't allow types.
 
@nikita2206 the more I think about it the more I like it because it favors the adoption of the feature in less constrained cases + it fits the "only add types where you need" PHP approach.
I think it's a bit sad that we don't have symmetry with interfaces though.
 
@bwoebi yes, this is an issue but it's not related to __call. I don't know what to do with it though... Full-fledged type inference would be too slow for PHP...
 
What we'd rather need is attaching a type on a variable (like callable(int): int) on the first type hint encountered and then, doing co-/contravariant checks when the callable is pushed further. And ultimately when the callable is executed use the strictest types applied so far to actually execute the callable.
 
1:35 PM
hai guys what iam wrong here its not executing $this->db->select($details);

$this->db->from('sanctioned amt');

$this->db->join('IHHT_Registration ihht','ihht.Ihht_id='.$date['Ihht_id'].',left'); $db_data = $this->db->get()->result_array();
 
@bwoebi could this become an issue in situations you pass the callable as argument through multiple functions with callable typehints?
 
@marcio and then, doing co-/contravariant checks when the callable is pushed further
 
@crysis
print_r your $details and paste into mysql
 
Sometimes I fear that Stas was right all this time and we're going to get Java from PHP in the end haha
 
that's not a possibility
 
1:40 PM
@nikita2206 (which is also why we need to avoid to force too much explicit typing.)
 
@SuperNoob i cant understand can u pls be more specific.
 
@crys
to see if there's an error
You say it's not executing--what is not executing?
 
@SuperNoob this line $this->db->join('IHHT_Registration ihht','ihht.Ihht_id='.$date['Ihht_id'].',left');
i have replaced a php variable instead of a value
 
@SuperNoob use [space] instead of [enter] after auto completing usernames :P
 
i thk i have a syntax problem there
 
1:44 PM
We all have a syntax problem
 
Are you error checking?
what is $this->db? pdo? mysqli? framework?
@marcio, thanks, I thought enter would select the name
 
Its code igniter framework
 
@nikita2206 I'll probably vote down the RFC if you force types on every closure ever. (Because normal functions "naturally" will try to typehint them.) It just is pointless and not the way to go.
 
@crysis, just print these and see what the errors are, $this->db->_error_message(); $this->db->_error_number();
 
do anybody know what is command that will show me all files listing one by one + addition of all those files one by one...
 
1:57 PM
ls && ls | wc -l
 
my folder size if very huge and du -csh is taking long time to calculate total size...
 
K
 
is there any alternate way to find the size ... atleast approximate
using inodes
 
du -h $(find -inum $INODE -print -quit)
 
2:05 PM
Is Opauth the best option for social login library?
 
@Sjon find: invalid argument -print' to -inum'
my server is of centos OS
 
replace $INODE with your inode
or set INODE=stuff
 
@bwoebi there's no better way really (yet)... you can omit argument types in your closure and it will pass even callable(Type) boundary. But you'll still have to declare return type. There's just no other reliable way to do that without type inference which in order to work would require parameterized types.
 
@Sjon how to know my INODE?
 
I hope that we'll add some way of declaring return type in short closures, that would solve the problem with little price
 
2:13 PM
fancy gdb dashboard >.> github.com/cyrus-and/gdb-dashboard
@bwoebi you're not forced to use types on every closure ever:
php > class A {}
php > (function(callable(A $a) $fn){ $fn(new A); })(function($a){ var_dump($a); });
^ this is perfectly valid
// heck, it looks horrible as a one liner
 
@nikita2206 why do we? find a way to attach the return type to the op array.
 
(function (callable(A) $fn) { $fn(new A); })($a ~> var_dump($a)); heh
 
when I'm working with a Closure like
($a, $b) ~> $a | $b it's obvious that it'll return an integer. The hint is just totally redundant.
 
@bwoebi you are talking about type inference, it is hard to implement and it is slow for runtime
 
@nikita2206 I disagree about the slow for runtime.
Might be hard to implement, but it won't be slow.
 
2:17 PM
@John sry I thought you knew what you were asking. I don't have time explaining
 
@nikita2206 all it'd need is checking if a return type is required and then eventually set a type [you should cache the resulting opcodes array though.]
 
@Sjon okay no issue ..
 
@JoeWatkins awesome... "If I take a big children's book, and whack you over the head with it, it doesn't make children's books violent." ....
3
 
we've talked about this before long time ago, we could augment the passed closure on function(callable($a, $b):int $fn){...} from ($a, $b) ~> $a | $b to ($a, $b) : int ~> $a | $b
 
@marcio precisely that.
 
2:23 PM
@bwoebi BUT when it was first discussed, I was thinking about this as a secondary RFC or maybe wait to see if the short closures would fly. The only difference is that at this point I have no reason to believe the short closures won't pass if ~> gets adjusted to ==> :)
 
What do you mean by augmenting?
 
TIL that Joel advocates for waterfall development: joelonsoftware.com/items/2007/10/26.html
 
@ircmaxell Is it current? That was 2007.
 
yes it was, I have no idea if it was current
though people are citing it as examples of how to do engineering planning o_O
 
I've fortunately never had to deal with either model.
This is partly because everything I've worked on is relatively small.
 
2:25 PM
@marcio eiiiih… this is the issue why I'm reluctant to put the RFC to vote :s
 
It's also partly because the people I work with are sane and understand neither model is perfect for us.
 
@marcio but I should just put it to vote…
 
@bwoebi did you ever wind up listing the differences to Hack?
 
(I'm also interested in the differences with Hack/HHVMM which is why I mentioned it on-list)
 
@ircmaxell no. Because I don't know if there are any subtle differences the doc doesn't mention or not.
except that the Hack one allows types
 
2:28 PM
@nikita2206 in the context of the typehinted function, the callable "inherits" the return type of the typehint prototype, but the original callback is not modified. (not sure if I'm being 100% clear).
 
@bwoebi phpdbg overrides zend.assertions
why ?
 
@JoeWatkins does it? o_O
 
yeah, seems too
 
@JoeWatkins lxr.php.net/search?q=%22zend.assertions%22 and lxr.php.net/… yields nothing for phpdbg
 
something strange is going on ...
 
2:31 PM
having a repro-case?
 
sorry, I'll shut up ...
go back to what you were doing, nothing to see here ...
 
@JoeWatkins do you have a Windows (VM?) setup by chance?
 
I do, two of the buggers, they took one galactic year each to setup ...
 
If yes, could you please quickly look at bugs.php.net/bug.php?id=70533 ?
 
win 8.1 32 and 64 bit
yes, will do
 
2:35 PM
@marcio how is it type safe? As in, what if I pass () ~> "stuff" to function foo(callable: int $cb); ?
 
@nikita2206 it'll blow up upon execution
 
reproduces yeah
I'll have a look
 
@nikita2206 just like when you had ():int ~> "stuff"
 
probably later on tonight ...
 
@nikita2206 Uncaught TypeError: Return value of {closure}() must be of the type integer, string returned
 
2:37 PM
@bwoebi well... I dunno.
 
I see a huge problem with it though... it's harder to interpret the error message in some cases :s
 
Yeah, the point of failure is not where it should be
 
@marcio not harder than when you'd pass ():int ~> "stuff" in...
 
@bwoebi I mean in that case why do we need callable type hints at all
 
@nikita2206 to make things blow up at all.
 
2:40 PM
oh yeah, there's a point
 
anyway in my experience, callables used as actual callbacks (meaning delayed execution) often do not require a return value.
 
@nikita2206 in this case we assume the equivalent PHP7 code would be checking the returned value of the callback with is_int() before proceeding or failing manually.
 
Callables returning values most often are just traceable directly through the stacktrace too.
 
btw what was Derick's opinion on short closures
 
@nikita2206 no particular opinion.
just one comment about the symbol.
 
2:43 PM
Ah yeah, he's not against it
 
right … or at least he hasn't said it. … why?
 
What about adding return typehint on fcall boundary, I guess that's a good idea, actually, I was in doubt at first... @marcio do you think we should add it in the current rfc?
Like, we will be adding a return type only if it's a Closure and it doesn't have a return type already
 
@nikita2206 no. You should always add the return type.
hmm
Think you're right. Adding it once is enough.
 
$fn = () ~> return "stuff";

(function(callable(): int $fn){

    // $fn becomes (): int ~> return "stuff"

    (function(callable(): string $fn){

        // $fn becomes (): string ~> return "stuff"
        $fn(); // works

    })($fn);

    $fn(); // blows

})($fn);
^ that's scary
// I should be actually using the returned value, the example itself is not good.
@bwoebi is that what you meant with "always add the return type"? doesn't seem like a good idea to me >.<
 
2:59 PM
That's looking more and more like JavaScript, and it's disgusting.
 
@Jimbo that's not even the point, I just used the nested anonymous functions for the sake of brevity ;)
 
I have a regexp problem:
find: (A)to(B)
replaced sample: A2B
what is the replace regexp? $12$2 do not yield what I want
 
That's gonna be hard to explain... I would go for another RFC for this.
 
@marcio eih, that should already blow up upon the inner callable call because return type is now int, incompatible with string.
 
@jvchn have you tried reading the manual php.net/manual/en/book.pcre.php ? Regular expressions are probably one of the best documented bits of PHP.
 
3:10 PM
@bwoebi ok, so I clearly got "You should always add the return type" wrong. That's what I wanted to confirm.
 
@Danack his issue is actually he wants $1, 2, $2, but it's parsed as $12, $2, no?
 
@jvchn put variable number in {}, it will be ${1}2$2
 
That's explicitly noted in the manual on the php.net/manual/en/function.preg-replace.php page btw.
 
@Danack right. But you have to find that.
 
....you mean he has to read the manual page for the function he's using ?
2
 
3:14 PM
@nikita2206 agreed, let's focus on what we already have first and wait for the short closures fate.
 
3:40 PM
@bwoebi truncation, on an epic scale ...
no wait, it's not that, because present on 32bit too ...
but there is a hell of a lot of truncation warnings in 64 bit ...
 
@JoeWatkins o_O
 
Regex: The one-size-fits-all solution for turning one problem into a dozen maintenance headaches.
 
user image
6
 
said dev is himself ^
 
Followed by "Oh... It was me"
 
3:53 PM
I just got 100 k req/s on my iMac with Aerys in a VM!!!
 
I should do a decision tree for "array_map() or foreach" where every flow ends up on "Fuck it this thing doesn't work use foreach". #php
3
 
@bwoebi The C100k problem now ;)
 
@Jimbo uh, well… let me try… that was concurrency 1000 now…
 

« first day (1801 days earlier)      last day (3138 days later) »