Jumpi’s Notepad

My annotations about the life, universe and everything!!! ;)

Archive for the ‘english’ Category

Visualizing Floats

with 2 comments

Continuing the posts about data types and your characteristics, I read a nice article about Floating point numbers published by gamasutra:

http://www.gamasutra.com/view/feature/1965/visualizing_floats

See ya!!!

Written by jumpi

January 14, 2009 at 3:50 pm

Posted in Math, Programming, english

The Practice of Perl II

with one comment

Upon requesting made and continuing my posts about perl practicality, show here a very elaborated code, extract from classic book that I have reading again, Pike & Kerninghan Practice of Programming.

Yes, this book have a very interesting example of Markov Chains in perl.

For those that dont knowing about Markov Chains, this is a particular case in stochastic process, where previous states are irrelevant for prediction of following states, since that actual state is knowing. This technique is very used for generate random text, as in the book example, but, the author uses only cases that envolve two-word prefixes, for test effects.

The code used in the example, written in perl language:

$MAXGEN = 10000;
$NONWORD = “\n”;
$wl = $w2 = $NONWORD;
while (<>) {
foreach (split) {
push(@{$statetab{$w1}{$w2}}, $_);
($w1, $w2) = ($w2, $_);
}
}
push(@($statetab{$w1}{$w2}}, $NONWORD);
$w1 = $w2 = $NONWORD;
for ($i = 0; $i < $MAXGEN; $i++) {
$suf = $statetab{$w1}{$w2};
$r = int(rand @$suf);
exit if(($t = $suf->[$r]) eq $NONWORD);
print “$t\n”;
($w1, $w2) = ($w2, $t);
}

And more impressive is what the result is make of simple and rapid form, very rapid, in the final of chapter has a performance table where perl losing only for C implementation, other implementations are written in Java, C++/STL/Deque, C++/STL/List and AWK, being that have 150 lines of code in C versus only 18 in perl.

Well, I dont make apologies to perl, because I love C too, but, as the author says and define in the final of paragraph, scripting languages (perl, in this case) are a good choice for experimental programming and making prototypes, and I conclude, for rapid tasks and tests, perl is again language of my choice.

Written by jumpi

January 6, 2008 at 8:43 pm

Posted in Programming, english

Tagged with , , , ,

The Excel 2007 Bug

with 4 comments

About the bug that affected Excel 2007, I think that is very hard to work with floating point calculations and approximation is very complex and find a problem in logic of this is a true nightmare!!!!

The summary of problem: Excel 2007 store six floating point numbers using binary representation between 65534.99999999995 and 65535, and dont store six between 65535.99999999995 and 65536 and this numbers are the cause of this problem.

I work with arbitrary precision in my scientific intiation and using libraries for care of this part for me, because of difficulties that involve the manipulation of calculate numbers that need arbitrary precision. IMHO, working with type of development demands very attention and very pacience.

The two links have a good explanation of this problem… Its a good lecture!!!

The Excel Bug Explanation by Good Math, Bad Math Blog
The Excel Bug Explanation for Mathematica Developers Blog

See ya people and have a good fun!!!

In play: Emerson, Lake and Palmer – Works (Black) Vol. 1 – 07: The Enemy God

Written by jumpi

October 3, 2007 at 8:54 pm

Posted in Math, Programming, english

Tagged with , ,

Really, Code::Blocks Rocks!!!

with 2 comments

Really, Code::Blocks Rocks!!!

Well… after a long time I post here again, because of this IDE… yeah… a many time that I try to test it and after tests of my friend Marcio that use and talk about the tool I decided test too. I’m very surprise with this IDE, the installation is very easy and work with this IDE is very easy too… I install it in my VM with WinXP and I testing the OpenGL app and it works very fine… The OpenGL app works fine in my VM too, in considerable time… I decided now use the Code::Blocks for developing my personal project at this time!!! Its convinced me!!! :D

Today, after reading some pages of the Programming Challenges Book I’m trying applying some memoization and dynamic programming techniques for solve some problems in SPOJs and UVA’s online-judge of life. Its a very utility tool for solving many problems. But I need more training for good application of this. I like this… :D

