Skip to content

Instantly share code, notes, and snippets.

View ngpestelos's full-sized avatar

Nestor G Pestelos Jr ngpestelos

View GitHub Profile
first post
# Video: http://rubyhoedown2008.confreaks.com/08-chris-wanstrath-keynote.html
Hi everyone, I'm Chris Wanstrath.
When Jeremy asked me to come talk, I said yes. Hell yes. Immediately. But
then I took a few moments and thought, Wait, why? Why me? What am I supposed
to say that's interesting? Something about Ruby, perhaps. Maybe the
future of it. The future of something, at least. That sounds
keynote-y.
Please refer to Erlang Programming, p. 199-200.
First, let's figure out how the splits function works. From the book, we have this definition:
1 splits([]) ->
2 [{[], []}];
3 splits([H | T] = Ys) ->
4 [ {[], Ys} | [ {[H | As], Bs} || {As, Bs} <- splits(T)]].
Here's what we know:
See Erlang Programming, p. 199-200)
This is the second part of the program (see splits_trace).
1 perms([]) ->
2 [[]];
3 perms([X | Xs]) ->
4 [insert(X, As, Bs) || Ps <- perms(Xs), {As, Bs} <- splits(Ps)].
Before we proceed, we need to know two things:
Here are the steps I took to get Rails working on an Ubuntu VirtualBox instance:
1. Software Versions
* Ubuntu 9.04 (I'm using xubuntu-9.04 and I assume Rails wouldn't care)
* Ruby 1.8.7
* Rails 2.3
* MySQL 5.x
You're new to Rails and would like to create an application.
1. Generating the starting app
$ rails demo
$ cd demo
$ ls -p
README config/ lib/ script/ vendor/ Rakefile db/ log/ test/ app/ doc/ public/ tmp/
2. Creating a controller
=== Epic Snow Leopard Upgrayyyyd Guide ===
Son, you’re now living in the land of 64-bit systems.
That means that some of your 32-bit shit is now broken.
Not all is lost.
== Fixing MySQL weirdness
You want to switch databases from sqlite (default) to Rails.
1. Create the database
$ mysql -u root create depot_development
2. Update config/database.yml
development:
adapter: mysql
Stopped at 16:20
Important part @ 19:10
From a pattern, produce a skeleton using a rule.
> A pattern is something that matches, and a skeleton is something you substitute into in order to get a new expression (03:03)
> A pattern is matched against the expression and the result of the application of the rule is to produce a new expression (target) by instantiation of the skeleton
-module(port_scanner).
-export([scan/3]).
scan(Addr, Start, End) ->
Services = parse_services(),
scan(Addr, Start, End, Services).
%% Internal functions
scan(Host, Start, End, Services) ->
[Data || Data <-