Epoch’s posterous

It's only a model.

A look at singleforest.com: polls

I've been getting a lot of work done on singleforest.com. I've got a week left to add features before I start tracking down bugs and getting my server ready for an August 30th deployment. 

Today I finished creating polls. I wasn't going to have polls as a feature to start with but they where so easy to create I figured, why not? (Still took two days...)

This is what a poll looks like. 

Nothing too fancy. It works though. One design note: I wanted people to be able to see what the current votes are before they decide what to vote.

Here's what it looks like when you click vote!

The asterisk tells you what you voted on and the green bar below the main navigation tells you that your vote has been saved.

And for a bonus, you can optionally make polls that allow people to vote on multiple answers!

As you can see, there are two asterisks on this one. You also get a preview of fully functioning editable comments.

Here's a bonus screen shot of that comment's edits.

I've been very busy. :) 

Loading mentions Retweet
Filed under  //   screenshots   singleforest.com  
Posted August 11, 2010
// 0 Comments

Some stuff is allowed to break on purpose.

I was playing around with markdown and I discovered attempting to submit indented text breaks things rather nicely.
This is what indented text looks like when viewed.
With a black background you have no hope of reading the submission. Editing is even worse.
The text box for editing has completely disappeared... wait, there is a horizontal scrollbar!
Ah, there it is. That's going to be a pain to edit.

