Archive | Apple Macintosh OS X

Panther, Tiger Leopard: Apple’s OS X on iMac, PowerBook, iBook, MacBook, PowerMac and more.

Notes from ManchLUG’s Launch Meeting

Twenty-seven people attended the first meeting of the Manchester Linux User Group, held on August 24, 2010 at Wings Your Way, Elm Street, in Manchester, NH. Congrats to organizers Kenta Koga and Chip Marshall for taking the initiative to start a group, finding a location and publicizing the meeting!

The meeting was primarily a meet-up, more focused on finding out if people would come out than running a training session. Kenta and Chip made a few announcements at the beginning of the meeting, including mentioning the GNHLUG calendar at http://gnhlug.org (on a Mac!), Leslie Poston’s efforts to bring together a lot of local tech and social media calendars on Google, activities happening at Float Left Labs and their Archimedes Space in Manchester, Jellies at Studio99 in Nashua.

Conversations were pretty local at that point, with a lot of people in a small space with good food and beers and apparently lots to say. What a joyous noise!

Thanks to Kenta and Chip for organizing the event, to Wings Your Way in Manchester for providing the space and to all who attended!

Notes from Ruby SIG, 16-Aug-2010

The New Hampshire Ruby/Rails group met as usual on the 3rd Monday of the month. We met at the New Hampshire Innovation Commercialization Center, a new space near the Pease airfield. Mark Galvin, NHICC’s Managing Director, was kind enough to offer the space for our meeting and tell us about the ICC. Eleven members attended the meeting.

As we often do, we started with a round of introductions. It’s always interesting to find out who’s there and what they’re up to. I mentioned the GNHLUG calendar and Nick plugged the upcoming Ruby Rampage. Near the end of the meeting, we plugged the NorthEast RailsCamp, coming up on it’s third meeting, this one in Stowe, VT. 5 alums from previous camps were there, and all loved it. There may still be a ticket or two left, even though the site says zero – you’d better hurry!

We were lucky enough to have two presentations tonight.

Brian Turnbull presented “Interfacing Ruby with C.” He explained he needed to do some automation with a “black box” his company was using, and their documentation consisted of a C API and a DLL. Rather than developing an entire application in C, he used Ruby to interface to the C API and then could develop an easy-to-modify Ruby app. That turned out to be a good idea, as the final product he delivered turned out to be very different from the initial request, and having the ability to rapidly re-develop in Ruby was a success. To show us how to use C to access Ruby and vice-versa, Brian used a simple example of a “leaky bucket stack,” a fixed-length stack that would lose the oldest item as the stack was pushed. It was a great example in that it had enough complex behavior to be useful, while simple enough to explain and translate into C without too much effort. First, we reviewed the pure Ruby implementation. Brian proceeded to build up the equivalent code in C, calling Ruby array functionality and data types where appropriate. He then showed how to configure the C extension from from Ruby, build, compile, debug and run from the ruby command line.

See the example code and slides (I’ll update the URL when available). Also http://github.com/bturnbull/padpaws for his more advanced C example.

Brian Cardarella, @bcardarella, http://bcardarella.com, presented his gem, client-side validation, which he developed while working on the “Raise Your Vote” site for the Democratic National Committee. The Raise Your Vote site is intended to assist in voter registration by collecting data online and generating matching PDFs of the voter application. Naturally, 50 states have fifty different forms, with different requirements. He wanted to avoid duplicating the server-side validations with hand-maintained client side code, as the regular changing of requirements and the difficulty of keeping business rules in synch across the two languages would doom the project. He wrote client-cisde_validations to use the declarative validations within the entity models to generate the equivalent Javascript code. Client-side_validations has remarkable depth and breadth, handling nearly all of the common and exceptional types of valiation (Brian notes the few difficult cases in his slides). You can find the code on GitHub (gem code, examples) and the slides here: client_side_validations.pdf

Thanks to Brian Cardarella for travelling all the way to Portsmouth and thanks to both Brians for their fine presentations. Thanks to Nick Plante and Brian Turnbull for organizing and promoting the meeting and the group. And thanks to Mark Galvin and the New Hampshire Innovation Commercialization Center for providing the fine facilities!

Notes from NH Ruby/Rails group, 15-Feb-2010, Brian Turnbull and Object Oriented Programming

Despite being President’s Day, February 15th’s meeting of the NH Ruby group got 14 attendees. Held as usual at RMC Research in Portsmouth and hosted by Tim, a good time was had by all.

