Moving iPhoto Library location

So you’re a fan of iPhoto, and you’re running out of disk space! How do you fix it? Well, you could install a new hard drive in your Mac, but if you’re like me, you have disk space, just not on this machine.

Well I found the answer, and it’s really frickin simple!

You can click through, or just read on.

  1. Quit iPhoto
  2. Open Finder to the iPhoto library (probably in ~/Pictures/)
  3. Move the iPhoto Library package to the new location
  4. Start iPhoto, Choose Location… and choose the new location
  5. That’s it! There is no number 5!

Like I said, simple.

PS. I plan on blogging about my new job, and also doing more blog posts on my continuing adventures. I also might be moving the techy side of this blog to jredville.com, I just have to decide on a blogging platform.
-JD

Aside

Comments (0)

Permalink

Drag and drop to assign to spaces

So I found free ringtones maker download free cingular music ringtones free cingular wireless ringtones get ringtones sony music box ringtones gold mp3 ringtones download free ringtones to cellular phone free ctu ringtones gold mp3 ringtones complimentary right ringtones free t mobile ringtones for cell phone make mp3 ringtones download free ringtones boost mobile free real ringtones sprint free mp3 ringtones maker sprint pcs ringtones motorola ringtones composer free virgin mobile ringtones download free ringtones verizon free music ringtones a great way to set up applications in Spaces for Mac OS X Leopard. First, open up the Expose and Spaces Preference pane. Choose the applications you want…

Before

And drag them…

After

Poof. giochi casino gratis on linecasino bonus gratiscasino on line condei casino onlinecraps in lineavideo poker pccasino gioca gratisvideo poker freewarecasino pokerregole gioco rouletteroulette on line gratisdownload casinobonus enquête casino on net,enquete casino on net,casino on netvideo poker gamecasino on line con bonusgioco in lineacasino giocakeno in lineablog casino online,casino online gratis,casino onlinei casino onlinecasino on line roulettecasino sanremo onlinecasino online autorizzatistrategie roulettewww casino gratiscasino paypalcasino gamingvincere casino onlinecasino gratis senza depositoregole baccaratroulette gamesmigliore casino onlineslots onlinekeno gratiscasino online italiacasino per pcvideo poker jack or betterroulette casino,casino on line roulette,gran roulette casinogioco video poker gratisdownload giochi roulette,giochi roulette,giochi on line roulettebaccarat gratisgioco roulette gratis,roulette gratis,roulette da scaricare gratisi migliori casino onlinecasino on line italiagiochi roulette gratisonline casino gamescasino no depositcasino gratis slot machinenoleggio video pokervideo poker machine Assigned!

Aside

Comments (1)

Permalink

Cool Erlang like feature in Ruby

So, in joining the bandwagon, I’ve been reading about Erlang recently.

One of the features I really like is matchers:

    1 many(X) ->
    2   case X of
    3     [] ->
    4       none;
    5     [ _One ] ->
    6       one;
    7     [ _One, _Two ] ->
    8       two;
    9     [ _One, _Two, _Three |_Tail ] ->
   10       many
   11   end.

This code will respond none for an argument array of no elements, 1 for 1 and so on. The two parts of this I like are a) the fact that Erlang matches against the number of variables, without extra syntax, and b) the fact that the underscore variables are discarded.

I just found out that you can discard variables in a parallel assignment in Ruby too!!!

    1 name, _, ext = first.name.spec.split(.)
    2 name # => “first”
    3 ext # => “spec”
    4 

That my friends, is awesome, and could only be made better by allowing me to splat the _ (*_) to allow it to catch an arbitrary number of variables.

Enjoy!

Uncategorized

Comments (0)

Permalink

Vacation

I’ll be on vacation in Lousiana for the next week. See ya in October.

Aside

Comments (0)

Permalink

ActionPack: Filter types

Using an external class makes for more easily reused generic filters, such as output compression. External filter classes are implemented by having a static filter method on any class and then passing this class to the filter method. Example:

