News for hackers. Stuff that matters.

brassybadger

Re:How a German Soda Became Hackers' Fuel of Choice on Saturday May 10, 2014 @01:34PM (#7726189)
Indeed, I'd say it's more popular in Berlin than Coke.
Re:Game servers: UDP vs TCP on Tuesday April 01, 2014 @11:15AM (#7508853)
A very good recap on how networking in Quake3 works without reliable packet delivery:

http://trac.bookofhook.com/bookofhook/trac.cgi/wiki/Quake3Ne...

Simple, yet robust.

Re:I reckon your message broker might be a bad idea on Saturday March 29, 2014 @08:30PM (#7494601)
This is the old debate whether applications should be tightly or loosely coupled. As the article concludes, there are tradeoffs to consider - the broker is a SPOF indeed, but on the other hand it'll take care of all the queueing logic (which is not that simple as it seems - acknowledgements, backpressure, redelivery, timeouts etc etc). It's also much easier to scale the system out if applications are loosely coupled.

Furthermore, a good broker supports some kind of failover. We run a RabbitMQ cluster behind a load balancer, and it works great - once e.g. we had a hardware failure, and the applications did not notice anything from it. Of course we also have to monitor the queues on the broker (one of the few ways to bring down Rabbit is to fill up its disk). But having a central broker for connecting apps also means you have a central point you can keep an eye on to check where your bottlenecks are (which queues build up).

Loosely coupled applications are also much more unix-like in the sense that you can make them do one thing instead of baking in your custom restart logic (over a network? please don't).

Re:Duktape: an embeddable JavaScript engine on Monday March 24, 2014 @06:27AM (#7457498)
Integration is very easy (check out the examples in their git repo), but this is still alpha quality software - there are known limitations, e.g. the one I ran into is that a large JS expression involving function calls might make Duktape run out of bytecode registers.
Re:Duktape: an embeddable JavaScript engine on Monday March 24, 2014 @06:20AM (#7457483)
After a quick glance it also seems that newer versions of SpiderMonkey only offer a C++ API, so you can't embed it anymore into C apps without some glue code. I checked out jsapi.h in SpiderMonkey24 - maybe some trick is needed to use SM from C?
Re:Duktape: an embeddable JavaScript engine on Monday March 24, 2014 @05:57AM (#7457410)
I'd say the combination of being small, easily embeddable and having a liberal license make it attractive.
Re:Elixir and the Internet of Things – Handling a Stampede on Tuesday January 14, 2014 @01:56PM (#7058929)
The funny thing is that most people choose Elixir over Erlang because of the syntax - personally I can't stand Ruby but love the Erlang syntax. When I see Erlang code, everything just clicks - almost like I'm reading prose.

So, if you want to harvest the power of Erlang, I'd suggest you start with the real thing first. The only drawback is that once you get used to functional programming, guards, pattern matching, OTP, cheap processes, links and all the other goodness, there's no way back.

If you still feel Erlang is weird after spending a couple of days working with it, feel free to jump on the Elixir bandwagon. :)

Re:Intermittent fasting: The good things it did to my body on Friday January 03, 2014 @02:10PM (#7007375)
If you're only looking into weight loss/gain, then yes. Both are terrible choices as a diet, though. The latter will provide more nutrients, so we can call it 'healthier', but you will lack important ones still, and significantly undereat if you are an adult male of average weight and height.
Re:Intermittent fasting: The good things it did to my body on Friday January 03, 2014 @11:36AM (#7006293)
The whole "clean eating" thing is mostly a fad. Nobody has managed to define what food is "clean" and what is not (see e.g. what the typical bodybuilder thinks is clean, and what someone doing paleo, what the average dietitian recommends, etc). The only important things are 1) the number of calories you eat, and 2) what nutrients your diet provides.

When I'm cutting, I don't make a fuss about "junk food", as long as I'm below my calorie intake limit and I'm not missing any important nutrient. Usually hovering around 20% junk food.

Re:Intermittent fasting: The good things it did to my body on Friday January 03, 2014 @08:53AM (#7005382)
Interesting to see how mainstream intermittent fasting has become. It's worth noting where it started.

A few years ago a few hardcore fitness fanatics started playing with the idea of using controlled fasting for weight loss and/or body recomposition. Two people that should be mentioned are Lyle McDonald[1] and Martin Berkhan[2]. Martin especially made IF popular via his blog, laying out the principles he used as a fitness consultant with his clients.

Most research (and especially the commercial IF knockoffs) only take some part of these principles, but the "diet" part is only part of the picture when it comes to body recomposition. It's almost worthless without the rest (high intensity, low volume weight training, basic compound movements, progressive overload, no focus on cardio).

Quite a few people/company are trying to rip off customers via their IF programs knockoffs and supplements. If you want give IF a shot, read through Martin's blog, and try the original Leangains protocol.

[1] http://www.bodyrecomposition.com/ [2] http://www.leangains.com/

Re:GCC Function Multiversioning on Thursday January 02, 2014 @05:38AM (#6999009)
The really nice thing about this is that the dispatching to the optimized version is done at runtime, via GCC adding the necessary stubs at compile time. No extra dispatching/CPU detection logic in the application is needed to take advantage of advanced CPU features. Very cool.
Re:The future of M:N threading on Wednesday November 13, 2013 @03:18PM (#6728169)
I have no experience with Akka, but what you write makes sense. Even Clojure concurrency primitives feel weird sometimes when one wants to mix them with low-level Java libraries.

Another option is to do it at the language level - see my comment on Erlang.

Re:The future of M:N threading on Wednesday November 13, 2013 @02:26PM (#6727738)
Interesting analogy: Erlang implements an M:N scheduling model, where it starts an OS thread for each CPU core (by default), and (preemptively) schedules its own lightweight processes on top of these threads. However, unlike OS threads, these are very lightweight: when they are created, they only need a few hundred bytes. Erlangers have been using the one process per request model for a very long time, and Erlang applications achieve massive concurrency via this.

To me it seems it is possible to do M:N right, but you need more abstraction and a different design. M:N seems to work well in Erlang-like cases (very lightweight processes on top of a kernel threads).

Older »