hello again 64digits. yes, i returned, to plague you with even more thoughts that I do not think i originally thought but may have originally thought if i had the chance to originally think them. wait, i think i just confused myself, or maybe that was you. i'm never really good at identifying what exactly i mean to do or what exactly i have done. in any case, here we go:
i'm going to reshare the link that I put up last time:http://ht.ly/3ESfqand again, this was a jam session between my friend, kirk, and i. i played the guitar on tracks one through five, and drums on track six and seven. it was a pretty fun night. i got to jam with some other friends last night too, but they were too structure, too… rigid. no room for really just having fun, no room for noise. some people try too hard to sound good, but good lord, is it fun to jam in any case. who knows? maybe i'm just insane. maybe not. in other news, my site went down temporarily today. that made me a bit upset.but right now i'm in the process of coding a miniature social network based off of sms/email. i've got most of it done, but i'm doing the backend maintenance right now, and soon will code the online part. here are some snippets from what i've got so far with the backend maint service:require 'sinatra'
require 'haml'
require 'mysql'
$host = "localhost"
$username = "user"
$pass = "pass"
$db = "database:
db = Mysql::new($host,$username,$pass,$db)
before do
begin
db.ping()
rescue Mysql::Error => msg
puts "MySql server went away/down, reinstating connection"
db = Mysql::new($host,$username,$pass,$db)
end
end
get '/' do
haml :index
end
get '/list' do
puts "yay"
users = Array.new
db.query("SELECT name,id FROM txt").each_hash do |row|
id = row['id'].to_i
name = row['name']
users[id]=name;
end
haml :list, :locals => {:usr => users}
end
get '/list/:id' do
sql = ""
db.query("SELECT * FROM txt WHERE id=#{params[:id]}").each_hash do |row|
row.each do |field, val|
puts "field: #{field}, val: #{val}"
puts
sql += "#{field}: #{val}\n"
end
end
haml :id, :locals => {:sql => sql}
end
%html
%head
%title= "Details for UserID #{params[:id]}"
%body
.content
.header
Header content
%br
.body
="User ID #{params[:id]}"
%br
Data from SQL server:
%br
%pre= sql
.footer
Lorem ipsum dolor foot amet
%br
%html
%title List users
%script{:src => "<a rel="nofollow" href="http://cdn.jquerytools.org/1.2.5/jquery.tools.min.js">http://cdn.jquerytools.org/1.2.5/jquery.tools.min.js</a>"}
%body
.content
.header
Header content
%br
.body
We list the users here
%select.id#id{:name => "id"}
-for i in 0..usr.length-1 do
-id = i
-name = usr[ i ]
%option{:value => id}=name
%br
.footer
Lorem ipsum dolor foot amet
%br
%script
$(document).ready(function() {
$(".id").bind("change",function() {
window.location="list/"+$(this).val();
})
})
What are you writing that in?
Good stuff. Now tell Serprex to get his ass back here.
melee: ruby.
kilin: y