class OutputCompressionFilter
def self.filter(controller)
controller.response.body = compress(controller.response.body)
end
end

class NewspaperController < ActionController::Base
after_filter OutputCompressionFilter
end

The filter method is passed the controller instance and is hence granted access to all aspects of the controller and can manipulate them as it sees fit.

Aside
Ruby on Rails
coding

Comments (0)

Permalink

RSpec Presentation

This is a zip of my RSpec presentation from Desert Code Camp this past weekend.

It includes all of my slides in the PDF, plus all of the supporting code.

Enjoy!

RSpec
Ruby on Rails
Technology
coding
desertcodecamp

Comments (0)

Permalink

RSpec cheatsheet

I couldn’t remember where I got this from, so I am posting it here. If anyone can help me figure out where this comes from I would love to give proper credit.

RSpec Cheat Sheet

RSpec
Ruby on Rails
Technology
coding

Comments (0)

Permalink

Growl, Autotest and RSpec 1.0.8

So I’ve finally gotten myself a mac. Well, actually my boss got one for me, but you get the point. Anyways, my coworkers and I were having problems with Autotest, RSpec, and Growl before the recent release. However, since 1.0.8 is a new version, we decided to try again. So far it’s worked. So with a big thanks to Daniel Fischer, I’d like to write up how.

How-to

Here’s how. First, get your essentials:

  • Growl
  • growlnotify
  • Zentest
  • Rspec

Second, download the following pictures:
rspec-okay
rspec-fail
rspec-pending

Third, copy the following into your .autotest file:

module Autotest::Growl
  def self.growl title, msg, img, pri=0, stick=""
    system "growlnotify -n autotest --image #{img} -p #{pri} -m #{ msg.inspect} #{title} #{stick}"
  end

  Autotest.add_hook :ran_command do |autotest|
    output = autotest.results.grep(/\d+\s.*examples?/).last.slice(/(\d+)\s.*examples?,\s(\d+)\s.*failures?(?:,\s(\d+)\s.*pending)?/)
    if output =~ /[1-9]\sfailures?/
      growl "Test Results", "#{output}", "~/Library/autotest/rails_fail.png", 2, "-s"
    elsif output =~ /pending/
      growl "Test Results", "#{output}", "~/Library/autotest/rails_pending.png"
    else
      growl "Test Results", "#{output}", "~/Library/autotest/rails_ok.png"
    end
  end
end

If you don’t already have one. Just save it to ~/.autotest. Replace the three image locations with your downloaded ones, and you should be good to go!

RSpec
Ruby on Rails
Technology
coding
productivity

Comments (9)

Permalink

Comment Driven Development

So on a reading trip about testing, I read about how certain parts of the aerospace industry practice TDD on the order of 4-to-1. Meaning 4 tests for every part of the system.

This got me thinking. We should start using Comment Driven Development*. How many lines of comment could we get in for each line of code. Just imagine how clear our code would be.

Example

Take this example:

jonny.go_to_store

Now, sure that is clear, but it could be better. Here it is with 100% CDD Coverage:

#Send jonny to the store
jonny.go_to_store

Even better is 200% CDD Coverage:

#Send jonny to the store, three blocks north and one block tothe left.
#he should get eggs, bacon and milk while he is there.
jonny.go_to_store.

Continue Reading »

Technology
coding
humor

Comments (0)

Permalink

Radio Feedback

The Top 40 of the Music industry once fueled it’s growth by driving more album sales. Now it does the opposite. With the rise of iTunes and other single song sales vectors, the Top 40 gets pushed, while the rest of the album’s songs get neglected. Thus, the obeying public goes out and buys what they are told, however, only via iTunes. They buy it literally, and ignore the rest of the album.

This is due to both poor quality, and low marketing. There is no marketing for the rest of the album, only hope from the industry. Hope that the old model of producing cruddy songs, with a few hits, will still sell. For years they have gotten by on producing the one hit wonder CD. Now they wonder why they are failing?

