Archive | Linux

A UNIX-like operating system.

Notes from NH Ruby, 21-May-2009: Brian Turnbull on Monit, Tim, Nick and the other Nick Lightning Talks

The New Hampshire Ruby / Rails Group met on the 3rd Thursday of the month at RMC Research. (Third-Thursday is the new standard, but June’s meeting is likely to be on a different night; see below.) Ten people attended. Nick Plante started off the meeting, noting that David Berube had to back out due to emergency, but we’d fill in with ad-hoc Lightning talks.

Brian Turnbull talked about Monit [link updated – Ed.] (see his slides here), a small-memory and resource-consuming application for monitoring key performance metrics, and launch scripts and/or alerts when alarm levels are met. Brian talked about early days of managing Mongrel and the necessity to restart the services on failure. While that’s mostly been resolved with later versions (and new options like Passenger), this is still a handy utility for keeping services going, especially if you’re troubleshooting some balky applications. Brian included some clear examples in his slides. We talked about how this wasn’t a solution for remote monitoring (your network could be down, even if you’ve restarted Apache), there were solutions, like running Monit on a couple of machines “watching the watchers” and other solutions, but that Monit was a simple and relatively lightweight solution. Other tools, such as Nagios, are available for more complex problems and the need for customization. Excellent presentation!

Tim Golden, our host, announced he had finally gotten to “Hello World” (a long running joke within the group) and described some of the challenges of setting up a Ruby development environment in Windows. He used the Ruby one-click-installer, and installed many gems. He’s trying out NetBeans as his IDE, and sticking with SQLite as the development database.

Nick Quaranto spoke on his work with gemcutter, developing a new scheme for a gem repository with a simple and scriptable API and a more scaleable and responsive repository architecture. This could grow to be a worthy replacement to RubyForge.

Nick Plante showed off the cool stuff he’s developed at RDoc.info – a web site that displays Ruby documentation generated with Yard . Noting that GitHub hosts your web pages and repositories if you name your repo as yourname.github.com and provide an index.html, he and fellow troublemaker Jeff Rafter came up with the righteous hack of creating the user and repo of http://docs.github.com and hosting the documentation for the thousands of projects hosted at github, fashioning their Yard template to closely duplicate the GitHub interface. For all practical purposes, they added a new feature to GitHub. The GitHub owners were… disturbed. But we hope they’ll come around, as this is a pretty elegant solution.

Nick Quaranto took the podium again to show off the use of Metric-Fu at ThoughtBot for their public projects. Metric-Fu is a rake task that automates other metrics tools (like Flog and Flay) to generate a number of interesting statistics that will point out excessive churn or suspicious smells in a project. Nick showed off the Sinatra front end to the package. This could be another very interesting set of pages on any repository offering software, although Nick noted that it would be resource-intensive, as the test runs and coverage processing can be pretty extensive.

Nick Plante announced a possibility of getting a special speaker in June, although the meeting would need to be on an alternate night. All present agreed that shouldn’t be a problem. Stay tuned for the announcement.

An excellent meeting, well worth the cost of admission. And that’s not even counting the free pizza! Thanks to Nick Plante for organizing the meeting, to Brian, Tim and the two Nicks for their presentations, RMC Research for the great facilities, and all for attending and participating!

If it’s the third Thursday…

If it’s the third Thursday of the month, this must be Portsmouth, New Hampshire. Today’s the day for the (recently rescheduled) New Hampshire Ruby / Rails Group to meet. Tonight’s meeting will feature two presentations: David Berube (co-author, Practical Rails Plugins, former leader of GNHLUG and CentraLUG) talking about high-performance web sites using Ruby on Rails and MySQL, and also Brian Turnbull (contributor to Rails Rumble and Portsmouth Coworking founder) talking about Monit, the monitoring system. The full meeting announcement is here. Hope to see you there!

Notes from DLSLUG, 2-April-2009: Nifties!

“Nifties!” are the name for the Dartmouth-Lake Sunapee Linux User Group meeting nights when a featured speaker can’t be found: the Users of the Group make short presentations to each other, hopefully eliciting the “Nifty!” response.