There was a round of introductions so everyone got to know each other. Announcements including Leslie Poston’s NHTweetup calendar, and the Rails Camp NE. Rails Camp is only a month away and down to a few last seats – don’t miss it!

Brian presented “Object Oriented Programming” — you can find the slides here. The presentation was a good high-level overview of OOP, as seen from the Ruby perspective. Brian noted ways in which Ruby differed from C++ and Java. There was some very good discussion and some teasers of future presentations: Mixins were thought too complex to try to squeeze into this presentation, and Brian is developing another talk, “The Complete Class,” which will include a discussion of all of the methods, properties and attributes a class should have to encapsulate best practices. I’m looking forward to both of those discussions.

Brian finished with two puzzles. Having covered the principles of OOP, Brian handed us an interesting problem to code: a 3×3 sliding tile puzzle. It’s great to see actual code being developed at the meetings, and it was a good challenge in that we all understood the problem domain. We broke into small groups and started modeling the problem. At the end of the evening Brian presented his model and code.

The bonus  challenge involved taking Brian’s model and solving a particular puzzle in the fewest steps possible. I worked with a team that took this one on, repeating the classic steps of invoking recursion, discovering the limits of Ruby on the Mac for stack overflows 😉 and failing to properly store and retrieve states and scopes diving in and out of the recursion. While we didn’t finish the solution, we had some great discussions on the various ways to solve the problem and all learned more about working with Ruby, which after all is the point. Brian also posted his solution to finding the shortest steps to solving this problem.

Thanks to Tim and RMC Research for hosting us in their fine facilities, to Brian for organizing, pizza and the presentation, and to all for attending and participating!

Notes from Python Special Interest Group, 20-Nov-2009

Eight people attended the Python Special Interest Group, held a week early to avoid the Thanksgiving holiday. Anticipate a reschedule December meeting as well.

