Better HN
topnewbestaskshowjobs
Log inSign up

stormpat

79 karma · joined Jan 5, 2013 (13y ago) · 23 submissions

Submissions

comment 9y ago · link · parent

{_, mem} = :erlang.process_info(spawn(fn -> 1 + 1 end), :memory)

mem -> 2720 bytes (~2.7kb)

comment 11y ago · link · parent

+100

comment 11y ago · link · parent

TLDR. Keep an healthy diet, and exercise. Sleep enough.

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 11y ago · link · parent

Skit literally means "Shit" in swedish.

comment 12y ago · link · parent

For a real low budget phone you could get an Nokia 105 for 18 dollars.

comment 12y ago · link · parent

Looks like the Dreamweaver for the next generation.

comment 12y ago · link · parent

Why exactly should it bee free? Its free for beta, and i could speculate that the price for the editor is somewhere between 30-50 dollars.

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 12y ago · link · parent

Why am i not suprised america has the most explosions, and still they try to ban other countries from producing nuclear fuel. The future generations will probably like the fallout on us soil. Congrats, this is a wondefull vid.

comment 13y ago · link · parent

Thats a sweet idea, i would really like to have something like coin.

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

Again, a totally useless benchmark. I really feel all these benchmark tests are useless, if they are not in the realm of any real world app. So why not create a crud app mimicing benchmark, test writes and reads, and calculations instead. In the real world it comes down to the ease of development, deployment and maintenance. This is where the traditional web languages still win, and ill want to bet you can ship software faster than ever these days when using a proved web framework.

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

The OP is posting BS links to BS sites, this is the 2nd today.. Linkbaiting for points ill guess...

comment 13y ago · link · parent

ALL YOUR PRISM ARE BELONG TO US

comment 13y ago · link · parent

This is probably true for Finland aswell, i was a student in Helsinki (I have lived in the helsinki metropolitan area for the most part of my life) from 2006-2012, and as any kid in his early 20s i wanted to have my own appartment.

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

As of now the official 4.0 docs are still on http://four.laravel.com/

17.

Laravel 4.0 Released(github.com ↗)

44 points · by stormpat · 13y ago · 23 comments

comment 13y ago · link · parent

The problem with static and singletons have been adressed by the creator, Taylor Otwell. Heres a quote (http://forums.laravel.io/viewtopic.php?pid=3237)from him regarding the static methods in laravel 4.

"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

The biggest is maybe the use of composer, its really changing PHP for the better.

comment 13y ago · link · parent

Its a complete rewrite, and there is many new concepts. The syntax is however almost the same. A good list of new features can be found here: http://phpmaster.com/whats-new-in-laravel-4/

21.

Laravel 4 Beta released(four.laravel.com ↗)

19 points · by stormpat · 13y ago · 17 comments