The recent moves by the Copyright royalty board are only going to further things. Internet radio was the only place where there was enough time and listeners to play all of the rest of the album. I don’t know what’s going to happen, but if Congress doesn’t pass the Internet Radio Equality Act (H.R. 2060), I strongly suspect that the industry will just fail faster.

RIAA
rant

Comments (0)

Permalink

Scary

This is just wrong. I’m really glad to see the general reaction is similar to mine!

Kathy, my prayers are with you, and I hope to see you back online. However, I understand if you stop here.

JD

people
rant

Comments (0)

Permalink

Shuttle Rant

I just ran across this great quote that looks at the space shuttle from a future archaeologist’s point of view:

Taken on its own merits, the Shuttle gives the impression of a vehicle designed to be launched repeatedly to near-Earth orbit, tended by five to seven passengers with little concern for their personal safety, and requiring extravagant care and preparation before each flight, with an almost fetishistic emphasis on reuse. Clearly this primitive space plane must have been a sacred artifact, used in religious rituals to deliver sacrifice to a sky god.

Aside

Comments (0)

Permalink

Three Features

Reganwald had an interesting post about business programming the other day. In it he discussed the idea that business programming is about to become a lot more interesting. He suggests that business programming will require knowledge of the more science-y aspects of computer science, such as “recursion, operations on data structures, code generation, and other topics that are often derided as being “unnecessary” in a business programming context.” I tend to agree, and if I’m (he’s, we’re, something like that) wrong, then I’d venture to say that business is wrong, not us.

He does a better job of explaining it both in that post and in another where he implicitly comments on the state of enterprise programming, and how the “immature” Ruby programmers and their kin are making things difficult for the hypothetical Java programmer.

However, more to the point of this post, is the question at the end.

Name three features from public web ‘sites’ like Google, Amazon, and YouTube (you can pick any site or sites you like) that will make the jump to business applications in 2007.

He asks it in reference to a job opening that someone has, and readers are supposed to e-mail their answer in. I am getting ready to interview for someone else, so I decided against trying for this. However I still wanted to give my answer to the question.

  • Usability
  • User-Generated Content (UGC)
  • Tags

Usability

Users, especially web-savvy users are beginning to see the enjoyment, fun, and usefulness of sites like Gmail, Google Reader, and Flickr. I think that users will start to expect this type of interaction from all applications in their life, and be disturbed by business applications that try to play by different rules.

User-Generated Content

Companies will have to recognize the value and knowledge held by their employees (and possibly users). I imagine it will start with a single company opening up, and then it will become a landslide. Knowledge is too valuable to have it locked up in silos, especially if those silos are free to walk away.

Tags

Tags, keywords, call them what you will. The fact is: they work. Whats best about them, and what separates them from categories and keywords, is that they are defined at publishing and post-publishing. This allows tremendous adaptation that can’t be achieved with structured hierarchical categorizing. If I want to tag something, it just requires a database change, not a folder change. Yes, this is possible with keywords and similar methods, but the attitude is different. I think it is in the same way that Web 2.0 is different than DHTML. Same technology, different feel.

Conclusion

Only time will tell how this will all play out. It’s a cliche, but it’s true. Meanwhile, I think your going to see exciting improvements, and perhaps convergence of business and consumer technology. With that, you’ll probably see changes in thinking from the top to the bottom of companies. If a company doesn’t change, well, there’s always the Titanic.

Uncategorized

Comments (0)

Permalink

Grocist-Your Grocery List Since 2006

Grocist-Your Grocery List Since 2006

Really cool site, and idea. Found again via A Whole Lotta Nothing.

Once this becomes automatic, its gonna be really cool.

Uncategorized

Comments (0)

Permalink

RadRails Template Documentation