Last night’s meeting was a vigorous and far-reaching discussion of MySQL, Oracle, the future of MySQL, Maria DB, OpenOffice.org automation using Python, OpenOffice.org automation using Visual FoxPro, Twisted, IE6, Zope, Plone, Django, MS SQL Server, pyodbc, SQLAlchemy, Cascading Style Sheets, IE6, FireFox and FireBug, User Agents, IE6, how not to insulate a bungalow roof, the (Python!) cssparse module (http://cthedot.de/cssutils/), Fortune’s selection of Steve Jobs as “CEO  of the Decade”, Lenovo netbooks and Ubuntu, the Millennium, why calendar years are one-based and not zero-based, distributed version control systems, master-slave and master-master replication using MySQL and Postgres, svn and git, and more! Whew! You should have been there!

Thanks to Bill for organizing the meeting, to all for attending and participating, and to the Amoskeag Business Incubator for providing the great facilities!

Stay tuned for an announcement of the December meeting, and hope everyone has a good Thanksgiving!

Notes from NH Ruby group, 20-Aug-2009, “Where’d you learn that?”

Eight folks enjoyed an excellent dinner at The Rosa Restaurant. We had a private room upstairs where we could woot and yell over each other and tell geek jokes without inhibitions, not that that has ever stopped us before.

Nick Plante mentioned Rails Rumble coming up this weekend. Watch for some incredible apps coming from the Rumble. Can’t wait to see the winners.

Adam Bair brought along two books, Kent Beck’s “Smalltalk Best Practice Patterns” (ISBN 978-0134769042) and Martin Fowler’s “Refactoring” (978-0201485677). Adam credit both books as being very helpful for his practice in the past several years where he has had to refactor a lot of code in rescuing lower-quality Rails projects.

Adam also mentioned an inspirational presentation by Marcel Molina, Jr. at Ruby Hoedown 2007 called “Beautiful Code” (http://rubyhoedown2007.confreaks.com/session09.html) – Adam recommends the higher quality videos as they include video/slides side by side – and also browsing much of the confreaks.com site for some great videos.

Russ talked about Peepcode videos (http://peepcode.com), which he really appreciates. In particular, he mentioned the most recent, Advanced Command Line, helped him debug an unusual problem he was having with one remote client whose shell behaved incorrectly. He’s used inspiration from that video to reconfigure the way he uses his shell. Russ also mentioned Ryan Bates “RailsCasts” (http://railscasts.com/) as very useful, and in particular, thought that the three part series on forms (link updated; thanks, Russ!) changed the way he developed Ruby apps.

I talked a little bit about “The Well Grounded Rubyist” (ISBN 979-1933988658) by David Black, which has helped me fill in some of the background of how and why Ruby behaves the way it does. I also passed around Jason Clinton’s “Ruby Phrasebook” which is a handy book of recipes on how an experienced Rubyist is likely to solve common problems like parsing config files or processing XML.

Nick mentioned that he’s using the unix screen command to do screen-sharing for remote pair-programming and you could see the lightbulbs go off over people’s heads (“That’s my payoff for tonight!” one attendee exclaimed.) He’s also working with EC2 instances and is fired up over how simple and powerful they are. Nick promised a followup, perhaps a demo at a future NHRuby meeting, and Casey mentioned that there’s someone local who’s been doing demos on the Amazon Web Services offerings – we hope to come up with some contact info and see if we can schedule a presentation.

The group also talked about how, as a group, we might contribute to one particular open source project. A couple of ideas were batted around. I look forward to hearing more about this idea.

The night’s theme was “How do you know that?” and I asked about how people are keeping up on all the news about what’s happening. We didn’t really come up with a list of links or blogs or news sites, so if you think of any now (or have your bookmarks handy for sharing), I’d appreciate you passing them on and I’ll include them in the meeting notes.

Thanks all, for a fun dinner amongst friends and some inspiring ideas!

Notes from PySIG, 28-May-2009

It was a dark and stormy night. Nonetheless, six members made it to the May meeting of the Python Special Interest Group, held as usual on the fourth Thursday of the month at the Amoskeag Business Incubator in Manchester.

We had an Open Mike Night format, a round-table discussion where everyone shared what they were working on.

I plugged upcoming meetings, available as always at http://gnhlug.org — MonadLUG in particular, is to be praised for posting 4 months worth of meetings in advance.

Mark has a client who’s weaning off a proprietary OS and looking for a replacement document management system / word processing system, and is considering LyX, which is a  front end to LaTeX and has numerous utility scripts written in Python. Mark asked for suggestions for additional resources and the two Bills were able to come up with some ideas.

Arc talked about some wireless technologies he’s researching (neat stuff!). Arc also reported the Gaming SIG is coming along nicely: 5 people at the first meeting, 10 at the second. Details at gnhlug.org . Hoping to schedule a FPS (First Person Shooter) night soon. Coming up next Friday June 5th, the SIG will take a look at the awesome audio utility, Audacity, as it relates to gaming, and then engage in the Battle for Wesnoth.  Gaming SIG meets at the Brady Sullivan building in the DynInc offices on the fifth floor – see http://wiki.gnhlug.org/twiki2/bin/view/Www/GamingSIG.

Shawn O’Shea completed a course in Network Design and Planning at UMass Lowell (and got an ‘A’, congrats!) and showed us his lab work, written in Python! He very bravely showed us his code and we talked about some of his algorithms and looked at a couple of the modules he used, including optparse, netaddr and cmd.

Bill Freeman reported he’d been working in Plone and Python 2.4 and missed some of the features available in later versions. He created some code to address the worst of the deficiencies, and hopes to be able to release it freely soon. Stay tuned.

Thanks to Bill for organizing the meeting, to the Amoskeag Business Incubator for the fine facilities, to Arc for bailing us out with an extension cord, to Janet for the awesome (!) cookies, and to 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 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!

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 PySIG, 24-July-2008: Improv Intro

Seven attendees made it to the July 2008 meeting of the Python Special Interest Group of the Greater New Hampshire Linux Group, despite the heavy rains. Due to some last-minute conflicts, our planned speaker, Ray Côté, had to take a rain check for a future meeting, but cookies were made and we resolutely carried on.

There were two first-time attendees, one with a novice level of knowledge of Python and the second very little. Lead by the PySIG leader, Bill Sconce, we launched into an improvised session introducing Python and talking about its power, range and flexibility, comparing it with other languages, heckling Ben Scott, demonstrating several IDEs, talking about procedural scripting and object-oriented programming, showing off some working code, migrating database applications from proprietary platforms, and much, much more. A good time was had by all.

Prominently mentioned were the great tutorials available directly off the Python web site and the Tutor mailing list.

Great thanks to Janet for a delightful variety of cookies, to Bill for not only running the meeting and providing the projector but also bringing the milk, to all for participating, and to the Amoskeag Business Incubator for providing the fine facilities.

(Note: despite the organizational support of the GNHLUG, members running all sorts of OSes are welcome. A typical meeting has people running Python on OS X, Linux and Windows. All should expect equal-opportunity heckling.)

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.