« first day (1614 days earlier)      last day (3348 days later) » 

7:00 PM
$userRepo->add(), not $userRepo->save() :P
 
Good mornings
 
that moment when you fix a bug in zend_vm_def.h, forget to rebuild, yet recompile and still see the bug existing
 
the repository could direct the persistence of the instances it contains, no? @Ocramius say, $repository->save($userMapper, $reportsMapper)
 
YAY, all bugs fixed!!!
running make test
 
@ircmaxell All known bugs, anyway :)
 
7:09 PM
yes, very much that
 
@FrontpageExpert nope
 
@ChrisBaker If you do go for a BA I recommend getting at least a minor in CS, given your tech background.
What was your associates in?
 
@Ocramius that's unit of work?
 
Also, I don't have or need a degree to get the particular jobs I want, but am pursuing a BA for other reasons.
(Notably because the upper level CS classes are really interesting. This Fall I'll get to work with 50GB of data from real companies to learn the basics in data mining and dealing with "big data")
 
50GB? Where could you possibly store so much data?
 
7:14 PM
@LeviMorrison Networking and Communications, the program was stuff like Cisco router config and Windows Server admin. I hate that stuff though, and have never done it professionally.
 
@Danack Well, given the field I'm in that's not even a lot of data, per se. But to answer your question: this class is putting in on Amazon AWS.
@ChrisBaker Yeah, I recommend at least getting a CS minor then.
 
@FrontpageExpert your mapper is a dependency of the repo, it's just the mechanism to convert data for/from the DB. As for the save(), there is no save(), there is add() and then there is update() eventually (if you're not using UoW)
 
If you want to be a better programmer/software engineer then maybe a Software Engineering or CS major.
But honestly I'd rather get a degree in some other science and get a CS minor. It all depends on why you are getting a degree :)
 
To get a real jawb!
lol
Seriously though, I get paid like shit.
 
7:17 PM
If the answer is "I want a get an engineering job with Amazon, Google, Microsoft, etc" then a CS degree is probably a good route.
@ChrisBaker What country do you live in?
 
Then you can probably get a better paying job even without a BA.
 
@Ocramius so what update() does?
 
Yo,
 
7:20 PM
@LeviMorrison That's why I'm on the fence about it, I feel like I can talk the talk and walk the walk, IF employers give me that first call. My uncertainty is whether I will ever get the call without the magic "BA" letters on my resume. I still owe student loans for my AS, if I went back to school I'd have to pay it up front. I work at a nonprofit, so I get paid very far below industry average. The job market seems to be pretty healthy, nationally and even in my home state (Michigan).
 
@FrontpageExpert it's just the right terminology :-) If you're not employing a UoW, then you should be specific about what you do with the repo, and not assume upserts all the time
 
Has someone suggestions. I would like to create myself a class which generates watermarks. >> paste.jesse-obrien.ca/1QNv
 
@ChrisBaker Sounds like you should get another job for a couple of years and then re-evaluate what you want to do.
 
aaah, well, yes :P
 
Getting a degree to make more money is not really the best reason, despite what everyone tells you.
 
7:21 PM
Someone a suggestion for a setup for the functions so I can manipulate the image?
 
I'm the first person from my ancestry to go to college. The first lesson I learned after graduating is that it probably wasn't worth it. None of my coworkers here (doing the same job for the same pay) have any degree at all.
 
Getting a degree to make money will never work
get a degree because you want to learn
 
@ChrisBaker Have you read/studied some of the classic software engineering books?
 
learning is the single most important part of that equation (and you don't need a university for that)
@NikiC github.com/php/php-src/pull/1180 <-- should be about ready for review
 
brace yourselves, trying to run php7 on windows
 
7:23 PM
Things like Refactoring and Design Patterns ?
(Those two are very helpful for practically any "programming" job)
 
@LeviMorrison Pastebin some recommendations. I read endlessly, but I don't think I've read anything that could be considered classic software
 
@ircmaxell why is there a test for generators? ^^
 
I'm mucking my way through Gödel Escher Bach right now.
 
@ChrisBaker Refactoring is very pragmatic, not very academic at all.
 
Going to a university might be valuable just for guidance on what to read! There are so many books out there, but anything I've tried to pick up aimlessly seems to be too introductory for my tastes.
 
hello
 
@ChrisBaker Those two I linked are both required reading for a 300 level CS course I've taken.
 
it works! :D
 
I spend a lot of my time on political activism too, and I think that if I tried to improve my programming skills, I'd need to "quit politics" for a while. I added both those books to my reading list, if anyone else has some good foundational books that don't waste a lot of time on entry-level concepts, lay em on me :)
 
