Buggy Screen

So I was using screen on my newly installed Dapper when I find that backspace is having an identity crisis.

When I hit backspace on the command line, it says “wuff wuff” and I need to ^h to delete.

Fine. I can live with that. However, neither backspace nor ^h works while editing files in Vim.

I can’t live with that.

The solution I found was to alias the screen command to set the TERM variable to screen before running screen:

alias screen=’TERM=screen screen’

I don’t know why that works, but it works beautifully.

Ignorance IS bliss!

ruby/rails facts

ruby facts:

  • Everything is an object in Ruby–even nil. It just happens to be an object that represents nothing.
  • Hashes return nil when given a key that it doesn’t contain. This is normally useful because nil evaluates to false.
  • Only nil and false evaluate to false.
  • In Ruby, fields and methods are considered identical. This property is known as the Uniform Access Principle.
  • Underscores are ignored in the digit string, and can be used to improve the readability of large numbers.
  • Protected methods can be called by the same instance and by other instances of the class or sub-class.
  • Another way of expressing a double-quoted string literal is %{…}. This is supposedly convenient for use with long strings. Don’t ask me why.

rails facts:

  • rake db:migrate VERSION=0 rolls the database back to the beginning.
  • In order to make a class method, define the method in the model as: self.method
  • Rails keeps a primary key for all tables called id. This is so that your keyspace is completely disconnected from the outside world. You can change the primary key of your Active Record model; however you will still have to refer to the primary key as id whenever you set it. At all other times, you should refer to it as whatever name you set it to. This is really confusing, and will probably be taken care of later on (right?).
  • Rails does not support composite primary keys, but you can probably find support for them as a plugin.

use google to download mp3s

-inurl:(htm|html|php) intitle:”index of” +”last modified” +”parent directory” +description +size +(wma|mp3) “search_string”

funny

setting up trac

I started off here: http://trac.edgewall.org/wiki/TracOnUbuntu

- For step 3, I needed to set up a virtualhost, so I did exactly that at everydns.net (host: trac.eugeek.com, value: ipaddress).

- After running into some trouble, I changed “SetEnv TRAC_ENV /var/trac” to “SetEnv TRAC_ENV /var/trac/project_name”.

    - Something was wrong because whenever I went to "http://servername/svn/YourProjectNameHere" I would get a 404 error, whereas: "http://servername/svn/" would show the branch, tags, and trunk.  After looking around, I came across this website: http://gentoo-wiki.com/HOWTO_Apache2_with_subversion_SVN_and_DAV and followed the instructions to change “SVNPath /var/svn/repos” into “SVNParentPath /var/svn”.  Everything was working at this point, and I added “SVNListParentPath on” for good measure.

    - Finally, install sqlite3 before running trac-admin, and let the database connection string should be “sqlite:db/trac.db”.  Wasted a few hours because I entered the wrong connection string!  It assumes you’re in the directory “/var/trac/” so it creates “/var/trac/db/trac.db” automatically.

    You’re done!

    css

    Cascading Style Sheets is a stylesheet language used to describe the presentation of a document written in a markup language.

    It facilitates the separation of content and how that content is presented (e.g. font, color, and layout).

    CSS information can be provided by various sources:

    • external stylesheets – a discrete stylesheet referenced by the document.
    • embedded style – a separate section within the document.
    • inline style – style information local to the element, specified with the “style” attribute.
    • user style – style information provided by the user that overrides all existing styles.
    • user agent style – the default (and often customizable) style applied by the user agent (such as a browser).

    CSS provides a priority scheme that gives conflicting styles different weights that can be used to decide which style to apply.  This is what is implied by the term, ‘cascading.’

    CSS Pros:

    • Reduces redundancy.
    • Results in smaller, easier-to-read files because the presentational markup is separated from the content.
    • Allows easier style modifications because the presentation of a whole document is held in one place.
    • Users can customize their viewing experience by providing their own CSS file.