Ruby

  • alias – alias
  • atr – attribute reader
  • begin – begin rescue block
  • begin – begin rescue ensure block
  • block – do…end single variable block
  • block – do…end two variable block
  • block – single variable block
  • block – two variable block
  • case – case statement
  • class – Class Definition
  • class – class with initialize
  • class – Singleton Class Definition
  • def – def with params
  • def – method definition
  • defs – class method definition
  • each – each block
  • else – else block
  • elsif – elsif block
  • for – for – iterate over Collection
  • for – for – iterate over Range
  • if – if block
  • ifeif – ifelseif block
  • ifelse – if-else block
  • inject – inject block
  • lambda – lambda block
  • loop – loop block
  • module – Module definition
  • pp – plus plus
  • r – require
  • rescue – rescue block
  • rescue – rescue block with error variable
  • until – until loop
  • while – while loop
  • while – while statement

Get the ruby pack Here

Controller

  • rcea – render component action
  • rcec – render component controller
  • rceca – render component controller action
  • rea – redirect_to(action)
  • reai – redirect_to(action,id)
  • rec – redirect_to(controller,action)
  • reca – redirect_to(controller,action)
  • recai – redirect_to(controller,action,id)
  • reu – redirect_to(url)
  • verify – verify
  • verifyr – verify redirect

Get the controller pack here

Models

  • aal – acts_as_list
  • aat – acts_as_tree
  • bt – belongs to
  • bt – belongs to basic
  • find – find
  • find – find conditions order
  • find – find conditions order group
  • finda – find all
  • findf – find first
  • habtm – has and belongs to many
  • hm – has many complex
  • hm – has_many
  • ho – has one
  • ho – has one complex

Get the models pack here

Validation

  • va – validates_associated(attributes)
  • vaco – validates_acceptance_of(attribute,message)
  • vaif – validates associated if
  • vaon – validates_associated(attributes) on
  • vc – validates_confirmation_of(attributes,message)
  • vcif – validates confirmation of attribute on message if
  • vcon – validates_confirmation_of(attributes,message) on
  • ve – validates_exclusion_of(attribute,in,message)
  • veach – validates_each
  • veif – validates exclusion if
  • vf – validates_format_of(attribute,with,message)
  • vi – validates_inclusion_of(attribute,in,message)
  • vl – validates_length_of(attribute,maximum,message)
  • vl – validates_length_of(attribute,minimum,message)
  • vl – validates_length_of(attribute,range,message)
  • vn – validates numericality of
  • vp – validates_presence_of(attribute,message)
  • vpif – validates_presence_of(attribute,message)
  • vs – validates_size_of(attribute,maximum,message)
  • vs – validates_size_of(attribute,minimum,message)
  • vs – validates_size_of(attribute,range,message)
  • vu – validates_uniqueness_of(attribute,message)
  • vuif – validates_uniqueness_of(attribute,message)
  • vus – validates_uniqueness_of(attribute,message,scope)
  • vusif – validates_uniqueness_of(attribute,message,scope)

Get the validation pack here

Render

  • ra – render action
  • ral – render action,layout
  • rf – render(file)
  • rfu – render(file,use_full_path)
  • ri – render(inline)
  • ril – render(inline,locals)
  • rit – render(inline,type)
  • rl – render(layout)
  • rn – render(nothing)
  • rns – render(nothing,status)
  • rp – render(partial)
  • rpc – render(partial,collection)
  • rpl – render(partial,locals)
  • rpo – render(partial,object)
  • rps – render(partial,status)
  • rt – render text
  • rtl – render text layout
  • rtlt – render text layout true
  • rts – render text status

Get the render pack here

Environment

  • flash – flash[]
  • logi – logger info
  • logn – logger notice
  • logw – logger warning
  • p – params
  • s – session
  • sset – session setter

Get the environment pack here

Migration

  • mac – add column
  • mai – add index
  • mcc – change column
  • mct – create table
  • mdt – drop table
  • mex – execute
  • mnc – rename column
  • mrc – remove column
  • mri – remove index
  • mtc – t.column create

Get the migration pack here