7:28 PM
could anybody tell why laravel 5 post method does not work for me?

public function postTasks($id)
{
return 'test';
}

get method works perfectly. With post I get error:

NotFoundHttpException in compiled.php line 8208:
Controller method not found.
 
Thanks
 
controller is the same as with get method, so it should find
 
@ChrisBaker This is used in a data structures and algorithms class: wiley.com/WileyCDA/WileyTitle/productCd-EHEP000461.html
Shoot, I could probably put a list of all the 200-300 level books somewhere :)
 
paste.jesse-obrien.ca/1QNw Someone a suggestion how to continu this
I already tried that. Now I have to generate a function to create the watermark on the imathpath image.
 
@LeviMorrison YUSSSS! Populate my GoodReads want-to-read list with programming goodness! I'd be a happy man if I never made it to the Vonnegut book that's been lonely on there for half the year.
 
7:33 PM
Mornings
 
Yo
 
or could you tell me why my route matches second:

Route::post('/todo/tasks/{id}', ['uses' => 'TodoController@postTasks']);
Route::post('/todo/tasks/{id}', function() {
return 'runs this code';
});
I want to run controller function with post method
 
7:49 PM
@ircmaxell I'm not really sold on the TypeException thing, especially given how it used for some error conditions that are arguably not type-related, e.g. argument count mismatches.
 
@NikiC well, luckily I implemented it in such a way as that's abstracted, so it's trivial to change it
 
Moornings
@Darius.V if you have multiple identical routes it uses the last declared..
instead using the ugly facade you could also do
$router->post(.....
 
does it not use the first route it matches?
at least on laravel 4 it was that it uses first route
 
not last I tried it out
It used the last route
I had a test like
 
Suggestions? :) Learning some OOP shizzle : paste.jesse-obrien.ca/1QNH
 
7:59 PM
$router->get('/', function ...
$this->get('/'/ ...
last was always used
 
oh sick
 
I would suggest you to avoid the facady things
 
but you agree than on laravel 4 it was using 1st route matched?
 
I never used L4
 
why avoid?
thanks, but this is huge news about last route
 
8:00 PM
@Darius.V The static facades are effectively global variables.
 
ok then why

Route::controllers([
'auth' => 'Auth\AuthController',
'password' => 'Auth\PasswordController',
'todo' => 'TodoController'
]);

which is last - does not match?
 
Because it a call to a magic __callStatic which in turns calls what you should really have used
 
@Duikboot your watermark is scraping the web, adding a watermark and setting a header?
 
I mean todo controller here should be matched
 
Like in your router .. just use $router instead of Router::
 
8:02 PM
How do you mean @Patrick ? :)
 
I have read in bood about laravel 4 unit testing that facade pattern is so good for testing
 
No not really, it can just be achived, but it is not a good way to do it or a "better" way. Now that you are using L5, instead use its reflection injection, type hint what you need, it will be autoloaded and injected
 
@Duikboot Your class is doing too many things
 
My class or my function in my class? :)
The thing is I can't test this :( I need GD support enabled ofcourse but my mac is not yet supporting apt-get :D
 
thats too much at once :D
 
8:04 PM
@Darius.V Whaaa? Static facades make testing more complicated or even impossible in some cases.
 
Weird:
Fatal error: Call to undefined function imagecreatefrompng() in soo. I have to install GD lib.. but when I check my phpini: gd support is enabled.
 
@ChrisBaker It's a book about laravel. Did you really think it isn't a piece of shit?
 
weird. I think this guy knows what he is talking about: leanpub.com/laravel-testing-decoded
 
ok, I add to my list to chec
check*
 
8:07 PM
uuhhhhhm WTF
> In the context of Laravel, Facades are what you are using when you make what appears to be a static call to a class
Route::get('/', 'HomeController@showWelcome');
so lets change that to:
$app['router']->get('/', 'HomeController@showWelcome');
WTF
 
are we re-iterating laravel's WTF/min rate?
 
Sure at least it isn't global by default but de fuck is $app and why does it contain a router?
 
yea, so the Route:: is actually a call to __CallStatic on a class which in configured in a file
and saved in a service locator
 
@Ocramius I felt like a head desk
 
