Month: April 2011

  • Gulf of Mexico oil spill

    While i was surfing on the web i found a video, in a blog post, which was published 3 days ago to remember the environmental disaster that was the last year’s oil spill. It’s a short animation that gathered the estimated amount of oil that went to the sea and tries to split it in his uses, to give us the notion of the real size of the damage.

    Take a look on one reason why it’s urgent to reduce our oil dependency.

  • E-mails: hours to seconds

    I remember those old times when i didn’t know nothing about computer programming and i was a member of the organization of the National Meeting of students of physiotherapy and after a conference about physiotherapy and spine related problems. At that time when we had to send some hundreds or even thousands of emails for other students and professional on that field, we spent hours or even days.

    One of the problems was that our email provider (Gmail) didn’t allow to send a single email for more than ‘x’ people or send more than ‘y’ emails a day,if you had exceeded the limit they would block your account for the next 24 hours. For that problem the solution is don’t use Gmail for what it isn’t intended for. There are plenty other services to do that.

    The other problem was the use of large files, full of emails adresses that we had to split through many emails. For this one, here is a possible solution, a script that connects to a SMTP server and sends the message to every contact in the “.txt” file.

    import smtplib
    from email.MIMEText import MIMEText
    
    def send_to_all(server,login,passwd,subject,msg, cfile):
    	contacts=open(cfile, 'r')
    	email=MIMEText(msg)
    	email['Subject']=subject
    	email['From']=login
    	
    	smtp=smtplib.SMTP(server, 465) #change for 587 if doesnt work
    	smtp.ehlo()
    	smtp.starttls() #comment this line if the server doesnt support TLS
    	smtp.login(login,passwd)
    	
    	for item in contacts:
    		smtp.sendmail(login,item,email.as_string())
    		
    	smtp.close()
    
    def main():
    	#Asks the info to the user
    	print "Server: "
    	server=raw_input()
    	print "Login: "
    	login=raw_input()
    	print "Password: "
    	passwd=raw_input()
    	print "Subject: "
    	subject=raw_input()
    	print "Message: "
    	msg=raw_input()
    	print "Contacts file: "
    	cfile=raw_input()
    	#sends the message to all contacts in the file
    	send_to_all(server, login, passwd, subject, msg, cfile)
    	return 0
    
    if __name__ == '__main__':
    	main()
    

    With this script you can only send simple text messages, but it might be usefull for someone anyway.

  • When UC website gets confused

    Bug or not, this is what happens when i try to access my university’s new website with two common browsers:

    UCbroswerfail2 UCbroswerfail

    Both browsers, at the time of the screenshots, were with their latest version and the message doesn’t always appear, that’s why i called it “confusion”. But the fun part is:

    UCbroswerfail3

  • Coimbra Startup Weekend: to go or not to go?

    coimstartweekend

    It seems to be a nice event and a well spent weekend with lots of things to be learned.

    I don’t know if i’m the kind of participant they are hoping for or even if i’m ready, but nevertheless i’ll stay tunned for more information.

  • Teleconferencing: The Kinect Way

    Well, i was reading some of my usual blogs and news websites, when i found an article about this new MIT Media Lab project, the same “guys” that brought to us the Sixth Sense idea (this one I posted in my old blog).

    I first saw the video in this engadged article and it looks awesome, please take a look at it:

    It looks great! right?
    I’ve done some research about this lab and it seems that they have lots of amazing ideas, i’ll try to follow and maybe write here a little bit more about some of their stuff that i find interesting.