How to Install Oracle 10g on Ubuntu 10.04 Lucid Lynx
Follow these steps to have a fresh installation of Oracle 10g on Ubuntu 10.04:
Download Oracle 10g Express Edition from http://bit.ly/brdXr5
Run these commands (add sudo prefix if needed):
apt-get install libaio-dev libaio1 libaio1-dbg
dpkg -i oracle-xe-universal_10.2.0.1-1.0_i386.deb
/etc/init.d/oracle-xe configure
Note: The username for http://127.0.0.1:8080/apex is SYSTEM
Install Client (Optional):
dpkg -i oracle-xe-client_10.2.0.1-1.0_i386.deb
ln -s /usr/lib/oracle/xe/app/oracle/product/10.2.0/client/scripts/runsqlplus.sh /usr/local/bin/sqlplus
Com a política no Brasil não se brinca, se faz piada.
Thursday, August 26, 2010
A economia do país esteve em boa forma durante o governo Lula, não necessariamente por mérito deste. Mas quem leva o prestígio é sem dúvida o presidente, o que lhe permite como “nunca antes na história deste país”, alavancar uma propaganda eleitoral com tanto sucesso.
Invisível ao olho do leigo. Não há como dar créditos à justiça eleitoral, que deveria realizar o nobre papel de repreender exemplarmente a manipulação de massas durante o processo eleitoral, mas esta prefere aplicar censura aos meios de comunicação e dar espaço a candidatos fanfarrões. E pior do que está, realmente não fica.
Sem dar outra opção, a justiça eleitoral recomenda ao cidadão utilizar-se de sua ferramenta democrática para a escolha de seu governo: O voto. É trabalhoso envolver-se com política, dispender energia na formulação de idéias, análise e escolha das melhores propostas. Mas como dar relevância a um trabalho sério se a campanha política transformou-se em uma festa para fanfarrões, picaretas e marqueteiros?
Dada nossa confiança à instituições irresponsáveis pelo trabalho sério que deveriam fazer, é angustiante saber que o resultado é inevitável. Tornamo-nos uma potência de impotentes. É improvável que tenhamos um processo eleitoral com dignidade. Mais quatro anos de decepção, e um pouco mais velhos e acostumados com um país charlatão.
Saiba quem você pode acabar elegendo ao votar no palhaço Tiririca.
http://www.youtube.com/watch?v=cTlkplDYaiM
Attribute finder in Javascript
This javascript allows you to find the value of an object’s attribute with a string in the same format used in the name of a form field that uses nested resources:
var find_attr = function(d, s) {
var a = s.indexOf('[');
var v = null;
if(a==-1) {
v = d[s];
}
else if(a > 0) {
var b = s.indexOf(']');
var z = s.length;
v = find_attr(d[s.substr(0, a)], s.substr(a+1, b-a-1)+s.substr(b+1, z-b-1));
}
return v;
}
The data object may be the response in JSON of an Ajax request, and you need to populate your form:
var data = {}
data.personal = {};
data.personal.name = "Castilho";
var field_name = "personal[name]";
document.getElementsByName(field_name)[0].value=find_attr(data, field_name);
Also works with arrays and an indefinite number of levels:
data.company = [];
data.company[0] = {};
data.company[0].name = "FBCO";
find_attr(data, "company[0][name]");
How to install Ruby on Rails on Ubuntu 10.04 Lucid Lynx
Follow these steps to have a fresh installation of Ruby on Rails in Ubuntu 10.04:
sudo su
apt-get install build-essential
apt-get install ruby rdoc libopenssl-ruby
wget http://production.cf.rubygems.org/rubygems/rubygems-1.3.7.tgz
tar zxvf rubygems-1.3.7.tgz
cd rubygems-1.3.7
ruby setup.rb
ln -s /usr/bin/gem1.8 /usr/local/bin/gem
gem install rails
Installing MySQL gem:
apt-get install ruby-dev libmysql-ruby libmysqlclient-dev
gem install mysql
My Labor Day
In this Labor day, I spent a LOT of time trying to find a solution to an invisible problem, called ZERO WIDTH SPACE (zwsp).
The ExtJS HtmlEditor set a default value to solve a focus problem with evil browsers:
A default value to be put into the editor to resolve focus issues (defaults to (Non-breaking space) in Opera and IE6, (Zero-width space) in all other browsers).
That’s when the QA have told me that the string “wtf” was being recorded with a question mark at the beginning (“?wtf”), when tested in IE7 and IE8:
LENGTH=6 ? (e2) ? (80) ? (8b) w (77) t (74) f (66)
UTF-8: E2 80 8B (ZERO WIDTH SPACE)
But in firefox was everything ok (with just a space on left):
LENGTH=4 (20) w (77) t (74) f (66)
UTF-8: 20 (SPACE)
Please ExtJS team! this is a nut solution, and no longer needed (goodbye IE6). Seems that this IE6 ghost still be around the web for long. Thanks Microsoft.
Setting up a Ruby on Rails / Windows Development Environment
Download Ruby One-Click Installer from:
http://www.ruby-lang.org/pt/downloads/
or directly from:
http://files.rubyforge.vm.bytemark.co.uk/rubyinstaller/ruby186-25.exe
Execute Ruby One-Click Installer and then:
Next > I Agree > Next > Next > Install…
Download Ruby Gems from:
http://rubyforge.org/frs/?group_id=126
or directly from:
http://rubyforge.org/frs/download.php/69366/rubygems-1.3.6.zip
Extract and run with cmd.exe:
ruby setup.rb
or click with mouse right button on ruby.rb and open
Install rails with cmd.exe:
gem install rails
Download MySQL Community Server from:
http://dev.mysql.com/downloads/mysql/
or directly from:
http://dev.mysql.com/get/Downloads/MySQL-5.1/mysql-5.1.45-win32.msi/from/http://mysql.he.net/
Run MySQL Community Server installer and then:
Next > Complete & Next > Install…
When Mysql Server Instance Configuration Wizard pops, follow:
Standard Configuration & Next > Next > Set root password & Next > Execute > Finish…
Install MySQL gem with cmd.exe:
gem install mysql
(don’t worry with ‘no definitions for …’ messages)
The MySQL Server 5.1 libmySQL.dll does not work well with Rails 2.3.5:
Copy libmySQL.dll
from: C:\Program Files\MySQL\MySQL Server 5.1\bin
to: C:\ruby\bin
The solution for above is shown below:
Download libmySQL.dll from:
http://instantrails.rubyforge.org/svn/trunk/InstantRails-win/InstantRails/mysql/bin/libmySQL.dll
and copy it to: C:\ruby\bin
Download RadRails (IDE) from:
http://www.radrails.org/download/
or directly from:
http://d1iwq2e2xrohf.cloudfront.net/tools/radrails/standalone/2.0.4.1268158942/win/Aptana_RadRails_Setup_2.0.4.exe
Run RadRails installer and then:
Next > I Agree > Next > Next > Next > Install … Next > Close…
Run RadRails and when Auto-install gems is prompted, click Install
To test your new environment, follow these steps:
- Go to File > New > Rails Project
- Write a Project name
- Choose mysql as database and click Finish
- In your project edit the file config/database.yml to set your database configuration (eg: password)
- Open Generators view from Window > Show View > Generators
- Choose scaffold from the dropdown and type the following parameters:
recipe title:string author:string description:text
- Press the Play button and wait
- Open Rake Tasks view from Window > Show View > Rake Tasks
- Choose db:setup from the dropdown, press the Play button and wait
- Start the Mongrel server from Run > Run
- Point your navigator address to http://127.0.0.1:3000/recipes
- Enjoy!
Rails 3.0: Second beta release
It took longer than we thought, but then again, what doesn’t? This is the second beta release of Rails 3.0 and hopefully our last stop before a release candidate. There are still a handful of known regressions (see the list at the end), but we’ve made huge strides since the last release and so have auxiliary tools like Bundler.
You can find all the detailed changes in the the CHANGELOGs for each framework: Action Mailer, Action Pack, Active Record, Active Resource, Active Model, Active Support, Rails.
Please install beta 2 and try it out with new and existing applications. (gem install rails --prerelease after you make sure you’re on Ruby Gems 1.3.6 with gem update --system).
You can use Jeremy McAnally’s excellent rails_upgrade plugin to take a 2.3.x app to 3.0 (and get his update book too). There are already a good number of Rails 3 applications live in the wild.
Thanks a million to everyone who’s been working on this. Rails 3 is a mighty big barn and it’s been a joy seeing the community come together to raise it.
Note that Ruby 1.8.7 p248 and p249 has marshaling bugs that crash both Rails 2.3.x and Rails 3.0.0. Ruby 1.9.1 outright segfaults on Rails 3.0.0, so if you want to use Rails 3 with 1.9.x, jump on 1.9.2 trunk for smooth sailing.
Three Cups of Coffee a Day Good for Your Brain
According to a study published in the Journal of Alzheimer’s Disease, coffee can stave off the effects of aging on the brain—specifically in women over the age of 65. “MRI brain scans revealed that women who drank three cups of coffee per day (or 6 cups of tea) had lost less brain tissue called white matter than those who drank less.” Unfortunately men who drank the same amount of coffee saw none of the same benefit, but either way, it’s not a bad endorsement of our favorite caffeine-delivery method. (Tea drinkers, the study noticed the same results for over six cups of tea).
Complex Life Found Under 600 Feet of Antarctic Ice
Chroniton writes “NASA ice scientists have found a shrimp-like creature and a possible jellyfish ‘frolicking’ beneath 600 feet of solid Antarctic ice, where only microbes were expected to live. The odds of finding two complex lifeforms after drilling only an 8-inch-wide hole suggests there may be much more. And if such life is possible beneath Earth’s oceans, why not elsewhere, like Europa?”