So the ProviderServices all gets a private with a ref to $app (the entire app)
 
8:09 PM
@Darius.V He knows about Laravel, to be sure. That doesn't mean he's any kind of authority on programming practices in general. Do some reading outside the Laravel ecosystem and you'll find plenty of knowledgeable people talking about testing, using static classes, and why it isn't a good thing.
 
it's all magic and the bad kind
I spend some time digging into the framework and there is alot which I do not think should be done in X Y way.. beyound the statics thing
primarly because someone said to me "oh you are not forced to use the 'facades/statics"
 
@ChrisBaker - this book looked easy to understand, I did not finish it yet and so I like it. Maybe in other books its much harder to adapt to laravel. Thats why I choose book with laravel examples
 
Oh no you can use this other terrible thing with the same problems instead :P
 
But, back to an earlier conversation: you could sit down and make a framework you're happy with, and someone else will come along and say you did X wrong or Y is a piece of shit. I wouldn't write off Laravel completely, but I wouldn't use it. What I would write off completely is using static facades as a global service locator.
 
8:11 PM
Yes @ChrisBaker
 
I still theorize that Zend Framework is an attempt to make all other frameworks look better by dragging the lowest common denominator down
 
@ChrisBaker If you don't I would be happy to write off laravel and its lead ;)
 
Been working with RabbitMQ lately.. anyone else use it?
 
Interesting.
 
@RonniSkansing It's on my list of possible interesting things to check out
 
8:13 PM
@PeeHaa I would recommend you to check it out whenever you need something new to think about.. =]
 
Still I believe after reaing this book I should be better at testing than I was before even when doing as this book says, shouldn't I ? otherwise I feel like I would jump to other hard to adapt book to laravel
and end up strguling too much
 
At first I thought it was just a queue.. seems it is much more
@Darius.V why did you choose Laravel?
 
because we use it at work
before we used codeigniter
 
@PeeHaa There isn't anything like uniformity or a unanimous consensus on what is and isn't the best practices at the language core level, how could there possibly be any kind of unity at the end-user level? I can't think of a single framework using PHP that a majority of developers would even describe as"good, let alone perfect.
 
Ok, many who migrated from CI went to Laravel
Read the book, get started with some tests, but please
spend some time, writting some decoupled classes
and unit tests with phpunit.. no framework, just your vanilla code and phpunit
 
8:15 PM
Can someone refresh my memory; what was the value in static closures, or was there never any?
 
I think I try to use dependency injection
 
@ChrisBaker I saw Rasmus speak several years ago and he proclaimed all frameworks were s***
 
but if I inject all facades, then my constructors would have million dependencies
 
Something tells me he's probably not changed that position
 
@Darius.V if your constructors have to many dependencies, then it is doing too much
 
8:16 PM
and in the book it was said and I have heard from other people that class should not have too many dependecies
 
Fast @RonniSkansing is fast
 
and should be split up
 
The conversation gets meta pretty fast, but there's one thing that is clear: no matter what framework you're using, there are some top-level best practices that DO have consensus. One of them is not using global variables. Static facades are global variables. So, you can use Laravel if you want to, and I won't agree with your choice. Use its facades, though, and I'll say with confidence you're wrong. (weird edit)
 
struct _scalar_typehint_info {
	const char* name;
	const size_t name_len;
	const zend_uchar type;
};

to

typedef struct {
	const char* name;
	const size_t name_len;
	const zend_uchar type;
} _scalar_typehint_info;
@NikiC ^^ that suffice?
 
typedef struct _scalar_typehint_info {
	const char* name;
	const size_t name_len;
	const zend_uchar type;
} scalar_typehint_info;
@ircmaxell ^-- that's our convention
 
8:17 PM
then I have no idea how to split thinkgs logically
 
@Darius.V remove the logic from the controller
 
I am trying to
 
Ah, ok, wasn't sure since it wasn't "exported"
 
@Darius.V use the middleswares
 
@Darius.V forget about MVC, use the controller just as entry points into your application. Use as many plain php classes as you need for your application logic. Hint: it will be much more than 1 per controller
 
8:20 PM
Ok lets say I need in a class those facades: App, Config, Input, Log, Session, Validator, View - those I use the most and they are used in many classes. So there are already 7 dependecies from those alone. So what if I need them all - what to do and to not have many dependecies?
dont know yet what are middlwares
 
@Darius.V why would you need them all? and wtf is app?
 
