Concurrency and parallelism are hard. With the traditional threading model, a developer has to constantly ensure threads are not in conflict, which is a very difficult task. The team behind Go implemented fantastic concurrency primitives within the language that make reasoning about concurrent code far easier. Fortunately, all that goodness is no longer locked up inside Go; there’s now a library f
In the first article, we examined why the fork() system call is useful and where it fits into the grand scheme of things. We saw that by passing a block to Kernel#fork or Process#fork it is possible to execute arbitrary code concurrently (or in parallel if there are multiple processors). In addition, we saw that although forking is relatively expensive, it can compete with threading if the Ruby im
I like to think of forking as the underdog of the concurrency world. In fact, at this point, many programmers have probably never even heard of it. The term “multithreaded” has almost become synonymous with “concurrent” or “parallel.” The fork() system call creates a “copy” of the current process. For our purposes in Ruby, it enables arbitrary code to run asynchronously. Since that code will be sc
March 10, 2014Uno! Use Sinatra to Implement a REST API The REpresentational State Transfer (REST) architecture provides a very convenient mechanism to shuttle data between clients and servers. Web services and protocols, like HTTP, have been using the REST architecture for many years, so it is a well-tested and mature concept. Sinatra can be used to effectively implement the REST architecture. Sin
December 9, 2013Build a Sinatra API Using TDD, Heroku, and Continuous Integration with Travis This post was inspired by this brilliant video, where Konstantin Haase, the maintainer of Sinatra builds a fully working app and deploys it on Heroku with tests on Travis (where he works). I decided to do a similar example that walks through each step of building an API service that demonstrates a typical
April 4, 2014Opal: Ruby in Your Browser, the Basics I love Ruby, and it is my go-to language for building web applications. Unfortunately, when dealing with the browser, Javascript is a necessary evil. As you can see, I am not a huge fan. So when someone comes along offering a way to use Ruby on the browser, sign me up! In the first part of this article, I will introduce Opal and show how to get O
The great folks over at Google have developed an awesome language called Go. At first glance, it seems like Ruby and Go are distant cousins, at best. However, their complementary skill sets provide a perfect match. It is definitely worth any Rubyist’s time to take a look at Go as some of the innovations it brings to the table are quite enticing. For me, Go was the missing link between C++ and Ruby
This article covers various ways that you can generate random (usually pseudo-random) information with Ruby. Random information can be useful for a variety of things, in particular testing, content generation, and security. I used Ruby 2.0.0, but 1.9 should produce the same results. Kernel#rand and Random In the past, a random range of numbers might be described like rand(max - min) + min For exam
Write powerful, clean and maintainable JavaScript. RRP $11.95 Ruby on Rails is the web development framework of the moment, powering GitHub, Twitter, Hulu and many more successful apps and websites. The arrival of Rails 4 is the perfect time to learn it. SitePoint’s newest ebook, ‘Jump Start Rails’, from Andy Hawthorne, will get you up to speed with Ruby on Rails in just a weekend. Andy has also p
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く