Abertura Facil
Afinal não sou o unico a ter um problema com embalagens de "abertura facil".
"I don't mean to sound bitter, cold, or cruel, but I am, so that's how it comes out" (Bill Hicks)
08 october 2007: big news
hello everyone. i've waited a long time to be able to make the
following announcement: as of right now nine inch nails is a totally
free agent, free of any recording contract with any label. i have
been under recording contracts for 18 years and have watched the
business radically mutate from one thing to something inherently very
different and it gives me great pleasure to be able to finally have a
direct relationship with the audience as i see fit and appropriate.
look for some announcements in the near future regarding 2008.
exciting times, indeed.
posted by trent reznor at 10:45 am.
My girlfriend's sister asked for help. But all she got was a 16.
The purpose of this script is to get a file(name) as a first argument, a regexp as a second argument and then search trough the file and print out the whole sequence where any of the possible regexp values are found, being that the searched sequence itself must be identified with "<>" symbols and then do a little basic math with the elements we've found.
To try this out, save the following as (for instance) sequences.txt:
>50c's and 50t's
cccccccccccccccccccccccccccccccccccccccccccccccccctttttttttt
tttttttttttttttttttttttttttttttttttttttt
>10G's and 90A's
GGGGGGGGGGAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
>A random sequence
ccagtcctgtctaaggactttggttcatgcgttaatttcggttagccagtggcgcccacg
taacaaagtgcgaccgacctgcttccatagcattgaaatgtccttgattggagattttac
gcaggaggactgataagttcgggtctgaattgatgcagcgaacgttcatccaatactcag
acttgcactcagtcg
>A second random sequence
cgcatgacggccctcctcgacggttcattaaccttgcacaccaactgttcctcaaccgat
ctggtgtctttctcacttacatagcagttgctgtaccatttgatgggaacccgagatcac
cgggttatcgcgggagtttattccgaattgttctcggaaatgtggcgtcggcttgaattg
ggaataatacggatcttgacaagcacgatttcatccacaatgcggcacgagtaatcccct
tctggaaggatgcagaaaggacatatacaatgagctagccacgtggcgcataacgcagct
tggttagaaactaaatctatacaggaagatacagaatgggaacagtgtcgctcagtctag
ccagctagatccgcctttagtcgaccttaggggtaaggca
And the below code as scripty.pl:
print "\n\n *girfriends_sister_school_id* \*girfriends_sisters_friend_school_id*\n\n";
print "filename:\n";
$filename =
open(TEMPFILE, $filename) or die("Cannot open the file $filename");
print "Insert the regular expression to find:\n";
chomp($regexp=
while (
if ( /^>/xms) {
$paragraph = "";
$paragraph_head = $_
}
if ( /^$/xms) {
push @paragraphs, $paragraph;
} else {
$paragraph .= $_;
}
}
push @paragraphs, $paragraph;
foreach (@paragraphs) {
while ( $_ =~ /($regexp)/gi) {
$expressions{$1} += 1;
}
}
foreach $key (keys %expressions) {
print "\n\nPattern = $key\n";
foreach (@paragraphs) {
if ($_ =~ /$key/) {
$paragraph_with_patterns = $_;
$total = length$paragraph_with_patterns;
$counterA = 0;
$counterC = 0;
$counterT = 0;
$counterG = 0;
if ($key =~ /a/){
while ( $paragraph_with_patterns =~ /a/gi) {
$counterA += 1;
$sum1 = ($counterA/$total);
}
}
if ($key =~ /c/){
while ( $paragraph_with_patterns =~ /c/gi) {
$counterC += 1;
$sum2 = ($counterC/$total);
}
}
if ($key =~ /t/){
while ( $paragraph_with_patterns =~ /t/gi) {
$counterT += 1;
$sum3 = ($counterT/$total);
}
}
if ($key =~ /g/){
while ( $paragraph_with_patterns =~ /g/gi) {
$counterG += 1;
$sum4 = ($counterG/$total);
}
}
$paragraph_with_patterns =~ s/($key)/\<$1\>/gi;
print "$paragraph_with_patterns\n\n";
%sum = ();
%sum1 = ();
%sum2 = ();
%sum3 = ();
%sum4 = ();
if ($counterA >0){
%sum1 = ("A", $counterA);
}
if ($counterC >0){
%sum2 = ("C", $counterC);
}
if ($counterT >0){
%sum3 = ("T", $counterT);
}
if ($counterG >0){
%sum4 = ("G", $counterG);
}
%sum = (%sum1,%sum2,%sum3,%sum4);
foreach $key_id (sort hashValueDescendingNum (keys(%sum))) {
$div = ($sum{$key_id}/$total);
print "$key_id = $sum{$key_id} \/ $total = $div\n";
}
}
}
}
sub hashValueDescendingNum{
$sum{$b} <=> $sum{$a};
}
exit;
Then run perl scripty.pl . Put sequences.txt as the file and a[c|t]g as the regexp when prompted.
I had alot of fun doing this wich is a good thing since I didn't get paid.
And no, neither bio::perl, nor any other module for that matter, were options.
Finally, a major thank you must go out to sab for the priceless (as in: he didn't get paid either) help.
Tags: fun, geek, perl, programing
Quicky:
Are you using OS X to develop the next big Rails app and need ImageMagick, RMagick and friends?
Well, just point your browser to rubyforge and download the rmagick-osx-installer package, unzip it and read the fine manual. If you have all the pre-requisites, "sudo run" the installer script and then... go out for a coffee.
When you're back you'll have the following log in your terminal windows:
libpng was installed successfully
libjpeg was installed successfully
ghostscript was installed successfully
ghostscript-fonts-std was installed successfully
FreeType was installed successfully
libwmf was installed successfully
ImageMagick was installed successfully
RMagick was installed successfully
Removing rm_install_tmp directory...Done
That simple.
Tags: geek, programing, ruby, software
As you might have noticed, I've been on a rather long break from my blogging activity, and again this was due to my Mac being broken. Again.
It's not like I didn't have a replacement (my old trusty Asus M6N), but as I've said before, i get depressed when my Mac brakes. And it just happens oh so many times.
Anyway, the downside, apart from the depression bit, was that I missed the opportunity of ego-blogging about the brand new Ruby-Lang Portuguese site .I'm very proud of being a part of the amazing team behind it, and sincere kudos must go out to Emanuel and Franc.
On the upside I had the chance of rediscovering Linux on the laptop!
I'm lucky that my Asus is a pretty linux-compatible, but with the new Ubuntu 7.04, everything just works. That includes wireless, the extra (media) buttons, the compiz powered desktop effects, the works.
Now, I've been known to prefer Suse/Novel over any Debian based system for users and user-grade hardware, but Ubuntu has been making such an extraordinary evolution that it has (for all that I care) become the de facto distro for desktop use. It just gives you roughly 70% you'll need from the first boot, and the rest you'll get with Automatix. For a little more specific usage needs, the excellent Aptitude app will do the trick. You'll never get so much for so little!
Anyway, here's a little list of apps I've been (re)discovering:
Aptana + RadRails (Netbeans, eat your heart out!. Thankfully its cross-platform);
F-Spot (will give iPhone a run for its money any day);
Songbird (think iTunes minus clutter);
Gnome-Launch-Box (it's a Quicksilver clone, gets the job done);
And a list of what I miss:
Integrated Dictionary just a shortcut away;
Textmate (it was growing on me...);
Dashboard (what? I love eye candy...);
That's not so bad is it?
Ruby trough Rails has been a poster-child for the so called web 2.0, but in the enterprise level the adoption rate hasn't been all that remarkable.
Rather than go trough an extensive diatribe about how adoption rates in the enterprise for just about any open source technology is always necessarily slow, because no self respecting OSS programmer plays golf, I'll just list some of the perceived weaknesses and shortcoming usually attributed to Ruby.
- Contrary to Perl, it doesn't come installed by default on just about every Unix-like OS;
- The treathing model used is week;
- Rails doesn't scale;
- It's just a fad, and it will go away before it matures;
- Poor Unicode support;
- No single good IDE and Text Editors are soo 80's;
- Nobody wants to learn yet another language especially when there is close to 0 employability for it;
While most of these are (at least to some extent) true, there are many projects that aim at overcoming them. And Ruby itself is still just version 1.8.6 at this point.
One such project seems to be catching enough wind behind it so that it could drive Ruby into mass (wishful thinking here...) adoption. JRuby.
Now, one might expect that the "J" would stand for Japanese, but remarkably it stands for Java. Isn't that ironic? Ruby is sometimes hailed as "What programmers should be using to still have time for a personal life" contrary to Java's "Write once. Then again, Just one more time... Ok, call your mom and cancel dinner" motto.
Jruby (which just recently reached the 1.0 mark) is a pure Java implementation of Ruby, and it's developed by Thomas Enebo and Charles Nutter with Ola Bini also being credited here and there, and, to some extent, sponsored by SUN. It aims at being more that just another implementation of Ruby (not that there are many...) which means that while still programming in pure Ruby, a coder can now enjoy the following added benefits:
- Java's scaling capabilities since Ruby code now runs inside a JVM which means parallelization in multi-processor setups ;
- An optimized Database connectivity with JDBC;
- Same level of Java's Unicode support;
- Garbage Collection handled by Java. (don't we all appreciate that?);
- A great IDE (Netbeans 6. Packed with all typical goodies plus code completion and a Swing Form Builder, it just might be the VB6 of the XXI century), plus a pretty good one (XCode + a hack);
- Access to those millions of lines of code in Java classes;
And last but not least : Integration. This is the one that's going bring it home.
With Jruby and a rails plugin called GoldSpike (previously rails-integration) we're a simple rake command away from turning any Rails app into a standard WAR file, which in turn can be deployed in either Tomcat or Glassfish or presumably just about any other applet container.
What this means is, in an enterprise environment where you have all these layers (think MVC in different LAN segments) set up and where any innovation is foreseen as potentially disruptive if not outright forbidden, we can easily introduce Ruby and Rails code, and from a manager's point of view its a win-win situation where the developers get things done faster, and the implemented structure is maintained without any hiccups. And they still get Sun's level of support.
In parts II and III I'll be showing some code and examples of rapid deployment with JRuby.
I've always been one to dislike repetitive tasks. I think it's partially because I find it hard to concentrate for a long time on tedious chores and partially because I fear getting carpel tunnel syndrome.
Just this weekend my "disability" was put to the test. I found myself going trough 8 GB of assorted files (note to self: do _not_ label zipped backups "stuff"...) trying to find a couple of pictures I wanted my girlfriend to see. I didn't know the filenames (note to self: rename the pictures I like because PIC00731 or DSC00239 aren't real _names_) or the time stamps.
Know, if I was "doing" Windows, I would pull out one of my 50+ lines VBS's, but that wouldn't get me no lollypop. I might had tried a bash-slash-perl trick to move only a couple of selected filetypes onto a new folder, but that wouldn't get me too far either since I would still need at least one more action to open all of them. And my girlfriend would leave before waiting for me to get the script right....
The solution ended up being my new favorite Mac OSX app. Automator.
Automator comes bundled with OSX 10.4 and basically it's a tool that provides you with a way to visually set up a group of actions that get a specific job done. And they call it a workflow, which pretty much sums it up.
Although you would use it to build a program, the programming background needed to use is zero, and the learning curve is neglectable.
After analyzing my specific needs, I came up with this list of necessary steps:
1 - specify the main folder;
2 - get the folder contents, repeating for each of the subfolders;
3 - filter the specified finder items by file type;
4 - decide what to do with them, in this case, I wanted to open the images in Preview so i could see them and find the ones I really needed.
And this was what I got:
Not bad huh?
By selecting and dragging the specific actions from the action list on the left to the right side pane and then changing a couple of options I was done! I saved it as an Application, runned it and 2 minutes later I was seeing the images trough Preview's Slideshow feature.
Fez esta semana anos que estudantes e outros bebados se juntaram numa manifestação sem precedentes na praça de Tiananmen para gritar pelo benfica e lutar pela democracia na china. Também fez anos a Angelina Jolie, mais merecedora de manifestações e apelos, mas muito menos interessante enquanto fenomeno social.
Em Rostock esta semana houve (uma vez mais) confrontos numa manifestação organizada como protesto anti-globalização, o que prova que quase vinte anos depois e a quase meio mundo de distancia, um pais moderno e democratico também consegue atiçar a policia sobre jovens manifestantes e tudo em nome da defesa daquilo em que acreditam. Se não é a ordem e disciplina chinesa, então que seja a democracia capitalista ocidental.
Este semana morreu um blogger, um fotografo, um amigo, um professor, um ser humano de fazer corar de humildade qualquer palerma que se ache com alguma piada ou que julgue perceber alguma coisa sobre alguma coisa.
Não há ninguem que tenha frequentado o IADE (ou que conheça alguém que tenha frequentado o IADE) que não tenha ouvido falar do Prof. Roberto.
A sua perda é irreparavel, mais de 600 comentários no seu ultimo post e a multidão no seu velório ontem á noite dão-me razão. Muitos mais nunca o esquecerão.
morabeza roberto!
Well, after much consideration and hearing lots of opinions (which I respectfully considered and discarded) I've decided to stay at my current job for now.
You know, sometimes it's not just about the money for me. I would miss the friends I've made (I can't believe I keep calling my coworkers "friends") and I would miss Solaris. And AIX, and Informix and Perl and... and to be completely honest, the offer wasn't all that you know? I mean, I actually heard the words "We only sell Microsoft technologies because if we didn't they would badmouth us to our potential costumers" and _that_ is something I want to stay away from.
And yeah, the title of this post is a reference to "batman and robin", because that's how I feel sometimes when I'm working with likes of "no-time-to-blog"er, penantes, "still offline" sab and "blogui? isso não é da SUN não" alex.
...And I _do_ mean the fellowship part, not the homosexual connoted male in tights thing, ok???
Tags: fun, jobs and career, me
"As the climate grows more and more desperate for record labels, their answer to their mostly self-inflicted wounds seems to be to screw the consumer over even more. A couple of examples that quickly come to mind:
* The ABSURD retail pricing of Year Zero in Australia. Shame on you, UMG. Year Zero is selling for $34.99 Australian dollars ($29.10 US). No wonder people steal music. Avril Lavigne's record in the same store was $21.99 ($18.21 US).
By the way, when I asked a label rep about this his response was: "It's because we know you have a real core audience that will pay whatever it costs when you put something out - you know, true fans. It's the pop stuff we have to discount to get people to buy."
So... I guess as a reward for being a "true fan" you get ripped off.
* The dreaded EURO Maxi-single. Nothing but a consumer rip-off that I've been talked into my whole career. No more.
The point is, I am trying my best to make sure the music and items NIN puts in the marketplace have value, substance and are worth you considering purchasing. I am not allowing Capital G to be repackaged into several configurations that result in you getting ripped off.
We are planning a full-length remix collection of substance that will be announced soon."
You might have heard me drool about having helped implement the first Rails app at work.
If you read this blog regularly, you might even know that this was a project done in collaboration with penantes.
Now, what has been missing is an overview of the technology used and a brief explanation thereof.
The project itself is little more that a web-based front-end to penantes's voodoo-like perl scripts and it's purpose is solely of giving interested parties a better view of the spell's script's results.
Well, we had an old Dell Poweredge laying around, so that was the machine used. It had an ancient implementation of Red Hat 8 (actually. I think it was vd who installed it) so that had to go. Not so much because it was old, but because it was Red Hat. And no noticeable services running around so a clean install it would be.
For OS we chose FreeBSD. We wasn't our first choice, but Ubuntu didn't correctly recognize the SCSI controllers and the openSolaris DVD was well...a DVD, and Debian 4 was late. The machine at this time didn't have a working network connection and only a CD drive for media. Since FreeBSD is a distant cousin from both Solaris and Mac (I just had to bring this up) it was the next best thing.
The install was easy enough and the software available was pretty much all we needed.
For web serving we have Apache, for database we used Mysql, and has i've said, we used Rails for development. And apart from configuring Apache with fcgid which is a hole new post subject, everything runs just fine for now.
Recommended reading Rails on FreeBSD wiki page.
(*) in case you didn't notice....
FreeBSD
Apache
Rails
Mysql
Recently i've been reading a fellow *'s musings on job searching and expectations and focus on career management, and although I mostly agree with his opinions and objectives, I can't stop but wondering if I (or most people, for that matter) can afford to be as straightforward as he seems to be.
In my career, and up until some 6 months ago, I've been mostly involved with Microsoft products and technologies. I've developed, administrated and and maintained applications, databases, systems and networks. However, Linux and Open Source in general have been my hobby and, i dare say, passion for the last 8 years or so. Cutting a long story short, in a Windows world I'm (somewhat) highly valued, but in a Unix\Linux context, I'm bound to be considered a junior staff member for a couple of years more.
Now, if the job title doesn't really bother me, the difference in wage is staggering. Enough to make me consider a jump back.
All this is only important when I'm faced with a difficult decision like I am right now.
I've managed to get a good deal of respect and appreciation on my current job, I've been involved with some very interesting technologies and have been given the chance to use Open Source technologies and am currently in the process of finishing up my first professional (cof...cof...) Ruby on Rails application, but the wage is ridiculous.
On the other hand, I have an offer to get back to a development only a sysadmin only position, but using .Net and other mostly Microsoft technologies. The pay is good, the challenge is well, challenging and the work environment as far as I could gather so far is very good. On the downside there will be plenty of grey suits and ties in my future. And a senior colleague who thinks rails is amateurish. But the boss says I can use whatever technologies I see fit to get the job done. And they both actually read my resume. And want _me_ to work for them.
Well, as you might have guessed the wage is the only thing that's making me consider the change, and the love for open technologies the only thing thats keeping me back.
In a ideal scenario I would refuse the change hands down, but these are not ideal times, so I'll have to sleep on it and hope for the strength to make the best decision.
Well things change quickly when you let them. There was a sysadmin position available too, and although I refused the developer job, I'll most likely be accepting the later. Stay tuned....
Tags: jobs and career, me, opinion
As seen on The freedom blog...
"Linux hackers! They aren’t smart enough to scare Bill Gates… and they certainly aren’t smart enough to scare Jesus. Did you know that He protects this website too? I prayed it, and it happened! All attacks rebuffed! All sin kept far from these pages.
Thank you Lord!"
By the way, did you know that if you use Ubuntu Christian Edition you can stop daemons with the command "Exorcize!" ? And that you can use "bless" whenever a program fails to start? Just beware not to issue a "chmod 666" , or you'll go to hell!!
Oh @wathever, forgive them, for they are funny. Seriously, I thought that sarcasm was beyond americans.
Year Zero, Nine Inch Nails new album was officially released today. And a few more surprises came with it.
After hearing it on repeat for about 3 hours, when i finally removed the cd from my macbook, the CD had turned from grayish into white revealing some binary code that (after some googling) "I" discovered could be translated to a link to another secret site!
And i though that it was just my macbook going _Extra_ hot this time!!
This is the beginning....
Red Hat Storage Management
Indie Lisboa
Linux 2007
E-MKT 2007
And what about the rest of us who don't have the gift of ubiquity?