In play: Bruce Dickinson – The Very Best Of (CD 1) – 02: Tattooed Millionarie

Written by jumpi

September 15, 2007 at 11:13 pm

Posted in Programming, english

The Practice of Perl

with one comment

Well.. a sugestive title for an post, but I decide for this title because of Perl is one of my prefer programming languages, my “swiss army knife”… and dont first time that I using perl for solving my problem… ehehehhehehehhee…

But why I talking about perl here??? Because of one problem, for more exactly, the problem 5 of Project Euler (http://projecteuler.net/), a site with mathematical problems that resolve with the use of algorithms. The problem 5 it follows below:

2520 is the smallest number that can be divided by each of the numbers from 1 to 10 without any remainder.

What is the smallest number that is evenly divisible by all of the numbers from 1 to 20?

I trying resolve this using C, but I dont have an simple compiler in my work machine,because in my opinion, Visual C is much complex for this task… (some of my friends dont think it…)

But I think… I have perl interpretor in my machine and write this program in perl dont much harder and I starting the port of C for Perl and write this piece of code for solving my problem:

for ( my $n = 20; 1; $n++ ) {
for ( 1..20 ) {
if ( $n % $_ ) {
last;
}
if ( $_ == 20 ) {
die $n;
}
}
}
Well… is an idiot program, extremaly simple but I have the answer of problem with this… dont consider the execution time, “only” 20 min of the pure brute force for answering the problem… ehehhehehehehehhehe…

And perl with your practical syntax save my world one more time!!!! :D

In Play: Gorguts – The Erosion of Sanity – 04: Orphans of Sickness

Written by jumpi

August 9, 2007 at 4:22 am

Posted in Programming, english

You’re Perl

with 3 comments

After long time that dont post here… I’m posting here again the result of language test that I see and answering… :D

Ohhhhhhh… This test is very funny!!!! Perl is my favorite language for write scripts… I like this…

You’re Perl

“You are Perl. People have a hard time understanding you, but you are always able to help them with almost all of their problems.”

For all that answering the questions too, the phrase above contains the link!!!

Thanks for all that see this blog… :D

Written by jumpi

April 30, 2007 at 5:07 pm

Posted in Pessoal, english

Love and Tensor Algebra

without comments

Come, let us hasten to a higher plane
Where dyads tread the fairy fields of Venn,
Their indices bedecked from one to n
Commingled in an endless Markov chain!
Come, every frustrum longs to be a cone
And every vector dreams of matrices.
Hark to the gentle gradient of the breeze:
It whispers of a more ergodic zone.
In Riemann, Hilbert or in Banach space
Let superscripts and subscripts go their ways.
Our asymptotes no longer out of phase,
We shall encounter, counting, face to face.
I’ll grant thee random access to my heart,
Thou’lt tell me all the constants of thy love;
And so we two shall all love’s lemmas prove,
And in our bound partition never part.
For what did Cauchy know, or Christoffel,
Or Fourier, or any Bools or Euler,
Wielding their compasses, their pens and rulers,
Of thy supernal sinusoidal spell?
Cancel me not – for what then shall remain?
Abscissas some mantissas, modules, modes,
A root or two, a torus and a node:
The inverse of my verse, a null domain.
Ellipse of bliss, converge, O lips divine!
the product o four scalars is defines!
Cyberiad draws nigh, and the skew mind
Cuts capers like a happy haversine.
I see the eigenvalue in thine eye,
I hear the tender tensor in thy sigh.
Bernoulli would have been content to die,
Had he but known such a^2 cos 2 phi!

Written by jumpi

March 4, 2007 at 2:47 am

Posted in Math, english

goto problems;

without comments

Ohhhhhhhh… very funny… Suddenly all very confused again for me… I dont speaking about… I dont have time for nothing… I’m dont have time for thinking… I’m have very things… studies, work… at last… one day I think who this suffering finish… The good is who I’m returned make all things of my past, music, sports… well… I’m waiting!!!

I’m returning for my home motivated for working in my website, I’m make a general remodel, but I’m prefer see one documentary about Heavy Metal Story and this documentary is very funny…

Well… now I’m waiting for Carcass video conversions for putting in my iPod… :)

