« first day (1945 days earlier)      last day (2988 days later) » 

11:00 AM
brb after changing the OS...
 
@PeeHaa +1 on !!/expr/ as syntax - however, how are you going to protect against things like segfaults due to PCRE stack overflows?
 
REALLY 89,686,730 views on this youtube.com/watch?v=kfVsfOSbJY0
 
@PeeHaa I have time now … wait, there's a exam in two weeks …
@Leigh Disable jit and length protection.
 
@kelunik doesn't help with recursive expressions?
 
Do you have an example?
 
11:07 AM
16:11
would need 5 more Yes votes to succeed, and they're not going to appear
 
What are the arguments against it?
 
more complexity, some people don't like the syntax
 
some people just don't like list, so don't see value in the change
 
I asked on internals why people voted against, I didn't get much response
:/
 
when will be php7 binaries, available in ubuntu software repositories ??
 
11:11 AM
@kelunik I was thinking something like ~(.|(?R))~ but that seems to be easily detected by PCRE now
 
@GourabNag never for current versions
use Ondrej's PPA
 
But why, it is stable enough i guess....
 
distributions pick a version and stick with it
 
Why not accept 1 argument as an array for list?
With the exact same spec
 
oh i see.... then i think i will have to build one from source....
 
11:13 AM
rolling release distros ftw
 
Guess it makes the syntax even weirder, but still. What a strange RFC to be so split about
 
hello guys
any one doing behaviour driven design here?
 
@FaizRasool Among other things.
 
@Oldskool here is question
you got user story
where you define how
the problem i see in the scenario is that it tell us what do
but does not explain explicitly how?
 
You define the how in a context for your features.
 
11:17 AM
My brand new Mint!
 
what i can see from the basic template it contains
 
shit wrong editing.. :P
 
Title, Narrative, Acceptance Criteria, Scenario 1, Scenario 2... Scenario N
@Oldskool where is context here?
 
11:18 AM
@Leigh I only know about segfaults when it's really long and something like (a)+
 
@Oldskool ok the steps in the Scenario
@Oldskool thanks
@Oldskool another quick one if you can answer
this is kind of dashboard i'm working on.
so for each of the panel i need different user story with Scenario
or one would work?
@Oldskool what you reckon?
 
@FaizRasool Different story for each panel. Otherwise it becomes a huge unreadable mess.
 
@Andrea shit.
 
Each panel has it's own goal, so it's a feature by itself.
 
@Oldskool totally agree. Thanks for your help.
@Oldskool we are currently not doing bdd, so this would be our first one possibly
 
11:23 AM
@FaizRasool You're welcome.
 
@Oldskool :)
 
11:34 AM
I hate ASN.1
 
Why do you need to work with it?
 
Anonymous
Is anyone good with cakephp 2.x?
 
11:50 AM
@Andrea voted, late, but better than never ... was hoping for more feedback from internals too ...
If you are a voting member of internals, and didn't vote on http://wiki.php.net/rfc/list_keys, you have the weekend ... please vote, either way. #php
if only people listened to me ;)
 
Democracy in action. Vote never, whine that we can't ever have good things.
 
it's not a terrible turnout actually ...
people probably just not reading internals because it has been full of drama for ages ...
 
LARAVEL Q - HI All, I want to call hasMany on a Builder Object. Is there a method that can be placed between them to give desired results.
 
sometimes you literally get a handful of votes @jbafford
 
yeah
You're probably right about the drama fatigue; it's why I stalled the two RFCs I was working on.
 
12:03 PM
@samayo What do you want to know?
 
Anonymous
@Oldskool when you add form contents into a database via the ->save() method, like ..
 
Anonymous
if ($this->User->save($this->request->data)) {}
 
Anonymous
How do you inject user id into it?
 
seriously? Active record?
 
Anonymous
The saved data only contains what is in the forum, but I need the user's session id to be injected into it.
 
Anonymous
12:09 PM
@tereško Don't blame me, I am forced to learn CakePHP 2.2 or else I would have no option of getting internship that lasts 4 years :\
 
Anonymous
/fml
 
@samayo The user id should be part of your data (e.g. a hidden field in your form).
 
Anonymous
@Oldskool Where can I find the actual code that does this?
 
