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()