A Great Adventure

Metadiscourse, Web Design — Tags: , , , — Ardekantur @ 11:29 am

To my faithful readers (all seven of you), I’m sure you’ll be delighted to know that I am finally going to do what I’ve been trying to accomplish for quite some time: open myself up to freelance development.

If you or anyone you know is looking for a web-designer with three years of experience and who is 4/5ths of the way through his computer science major, with emphasis on intermediate ASP.NET and experimental but consistent Ruby on Rails work, drop me a line at sales@iociem.com. My focus is on clean, functional, modern web design, and cutting-edge development practices and ideas. Any interested parties can also request a full resume from the address above.

Thoughts about Rails and the Enterprise

Observations, Ruby, Ruby on Rails — Tags: , , — Ardekantur @ 1:09 pm

I know, I know. I said the E word. But bear with me. I’m working with some code right now that, while well-written for the most part, still is written in ASP.NET, and makes me wonder if its levels of intricacies can be managed in Rails. Some of the particular obstacles that would require tackling are:

  • A modular architecture. We provide our product in separate pieces, but they all use the same basic data model on the backend. Having a nice, clean way to install new modules for a client on a dime, and have it integrate with the rest of the web application, would be wonderful. Logins would have to across modules. All workable, but difficult. Is a plugin the best way to modularize part of a Rails application? Is a gem?

  • Batch data insertion. Our clients receive products in bulk, and a form that allows them to insert multiple rows at once, on one web form, while still being RESTFUL, sounds complicated. I’m sure it’s possible, but I’d have to think through it to make sure.

  • Integration with the desktop. Some of our web application’s functionality is relegated to the desktop, where GUI applications keep track of things for us. This is looking more and more possible with Ruby and QT bindings.

So those are my thoughts.

EDIT: And some more thoughts.

  • Auditing. Being able to see every single change that anybody made to an some database objects is an absolute must. Full and complete accounting practices should be available without any extra work on the programmer’s part.

  • Reports. Right now I think we have about 84 separate Crystal Reports files. I’ve been looking at Ruport but it’s hard to tell whether or not it would fit all of our needs.

Feedsweep

Interesting Links — Tags: , — Ardekantur @ 7:37 am

Why Rails is total overkill and why I love Rack:

That’s why Rails is overkill: You can easily build web applications without the “magic”, and without the interdependencies and all the rest that comes with it.

This may be the case, but if it weren’t for Rails providing the exact methodology for programmers to use and making site development rapid and effective, chances are there wouldn’t be any other Ruby web frameworks (or antiframeworks).

39 Clippings, Part 1

Interesting Links — Tags: , , , , , — Ardekantur @ 11:23 pm

For a decently long time I’ve been keeping track of newsfeed articles that catch me attention in the ‘Clippings’ folder of NetNewsWire. Since I’ve just finished with school and have a lot of free time, I’m going to go back and see why I saved those clippings originally, and write a little something about each one, in order to get my creative juices flowing and try and rock out a bit more with my writing. The things I mention about each article might be related to the content, or the website design of the article’s page, or it might not be relevant at all. Think of it as a free association.

I call this movement: 39 Clippings.

Clipping I: 50 Ways to Become a Better Designer

I’m sure I saved this because I was interested in becoming a better web designer. Makes sense, right? :-) In general I really like the site style and how even separate headings in a blog entry receive a full graphic treatment. This is a devotion I don’t have currently, but I’m sure those little things are definite touches to consider when spiffying up a blog. I almost think the article is too long. If it were broken up into five separate articles of ten items each, it would feel a lot more accessible.

While there are a few worthwhile gems in the article, a lot of the advice seems overtly cliché. I think a lot of the technical advice is definitely important: Save often! Use as many layers as you can in Photoshop! Keep all of your digital and vector assets! Back things up! If I had a dollar for every time I wished I had followed this advice, I wouldn’t have to worry about becoming a better designer.