Should be in your view.
 
12:12 PM
Hey guys need an assist with php ajax file upload on this stackoverflow.com/questions/35362290/…
 
@samayo Alternatively you can do it directly in the controller, e.g. $this->User->id = $this->Session->get('User.id');`
(assuming there is an active session)
 
Anonymous
Yeah, there is an active session.
 
Anonymous
I'll try it
 
It's $this->Session->read() btw... it's been a while :)
 
12:18 PM
hi guys i am new in this group so please help me . when i get issue .
 
Anonymous
$this->User->id = $this->Session->read()['Auth']['User']['id'];
 
Anonymous
> Notice (8): Indirect modification of overloaded property BookingsController::$User has no effect [APP\Controller\BookingsController.php, line 11]
 
Anonymous
@Oldskool I still have no idea how this framework 'earned' a name in the first place.
 
is the "reference" url on https://wiki.php.net/rfc/list_keys supposed to be https://wiki.php.net/rfc/named_params ?
It's broken
 
@JoeWatkins this
 
12:23 PM
@Sean I think it's an anti-pattern most of the time, and is only really needed in languages that lack functions or the 'clone' functionality - gameprogrammingpatterns.com/prototype.html
 
Also on that particular issue I have yet to decide, I don't really like the syntax but I can't come up with a better one and do like the functionality so will probably just end up voting yes
 
@samayo Looks like you haven't associated/loaded the User model yet.
 
Having the thing being assigned to on the right is pretty weird though
 
Anonymous
@Oldskool user model is empty actually, but this is my index action
 
Anonymous
public function index(){
	$bookings = $this->Booking->find('all', array(
	'fields' => '*',
	'joins' => array(
		array(
		'table' => 'Users',
		'alias' => 'User',
		'type' => 'LEFT',
		'conditions' => array('User.id = Booking.user_id')
		)
	)
));
 
12:26 PM
@samayo In that case you should just add user_id to your Booking form, so it'll figure out the association.
 
Anonymous
You mean make a hidden field and that sort?
 
Anonymous
It sounds like a hack
 
Anonymous
@Oldskool the idea is to list all the bookings, while fetching username from User via the booking.user_id
 
hello guys i have an issue occurred that when i use croper.js for crop and zoom image after that when i submit i get a base_64 and after that i convert into image using base64_decode and finally i get filename.jpg but its created in root directory .. but i want to move this image into another dir .. i also tried move_uploaded_file,copy,rename but nothing happend any helps ?
 
@samayo For example: $this->Form->input('user_id', ['type' => 'hidden', 'value' => $this->Session->read('Auth.User.id')]);
@samayo It should figure that out automatically if your associations are right. You can then just do $this->Booking->find('all');
Should list the associated user incl. id/username etc.
 
Anonymous
12:30 PM
hm, sadly user_id still 0.
 
@DaveRandom "Think of it as evolution in action." - actually if you get that reference, don't; that book gets more and more horribly sinister as I get older.
 
@samayo Can you pastebin your User and Booking models?
brb
 
Anonymous
Damn, you crushed my browser.
 
@tereško watched it yesterday. plx as a full length film now.
 
12:39 PM
I am honestly impressed with that one .. and it kinda takes a lot to impress me
 
Anonymous
@Oldskool the model 'class' is actually empty
 
@samayo It shouldn't be. You'll have to define the relationship between a Booking and a User: book.cakephp.org/2.0/en/models/…
 
@Andrea Well, you just need one vote plus one who switches from yes to no… ;-)
 
Anonymous
@Oldskool still don't know why it worked in this example.
 
Anonymous
it is a similar scheme.
 
12:54 PM
@Andrea how dared you to top-post? now everyone following (including me) top-posted in reply to your email ^^
 
@kelunik :P
@Leigh Does that still happen?
 
@samayo Do you have any specific reason to keep your model empty and do a "custom join" in your controller? Doing manual joins should only be needed in rare cases. Joining stuff together within your Model layer is the usual/recommended way.
 
I could always outsource the execution to some PCRE compatible online service
 
hello
I need help in magento..Can i ask here ?
 
Anonymous
@Oldskool It wasn't my idea, the guy who uses this framework show me the idea yesteday
 
1:01 PM
 
Do you have to do a lot in terms of preparation for your exams?
 
@samayo If there's no explicit reason, it's best to avoid manual joins.
 
@Leigh Nicely done!
 
Perhaps something for you guys
0
Q: PHP, Compile foreach and opline

JesusTheHunI'm trying to figure out how a foreach statement is interpreted by PHP. That led me to use gdb while executing a dummy foreach script. I end up in zend_compile.c, in the zend_compile_foreach() function. I see the call to the macro ZEND_FE_FETCH_R that moves the internal pointer of the array/obje...

 
Magic.gif
 
1:12 PM
:P
 
@jbafford I have a HTTP/1 and a Websocket parser neither of which need a goto. [HTTP/2 needs gotos though :-/]
 
@Feeds go home, you're typing drunk
2
 
@bwoebi I'm not sure http/1 is sufficiently complicated as to warrant goto. I was thinking more a language parser than what would be required for http (which should work with simple regex, I'd think)
 
@jbafford have fun making HTTP work with a simple regex.
 
1:16 PM
@Machavity You never ear any sales guy saling stuff? ;-)
 
@jbafford I'm not sure how you'd decode chunked encoding with regex :-D
 
@bwoebi nah, I'll let someone else's parser handle it. Why reinvent the wheel unnecessarily? ;)
well, I wouldn't decode the chunked encoding with regex.
 
@jbafford To make it fast and incremental...
@jbafford But I indeed have a regex for headers
@jbafford @jbafford but the only reason I'm using gotos in HTTP/2 is because using yield from + extra Generator turned out too slow
 
1:32 PM
@PeeHaa I've seen a couple of PCRE related segfault bugs be reported recently, haven't checked them out though
 
Happy frydais room!!
 
.........I keep writing snake case by accident. And I'm liking it.....
 
i like snake case
 
@tereško That was pretty damn good
 
yes, yes it was
 
1:50 PM
@Danack kebab-case, go go :P
 
@FlorianMargaine ow-my-eyes.
 
@Danack works well in languages that support it :)
 
@Leigh Good to know
 
Have you guys heard anything about PHP 7 having problems with custom session handlers?
I ran across bugs.php.net/bug.php?id=70520 but it seems to consider it closed
 
@Machavity simple: don't use custom session handlers!
 
1:55 PM
@FlorianMargaine Ah, I knew it was something simple like that :P
 
@Machavity this was a programming error
> Thanks for the pointers here. The error occurred with my database session handler read() method returning a bool false instead of a string. This was only caught in RC3 as earlier 7dev releases and previous PHP versions did not produce any kind of error.
 
Guess I've gotta debug the handler
> - PHP 7.0 and up does not allow buggy return values from user save handler.
user read handler MUST return "string" data for success always.
- Native save handler must return SUCCESS for successful cases including non-existing session data.
- FALSE/failure means "Something wrong in read" such as permission/network/etc errors.
 
@Machavity Congratulations, you now have legitimate reasons to hate the guy who introduced that regression.
oh wait, different thing. Still the session extensions needs fire applying to it.
 
I found it. My read() method was returning false. Has to return an empty string on failure
Would be nice if that threw an error saying that :P
 
@Machavity That is just awkward, an empty string as "error" return value :\
 
2:22 PM
Oh wow, 20:11
thank you @JoeWatkins :)
 
Tension mounts.
 
maybe I should try to convince Levi and salathe
 
and Nikita hasn't voted at all yet
 
oh yeah
I suspect NikiC just isn't convinced either way
But I don't know :)
 
Flipping a No would count for more at this point
 
2:30 PM
Of course
 
Also, you could get Anthony to vote
 
@Machavity he's suffered enough
 
Wes
@Andrea there's not much to say really. i think it just makes list() consistent with arrays. if you don't like it then you dislike arrays as well :P
i hope people didn't vote no just because "i don't use list()". i don't use list but i wouldn't oppose to that as it's legit, not weird and fitting to the language
Levi is hard to convince though :B there's also Gordon
 
I have no idea why @Gordon voted no…
 
So many people seemed to get stuck on the constructor example :/
 
2:41 PM
Hi guys Im about to redesign and add some a new features to an old codeigniter project with pyroCMS but im confused do I have to recode the whole project in laravel and pyroCMS built in laravel or just work with old one ??
 
@Andrea It may have been more palatable without the future scope and the argument bag constructor example - some people are gonna find those things distasteful and you don't want folk feeling aversion while you're trying to sell them something. More focus in the introduction on how it'd be the only way to use list with string-indexed values, and the only sane way to use list with sparse arrays may have come off better.
 
@ELOISSIFIAhmed what do you expect to gain from migration to laravel? Also, have you given it a thought to what would your alternative CMS will be?
 
user5236938
has anyone used the roundcube autologon lately? was wondering if it was still working. last update was 3 years ago
 
@Wicked lol, last time I heard about RoundCube was some time around 2008
 
user5236938
@tereško recommended alternatives?
 
2:49 PM
@PaulCrovella Yah. That named parameters syntax is an atrociously abominable abhorrence.
Also I ran out of A words
 
absolutely
 
@tereško I choosed to work with laravel cuz im not familiar with codeigniter especially when it comes to an old version of codeIgniter
@tereško
Im confused between upgrade the whole website to codigniter or recode it from scratch with laravel and pyroCMS
 
hi!
 
@ELOISSIFIAhmed ... you also didn't answer my questions.
 
Codeigniter <=> code disaster
 
2:56 PM
@AnmolRaghuvanshiVersion1.0 how many times have you worked on a project which attempts a framework-migration as part of the new iteration?
2
 
@tereško I did lol I dont like codeigniter Ive worked with laravel and its awsome
 
> what do you expect to gain from migration to laravel?
so your answer is "it will be awesome" ... right .. there is nothing more I need to say, I guess
 
@tereško I expect from migration to laravel I it will be easy to recode the whole website cuz ive never worked with codeIgniter
 
You have already made up your mind. Which means that even if we try to warn you, that you are heading for an unmitigated disaster, it probably won't change anything.
 
ok what do you advice me to do
 
3:02 PM
Framework or language migrations or otherwise large wholesale rewrites are going to totally kill your forward momentum on the project.
 
posted on February 12, 2016 by nlecointre

/* by zefigue */

 
If you need to do a migration, do it under the cover of some other necessary refactoring work, or or a new feature that has no pre-existing code.
But if you stop, rewrite the application, and then continue, then that's potentially months or years your application is not getting better.
 
Good morning
 
yeah thats website is coded by another developper in 2013
my mission in work is to create something similar to that website in orde to buy to clients I hope you understad what im trying to say
sorry for my english
 
@jbafford while I agree, there are definitely situations where that falls down, meaning when the features require massive fundamental refactorings to introduce
 
3:10 PM
@ircmaxell Yes. But I think I covered that with "do it under the cover of some other necessary refactoring work"
My larger point was, you should always be making direct, measurable forward progress.
 
ideally you isolate components and migrate a bit at a time
 
I gave a talk about unit tests on Wednesday that says about the same thing... docs.basereality.com/ValueCaseForUnitTests/#/18 press right twice.
 
@jbafford no, I think that misses part of the point
it's not doing it under cover
 
@jbafford what do advice me to do upload the whole website and add new features to it using codeigniter or starting the website from scratch with laravel (I want to create another website like the first one)
 
@tereško not till now I have worked
 
3:12 PM
it's realizing when the business is trying to pivot, and where refactoring your way through that pivot is simply going to be too slow and risky
sometimes saying "ok, we need to declare bankrupcy so we can reinvest in the right direction" isn't bad
 
fair enough
It's got to be pretty bad for a throw-out-rewrite to make sense, but I won't deny that's a necessity sometimes.
That just shouldn't be your first resort to "I don't like the framework this is written in".
 
well, it's not even that it has to be bad
it just has to be not right "enough"
even the best code has assumptions. If you want to break enough of those assumptions, writing a new version can be easier and faster
 
true
 
^ in case anyone was wondering how to ruin someone else's day
 
@ELOISSIFIAhmed You should do a from-scratch rewrite only if the existing code is so unsalvageable for the intended purpose that it will take more time to do a proper clean iterative refactoring update to get from start to finish than rewriting it will.
 
3:17 PM
> If you wanted to be completely hostile towards your users
Understatement detected.
 
yeah, I just think the conventional wisdom of "never rewrite, only refactor" only applies if the rewrite will be rebuilding the same thing over again
 
Keep in mind that if you start from scratch, you may lose sight of the lessons learned in the original code (for example, edge cases encountered and resolved) that you have to run into and learn again in a reimplementation.
@ircmaxell Yeah. If the intent of the rewrite is to produce something sufficiently different, it might make a lot of sense to throw the old thing out.
 
I think that's a nuance that's not often captured in those discussions
 
nuance? ain't nobody got time for that
we only paint with the widest brushes here :P
 
3:20 PM
lol
 
see also: How Netscape lost the browser war, by not having anything to release while they were rewriting Mozilla 5 from scratch.
 
almost every form of "conventional wisdom" needs to be broken from time to time
I forget which famous author described writing as "learn the rules, then break them"
 
@jbafford this is under-appreciated - all that horrible spaghetti got that way for a series of reasons, some of which are still important
 
@jbafford ok buddy thank a lot I ll refactor the website using laravel and pyroCMS
 
@ELOISSIFIAhmed whatever you do, good luck :)
 
3:23 PM
the problem was I dont wanna work with old code (codeIgniter 2)
 
I don't wanna work with old code either.
Sometimes you have to.
 
as I said about - he had decided before even asking here
 
I just spent a couple of months rewriting a legacy app to something resembling modern code, through iterative refactoring.
 
I just spent a few months writing an alternative to legacy apps ;P
not finished yet
my definition of "legacy code" is less forgiving than most ;)
 
3:25 PM
It took much longer than I expected (and it's still not 100% done, really, but it's good enough), but by doing iterative refactoring, I was able to not have to re-learn all the edge cases the code picked up over the last ten years.
 
Does anyone have any example text for a "non-dealing clause" in an employment contract, as opposed to a non-compete clause.
 
my boss told me to learn creating website like the existing one because we need it to create of version of that website to client
 
Reimplementing from scratch would have taken twice as long to do, because most of the business logic was directly usable, and a from-scratch implementation would have introduced a lot more bugs and required a lot more attention from the QA team.
 
@ELOISSIFIAhmed "Learn to create a website like the existing one" is pretty much like saying "Learn how to build a car", there's numerous ways to achieve that. First, you'll have to determine what you want/need and then focus on that.
 
@Oldskool the existing website its actualy an e-library we have a lot of clients need e-library do i have to start from scratch and recode the whole website or redesig for every client
 
3:29 PM
sad part is it's still got a ton of global functions, static methods and global $db in every db-accessing function, but almost all the other globals have gone away and it's almost in a position to use DI.
 
Who's going to PHP UK ?
 
I won't be
 
Hey guys, do you think it's possible to have a long running external bash script being executed from php via the exec() in such manner that it won't be killed at the exact moment PHP-FPM service is killed? I'm going nuts over here. I'm fighting with "wrapper bash script" executing the long running script using nohup ./long_task.sh > /dev/null 2>&1 & but no luck. :/
 
@Smuuf why do you want to do that through exec? And not something sensible like supervisord ?
 
@Danack Amen to that.
 
3:35 PM
The thing is there is a need of stopping the PHP-FPM service inside of the long running script, but the systemctl stop php-fpm is the last thing that's executed.
 
.....I told this joke when giving my talk.......There's tourist driving around rural Ireland countryside, and he's lost.
 
Yes, maybe that would be one option, but there's no time for that - I'm not using supervisord for this project and I wouldn't know how long would it take for me to have it working.
 
He sees a farmer standing at the side of the road, so he stops and asks the farmer "Excuse me, can you tell me how to get to Dublin".
And the farmer replies "Ah, to get there, you certainly don't want to start from here."
It's not a very funny joke.
But "need of stopping the PHP-FPM service inside of the long running script" that is invoked through PHP-FPM is not a good place to be.
 
I figured :)
 
Anonymous
@Oldskool in Cake, is it a big no no to pass flash message to view?
 
3:40 PM
@tereško I'm attempting this right now, from a legacy proprietary "framework" to Symfony
 
Anonymous
@Jimbo I honestly think I would have made a better framework than CakePHP 2.*
 
@Jimbo you actually should keep a journal of what you do and in what order
 
@tereško Documenting it all in confluence. There was no documentation the first time around
 
no, not documentation
more along the lines of "dear diary"
 
Current status: "Dear Diary, today I want to kill myself because this legacy code is just bollocks"
 
3:44 PM
I would be interested in what steps did you take and what problems each step revealed
 
@PaulCrovella yeah I really want to add a better example
I just didn't think of one
 
yay
home!
 
o/
 
I need to delete a directory with some scripts potentially running (it's an "app" and it's located in a directory and I want to delete it) .. So I figured I need to gracefully-stop PHP-FPM, then delete the directory, then start the PHP-FPM again. But the script ends at stopping the PHP-FPM :D

I guess what am asking is: Is there's a way of "separating" a process off another process (that started the first process) somehow, so that when the parent PHP script, which exec()'d some bash script, is killed, the bash script is allowed to finish. Am I wrong? Is there no way?
 
yes. You need to detach from the parent process's session
lemme see if I have some php code to do that
 
3:46 PM
@samayo How do you mean "pass flash message"?
 
@jbaff
 
@Jimbo @Jimbo every day
 
@tereško Potential body post in the future then if I succeed
 
@jbafford that would be great. although I would be more interested in a "bash" only way, if it is even possible.
 
see posix_setsid()
for shell scripting, see nohup
 
3:47 PM
@Jimbo yes, or maybe even a proper conference talk
 
Anonymous
@Oldskool I want to send this flash message to the view.
 
Anonymous
<?php
if(...){
	...
  $this->Session->setFlash(__(" You have booked one night with stephany"));
}else{
  $this->Session->setFlash(__(" Alright, looky but no touchy!! "));
}
 
@Andrea welcome
 
hi guys
 
@NikiC would it be less terrifying if it used []
 
3:50 PM
@Oldskool can you answer me please
 
@Jimbo "Dear Diary, Today I thought I saw a light at the end of the tunnel." ... "Dear Diary, You know that light? Turns out it's an oncoming train. I'm looking forward to sweet release."
 
@samayo If that is controller code that's just fine. That's how it's supposed to be used.
 
I'm working with select tag and I want to assign a value to a variable when an option is selected. How can I achieve this?
 
@ELOISSIFIAhmed I think I've missed the question in the first place?
 
Anonymous
@Oldskool it is a controller code, I want it to appear in the view so it can appear inside a <div></div> of my view.
 
3:51 PM
@Oldskool the existing website its actualy an e-library we have a lot of clients need e-library do i have to start from scratch and recode the whole website or redesig for every client ?
 
@samayo Yeah, than that's fine. Also see book.cakephp.org/2.0/en/core-libraries/components/…
 
Anonymous
Ah, great.
 
@ELOISSIFIAhmed Depending on the needs of your clients I'd just create a global e-library app that you can customize per client.
@ELOISSIFIAhmed For example, each client has it's own database and configurations/stylesheets, but they share the same core logic for the app/site itself.
 
What @Oldskool suggests is exactly what I've done with two separate applications. Core code, with per-site configuration and styling.
 
@Oldskool there is an existing live e-library app coded in codeIgniter 2 I just want to upload it on local and learn how this works and then change the styling and database for the client
 
3:55 PM
And some hooks to allow per-site custom behaviors (with those behaviors migrated into core as config options when more than two sites require the same or similar customization).
 
@Oldskool the problem is that I dont like to work with codeIgniter 2
 
@ELOISSIFIAhmed If that app does everything you need (or can do so with some tweaking), then go for it. No need to re-invent the wheel.
 
@Oldskool but its old its coded in 2013
 
that means absolutely nothing - it's code not milk, it doesn't come with expiration date
 
So what that it's written two years ago?
I've worked on projects that had code that was more than ten years old, and managed perfectly fine without whining about it.
 
3:59 PM
ok Ill be back two years
 
I've also worked on code my drink-infused alter-ego wrote the day before and have had struggles.
It works both ways ^^
 

« first day (1945 days earlier)      last day (2988 days later) »