Thkz ppl… and c’ya… :)

________________________________________________________________________________

Caramba… que engracado… De repente tudo comecou a ficar tao confuso de novo… nem sei o que dizer… ando sem tempo para nada… nem para pensar eu tenho tempo… sao tantas coisas… estudos, trabalho… enfim… um dia acredito que esse sofrimento acabe… ohhhhhhhhh se acaba… o bom e que tambem aos poucos estou voltando a fazer tudo que abandonei no passado… musica, esportes… enfim… vamos ver no que vai dar ne???

Voltei para casa hoje empolgado para mexer no meu site… ia fazer uma reforma geral… mais estava passando um documentario sobre a Historia do Heavy Metal na TV e preferi assistir… por sinal foi bem divertido…

Well… agora deixa eu esperar terminar a conversao dos shows do carcass para jogar no meu iPod… :)

E isso ai galera… ate a proxima… :)

No play: Blackstar Rising – Barbed Wire Soul – 07: Revolution of the Heart

Written by jumpi

February 23, 2007 at 2:34 am

Posted in Pessoal, english

Finally Free

with 3 comments

Imagine you entering in the people life, aren’t notice and you when dont wait, you find one special people, you know with him, you life with him, you have a good and happy moments with him and when seen have all good, the people disappear of your life, as if it died and you have with empty feeling… and killing yourself, its horrible…

All time who listen this Dream Theater album (SFAM – Scenes From a Memory), mainly this song, I have this sensation, the strange sensation… Yesterday in my car I have hearing this album and I have much sincerity… I’m crying… Why??? I dont know… Perhaps either the sensation…

Well… who understand it ????

______________________________________________________________________________________________________________________________

Imagine você entrando na vida das pessoas, sem que elas percebam e quando voce menos espera tem um encontro com uma pessoa especial, vai conhecendo-a, vivendo com ela, tendo momentos bons e felizes e quando parece estar tudo certo a pessoa some, desaparece da sua vida, como se ela morresse e voce fica com aquele sentimento de vazio… E voce acaba se matando… Horrivel isso….

Porem toda a vez que escuto esse album do Dream Theater, principalmente essa musica… tenho essa sensacao… uma estranha sensacao… ontem no carro estava a ouvir esse album e vou ser bem sincero… ate acabei chorando… o porque??? nao sei… talvez seja a sensacao…

Bem… vai entender ne???

Listen: Dream Theater – Score (CD 1) – 05: Under a Glass Moon

Written by jumpi

February 14, 2007 at 1:23 pm

Posted in Pessoal, english

Freshmeat is back!!!

without comments

Well… after a long time all we back… with some changes and a new member… Elaine is the new Freshmeat singer… well… today is very funny… we have a little problem because I need to obtain a guitar for Alex… but we very amuse… we playing some megadeth songs and we have starting a make a little intermeshing, finishing the time… but have very funny…

Well… talking about weekend… I’m dont have much talking about… Its very funny… I’m making very things… I’m go to cine, I’m playing, I’m go to circus… well… I’m very like!!! its very funny and go to more thus happy weekends….

________________________________________________________________________________________________________

Well… depois de tanto tempo… estamos de volta a ativa… com algumas mudancas e novos membros, como a Elaine que e a nossa nova vocalista… enfim… hoje o ensaio foi deveras divertido… tirando que chegamos atrasados pois eu tive que arrumar uma guitarra para o Alex… nos divertimos a beca… tiramos alguns sons do megadeth e quando estavamos comecando a criar um certo entrosamento, acabou o horario… mais foi divertido…

Bem… quanto ao fim de semana… nem tenho o que dizer… foi super divertido… fiz varias coisas… fui ao cinema, toquei, fui ao circo… enfim… adorei… foi super divertido… e que venham mais fins de semana felizes assim… :)
Listen: George Harrison – The Best Of – 13: What is life

Written by jumpi

February 12, 2007 at 1:30 am

Posted in Pessoal, english