In any event, I think this has been sitting in my clippings folder long enough.

Clipping II: Immutability in C# Part One: Different Kinds of Immutability

I saved this because I only had a vague idea of what immutability was in terms of C# programming, and being a novice C# programmer, wanted to learn more about the nuances of the language. This is the first article in a series of eleven (!) articles about immutability in C#, and going through all of them to understand this one concept might take more time than I actually have this break! If I manage to make it through all of these articles, I’ll write about it.

This clipping is being bookmarked toread in del.icio.us, and I’ll be back for it later.

Clipping III: ActiveRecord::Base.with_scope { :only => ‘in your model’ } - Rails 2.0 a feature a day #4

The title of this clipping annoys me. Bloggers need to stop using Ruby code in their post titles.

The with_scope method in Ruby allows certain constraints on ActiveRecord operations to apply to all actions taken with a particular model. This cleans up a lot of duplicate code, but in certain situations Rails developers might find it necessary to place a with_scope block in their controllers, which is bad design. The article I clipped announced that in Rails 2.0, with_scope was now protected in the ActiveRecord class, preventing this awkward usage completely.

The article was written in what I call Linux Documentation Form, meaning it assumed the readers were familiar with the topic material before breaking new ground. It did this by providing a link to another blog post on with_scope, which explained its use and bad design decisions made with it. I support this form of blogging wholeheartedly because it means less work all around — except for the readers :-)

Now that I understand this awesome construct, I can remove this clipping and bookmark it in case I need a refresher.

Clipping IV: Porticus GUI for MacPorts

Porticus! A GUI for MacPorts! The title of the post says it all. Awesome. I never got a chance to check this out, but apparently at one point I wanted to. I’ll give it a go and see if it does anything particularly awesome (what more do you need from MacPorts other than sudo port install?), and write about it.

It’s downloaded, so there goes the clipping.

Clipping V: Photoshop vintage effect

Photoshop tutorials seem to be divided up between the extremely good and the extremely bad. This one looked awesome on a first skim. As it stands I don’t own Photoshop, but with some disposable income coming my way this co-op, I’ll soon have a chance to try this tutorial out.

Bookmarked.

That’s all I can absorb for now. Stay tuned for part 2!

Custom Rails Validations

Error Messages, Ruby, Software Tweaking, Tutorials — Tags: , , — Ardekantur @ 5:29 pm

I’ve been having some trouble getting custom rails validations to work after reading Peter Marklund’s post on the topic. I finally have a configuration that works, and I’m posting it up here because

  1. I’ve read some random posts and threads about problems with this, and
  2. Because randomly this configuration seems to stop working for me.

So here it is. (Thanks to Peter for the actual validation technique.)

app/models/listing.rb:

def validate
 	validate_phone('phone')
end

lib/iociem/validations.rb:

require 'active_record'
 
module Iociem
 
  module Validations
 
    def validate_phone(*attributes)
      error_message = 'is an invalid phone number, must contain at least 5 digits, only the following characters are allowed: 0-9/-()+'
      attributes.each do |attribute|
        self.errors.add(attribute, error_message) unless valid_phone?(self.send(attribute))
      end
    end
 
    def valid_phone?(number)
      return true if number.nil?
      n_digits = number.scan(/[0-9]/).size
      valid_chars = (number =~ /^[+/-() 0-9]+$/)
      return n_digits > 5 && valid_chars
    end
 
  end
 
end
 
class ActiveRecord::Base
  include Iociem::Validations
end

EDIT: Yup, and it stopped working.

Undefined method validate_phone for <Listing:0xDEADBEEF>

What the hell? It’s probably about now that I should start looking into actually using the testing parts of Rails.

EDIT 2: I think this works for now. I moved this code to my environment.rb:

class ActiveRecord::Base
  include Iociem::Validations
end
This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License.
(c) 2008 Ardekantur | powered by WordPress with Barecity