79 karma · joined Jan 5, 2013 (13y ago) · 23 submissions
comment 11y ago · link · parent
Im lucky to have a gym 10 meters from our office, so 3 times a week i use my lunch ti go to the gym, and eat afterwards something light at the office, i try to go jogging twice a week on to of the gym.
Try to eat a fiber rich diet, if you choose to exercise. And never pass breakfast. Its important, the most important meal of the day.
Now for the mental part, here the most important thing is to sleep. Dont watch TV, read a book instead.
comment 12y ago · link · parent
So if its too ethical to pay for quality software, just think about your own job, you get paid, right?
Sublime is not free, still people create packages for it, for free.
Do you mean that if the code is open to everyone, the software should not cost?
Kind of weird, using open source software to create software to make money, but not being able to sell software for money if its opensource.
comment 13y ago · link · parent
The problem is that in Finland there is very few places that uses the "swipe" your card and sign method anymore. Back some 2-3 years ago it was a custom, but for security reasons (anyone can swipe a stolen card and sign it, the law does not require an ID unless the amount being paid is over 100 euros) it was abandoned and now you simply enter your PIN and that that.
Im not sure about other countries, but atm this is the norm in Finland.
comment 13y ago · link · parent
Speed is not the only factor, and usually not even a factor that has to be accounted for, lets be reasonable, 99% of any web apps dont reach the state that they even need to scale to 10000s of user actions per second.
Id be interested to see how hhvm/php whould compare though.
11.
Ask HN: How do you stay uptodate with all the tech?
1 points · by stormpat · 13y ago · 1 comment
12.
Ask HN: US citizens, whats your Prims feelings?
2 points · by stormpat · 13y ago · discuss
comment 13y ago · link · parent
So my rent was 650 euros/month, and adding other costs the monthly cost for living was probably over 1200 euros/month.
So school was free, and we also get a student benefit from the government for 9 months each year, the benefit is for everyone studying and its about 450 euros/month.
So as you see i also had to work at the same time, which was fine. I had a job for the entire time i studied, and got a decent salary.
Now, heres the catch. By some idiotic law i cannot make more than 9000 euros per year. If o make more i have to pay back the student benefit.
Why? I pay taxes, i get the points in school? So the government is telling me: DONT WORK!
This law resuts in people dont working, or working just a little bit and ending up taking student loans, and when they are finished studying many have loads for 1000s of euros.
As a student work experience is as valuable as the knowledge from school, i would not hire anyone without work experience, and this is where the finnish government fails.
comment 13y ago · link · parent
17.
Laravel 4.0 Released(github.com ↗)
44 points · by stormpat · 13y ago · 23 comments
comment 13y ago · link · parent
"Yeah, this [static methods/singletons] is something I have thought about a lot.
I have gone from everything totally static, to everything totally dependency injected, to somewhere in between. The criticisms of static methods are certainly valid. If you'll notice in the Laravel core code, the router, session handling, and database stuff is actually pretty thoroughly dependency injected. When the Laravel core creates the session payload, it injects the driver. That allows me to unit test the framework more thoroughly since I can inject mocks and stubs.
Problems I have run into with using DI throughout the framework is that you start to fight against the global state that exists within PHP itself. For instance, functions like "file_get_contents" and "file_exists"... you have to have some way to mock those.
I have actually moved Laravel totally off of static methods before to see what it would be like, and it's not too bad. I think in the future it's possible more classes will be moved off of static methods.
To dig deeper into Laravel, there is actually an abstract "Facade" class that makes you think a class is static when it's not. For instance, when you do "Session::get", you are actually hitting the Laravel\Facades\Session class, which is resolving the session payload out of the IoC container and then calling the method you want. It's a trick to give you convenient access while still keeping the framework somewhat testable.
So, I totally agree with the articles. The struggle so far has just been to find a good balance point for Laravel. Writing testable code is still up to the developer to an extent. You can use the IoC container to inject a database connection instead of just using the DB static methods. However, things like the Input, URL, File, etc. classes still being static could lead to some testability problems. I've broken encapsulation on the Input class just to make it a little more testable. You can set the Input just by saying "Input::$input = array()".
This is probably way more information than you wanted, but just letting you know this is something I have thought about a lot. Symfony2 has probably done the best job of keeping things testable that I know of. I think Laravel's testability is decent as it stands, but I know there are things that could make it better."
comment 13y ago · link · parent
21.
Laravel 4 Beta released(four.laravel.com ↗)
19 points · by stormpat · 13y ago · 17 comments