I spoke on my work with Nick Plante and Brian Turnbull starting a business to host a coworking site in Portsmouth, NH with several of the folks there before the meeting started. We had some insightful discussions on the terminology of commercial space leasing, and the intricacies and politics of finding the right spot to start a business.

Rich Brown of Dartware talked about Dojo, the javascript library, and a book he borrowed from the DLSLUG library. (see below for more)

Lloyd Kvam presented his book report on the Google Apps books. Google Apps allows a small business or group to buy a domain, register it with Google Apps. We shared experiences of setting up domains in Google Apps.

Then we realized the meeting was actually next door in L02 rather than L01, not the first time we’ve gotten the wrong room, so we moved over and caught the end of a presentation. Then Bill McGonigle showed how ejabberd was set up with Red Hat – family user accounts (Pluggable Authentication Module – PAM) to which he contributed some code.

Richard Brittain (http://www.dartmouth.edu/~richard) showed a ksh script to kill a subprocess after a specified timout and another script that would check a path (checkpath.ksh) and remove all the cruft that builds up as software is added and removed, machines appear and disappear, etc.

Rich Brown of Dartware presented his Dojo report again. Rich needed a simple web page that would let his clients enter in several key pieces of information in a form and from that data generate a configuration file in a specific format. Eventually, he realized a prebuilt library of JavaScript could do a better job, he worked with Dojo and realized he needed a reference. He borrowed the Dojo book from the DLSLUG library. While there were a few frustrations, overall he was pleased with the content of the book, it’s organization, clean examples and good indexing. The book didn’t have a good description of how the CDN supplied JS libraries can be downloaded over the web quicker and in the correct forms and versions; he ran into a race condition that took a while to debug. The Dojo book covers 1.1 while he was working with 1.2, may even be up to 1.3 by now, always a problem with letting the ink dry.

Parker (I didn’t catch his last name) posted a Madebyparker.com blog entry that was spurred on by trying to make a copy of document, but the machine was eating dollars, so scanned to his email address and sent it to himself: nine pdfs in nine pages. The Dartmouth facilities wisely try to minimize the waste of paper with something called “GreenPrint” but the implementation leaves something to be desired, especially for folks running Linux. He searched around and found a command line to concatenate the documents together into one PDF for faster printing and management.

Ten folks made it to the meeting, and I have no doubt everyone learned something; a great result!

Notes from NH Ruby/Rails Group, 19-February-2009: Josh Nichols, Jeweler, Brian Turnbull, Rails 2.3

The New Hampshire Ruby / Rails group met as usual at the RMC Research offices in Portsmouth. Thirteen people attended the meeting, a suspicious number of them from Maine. We started, as we often do, with a round of introductions.

Josh Nichols presented RubyGems and You. A former Java developer, started working with Ruby about two years ago, got a “real” Ruby job about 6 months ago, laid off 2 months ago, currently “employment independent.” Josh presented an excellent overview of how gems work, how they fit into the logic of Rails apps, how they are distinguished from plugins, and how gems can be created. He went on to talk about the two primary repositories, RubyForge and GitHub, and talked about the benifits and liabilities of each. This was all pretty much background for his presentation of Jeweler, a set of scripts that can generate the framework needed to build a gem, with support for pushing it directly up onto GitHub, automating the bumping of version numbers (patch, minor and major versions). Josh made a very clear presentation of the skeletal files that were created and touched on issues with RSpec testing, rake scripts, how to tie in library paths, vendor-izing your gems. Whew! A great amount of material covered quickly and well. Thanks, Josh!

Brian Turnbull did a presentation on the new features of Rails 2.3: Engines, nested transactions, nested forms, nested attributes, dynamic and default scope, other changes (multiple conditions for callbacks, HTTP digest authentication, lazy loaded sessions, localized views, and more!)

Brian then did a short presentation on Rails Metal. Metal runs on top of Rack, and is a tool you turn to when the full Rails stack is too complex or too slow. There was some interesting discussion on how Metal can fit into the calling stack, short-circuiting calls that didn’t need the full Rails process.

Demo version: http://github.com/bturnbull/bturnbull-metal-demo

You can view their slides via SlideShare and also view a WebEx video of the event (see the post’s comments) at http://nhruby.org/2009/2/20/ruby-gems-jeweler-and-a-rails-2-3-preview

Thanks to Josh for the trip up from Boston and the great presentation. Thanks to Brian for two cool presentations. Thanks to Tim Golden and our hosts at RMC Research for the great facilities and for broadcasting the presentation via WebEx this month. Thanks to Nick for herding the cats and ordering the pizza and making the announcements and giving away a couple of cool O’Reilly books. Thanks to all for attending and participating!

Next month: Ted Roche presents an introduction to Cascading Style Sheets, Nick Plante presents Sinatra. Hope to see you there!

Notes from CentraLUG, 2-Feb-2009: Open Source Business Models

Fourteen people attended the February meeting of the Central New Hampshire Linux User Group, a chapter of the Greater New Hampshire Linux User Group. We held our meeting at the usual place and time: the first Monday of the month at the New Hampshire Technical Institute Library, Room 146. Formal meeting starts at 7 PM. Gathering and networking often starts a half-hour earlier.

A few of us met at Panera Bread in Concord before the meeting for dinner and geek talk. We’ll try to make this a regular thing, if people want to.

Before the main meeting, maddog showed off a video he had created, inspired by some recent demonstrations of Open Source software he had seen. Using nothing buy Open Source software, including Inkscape and Kino. maddog emphasized that he’s not an experienced cinematographer, nor had he much experience with the other packages, but that making the video was simple and straight-forward. And the results quite amusing. Look forward to a future post with a link to the video!

We were fortunate to have a variety of attendees to discuss the topic of “Open Source Business Models.” After a brief introduction of what the LUG was about and where to learn more, I opened the floor to the attendees for discussions, and discuss they did!

We talked about the Brazilian music scene, Microsoft EULAs, the difference between Free Software and Open Source software, some great Open Source success stories, like the Project.Net software. There were questions on the fine points of licensing, comments on the openness of the Java Development Kit and runtimes, and much good discussion.

At the end of the evening, two lucky attendees got to pick from the assortment of books we’d been provided by generous publishers. Using the formula of:

(14*rand()).to_int

in interactive ruby and counting off around the room (I started with zero and we went clockwise around the room, a surprisingly difficult process with cats). Mark and Bill each won a book, congratulations! The next CentraLUG meeting will be the 2nd of March. Stay tuned for an announcement of details. Thanks all for attending and vigorously participating. Thanks to Bill for bringing the projector, though we didn’t need it.

Fedora 10 “Cambridge” ships!

Last Wednesday, just in time to give thanks, the five-year-old Fedora Project released their 10th version, code-named Cambridge. Fedora 10 has all the latest goodies: a very improved wireless networking tool, far better Java support, and a slew of features they list here. I was very impressed with the new version upgrade features: I was able to download a single “pre-upgrade” package and run it to convert my Fedora 9 installation on my ThinkPad T61 to a Fedora 10. Over at the Linux Format website, Andy Hudson reviews the new release and concludes, “If you’ve not tried Fedora, or have moved away from it in the past then you should definitely take a look…”

Jump on the bandwagon and check out the new Fedora 10 here

Voices That Matter, Professional Ruby ’08, notes from Day Three

Well, the Day Three notes are a bit rough. Wrapping up 800 miles of commuting and not enough sleep during the conference. But at least I didn’t have to come up with bail money 🙂 Stay tuned. Expect updates, spell-fixes and proper grammar as I punch this up over the weekend…

Josh Susser, Pivotal Labs
dawn of history: agriculture, pyramids, smalltalk
what the hell happened to smalltalk? In the 80s,
arguably the most advanced software development
platform in the world. The best of the best.
At Apple, wrote a memo damning C++
Bjorne’s fault.
C++ is portable structured assembler.
SmallTalk had IDE, garbafe collection, and a big blind spot.
It’s greatest strength is also his greatest weakness.
Consider SuperMan. His moral certitude is his greatest flaw, too.

With SmallTalk, the virtual image stored everything, down to
the network stack and primitives of the file system.
Just the kernel needed to actually be implemented on the OS
itself.

Squeak is the modern implementation.

Virtual Image was very powerful, but not without costs: it made
it nearly impossible to deliver client applications.

Updating a client involved sending them code for them to compile
to update the application code, which was mixed in with
the data in the Virtual Image. Problem. Multiple vendors couldn’t
really practically share a VI, since they could easily clobber each
other’s stuff.

Was a regular at OOPSLA for years; it was all SmallTalk for the longest time. Then
C++ came along, and OOPSLA was all C++. And it wasn’t that C++ was so much
better than SmallTalk, it was that it was so much better than C.

Argues Ruby is prodeominant because of Rails, and Rails predominates because of
web apps and XP. Extreme Programming is highly adopted in the Rails community,
and TDD is very easy to accomplish. “It’s almost easier to test than not.”

Many current issues will be solved with MagLev or Rubinius or Marv.

Problem with the flexibility of Ruby/Rails is the strength and weakness: meta-programming and on-the-fly in-code creation of classes and method means that code is executed that doesn’t exist anywhere on disk. How can you find and modify and refactor code that’s not there? Answer: tough. But we have testing that should describe all the behaviors or our application, even the just-in-time code. Modifications to base classes such as Active Record to hook in and capture the creation of classes and methods. Clever!

RESTful possibilities, REST in Rails and Beyond
James Golick
Survey: who codes REST? half the hands
Example: you host a web site, want to map some data. Don’t have the geocodes, want to oursource that
Solution: remote procedure calls, SOAP or CORBA. Complexities of underlying stacks is huge: 41,659 LOC for the SOAP client in Ruby. rpc = FAIL. Roy Fielding’s PhD dissertation. Describes http as Representational State Transfer (REST)
anything can be a resource http is verb (GET, PUT) and a noun (location) Argues POST http://example.com/comment/create is NOT RESTful – Don’t Verb the Noun map.resources :post – tells the Rails router to route the request not only on the noun, but also on the verb

standardization is good.

Assumes that most “professional” ruby developers have worked with these conventions, and therefore will be productive much faster. RESTful api with YAML, JSON or XML exposed. powerful tooling. Example: James had an idea, Tweet:”walking my dogs thought I’d bore you with details of my life, blahblahblah” right from the command line. 35 minutes from concept to shipping

Things not to do in Boston while you’re drunk: Bukowski Tavern FAIL

Using Berkeley DB and Ruby for large data sets Matt Bauer
Tweets: Still at the Boston police station. #prorubyconf08 Bailsman is on the way. Still not processed completely yet. Long nite
Data collection of bike racing, 28 data points captured every 5 seconds, 1.7 TERAbytes of data annually .
Wrote a custom lighttpd plugin, SleepyCat (BerkeleyDB) and merb for data collection.
Bullet points: Open Source, highly concurrent (thousands of threads), scales to 256 TB, keys/data to 4 Gb, Supports ACID transactoion
embedded/ runs in same address space, written in C with many bindings, very small: 399 kb of text space, no SQL or Schema
Doesn’t operate on Keys or Data
Two data stores: concurrent: no recoverability; transactional: Fully recoverable, ACID
BerekeleyDB is like an Indy Car: wicked fast, but you will hit the wall. Advice: read the manuals! Plan for recovery.
Specs on performance he’s measured: Concurrent, nearly 1M records posted per second, Transactional, 128K/s

Ruby & Dbd bindings, two versions: Guy Decoux 2002-2008, passed away! Dan Janowski (2006-2007) exact
implementation of C API, Oracle API, Quite Stable, Only Three Test Cases.

Very frank about “hating” SQL – like swim floaties, we can do better. I’m not sure he understands the problem space
that SQL solves.

Code example, very C-like
Four data storage patterns: BTree (sorted balanced trees, can set fill factor high on ordered insertion),
Hash (extended linear hashing), Queue (fixed length records, head/tail push/pop), Recno (stable record number).
Simple tuple can be 8 Gb in size, one key (4 Gb), one value (4 Gb)
Flags are all-important to interface, each method call has parameters to be tunable.
Cursor support, open, first, next, last, close. create, save.

Voices That Matter, Professional Ruby Conf ’08 Boston, Day Two

Matt Knox did a stand-up presentation for the second day keynote, as Giles Bowkett was not able to make it to the conference. Matt was telling us about the great stuff he’s learned at conferences. Smalltalk is the coolest language ever. Unit Testing is not the greatest thing ever. Damien Katz’ great story of success. DHH wrote some framework, we’re not the fringe any more. The Great Surplus (I believe this talk is available on IT Conversations, search for RailsConf). Giles, in a picture, bowling and archery at the same time. Giles (in words): an epic tale of adventure, fail, music, rebar, LSD, VC, parking-ticket evasion, and pet monkeys (that’s be us).

Followed an informal Smack-Down session: one yellow sheet, one blue sheet, Obie Fernandez pops up slides and we get to vote, vim vs. emacs, Agile Dev w/ Rails vs. The Ruby Way. svn vs. git broke out into a debate, Brian argued that svn is for maintaining versions of files, not for collaboration, and is fundamentally broken and people need to get over it. jQuery vs. Prototype? Chad from Thoughtbot uses Prototype, and says currently the pain of switching outweighs the pain of sticking with Prototype. grid960 (http://960.gs/) versus… I missed it, Sinatra v. Camping? Few if any cards, all for Sinatra. Blueprint v. YUI, empty? v. blank?, system gems v, frozen gems, Vlad v. Capistraro, Mocha v. Flexmock, FactoryGirl v. ObjectDaddy, resource_controller v. make_resourceful, HAML v. ERB: interesting debate: HAML “Beautiful but astere”, ERB parses like HTML. HAML less typing & faster, ERB has too many close-tags, Obie argues that HAML maps well to CSS – I need to check this out!, Redcloth v. Bluecloth (no one), RMagick v. ImageScience (nobody’s sure) , Tiny MCE v. FCKEditor, restful_authentication v. clearance, Test::Unit v. RSpec (RSpec 3:1). Very informative!

Payment Processing with Active Merchant, Cody Fauser, Shopify
Why? Get money from your customers. Originally http://www.snowdevil.ca/ integrated with Moneris, a single payment processor. Expanding to support multiple processing options, everyone has their unique API, glossaries, , “unique snowflakes,” etc. Simple Uniform API to dozens and dozens of payment processor back ends in over a dozen countries. Components follow the normal flow of Customer data entry, Authorization, Payment and Settlement. Includes extensions for the Address Verification System and Card Security Code (CID, CVC or CW2). Cody jumps into the code. It’s simple. And it’s the same for three processors he shows — that’s the point, after all. The code for settlement is drop-dead simple as well, and for collecting the results.

Rock Solid Ruby Deployments, Philippe Hanrigou
Addison Wesley Shortcuts, Troubleshooting Ruby Processes, free chapter available on line at InformIT. How to troubleshoot problems with with threads. An http request gets the attention of the Rails handler, which gets the lock, goes to the dispatch, which might go to the database. While waiting on the I/O, a new request gets a new handler spawned which… goes to get the lock, which is busy, and… goes to sleep waiting. Ouch! This drove the need for caller_for_all_threads, which can be used to dump the state of all threads. This is a patch, not a gem, but will be included in next version of Ruby Enterprise Edition and Passenger. Another good tool for troubleshooting is DTrace “a comprehensive, dynamic troubleshooting tool” or in Brian-talk “a freaking awesome tool for debugging all the fracking stack.” DTrace runs within the kernel and so it can see all the hangups from the Ruby interpreter to the networking calls to the database processes to the raw I/O. However, DTrace is not running on Linux. “How many of you deploy on Solaris? Open Solaris OS X Server?” Not a single hand. “We all deploy in Linux.” A DTrace is not Linux-friendly. And SystemTap, while venerable is not DTrace. Paul Fox, www.crisp.demon.co.uk, is trying to port. Had a demo of DTrace running on Ubuntu in a VM. PID Provider is a wrapper that can intercept calls from an application that’s not instrumented for DTrace. Until then, we talk about what we can troubleshoot now. Ruby Probes, Joyent, good wy to get started. Ben Rockwood has a good presentation on MySQL and DTrace from the MySQL Conference 2008, find on the web. There’s also a ruby plug-in for DTrace: gem ruby-dtrace ‘Tracer”
http://github.com/ph7/xray/tree/master

Blaine Cook, formerly of Twitter
A short story about messages… things we do every day: postal mail, telephones, etc. Synchronous v. asychronous. Clustering, hadoop documentation, Google MapReduce. Reduce latency. Messaging: has a sender and a recipient. Synchronous: bad. Options: RabbitMQ, ActiveMQ, Spread, beanstalkd, Starling (Blaine wrote for Twitter), Gearman/TheSchwartz, Delayed::Job, cron. Each has their own protocols, some share a few like AMQP. Does queue need durability? What kind of guarantee can you get on delivery? Beanstalk doesn’t have a durability guaranty, and Spread only under certain configurations. Reliability? Atomicity? If a job is sent off into a queue and no success or failure message is received, how should the messaging system behave? Restart the job? What if the job has a cost (example: sending SMS) whose cost is incurred, but completion fails later? Recently released ActiveQueue, some similarities to Nanite. Others: Workling talks to Sterling, Rabbit, ActiveMQ, etc. Paraphrasing, if email worked the way the internet works now, you’d have to check individually to see if each of your friends had sent you email.

Matt Pelletier (CTO, Eastmedia) was to talk “Rails Scales” but instead talk about “Mobile Developments” taken a great interest in the mobile sphere, business has grown out of web-only focus. Global PC stats: 280 million PC sales/year. Phones sold: 1.3 BILLION, more in a single quarter than all computer sales. “Smart” phones have small share of that market, admittedly, but growing. Technologies: Voice, SMS, MMS, Mobile Data Services. Voice: regular calls, robo calls, automated voice services (airlines), VOIP, Voice XML, Asterisk/Adhearsion. SMS, finally exceeding voice in US, has been the situtation in Far East for a while: Mobile Terminated (MT), Mobile Originated (MO), Shortcode vs. Phone number, No friggin’ metadata, Project: Mobile Commons (launched 2006, worked with civic organizations). MMS: “Total Shit Show,” Carrier Specific, Event Apple said screw it, use email instead. What’s up with viewmymessages.com???? Mobile Data Services: WAP, the “Real” internet, Apps. WAP 1.0 complete disaster, WAP 2.0 is basically trimmed down Web. Project: New York Jets Mobile. Page caching rocks. Brett Farve signed, 4 million page views in a couple of hours, cached through Akamai. The “Real” Internet: as long as you exclude Flash, Real browsers with Js/AJAX support, marketing heating up, MobileSafari, Android Browser (WebKit based), Fennec (FireFox), Opera, Skyfire. Apps: used to be controlled by the carriers in the US, Qualcom’s BREW, Apple iPhone via App Store, Google Android offers Marketplace. App Technology: (most of these folks are too young to remember OS/2 v. Windows) too many OSes, entrenched. Interesting stats on numbers of smart phones sold (Apple #2 to Nokia), as of Q4 more messages that voice calls in US. What are people doing on their phones? Watching videos, accessing social sites, Matt said “boring but played out” but I’m not sure of the context. Up and coming: Geo-related apps: directions, find a restaurant. GPS is still really slow, AGPS (tower triangulation) much faster, less accurate, Skyhook Wireless FTW, “I want to know exacly where I am, in motion” – makes trouble playing games that are exacly location-dependent. New product, RSN, http://spot.io – “tell us what you saw and where you saw it.” iPhone development… feels like the Rails community, sort of: searching sparse domain knowledge; Objective-C ain’t Ruby; iPhone SDK ain’t Rails. “But STFU, it’s pretty badass for 6 months in.” A decent coder can get going… it’s fun and excitig. For Spot.io we wanted the photos off the camers and quick entry.

Jon “Lark” Larkowski, HashRocket, Communications to support Client Development
Pivotal Tracker: we don’t write a line of code that doesn’t support a user story. Current iteration gets its own page listing ongoing stories, amount of effort. Let’s clients view velocity and acceleration, where stories are in the process, etc. Stories need to be full (BAD: “admin interface”) so any dev can sit down and start coding. Direct capture to Tracker, slowly train customers to write their own. Moving toward standard forms, ideally, Cucumber forms As a l Pair Programming (ATFT). d2d: keep focused, honest, high quality. two wheels on the axle. Company-wide standup each morning: what did you do, what goes next what. Communication aspects: c2w express stores as test, d2c RSpec specdoc format, cucumberl d2d: durable system specification. Techniques used every day at HashRocket: RSpec, MVC test, Factory Girl Object Daddy, Cucumber. Selenium, RSpactor, Continuous Integration, Clicking on Stuff. Delivery: all the f’ing time (Sorry, Brian). Deliver finished stories multiple times a day, c2d very tight feedback look with client, then d2d back together (2 pairs programming separately meets to exchange what’s new). Engine Yard staging slice (highly recommended) or EC2 with Passenger. Funny diagram of “Impedance Mismatch” with client communication, dev communication,

David Berube, Surviving as a Windows-based Ruby developer
Windows is a difficult platform to develop Ruby on, since it lacks many of the POSIX tools (natively, there are add-ons) and running Apache is less well-known. David’s pretty frank: he recommended a Windows dev look seriously at Ubuntu (Disclaimer David was my predecessor as “Fearless Leader” of the Greater New Hampshire Linux User Group, and I think we’re both equally, correctly prejudiced). Intrinsic pitfalls: automatic binary conversions (LF->CRLF) can corrupt binaries. No Kernel#fork; this won’t work. No GNU out of the box. No compiler out of the box. There are some good options: Editor: Visual Studio: Ruby in Steel, Net Beans, gvim (recommended) cream, Emacs, “E Text Editor” – Textmate clone (bundles can be work, slashes are the wrong way, someone has a patch bundle for those, too) Cygwin, UNXtils (preferred). Misc tools: Safari for Windows, FireFox, Tortoise for SNC, LDE(x) windows desktop replacement, PuTTY, FileZilla, SmartFTP

Rails AntiPatterns, Chad Pytel and Tammer Saleh, Thoughtbot
Moving code from controllers to the models: ‘create’ method, 14 lines is too long. Smells funny: there’s a transaction that wraps a single call create_version!() Eliminate DRY code in create new version and create first version, use defaults to set default/initial values of version, use created_at and id functionality built into ActiveRecord design. Slide entitled “Minor Law of Demeter Violation” where they short-circuit the redundant code that references an object and drills into its properties.; better to expose that property/attribute/structure as an explicit method in one place and use the new method to free multiple dependencies on an internal structure. Simplified the create version method to half-dozen lines, removed a related trigger as a callback rather than explicit code. Lessons learned: even a 15 line controller action is too long. Exceptions should be exceptional, Your models should use callbacks to add complex behavior. 2nd example: way too much code in update. Solution: use a constant with a hash to create a set of methods. Lessions: tackle large refactors iteratively. push as much business logic into the model as possible. In lots of code, dimple DRY principles will lead to a lot of refactorings. Common problem domain: user and roles. “Thoughtless Code” Methods like Role, Roles, CanEdit, CanPublish, CanDoSomethingElse…. Solution: Remove the whole shebang, add boolean columns to User: Admin, Edit, Publish, and Active Record automatically gives you the elegant User.Edit?, User.Publish? User.Admin? Lessons: Refactoring! Bug Fixing, Always Be Refactoring, didn’t cover testing; there was a test suite, so regressions were avoided.

Battle Royale, Foy Savas, author “The Merb Way”
Merb’s Role in the MVC Holy Wars
Merb is Rails rewritten with Django and Pylons influences. Created by Ezra in 120 LOC Mongrel _ ERB. Now: high performance, quick to deploy, easy to scale. Sounds like Rails. It isl Awesome. Rails vs. Merb in a fight cage? Point by point comparison. “No code is faster than no code.” “A micro-second saved is a micro-second earned” Background processes, run_later block. Built on Rack Rack allows ou to string together apps using Rack::Cascade. Example, just serving RSS feeds don’t have to invoke entire Merb framework. ActiveSupport is a kitchen sink, ExLib isn’t. DataMapper destroys ActiveRecord. Authomigrations are what your developers always needed. Lazy Loading DataSets. Strategic Eager Loading. Plugins are Gems. Merb Parts. Arguably one of the slickest presentations at the conference, Foy’s rendering of the Dao De Jing, which he read in what I presume is the original dialect, “A way that can be taken rarely stays the way. A name that can be named rarely stays the name.” Not just dramatic, but the theme of his presentation. Perhaps Merb will be the next way.

Notes from CentraLUG, 6-October-2008

Eight people attended our October meeting of the Central New Hampshire Linux User Group, held as usual on the first Monday of the month, at the New Hampshire Technical Institute‘s Library, Room 146, at 7 PM.

We had the usual round of announcements. I had a ‘hot off the presses’ set of Apress Fall/Winter 2008 catalogs to pass around, including the half-page feature of the GNHLUG group as the highlighted user group. I mentioned the many discounts UG members can get through the various publishers, especially Apress, O’Reilly and Pearson. As usual, I plugged the gnhlug.org web site as the place to get the event calendar, and we reviewed some of the upcoming events, like the SwaNH infoeXchange and MonadLUG’s MySQL meeting tomorrow, the NEAR-Fest the following two days, and some of the interesting upcoming meetings. Keep an eye on the calendar and subscribe to the announcement list for future meetings.

Arc Riley was the main presenter. A newcomer to New Hampshire, Arc was previously active in a FOSS group in Ithaca, NY, and is an active contributor to several Open Source projects, including PySoy (which he demoed a few months ago at PySIG). He’s also an active member of the New Hampshire Ubuntu Local Community organization (“Loco”), which is working its way to formal approval as a Loco with the Ubuntu organization. Activities such as the Software Freedom Day activism last month and presentations at the LUG count towards this recognition.

Arc had a presentation on the upcoming version of Ubuntu, 8.10 (Year.Month) due out at the end of the month, code-named Intrepid Ibex. A list of new features can be seen on the web site and Arc reviewed them briefly (slides) and then demonstrated several of them, including: Gnome 2.2.4., X.org 7.4, Guest session, Network Manager 0.7, and more.

We also got to break it a bit, perhaps, by testing to see if a USB device plugged in when the Guest user was active would be readable, and whether there would be any security implications to that. The USB subsystem seemed a bit unresponsive, and poking in the logs revealed that some of the other devices on the bus, like the webcam, weren’t natively recognized (Arc hadn’t added drivers yet) so it was possible the subsystem was unavailable. Did we mention it was a beta? Beta test reports are welcomed by the Ubuntu team, as they hope to release a final product at the end of the month.

We got to talk a bit about Ubuntu and the community behind it, the philosophy surround the distribution, and the activities of the Loco, including pictures from SFD 2008, which included a Wookie, balloons, a penguin, Ben Scott and lots of geeks promoting Linux. Ben was heckled in absentia at the CentraLUG meeting. The next meeting of CentraLUG will be on Monday, November 3rd, the day before what may be the most important election of our time (vote early, vote often!) with a topic TBD, but at the same place and time. Stay tuned for announcements and updates! Thanks to Arc for presenting, to Bill for the projector, to Nikki for the transportation, to the New Hampshire Technical Institute Library for the facilities and to all for attending and participating!

Notes from PySIG, 25-Sept-2008: What’s New in Python 2.6

Fourteen people attended the September meeting of the Python Special Interest Group of the Greater New Hampshire Linux User Group, held as usual on the fourth Thursday of the month at the Amoskeag Business Incubator in Manchester, NH, 7 PM – 9 PM.

Our presenter of the evening had to postpone, due to family obligations, so we had a general night of discussion. It was vigorous and interesting. I was a tad late to the meeting, so I missed Ray Côté’s description of a gotcha using Python. It pays to show up early to the meetings! Bill Sconce brought along a two page agenda and list of topics, focused on new features in Python 2.6. This lead to a lot of discussions, clarifying what can be done in earlier Python versions and how the new version works, including many times when we dropped to the shell and started python to test out our assumptions.

Janet provided yummy cookies, as always — thanks, Janet! And Ben was harassed in absentia. Thanks to Bill for arranging, announcing and herding cats to run the meeting, the Amoskeag Business Incubator for their great facilities, Janet for the cookies, and all for attending and participating.

Powered by WordPress. Designed by Woo Themes

This work by Ted Roche is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 United States.