Testing

  • ae – assert_equal
  • aio – assert instance of
  • ako – assert_kind_of
  • am – assert match
  • an – assert nil
  • ane – assert not equal
  • anm – assert not match
  • ann – assert_not_nil
  • ar – assert_raise
  • are – assert_response
  • aret – assert respond to
  • art – assert_redirected_to

Get the testing pack here

Rspec

  • cn – controller name
  • cshra – controller should have rendered action
  • cshrt – controller should have rendered text
  • cshrte – controller should have rendered template
  • csra – controller should render action
  • csrdt – controller should redirect to
  • csrr – controller should render rjs
  • csrrp – controller should render rjs page
  • csrt – controller should render text
  • csrte – controller should render template
  • rsbr – response should be redirect
  • rsbs – response should be success
  • sbe – should be empty
  • sbio – should be instance of
  • sbn – should be nil
  • sbs – should be something
  • se – should equal
  • sh – should have
  • shr – should have rjs
  • shrp – should have rjs page
  • sht – should have tag
  • shtc – should have tag content
  • sm – should match
  • snbe – should not be empty
  • sne – should not equal
  • snm – should not match
  • srt – should respond to
  • ss – should something

Get the rspec pack here

Rhtml

  • a – html link
  • at – attributes
  • cb – check box
  • cbt – check box tag
  • cfl – content for layout
  • comment – comment
  • div – div
  • ds – date select
  • dth1 – doctype xhtml 1.1
  • dthf – doctype 4 frameset
  • dths – doctype html strict
  • dtht – doctype html transitional
  • dtxf – doctype xhtml frameset
  • dtxs – doctype xhtml strict
  • dtxt – doctype xhtml transitional
  • emf – error message for
  • ff – file field
  • forin – for…in..end
  • frt – form_remote_tag(html)
  • ft – form_tag
  • hf – hidden field
  • hft – hidden field tag
  • htdoc – document outline
  • htt – http://
  • if – if block
  • ifei – if else if
  • ifeie – if else if else block
  • ifelse – if else block
  • img – image
  • ist – image submit tag
  • it – image tag
  • li – li
  • lia – link_to(action)
  • liai – link_to(action,id)
  • lic – link_to(controller)
  • lica – link_to(controller,action)
  • licai – link_to(controller,action,id)
  • link – link
  • ltr – link_to_remote(name,update,url)
  • meta – meta tag
  • metah – meta http equiv
  • ol – ol
  • pe – pe
  • pf – password field
  • pft – password field tag
  • pm – percent minus
  • pr – asp style script tags
  • pta – p text area
  • ptf – p text field
  • rb – radio button
  • rbt – radio button tag
  • rp – render partial
  • rpc – render partial collection
  • s – select
  • span – span
  • st – submit tag
  • style – style
  • ta – text area
  • table – table
  • tat – text area tag
  • td – td tag
  • tf – text field
  • tft – text field tag
  • trtd – tr and td
  • tt – closed tag
  • ul – ul

Get the rhtml pack here

Finally, documentation as promised. You can get the entire set of packs here as one zip file with all of the individual xml files inside. Or you can just download this zip and get it as two files. One for RHTML, and one for Ruby.

I’d also like to share my script for making this documentation. It should work for any Eclipse template file. Change the extension to .rb, and drop it in the directory with the xml files. Run it and it should create a txt file for each xml file in the directory. The text file is in textile and it is simply a h2 followed by a list of the templates. Enjoy

Ruby on Rails
Technology
coding
radrails

Comments (0)

Permalink

Documentation update

So, I finished the documentation… but is not up… because WP lost it. I went to edit the source, and I lost 3/4 of my post. So I have to redo it…. )#*&$(*)&$(*&@#$@#)(*&

JD

Uncategorized

Comments (0)

Permalink

RadRails textmate templates

I have been inspired by earlier templates for RadRails and by the templates for JEdit, I have created another set of templates. These ones use the same commands as TextMate, and can use the same reference as the ones for JEdit (although I will try to post another reference soon).

