Paul in My Bedroom




My mom fixed a Paul McCartney's Disco in my bedroom wall.

Interstellar Overdrive


The Hyperdrive is the most famous way to travel more fast than the light. The hyperdrive puts the starship into other dimension, where it can cover vast distances in an amount of time greatly reduced from the time it would take in the"real" space and the travel will be without the time dilation predicted by the Theory of the Relativity.

It was formulated by David Hilbert in a article called "The Foundations of Physics" describe the consequences of the Relativity, when a thing in a interaction with a stationary mass is in a speed superior to 0,5c, the result is that the stationary mass will repel that thing it will generate a propulsion.

The LHC will test this propulsion and you can be a archive about it here: http://arxiv.org/abs/0910.1084

Another article that I recommend is this: http://omnis.if.ufrj.br/~mbr/warp/alcubierre/cq940501.pdf They talk about the mathematics behind the Hyperdrive Propulsion.

The Sir Method in Python



It's a method created by Sir Isaac Newton to calculate the number Pi.
See the code:

2*sum([ float(map( lambda n:reduce(lambda a,b:a*(b+1),range(n),1) ,range(0,50))[i]) / map( lambda c: reduce(lambda x,y: x*y ,c) , [range(1,n,2) for n in range(3,101,2)])[i] for i in range(0,33)])

And see a draw
https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhfn2ZVx9RqRIO9tpKVSy5F6HrHM1cX31oeE8bzaNTkRhiTxrm2z2tG2NMyIMir4q2MN4qnLPl_BzNVheNdSLGyOo70YuBWGVO3NHjvsR2MnPZbyjwlUKK1bU0-gLW5TFkfrKqHlPUkCoo/s1600-h/Newton.png

The best english band since The Beatles [Damien Hirst]

Damon Albarn sing while Graham Coxon play your Fender Telecaster, Alex James play the Fender Precision Bass and Dave Rowntree is with a Pearl Drum

Yeah, Blur is my favorite 90's band. Remember when in December of 2008 I watched in TV the Bittersweet Bundle of Misery, and resolved search about Graham Coxon and discover Blur.

I was there(or one of the happiest day of my life)


If you are good try to find me

It's from times ago

Status icon in C (GTK+)




#include
void tray_icon_on_click(GtkStatusIcon *status_icon,
gpointer user_data)
{
printf("Clicked on tray icon\n");
}

void tray_icon_on_menu(GtkStatusIcon *status_icon, guint button,
guint activate_time, gpointer user_data)
{
printf("Popup menu\n");
}

static GtkStatusIcon *create_tray_icon() {
GtkStatusIcon *tray_icon;

tray_icon = gtk_status_icon_new();
g_signal_connect(G_OBJECT(tray_icon), "activate",
G_CALLBACK(tray_icon_on_click), NULL);
g_signal_connect(G_OBJECT(tray_icon),
"popup-menu",
G_CALLBACK(tray_icon_on_menu), NULL);
gtk_status_icon_set_from_icon_name(tray_icon,
GTK_STOCK_MEDIA_STOP);
gtk_status_icon_set_tooltip(tray_icon,
"Example Tray Icon");
gtk_status_icon_set_visible(tray_icon, TRUE);

return tray_icon;
}

int main(int argc, char **argv) {
GtkStatusIcon *tray_icon;

gtk_init(&argc, &argv);
tray_icon = create_tray_icon();
gtk_main();

return 0;
}

Maxwell.py - eletrocmagnetism and Python

Hi folks, I get back with the blog. I brought here a code that I wrote in 2009, December. I was fascinated by the electromagnetism and I wanted to try some lib to plot graphics in python.

So I do a small program that calcule the eletric force in a spire inside a magnetic fiel that grows with a 2º grade polynomial.
This was wrote in the Tkinter GUI. See some screenshots:




Now see the code:

#! /usr/bin/env python
from pylab import *
from Tkinter import *
import tkMessageBox

class GuiFramework(Frame):
def __init__(self, master=None):
Frame.__init__(self,master)
self.master.title("Maxwell.py")
self.grid(padx=10,pady=10)
self.CreateWidgets()
def CreateWidgets(self):
self.a = Label(self, text="A:")
self.a.grid(row=0, column=0)
self.b = Label(self, text="B:")
self.b.grid(row=1, column=0)
self.t = Label(self, text="T:")
self.t.grid(row=2, column=0)
self.ra = Entry(self)
self.ra.grid(row=0, column=1, columnspan=3)
self.rb = Entry(self)
self.rb.grid(row=1, column=1, columnspan=3)
self.rt = Entry(self)
self.rt.grid(row=2, column=1, columnspan=3)
self.btn = Button(self, text="Calcule", command=self.Calcule)
self.btn.grid(row=2, column=4)
self.plot = Button(self, text="Plot", command=self.Plot)
self.plot.grid(row=0, column=4)

def Calcule(self):
r = 2*int(self.ra.get())*int(self.rt.get()) + int(self.rb.get())
tkMessageBox.showinfo("Text", "Eletric Force: %d" % r)

def Plot(self):
t = arange(0.0, 10.0, 0.01)
s = 2*int(self.ra.get())*t + int(self.rb.get())
plot(t, s, linewidth=1.0)
title('F(t)= 2.t.A + B')
grid(True)
show()

if __name__ == "__main__":
print "\n \n Maxwell will go calculate the eletric force necessary to put a ring in equillibrium second the Faraday/Lenz law. The magnetic flow grow with a polinomiun equation:\n\n at^2 + bt + c "
guiFrame = GuiFramework()
guiFrame.mainloop()