I didn't plan on breaking indented text this badly but it certainly works. I don't want any user-submitted content to have indentation. I have a very specific reason for this. I want to present every submission in the same, readable format. If you want indented text, I would be happy to use css to properly indent it for you! I want the text on singleforest to be readable and consistent when submitted. Using markdown enforces some level of standardization. Restricting allowed html helps even more. (CSS may work in the preview but you ain't getting colored fonts in your literature. Yeah, I remove the <font> tag too.)

As always, comments are welcome and you can keep up to date on the mailing list on google groups. 

 

Loading mentions Retweet
Filed under  //   singleforest.com  
Posted August 10, 2010
// 1 Comment

Google Group created for singleforest.com

I created a google group for singleforest.com at http://groups.google.com/group/singleforest. I choose to use google groups over dokuwiki to simplify the code I would have to support. Google groups does everything I needed the wiki to do without having to modify dokuwiki to integrate with rails. It also comes with a free mailing list. 

As you can read on the group, I plan to finally deploy the site late in August. We'll see if that happens. I've got a lot of work to do. 

Loading mentions Retweet
Filed under  //   singleforest.com  
Posted August 4, 2010
// 0 Comments

Rails 3 RC injuries.

If you're going to run bleeding edge, you will bleed profusely. I nearly lost an arm today. I upgraded my application to Rails 3 rc from Rails 3 beta4. The list of problems I've encounter is not long but very annoying. 

  1. gem install rails --pre on top of existing rails beta causes vague untraceable errors just like upgrading to beta2 and beta3. 
    1. Solution is to remove all installed gems manually.
    2. Happily discover rvm has support for this. (rvm gemset clear)
    3. Install rails 3 rc and all dependencies. 
    4. While gems download find out in #rails-contrib that rails 3 rc isn't loading the lib/ folder
      1. Add "config.autoload_paths += %W(#{config.root}/lib)" to application.rb
    5. Ruby 1.9.1 segfautls on load. Joy of joys but not surprising.
  2. Try ruby 1.9.2-preview1
    1. Remove all installed gems
    2. Install rails 3 rc and application gems
    3. Instant sigabrt on running rails server
    4. Discover in #rails-contrib that preview1 is buggy as hell... (then why does rvm install 1.9.2 install preview1?)
  3. Try ruby 1.9.2-head
    1. No gems to remove because I need to update the head anyway.
    2. Download, compile, and install ruby 1.9.2-head
    3. Install rails 3 rc and application gems
    4. Instant internal server errors relating to failsafe failing. 
    5. #rails-contrib recommends 1.9.2-rc2
  4. Try ruby 1.9.2-rc2
    1. Not installed
    2. Download, compile, and install ruby-1.9.2-rc2
    3. Install rails 3 rc and application gems
    4. Instant internal server errors relating to failsafe failing. 
  5. Swear quietly and profusely
  6. Start testing
    1. Build new rails 3 rc application 
      1. launches okay with simple controller and view
      2. compare boot.rb, application.rb, environment/ and initializers/ with non-working app 
      3. no difference...
    2. Test difference configurations with non-working application
      1. Throw exception in home#index
      2. Works, controllers are probably okay
      3. Render index view without layout
      4. 500 Error
      5. Render index using erb instead of haml
      6. Works...
    3. Back to new rails 3 rc app
      1. Add haml gem to Gemfile and make a basic haml view
      2. Works okay. 
      3. Add haml configuration initializer from non-working application
      4. 500 Error
      5. Start playing around with different configuration options
      6. Discovered setting :encoding to :"utf-8" (notice the colon, :"" is a symbol, not a string)
      7. Using "UTF-8" (string) instead of :"utf-8" (symbol) works...
    4. Change :"utf-8" to "UTF-8" in non-working application
      1. Application works now.

I am now able to continue working on singleforest.com but I'm ready for a nap. I estimated this morning I would spend several hours just getting my application working again. For once I was correct. It only took several hours instead of the entire day. 

I would like to thank elux and nbibler in #rails-contrib on freenode for helping me out. 

Loading mentions Retweet
Filed under  //   singleforest.com  
Posted July 27, 2010
// 0 Comments

Old version of singleforest.com available on github

I've deployed an old copy of singleforest.com on github at http://github.com/epochwolf/singleforest-old for all you voyeurs to see. It's the same copy you see in the screen shots. 

My current version of singleforest.com is quite different. I'm not using openid anymore. I wish I could have used OpenID but the rack-openid gem has issues with ruby 1.9's encoding scheme. My current version also uses Rails 3 and MongoDB instead of Rails 2.3.5 and SQLite. 

In other news, this blog is now linked to on my public cv at careers.stackoverflow.com. I won't link you directly to it but those of you interested can now find my real name.  (I give my family about a week before one of them discovers my posts to a certain art website.) My real name would have come out anyway, I figure now is as good as a time as any to let the cat^H^H^Hwolf out of the bag.

Loading mentions Retweet
Filed under  //   singleforest.com  
Posted July 7, 2010
// 0 Comments

A brief, fragmented update on everything.

I've finally graduated with a Computer Science degree. My GPA was 2.866 or so. I'm just glad that's over with. I can't help that nagging feeling that I've wasted 4 years of my life.

I hammered out less ambitious plans for my literature website (singleforest.com) last night. I've decided to try getting rid of every feature that most art websites have. This isn't the most brilliant move I've had (yet) but it's one I need to get anything done. I want to experiment with using email and rss instead of a traditional message center. I'll probably need to rethink this at some point. That point being a significant number of annoyed users which I expect to happen a few months into the life of the site.

My maternal grandfather has been in the hospital for over two weeks now because of complications from lung surgery. He's going to need heart surgery for an eventually fatal heart defect but he needs to heal from the last surgery. It's been fairly stressful for me and my family. It's not the reason I've been silent for so long but it certainly isn't helping things.

On top of this, I'm getting depressed from lack of motivation and useful things to do. I'm still living at home with my parents and I really want to move out and start living my own life. I've having a difficult time with looking for jobs. It's a task that has very limited feedback if any, which is something I don't handle as well as I want to. I'm also frustrated by the lack of interesting programming opportunities in Wisconsin. I'd love to relocate but I can't take the financial risk unless I'd have a job waiting for me. I've applied at local java and .net shops but those jobs are absolutely flooded and given my lack of experience I'm not getting much consideration. Those of you that know me on irc will remember my trip to Eau Claire, I didn't get the job.

If you read all of that I thank you. Don't let my bad week keep you from enjoying yours!

Loading mentions Retweet
Posted June 16, 2010
// 1 Comment

Another snag! (I gotta stop doing this)

Well, I haven't done any programming related to singleforest.com for about two weeks. I've been working pretty hard on my final project. I just finished the presentation with my group and the professor said it was good enough to pass. I should be officially graduated in a week or two. 

I've come to realize my issues with this website are not based on technology. Took 5 months to realize this. I'm pretty sure if I had someone else to look over my shoulder this website would be done by now. I never sat down and hammered out what features I needed and how some of the stuff was going to work. You can't just tack on a full notifications system. You can't be working on a website this big without some automated testing. (Yes, my bad. I never learned to use testing.)

I had exactly 10 versions of singleforest.com sitting in my project folder. Five of them are working but incomplete versions. I don't know what I'm doing. I keep trying to add extra layers to things that don't need them because I don't know where to put stuff. I'm going to take a deep breath and relax tonight.

The last SciFi Club meeting of the year is tonight. I'm going to party with all my friends that I made before I leave this school permanently. Tomorrow, I'm going to go to an all day party and enjoy myself. Only after that will I sit down and figure out what I'm going to put into singleforest.com using ruby on rails. An anemic bullet list isn't going to be good enough this time. 

Loading mentions Retweet
Filed under  //   singleforest.com  
Posted May 13, 2010
// 0 Comments

And the winner is:

Pylons!

I'm still figuring out if I'm going with postgres or couchdb for the backend. I need to read more on pylons before I can make that decision. (I decided on this last night but I was too busy reading to post)

Loading mentions Retweet
Filed under  //   singleforest.com  
Posted April 29, 2010
// 0 Comments

Singleforest.com hits a major snag

Well I've been working on singleforest.com for a while. I made the mistake of choosing the Rails 3.0 beta with Ruby 1.9 for my application. I've spent almost at much time dealing with framework and library bugs as I have with writing code. Today I hit the final bug. The openid library I've been using doesn't work with several openid providers due to the way Ruby 1.9 handles string encoding. The library throws unhandled exceptions that I can't work around. I could try patching the library myself but I'm already working with 4 patched libraries that will likely not survive the next Rails 3.0 beta release. 

So, I've decided to walk away from rails for a bit. I know I could use Rails 2.3.5 with Ruby 1.8 but I would like a change of scenery. I have previous experience with python so I have been looking at using Django or Pylons. Many people have wasted time on debating the merits of various framework for weeks before choosing one. I will have chosen a framework by this time tomorrow. 

Loading mentions Retweet
Filed under  //   singleforest.com  
Posted April 27, 2010
// 0 Comments

Capistrano: use git repository on the same server you deploy to

I ran across an interesting problem the other night. I finally convinced myself that I need to set up automated deployment for a personal website I was working on. The website is written in Ruby on Rails and I decided to use capistrano for deployment like ever other person I know that uses rails. The first problem I had was the capistrano docs are really really lacking in details. The tutorial covers the basics but that only works if you aren't doing something wacky.

 

I'm using git for version control which isn't all that odd. What is odd is that I don't have a remote repository. I don't really need to because I backup my laptop almost every night.  I don't want capistrano to use the copy method for deployment because I don't want to be trying to push several hundred kilobytes of data over a coffee shop's overloaded public wifi for every deployment.

 

I didn't want to use a git host like github or any one of a hundred others because I already rent a Virtual Private Server from slicehost.com. (256 slice to be specific) So I decided to just use git over ssh and store a copy of my repository on my server. It was pretty easy to create an empty repository on my server and push my local copy over. Capistrano however did not like this. My website needed to deploy to the same sever my remote repository was sitting on. There is no tutorial or examples for doing this. I googled for over an hour and read all the docs on capistrano.

 

The problem with capistrano is that by default the :repository variable only paths to urls or files on your local machine. I couldn't find a way to tell capistrano to look on the deployment server for the repository.

 

The solution:

set :repository, "file:///srv/git/repository.git"

set :local_repository, "file://."

The above works because setting undocumented variable :local_repository tells capistrano that :repository is a location on the app server. Suddenly, I'm able to deploy using export instead of copy. I hope I saved someone else hours of searching to figure out how to do this.

 

Loading mentions Retweet
Filed under  //   capistrano  
Posted April 15, 2010
// 0 Comments