Sunday, March 30, 2008
Saturday, March 29, 2008
deepmix
deepmix.eu
Name : Deep Mix Moscow Radio: deepmix.ru
Genre : Deep House Techno Minimal Tech Dub Electronic Mixed
Website: http://www.deepmix.eu/
Public : yes
Bitrate: 128kbit/s
Friday, March 28, 2008
Thursday, March 27, 2008
Wednesday, March 26, 2008
molybdenum
Scientists discover clue to 2 billion year delay of life on Earth - It is the lack of molybdenum. I like molybdenum.
8.5GB
The OLPC project just gave the world 8.5GB of free sound samples, unencumbered and free to use! Sweet.
Tuesday, March 25, 2008
Monday, March 24, 2008
MIR
Xavier Serra's homepage
SMC - Sound and Music Computing
SMC Network roadmap
MISTIC @ University of Victoria
Freesound
simile on rails
SMILE Timeline plugin for Rails - similie is a timeline browser from MIT. Interesting idea, but the speed is really slow. Probably a better fit would be to do it in Actionscript 3.0.
Sunday, March 23, 2008
Friday, March 21, 2008
functional
From HowToUseSubdomainsAsAccountKeys
Functional testing with subdomains:
To test subdomain account keys, you can set the host parameter of the @request object in a functional test:
def test_example_test
@request.host = 'subdomain.local.host'
end
HD 189733
Thursday, March 20, 2008
limoncelloquest
Ben left me a nice and useful comment on making limoncello, and has a neat website atlimoncelloquest.com. Neato!
Wednesday, March 19, 2008
room temperature superconductivity
Wacky! Scientists in Germany and Canada announce high temperature superconductivity, albeit at very high pressures. Very interesting.
disks have become tapes
An interesting analysis of MapReduce and similar algorithms, transfer rates for disks have increased at 20% per year recently, while seek rates have only risen at 5%, so write algorithms that take advantage of transfer rates.
I certainly will have to in my new work with audio algorithms.
RecordInvalid
ActiveRecord::RecordInvalid
begin
complex_operation_that_calls_save!_internally
rescue ActiveRecord::RecordInvalid => invalid
puts invalid.record.errors
end
limoncello
limoncello from recipezaar
15 thick skinned lemons
2(750ml)bottles 100% proof vodka
4 cups sugar
5 cups water
Maybe I'll just make a half (or 1/10) batch, but sure does sound tasty.
functional
Loving Rails' functional testing - I'm trying to become a convert to functional testing, I love integration testing, but I think I need to do functional testing as well.
Tuesday, March 18, 2008
Monday, March 17, 2008
Sunday, March 16, 2008
admin interface
Administrative Debris in which Ryan Tomayko talks about improving an admin interface.
I've been working on this big project with making an admin interface for sunshineorganics.ca for quite a few months now, so this post is quite relevant.
frink
frink - is a practical calculating tool and programming language designed to help us all to better understand the world around us, to help us get calculations right without getting bogged down in the mechanics, and to make a tool that's really useful in the real world. It tracks units of measure (feet, meters, kilograms, watts, etc.) through all calculations, allowing you to make physical calculations easily, to mix units of measure transparently, and ensures that the answers come out right.
That's really cool, and when I was studying chemistry and physical chemistry, I found that the best way to make sure you were on the right path was to keep track of the units, make sure the units work out, and then focus on the numbers. It looks like this is what this tool does as well.
fast sparse
A clever trick to initialize memory to 0 the first time it is accessed, thus speeding up accesses to spare vectors.
Saturday, March 15, 2008
rest-client
rest-client is a simple API for accessing REST resources with Ruby. Looks really nice and simple.
require 'rest_client'
xml = RestClient.get 'http://some/resource'
jpg = RestClient.get 'http://some/resource', :accept => 'image/jpg'
RestClient.put 'http://some/resource', File.read('my.pdf'), :content_type => 'application/pdf'
RestClient.post 'http://some/resource', xml, :content_type => 'application/xml'
RestClient.delete 'http://some/resource'
Friday, March 14, 2008
fix the web
A really funny video about how to fix the web with greasemonkey. I've played a bit with greasemonkey, and this video makes me want to learn more.
custom ruby dates
From : dzone snippets and http://wiki.rubyonrails.org/rails/pages/HowToDefineYourOwnDateFormat
my_formats = {
:my_format_1 => '%l %p, %b %d, %Y',
:my_format_2 => '%l:%M %p, %B %d, %Y'
}
ActiveSupport::CoreExtensions::Time::Conversions::DATE_FORMATS.merge!(my_formats)
ActiveSupport::CoreExtensions::Date::Conversions::DATE_FORMATS.merge!(my_formats)
Thursday, March 13, 2008
testing
PragDave show us an interesting new library for doing testing. I've been doing tons of TDD (Test Driven Development) lately, either that or writing the tests right after I write the code, and I've found that it makes my life much better. What I find lacking though is that the reports of what fails in the tests is a bit lacking, the way that Ruby on Rails gives the whole call stack is sometimes hard to parse.
Integration tests though are much harder, and I find myself having to frequently consult the test.log file to figure out what went wrong. There must be a better way to do integration testing.
In my next big project, the Orchive, I plan to do things right, I think it's going to be RESTful, and I'm going to think hard to make a beautiful API.
paleocene-eocene climate
CLIMATE SCIENCE: All Stirred Up
H. Jesse Smith
Around 55 million years ago, at the height of the Paleocene-Eocene thermal maximum, the world was a much warmer place than today. Sea surface temperatures were higher everywhere than now, and the equator-to-pole thermal gradient was much shallower. Climate for much of the past 500 million years has been warmer than it is now, and during the warm periods the surface meridional temperature gradient generally appears to have been weak. Explaining how the climate system might have transferred heat from low to high latitudes to maintain such a shallow thermal gradient has been difficult, and many hypotheses have been advanced, including those involving effects from radiative forcing by high concentrations of atmospheric carbon dioxide, more intense ocean heat transport, differences in the amounts and locations of polar stratospheric clouds, and extratropical atmospheric convection. Korty et al., using a coupled model of intermediate complexity, investigate another possibility: that tropical cyclones could have caused enough ocean surface mixing in the tropics to cool the sea surface there and drive the strong poleward heat flux needed to produce the shallow thermal gradients that seem to have prevailed during warm climates. This solution, if correct, also has implications for how we might expect the climate system to respond to anthropogenic warming. -- HJS
J. Clim. 21, 638 (2008).
Wednesday, March 12, 2008
music in higher dimensions
The Geometry of Music - Dmitri Tymoczko of Princeton University has developed a theory that uses higher dimensions to explain chordal theory. Sweet stuff.
unit test errors.full_messages
I recently needed to check why a model in Rails was failing, and I found the following useful. It tells me all the errors that have occurred to stop this model from validating:
@sness_aug01_medium_bin.valid?
puts "errors=(#{@sness_aug01_medium_bin.errors.full_messages})"
gruff
I was building a dynamic bar graph into the Orchive website, and decided to try Gruff Graphs for it. Since I tried it last, it's really matured with a really nice Ruby on Rails plugin. It has fairly good API documentation, but to really find out how to use it, look at the test code in the gem, for example /usr/lib/ruby/gems/1.8/gems/gruff-0.2.9/test/test_bar.rb for the Bar graph.
On the plugin page, he shows a really neat way to have a controller action use send_data to send a dynamically generated png back to the browser, but doesn't really explain how to use this in your view. I found a blog post that shows how to do this, you just make an action like:
def year_graph
g = Gruff::Bar.new("700x400")
g.title = "Percent of Orca song digitized per Year"
g.labels = Year.labels
g.data(:Test, Year.data, "#008B00" )
g.hide_legend = true
g.minimum_value = 0
g.maximum_value = 100
send_data(g.to_blob,
:disposition => 'inline',
:type => 'image/png',
:filename => "years.png")
end
and then in your view, call this action as the target of an img tag:
<div class="year-graph">
<%= image_tag "/main/year_graph" %>
</div>
I then use some CSS to center this in the page:
.year-graph {
margin-left: auto;
margin-right: auto;
width: 700px;
}
The end result looks like:
Tuesday, March 11, 2008
pwgen
pwgen is a great tool for generating a whole page of randomly generated passwords. With various command line options, you can increase the difficulty of the passwords for people to guess.
It gives you a whole page of passwords, which is a great idea in case there are people spying on your screen via Van Eck phreaking, or perhaps just reading your terminal history.
Monday, March 10, 2008
Sunday, March 09, 2008
doodle
doodle is a Ruby library and gem for simplifying the definition of Ruby classes by making attributes and their properties more declarative.
Doodle is eco-friendly - it does not globally modify Object, Class or Module, nor does it pollute instances with its own instance variables (i.e. it plays nice with yaml).
Sounds interesting.
ruby fringe
Ruby Fringe is an avant-garde conference for developers that are excited about emerging technologies outside of the Ruby on Rails monoculture.
I think that some of the coolest things happening nowadays in Ruby are outside of Rails. The more I work with Rails, the more I see its limitations, it just wasn't that well thought out before it was widely adopted. There is something to be said for a framework that just organically builds without having all the hype.
Still though, I do all my websites in Rails, and for a certain kind of website, it's pretty awesome and super fast to develop something that works.
Saturday, March 08, 2008
tractatus
Quotes from the Tractatus Logico-Philosophicus - I used to carry the Tractatus around with me at Pearson College, and would listen to Stockhausen in the library.
Friday, March 07, 2008
image slicing for the hardcore
I'm working on a new version of the Orchive webpage, and after a little clicking with Illustrator and Inkscape, both excellent programs, by the way, I decided that I would rather just write a script to do the slicing for "normal", "hover" and "selected" states of hover buttons.
It turned out to be super easy. I loaded up the image in Gimp, found the X,Y coordinates of the places where I wanted to slice and used RMagick to slice up the image, like this:
#!/usr/bin/ruby
require 'rubygems'
require 'RMagick'
include Magick
normal = ImageList.new("full_normal_state.png")
normal_left = normal.crop(0,274,125,38)
normal_left.write("normal_left.png")
normal_home = normal.crop(125,274,180-125,38)
normal_home.write("normal_home.png")
hover = ImageList.new("full_hover_state.png")
hover_left = hover.crop(0,274,125,38)
hover_left.write("hover_left.png")
hover_home = hover.crop(125,274,180-125,38)
hover_home.write("hover_home.png")
selected = ImageList.new("full_selected_state.png")
selected_left = selected.crop(0,274,125,38)
selected_left.write("selected_left.png")
selected_home = selected.crop(125,274,180-125,38)
selected_home.write("selected_home.png")
So much simpler. And I'm done.
Thursday, March 06, 2008
git ssh
It looks like it should be easy to use git with ssh, in fact it appears to be the default. That's cool.
It also looks like it should be fairly easy to use Capistrano with a remote git store. That's essential because I use Capistrano to do all my Ruby on Rails deployment.
git and svn
how to use git and svn together.
I don't know, I think I should just move right over to git, but it might be smart to go halfway first, and use gitsvn to do them together.
moving to git
I've decided that sometime in the next few months, I'm going to move completely over to git instead of subversion, and that means that I'll be deploying all my Ruby on Rails projects with git. Here are some resources I've found:
screencast of using git with rails
git-rails - Using git with Ruby on Rails
giston - A piston lookalike for git (I use piston for installing all my Ruby on Rails plugins, piston is really awesome)
using git for Rails development - More about how they are moving the development of the Rails engine to git, but still might be useful.
git-rails at Rubyforge.
1000 true fans
Kevin Kelly (former editor of Wired magazine) has a great article about how artists just need 1000 true fans to make a living.
Tuesday, March 04, 2008
Monday, March 03, 2008
msramdmp
msramdmp - is a little bootable syslinux USB stick that manages to boot itself without overwriting the contents of RAM, which as was discovered recently by some Princeton researchers, can hold it's contents for some time after a computer is powered down.
I guess we now need a /etc/rc.d/init.d script that will overwrite the contents of your RAM before you shutdown your computer.
Sunday, March 02, 2008
silent rm in zsh
Sometimes, very rarely, I want zsh to do an "rm *" without asking me for confirmation, you can do this by:
setopt rmstarsilent
Saturday, March 01, 2008
attachment_fu
How to tell attachment_fu to store it's files where you want it to. I use attachment_fu for all my file uploads in Rails, it rocks.
ruby try sugar
try is a little snippet for Ruby that extends the Object class so that instead of having to do:
@person ? @person.name : nil
you can instead just do:
@person.try(:name)
Just add the following to your Object class:
class Object
##
# @person ? @person.name : nil
# vs
# @person.try(:name)
def try(method)
send method if respond_to? method
end
end
Subscribe to:
Posts (Atom)