To install:

  1. Unzip this file
  2. Open RadRails
  3. Goto Window>Preferences…
  4. Goto the Rails>Editors>RHTML Editor>RHTML Templates section
  5. Import the RHTML file.
  6. Goto the Ruby>Editor>Templates section
  7. Import the Ruby file
  8. Test it
  1. Open a ruby file
  2. Type ‘bt’ followed by Ctl+Space
  3. Choose one of the belongs_to options
  4. Tab between sections to fill in the parameters
  5. Start typing on the next line, cause you’re done!

Hope you all enjoy, this includes both the regular Textmate Templates, plus some that I find useful (like pp which expands to +=, pure laziness, but nice for someone coming from Java/C#/C++ background).

JD

EDIT: So, for the life of me, I realized that I didn’t include habtm in the templates. Why, I don’t know, its not like I enjoy typing that beast, anyways, here is a new zip that includes the new template. If you want just the single template for habtm, let me know and I can post it as well. JD

Uncategorized

Comments (0)

Permalink

Hacking

Hacking is an interesting term. The common definition turns it into a nasty creature:

To use one’s skill in computer programming to gain illegal or unauthorized access to a file or network: hacked into the company’s intranet.“hack.” The American Heritage® Dictionary of the English Language, Fourth Edition. Houghton Mifflin Company, 2004. 01 Oct. 2006.

Computer geeks like me tend to refer to this as “cracking.” And it appears that our definition of the term “hack” in its original sense is coming back in mainstream news as well. Yahoo recently had a 24-hour “Yahoo Hack Day,” and in its press release, they mention that: “Hack is used in its original sense of ‘creative programming’ not illicit sense of breaking into computers.” What has brought about this change? My theory: Mash-ups.

Mash-ups like Frappr are websites that fundamentally require one or more other sites to function. In Frappr’s case, they use Google Maps to create a site where online communities can ‘pin’ their location in the map to show their spread across the globe. It works because Google has an open API that allows other sites to send and request information from Google.

Mash-ups are common in the so-called ‘Web 2.0′ world, where the user is king, and blogging, podcasts, and Flickr are everyday terms. After Digg came out there were mash-ups that combined Digg and Slashdot, later after other copycats of Digg came, there were mash-ups of these new sites.

The mash-up is probably just a step along the way to maturity for web programming. Application programming saw similar trends, which birthed the PC, Apple, Linux, BSD, GNU, and Open Source Software (OSS). Today, it is nearly a harmonic interaction with the rise of OSS coinciding, and building with, the rise of mashups and cheap internet programming. It will be interesting to see where it goes from here.

It could go the way of Microsoft, IBM, Sun and Oracle, the titans of application programming. Or it could be unpredictable, following in Google’s footsteps and beyond in ways that are unimagineable. All that can be said for certain is that while Richard Stallman and his followers were tainted by the taste of freedom in OSS, my generation, including myself, will be tainted by this movement. It may be a trend, but perhaps, just perhaps, it will be more. Perhaps it will lead to a change in the way managements are structured. Perhaps it will lead to a weakening of Global Corporations. Perhaps, just perhaps, it will lead to real Democracy and freedom.

Technorati Tags: , , , , , , ,

powered by performancing firefox

Uncategorized

Comments (0)

Permalink

Prime Obsession

“Prime Obsession” by John Derbyshire (Joseph Henry Press).

Uncategorized

Comments (0)

Permalink

30 Boxes Issue

30boxes

Honestly, I love 30 Boxes. Its a great service, and it has plenty of people who agree. They are innovative, constantly coming out with creative features.

  • Buddies
  • MySpace, Flickr, Upcoming and other Web 2.0 site integration
  • SMS and Email reminders
  • Integrated Mapping
  • Tags
  • The One Box
  • Themes

30Boxes Screenshot showing the default themes
Continue Reading »

30boxes
rant

Comments (0)

Permalink