Goddamnit people are keep being faster
 
yea, I will read it some time latter, now I have a task to program still :)
 
e_ENGRISH
 
8:22 PM
@Darius.V this will help clarify some things, even if you still decide to use laravel after reading it (which I hope you won't)
 
in laravel 4 there is App, this is used bit more rarely, so I dont remember now why it is used for
 
App, what do you need this dependency for?
Config, should not be injected into the controller
Input -> should come from Reqest / Response
Log -> put into middlewares
Session -> inject into a service which you depend on
validator -> inject into a service which you depend on
and the tutorial @Patrick gave you is .. great >=]
 
Ronni - I do not remember about App, but I remember I needed this facade at work
"Config, should not be injected into the controller " - I need to get some config. But maybe middlware can solve this, do not knwo. And in laravel 4 there is no middleware, so then write myself?
 
Ok.. =] anyways, I am sure you already have lots to try out now
 
I need a lead programmer like you at work :)
then I would learn things fast :) and good practices
 
8:25 PM
Oh not like me, maybe like some of the other guys/girls in this room
I work with Yii 1 all day... (and it is much worse than L5/L4)
 
@Darius.V Just keep advancing like you seem to be willing to and you will be that lead
 
:D
especially now if I come to work and say - I saw in the chat that facades suck
and I bet that I would not know how to explain why
 
@Darius.V Do you think that using global is correct?
 
and this is not a reason - "because I saw in chat"
 
I like that reason
 
8:27 PM
no, I have heard bad things about global states
 
@Darius.V Exactly
 
@Darius.V tl;dr: They're using a standard term in a non-standard way; they're just fancy static methods, and thus have all the potential baggage that static stuff carries around, like what is effectively global state.
 
"Facade" is a valid pattern. "Static facade" is not.
 
If you want to use them, you can. Just know the downsides and be prepared to deal with them.
 
So far I did not see any downsides by using them :)
 
8:30 PM
55
A: Use global variables in a class

PeeHaaThe correct way to solve this would be to inject the database handle into the other class (dependency injection): $db = new DB_MySQL("localhost", "root", "", "test"); // connect to the database include_once("pagi.php"); $pagination = new Paginator($db); $records = $pagination->get_records("SELE...

 
^^^ that's another thing -- working code beats the crap out of theoretically awesome code that you haven't written yet because you aren't sure how. Only one of those will get you a paycheck if your job is to write working code :)
 
@Darius.V in the router example
 
Jul 30 '14 at 15:14, by rdlowrey
First rule of programming: the last guy was an idiot and it's a good thing I'm here to fix this mess.
 
:)
 
Second rule of programming: hopefully the next guy doesn't think I'm an idiot when he comes to fix this mess I made
 
8:33 PM
@Darius.V this is the default implentation of a RouteServiceProvider in L5
public function map(Router $router)
{
	$router->group(['namespace' => $this->namespace], function($router)
	{
		require app_path('Http/routes.php');
	});
}
as you can see, it requires your route file
 
@Machavity Third rule of programming: get a junior and pound your way of working in him and call it "your legacy"
 
in a function which takes the argument $router
 
@DanLugg That can also be expressed as "Assume that the people inheriting your code are murderous psychopaths that know where you live."
 
so why would you in the route.php file write Router::get(...) instead of $router->get(..)
 
Nah, I'm the murderous psychopath. I can write code a shitty as I want and people stay away.
 
8:34 PM
when you write Router::get(..) it calls the __CallStatic which calls the $router->get(..)
a extra step without any reason
 
its interesing - why in PHP people learn so lot wrong stuff from the frameworks and other people. I saw some legacy code where was html , database , and php in one long file. Why people learn such things or why others teach such things :)
probably in other language communiteis there is no such thing, or is it?
 
@RonniSkansing ouch you're still stuck with that? :-/
 
why frameworks do not teach the best practices in their documentation?
 
@MarcelBurkhard I think I will be for atleast a year
 
frameworks should be written by pros
 
8:35 PM
@Darius.V define "pro"
 
@RonniSkansing at least you're not proud of it being bad
 
the one who is using best practices
its not a complete definition of course
 
@Darius.V give me some cash and I'll write documentation :)
anyway, tagging ORM 2.5.0-b1 today @_@
 
@Darius.V they don't use frameworks, they use components
 
ah, so the problem is - when you get free stuff- its not good :)
 
