Ruby

add news feed

tweet a story

StackEdit - Markdown-based browser edit control. Rubinius 2.0 Released - With Ruby 2.1 compatibility and big plans for the future. CloudFlare and Open Source Software: A Two-Way Street - Yes, this is how things are supposed to work. T...
StackEdit - Markdown-based browser edit control. Rubinius 2.0 Released - With Ruby 2.1 compatibility and big plans for the future. CloudFlare and Open Source Software: A Two-Way Street - Yes, this is how things are supposed to work. Tails - Bootable Linux designed to use Tor for everything. Firefox Developer Tools and Firebug - Looking at the two different sets of dev tools in Firefox. WebSockets Now in Public Beta - On Heroku.
about 2 hours ago
An Introduction to Python programming – A Free Online Course You should learn a programming language every year, as recommended by The Pragmatic Programmer. By learning a new language, you’ll broaden your perspective of progr...
An Introduction to Python programming – A Free Online Course You should learn a programming language every year, as recommended by The Pragmatic Programmer. By learning a new language, you’ll broaden your perspective of programming. In 2010 we brought to you Clojure, last month we offered you Go and now we offer you a free introductory course on Python programming. You will learn Python programming along with RubyLearning’s mentors Anders Persson, Satish Talim and Victor Goff. Registrations have already started. Are you there? How do I register? You first create an account on rubylearning.org To enroll into the course, use the enrollment key PP101 Course Fees The course is completely free of cost. What’s Python? Python is an interpreted, object-oriented, high-level programming language with dynamic semantics. Its high-level built in data structures, combined with dynamic typing and dynamic binding, make it very attractive for Rapid Application Development, as well as for use as a scripting or glue language to connect existing components together. Python’s simple, easy to learn syntax emphasizes readability and therefore reduces the cost of program maintenance. Python supports modules and packages, which encourages program modularity and code reuse. The Python interpreter and the extensive standard library are available in source or binary form without charge for all major platforms, and can be freely distributed. What Will I Learn? In this introductory course, you will learn the essential features of Python programming that you will end up using every day. Who’s It For? Anyone with some programming experience in any programming language. Dates The course is ongoing and you can join anytime you want. Also, you can log into the course area at a time convenient to you. Hurry, registrations have started. Remember, the idea is to have fun learning Python. At the end of this course you should have all the knowledge to explore the wonderful world of Python on your own. Technorati Tags: Python programming, Python, programming (Powered by LaunchBit)
about 3 hours ago
In the world of physical and virtual computing computing there are thousands of metrics to choose from.  These can range from describing a running operating system to describing multiple processes representing a single application runnin...
In the world of physical and virtual computing computing there are thousands of metrics to choose from.  These can range from describing a running operating system to describing multiple processes representing a single application running on many servers. Obtaining visibility into the runtime attributes of these servers and processes is critical to effective operations. We must have operational vision which consists of hindsight, sight and foresight. The ability to see past, present and future is critical to guiding effective operations and development. Without this vision we have operational blindness. We will use a human body and its organs as an analogy for a running operating system and its processes. There are many approaches to collecting the appropriate metrics to accomplish this goal—let us explore a few of the more prominent ones: Do Nothing Approach Medical We assume the body is healthy because we are not aware of anything wrong.  Our system seems to be functioning by just observing from afar. System This approach is the default state of a freshly running operating system environment. With this approach, we maintain the status quo and maintain operational blindness. Without insightful metrics, we have a misguided sense of safety based on the operating system's newness and the fact that its processes are still running. Effective business decisions guiding operations and development cannot be made. Results The blissful paradise of ignorance quickly turns to constant pain. An illness that could have easily been cured when symptoms first appeared instead requires painful and costly treatment. The analogy to this for running systems would be:  Processes ceasing to function, disk drives filling up, the dreaded random “Out of memory killer”, or constant CPU usage that keeps critical business processes from keeping up with the demand. Operational blindness should never become the choice the systems your business are built on. To minimize risk and maximize efficiency, issues need to be detected early and mitigated at the first responsible opportunity. If we are operationally blind, we can only prevent issues through guesswork and luck. Examination and Scanning Mechanisms Medical This is analogous to going for a routine checkup with your physician. They poke and prod and scan your body to see how it is functioning, looking for warning signs that they have encountered in the past in order to mitigate health risks before they become issues. System We write scripts and small programs which, similar to our physicians, examine and scan the system looking for events which indicate issues before they become issues. We may even instrument some invasive monitors into our critical business programs that notify us when events happen. These checks run at regular intervals and watch for events that are similar to known past issues. Results In this scenario, we are granted a kind of black and white operational vision.  However, we are still unable to see with full color and excellent foresight. This approach is still valuable, no matter the other methods we use. At intervals we run scripts which gather log data, poll running processes and collect system {cpu,ram,disk} resource information. Additionally per-language instrumentation is done that modifies language runtimes in order to collect trace data. These are great sources of information, but they don't compare to the ability to having detailed data from every process all the time, a “miss nothing” approach. Brain and Central Nervous System Medical A physician’s dream would be to hook into the brain and central nervous system (BCNS) in order to intercept and know exactly what was happening at all times. The problem with such a monitoring system (if it even existed) is that it involves an extremely invasive operation and therefore should only be undertaken in cases where the benefits outweigh the risks. System The BCNS of our running systems is the Kernel and its nerves are called “modules
about 15 hours ago
We’re excited to announce that WebSocket functionality is now available on Heroku in public beta. We can’t wait to see the powerful and creative real-time apps you’ll build. In this post, we show how to get up and running with WebSockets...
We’re excited to announce that WebSocket functionality is now available on Heroku in public beta. We can’t wait to see the powerful and creative real-time apps you’ll build. In this post, we show how to get up and running with WebSockets and demonstrate the functionality with two sample apps you can get on GitHub. Editor's Note: Features added through Heroku Labs are experimental and are subject to change. Getting Started For full documentation of WebSocket support on Heroku, visit the Dev Center. WebSocket functionality is available as part of Heroku Labs. First make sure you have the Heroku Toolbelt installed. Then enable the WebSocket feature: $ heroku labs:enable websockets -a myapp Enabling websockets for myapp... done WARNING: This feature is experimental and may change or be removed without notice. For more information see: https://devcenter.heroku.com/articles/heroku-labs-websockets Congratulations, you’re now ready to build and deploy real-time apps on Heroku leveraging WebSockets. Have feedback or run into issues? Let us know in the Heroku Forums. Please note: When the websockets labs feature is enabled for your app, the DNS record for your herokuapp.com domain is updated to point at a WebSocket-capable endpoint. However, once WebSocket functionality leaves public beta, all apps and endpoints will support WebSocket functionality automatically. Example WebSocket Apps It’s easy to get up and running experimenting with WebSockets on Heroku. Two very simple sample apps are available for you to clone and deploy on Heroku: A Node.js app using the ws WebSocket implementation and a Ruby app using the faye WebSocket implementation. This is all it takes to get the Node.js WebSocket app running on Heroku: $ git clone git@github.com:heroku-examples/node-ws-test.git Cloning into 'node-ws-test'... $ cd node-ws-test $ heroku create Creating fathomless-hamlet-4092... done http://fathomless-hamlet-4092.herokuapp.com/ | git@heroku.com:fathomless-hamlet-4092.git Git remote heroku added $ heroku labs:enable websockets Enabling websockets for fathomless-hamlet-4092... done WARNING: This feature is experimental and may change or be removed without notice. For more information see: https://devcenter.heroku.com/articles/heroku-labs-websockets $ git push heroku master Counting objects: 12, done. ... -----> Node.js app detected ... -----> Launching... done, v4 http://fathomless-hamlet-4092.herokuapp.com deployed to Heroku $ heroku open Opening fathomless-hamlet-4092... done You should see an auto-updating list of timestamps in your browser. The timestamp value is captured on the server side (your dyno) and sent via a WebSocket connection to the client. Client-side JavaScript running in your browser updates the DOM every time a new value is received. This is a very simple example meant to demonstrate the most basic WebSocket functionality. Next we’ll look at a more interesting example of what you can build with WebSockets. WebSocket Geolocation App The map below uses WebSockets and the browser Geolocation API to plot a point for every client currently viewing this post. The Node.js app powering this map is open-source and available on GitHub at heroku-examples/geosockets. Note: If you do not see your location on the map, your browser may be configured to block location services. The geosockets app was designed with horizontal scalability in mind. The shared location dataset is stored in a redis datastore and each web dyno connects to this shared resource to pull the complete list of pins to place on the map. Clients viewing the map each establish their own WebSocket connection to any one of the backend web dynos and receive real-time updates as locations are added and removed from the redis datastore. Further Reading Hopefully this gives you an idea of some of the potential applications of this t
about 19 hours ago
One day, two rubies with Rubinius 2.0 and JRuby 1.7.5. MRI 2.1 vs Rubinius 2.0 benchmark, Virtus 1.0, Capistrano woes, and help Ruby on Sails. Listen to this episode on Ruby5 This episode is sponsored by Code School Spanning 7 levels...
One day, two rubies with Rubinius 2.0 and JRuby 1.7.5. MRI 2.1 vs Rubinius 2.0 benchmark, Virtus 1.0, Capistrano woes, and help Ruby on Sails. Listen to this episode on Ruby5 This episode is sponsored by Code School Spanning 7 levels and bringing you nearly 40 interactive coding challenges, Rails 4 Patterns follows up on Rails Best Practices and teaches you common practices and techniques to help your Rails application stand the test of time. Learn how to avoid pitfalls in ActiveRecord, extract reusable components and concerns, build a JSON API, and more. Rubinius 2.0 Last Friday, Ruby Hero Brian Shirai announced the release of Rubinius 2.0. And, with this release, Rubinius is moving toward concentrating on being the foundation for modern concurrent and distributed applications. MRI 2.1 vs. Rubinius 2.0 Miguel Camba put together a blog post where he recorded Ruby benchmarks across MRI, JRuby, and Rubinius using the ruby­benchmark­suite. Rubinius actually ran faster than the current Ruby 2.1 dev branch and even beat JRuby 1.7.4 in all of the multithreaded tests. JRuby 1.7.5 JRuby 1.7.5 was released yesterday! Aside from a number (243) of issues resolved, this new version brings improved transcoding support, Ripper support, Fiber fixes, and encoding and multilingualization improvements. It seems like pathname, date and time have been sped up. Call performance for magic globals has been increased as well, and block and proc creation and dispatch has been improved as well. It’s interesting to note that as the Rubinius project did, the JRuby project moved several standard library pieces into gems with this release. Virtus 1.0 This weekend, Piotr Solnica released Virtus 1.0. Virtus was built from extracting the dynamic property definitions in DataMapper into its own library. Think of it kind of similarly to attr_accessor but with 100% more utility, or as they put it, “Attributes on Steroids for Plain Old Ruby Objects.” It supports defaults, type checks, coercion, and a whole lot more. Everyone has probably rolled their own library for doing something like this and Piotr and the rest of the team have done an incredible job with Virtus. Capistrano woes Lee Hambley, the maintainer of Capistrano over the last few years posted a heartfelt message to the project’s mailing list last week talking about how we was considering stepping down. Help Ruby on Sails A lot of people apparently signed up for Ruby on Sails but sponsors were hard to find and Jim found himself having to put $7,200 of his own money to cover the cost. To help him out you can purchase a Ruby on Sails t­-shirt. If Jim closes the fundraising gap he will donate any excess funds to Rails Girls South Florida. The event is still 4 sponsors short, so don’t hesitate to get in touch with info@rubyonsails.info if you’re interested.
about 19 hours ago
Registration Has Opened! - For this year's Rails Rumble. build_frontend.sh - Work towards replacing the asset pipeline with a bash script. Use Rails with the db schema you always wanted - A gem to reverse-engineer models from a pre-exi...
Registration Has Opened! - For this year's Rails Rumble. build_frontend.sh - Work towards replacing the asset pipeline with a bash script. Use Rails with the db schema you always wanted - A gem to reverse-engineer models from a pre-existing PostgreSQL database.
1 day ago
Heroku is now using Extended Validation SSL Certificates for most of our Heroku-owned applications. This allows you to tell at a glance if an URL belongs to Heroku itself, or is merely hosted on us. Applications in our legacy “B...
Heroku is now using Extended Validation SSL Certificates for most of our Heroku-owned applications. This allows you to tell at a glance if an URL belongs to Heroku itself, or is merely hosted on us. Applications in our legacy “Bamboo” stack are hosted under the heroku.com DNS domain, which has historically made it difficult for people to differentiate between Heroku-owned apps (e.g., id.heroku.com, dashboard.heroku.com) and customer applications. We believe the extra UI indication will prove useful in solving this problem. For more information, see "EV SSL Certificates and Heroku-owned Applications" on Heroku DevCenter. -Tom Maher Heroku Security Team
1 day ago
I've been dabbling in Dancer (Version One, not so much Version Two). Our first opportunity to create a production-worthy Dancer application just rolled out with encouraging results, so I thought I would outline some things we tried, and ...
I've been dabbling in Dancer (Version One, not so much Version Two). Our first opportunity to create a production-worthy Dancer application just rolled out with encouraging results, so I thought I would outline some things we tried, and things we learned. Don't worry if you don't know a thing about Dancer; I'll educate you a little as we go along. First, some background. This application was a re-host and rewrite of an existing application written in Javascript and plain old CGI Perl scripts, returning either HTML or fairly simple JSON objects. Even the database it connected to was ancient DBM files. Those files were created by extracting data from the main website's database, so that part was easy to replace – we just had to use the extraction queries (mostly) to connect directly. We chose Dancer as the platform for this effort because of its purely Perl footprint, and its relatively easy deployment. Since I didn't really want to rewrite the front-end Javascript code, I left that mostly as-is and concentrated on replacing the CGI scripts. The first step was to move all their code into a non-Dancer Perl module, which communicated with the outside world entirely in the form of hashrefs: sub do_something_great { my $opt = shift; my $output = {}; # do something great! return $output; } Next, as a stop-gap measure, I replaced the innards of all the CGI scripts to turn CGI arguments into a hashref and call my new processing stuff. Note that so far, no actual Dancer code has been involved. This was intentional; since my Dancer expertise was still a bit thin, I wanted to have as few app-caused problems as possible, when I started Dancing. But now we should stop for a moment and learn just enough about Dancer to be less dangerous. Dancer (details at the first link in this article) is a web application framework: in essence, it's a way to convert URLs into data. You feed in a URL, you get back a web page, a structure, maybe a side effect or three. In order to connect your application to a browser, you need a series of routes: package MyApp::Routes; use Dancer; get '/index.html' => sub { print 'hello, world'; } Dancer sets up some easy-to-grasp syntax that lets you associate a clump of Perl code (an anonymous sub, in the example above) with a URL and a method. Here, a GET of "/index.html" runs the code, and sends the output back to the browser. ... post '/myapp/do_this.html' => sub { do_this(param->{foo}); return q{It's done.}; }; Likewise, we can specify more complex URLs (such as "/myapp/do_this.html?foo=bar"), with POST methods, and access the CGI parameters via the param() function. (It just returns a hashref, which we can address as shown. Dancer provides quite a bit of support infrastructure: config files, database connections, plug-ins for templating HTML or other output, etc. Since this article is a Gentle Introduction, I refer you to the link cited above if you want to delve deeper. Now it was pretty simple to make gradual progress: I'd eliminate one CGI script at a time, replacing it with a Dancer route (stored separately from my main processing module, so that the processing could continue to be ignorant of Dancer). Most of the routes were very simple, since the paths they had to recognize were simple and straightforward, with simple CGI parameter lists. E.g., get '/notes.html' => sub { my $context = MyApp::get_notes({ dbh => database(), order => params->{order}, raw => 1, }); template 'notes', $context, { layout => 'plain' }; }; This example is one of the routes that produces HTML. The "template" built-in is just a layer wrapped around your preferred templating system (such as Template::Toolkit); it looks for a template file called "notes", using a set of values specified by "$context", and wraps the result in a "layout" file called "plain". (At the risk of grossly oversimplifying: your "template" can be thought of as all of you
2 days ago
Appmaker - New online mobile application generation tool from Mozilla. Introducting Harp - A web server for static files with built-in preprocessing. Bitch - Log ruby messages to the OS X notification center. Time to hand over the rei...
Appmaker - New online mobile application generation tool from Mozilla. Introducting Harp - A web server for static files with built-in preprocessing. Bitch - Log ruby messages to the OS X notification center. Time to hand over the reigns before Capistrano costs me my youth? - Looks like Lee Hambley has about had it with maintaining this particular piece of OSS.
2 days ago
Ben Orenstein has written an interesting article: How much should global variables cost?. It's basically a price-list for different kinds of technical debt, and you can use it to calculate the "cost" that each of your commits adds to yo...
Ben Orenstein has written an interesting article: How much should global variables cost?. It's basically a price-list for different kinds of technical debt, and you can use it to calculate the "cost" that each of your commits adds to your codebase. By actually putting a dollar amount on each "violation" - you can get a good, visceral feel for what you're doing. As he points out - you can still choose whether or not to keep something (sometimes you really do need to do something that would otherwise be considered a no-no), as long as you can "afford" it. I think it's an interesting way of looking at the problem. I'd like to see you regaining points for fixing/refactoring similar code-violations out of the project too :)
4 days ago