8:37 PM
@Darius.V no, the problem is that there are 24 hours in a day
 
^ that
 
@Ocramius thanks. I get to practice my "magic" and my refactor skills.. but when you are hardcoupled to a old framework, it is sometimes kind of impossible to break out any use good pattern.. because I am stuck inside a box..
which is why I am building a super front controller...
Attack plan. 1. Upgrade PHP. 2. Put a front controller infront of the front controller. 3. Migrate each painfull part, bit by bit
 
@RonniSkansing very true, I just try to make the best out of it in these cases, e.g. short descriptive functions
 
@MarcelBurkhard yea I guess. [=
 
@RonniSkansing thats what we did at work. Worked out great :) (still not everything migrated though)
 
8:40 PM
> Put a front controller infront of the front controller.
yo dawg
 
@PeeHaa github.com/RonnieSkansing/Escapology lol yea exactly my thoughts when I started writting it... yo dawg ..
 
Is it still a front controller if it's behind another front controller? dunno...
 
@RonniSkansing awesome
 
@ChrisBaker If I work with you and you use globals to get your code working, I'll put in some effort to make sure you won't be getting that paycheck for much longer ;)
 
man, github is being slow today
 
8:42 PM
@RonniSkansing that new front controller is another framework or like in the no-framework-tutorial?
@PeeHaa fifty shades of php
 
@MarcelBurkhard basicly a stupid router.. if it find the route, it goes to the "new application" else it routes the request to the old
 
/me didn't watch the movie or read the books
@RonniSkansing ok
 
@RonniSkansing why a separate package for that though? Just write your new app so that if no route matches the old code gets executed
 
Hello
 
8:44 PM
@Patrick yea that would be ideal and I would def recommend that. I wrote it because person X might be migrating to another shitty framework.. and this shitty framework (Laravel5) loads the entire application at the point you reach the router (the route Provider contains a ref to the entire loaded application container)
which is costly if must routes go to the old app
 
Well... tell those people not to migrate to another shitty framework :D
 
=] Yea.. I wish
But still I would rather work in Laravel then Yii 1
so it offers a migration path
the package is only meant to be temp
so when migration is done, remove it
but you right, if you build it off packages, just make the NOT_FOUND point to the old app
 
when migration is done, 10 years later :P
 
lol yep
if ever
and if the migrations fails..
just setup a new front controller ifront of your front....
 
yeah. But worth it anyways, you'll spend more and more time in the new code. The stuff that gets done last are the rarely used parts
haha
 
8:51 PM
But yea the more I think of it.. my package is a gateway to another shitty framework where you have a "heavy load" when you hit the router already.. I name it escapism originally.. maybe it was a better name after all
 
has it already been mentioned that laravel sucks
(just kidding)
 
Having now another problem: my route now works when I run with Advanced rest client. But it still shows NotFoundHttpException when it is called by backbone.js . Any ideas how can that be possible?
 
same http method?
(GET/POST/POT/...)
 
yes
 
no clue then
 
8:53 PM
and I noticed when I comment out from this:

Route::controllers([
'auth' => 'Auth\AuthController',
'password' => 'Auth\PasswordController',
//'todo' => 'TodoController'
]);

then I get MethodNotAllowedHttpException
 
The word "todo" has, through labyrinth word association and poor eyesight, gotten the song "Africa" by Toto stuck in my head for the rest of the day. Thanks, Obama.
 
wait till his wife funks you up
 
bob$ ~/php-src-7.0/sapi/cli/php -r '$a = ["\xf7\x17\x7f\x7f\x7f\x7f\x7f\x7f\x7f\x6b\x03\x6a\x13\x63\x17\x6b\x1d\x67" => 0];'
Assertion failed: (hash != 0), function zend_inline_hash_func, file Zend/zend_string.h, line 287.
Abort trap: 6
 
yeah? :-D
I searched some hash which is equal to zero… which makes PHP crash…^^
 
8:58 PM
Looks crazy =]
hmm
 
$hash = function($s) { $hash = "5381"; $max = bcpow(2, 64); for ($i = 0, $to = strlen($s); $i < $to; $i++) { $x = ord($s[$i]); $hash = bcmod(bcadd(bcmul($hash, 33), $x < 128 ? $x : ($x - 256)), $max); } return $hash; };
That's the hash function PHP uses internally…
but due to overflowing ;-)
You need a 64 bit build with debug enabled
 

« first day (1614 days earlier)      last day (3348 days later) »