Warning: file_get_contents(http://www.prelovac.com/deploy.csv) [function.file-get-contents]: failed to open stream: HTTP request failed! HTTP/1.1 403 Forbidden in /accounts/giovannidimilia/www/dimilia.it/wp-content/plugins/wp-quick-deploy/wp-quick-deploy.class.php on line 437
Archive Computer Science | Giovanni Di Milia
Jan 28 2014

Pain with Bottle.py app and PyDev debugger

Giovanni

Since it took quite a bit of time for me to figure out the solution to this problem, I decided to write a quick reminder here.

I was working on a web application written in Bottle.py and everything was going smoothly until I decided to debug a function using the PyDev debugger in Eclipse.

Long story short there was no way to make the debugger work even if the same debugger was working perfectly fine in the unit tests.

After several tests I was able to understand that the PyDev debugger is incompatible with the option “reloader=True” of the bottle app.

So you can run your app in this way:

application.run(host=your_host, port=your_port, debug=True, reloader=True)

and it is wonderful because the app will reload by itself every time you change a python file,

but if you want to run the code in the PyDev debugger you need to start your app in this way:

application.run(host=your_host, port=your_port, debug=True)


Aug 3 2012

virtualenv and .bash_profile

Giovanni

Just a reminder… mostly for myself: 
the aliases set in .bash_profile are considered ALWAYS first, even if you are in a python virtualenv environment.

This means that if you have (like I do) an alias to a particular instance of ipython with the name “ipython” and in virtualenv you install ipython as well, if you simply type “ipython” the first (with all its libraries) will always be called!

 


Jul 6 2012

Thoughts with a slow connection

Giovanni

A travel to Italy has been for me like a time travel!

I still remember when I used to surf Internet with my old pc with Windows 98SE and my modem 56Kbps!

Life was different: waiting for a web page to come up was not a big deal… it was part of the experience!

Well… Thinking better about it, probably the websites were designed differently with more text, less images and for sure no JavaScript! In total not so many KB of data to download per page.

Now even my grandma (if she was still alive) would know that Internet and its websites are much more complex and heavier!

But who cares?!? There are cheap wired connection at 15Mbps, there is 3G everywhere and 4G is coming out all around the world!

It is really simple, isn’t it?

Well it’s not at all!!!

In my travel in Italy I have spent time in a little village where there is no 3G and it’s hard to find an open hotspot!

The result is me using 2G (GPRS) struggling with any single web page, waiting even minutes to download some content!

In this situation do you know what I learned?

1- Smartphone apps work better than websites mobile oriented: I think the reason is that the apps download only content while the websites, even if are less complex than the desktop ones, still make you download tons of data!

2- There is way too much unnecessary content in any single web page: there are ads, related but not really relevant infos and A LOT of images: KBs that my browser downloads in a huge amount of time!

3- Some key services like bank and credit card accounts, utilities and so on most of the times don’t have a mobile version of their website but only an app that you cannot download because it is simply too big for your connection speed! This is unacceptable! If I need to access my bank account to pay the credit card, I do want a skinny website I can access with any crappy connection!

But more in general: why there are such morons that design these websites assuming that everybody has access to broadband?!?

A website should be self adaptive! There are technologies to do this, to remove unnecessary content based on the time the data is downloaded! In this moment I have at least 3 different ideas to do it and I didn’t even consider special setups of the web servers!

Never never never assume anything! If you have a website that can be necessary to someone, you must provide access even in difficult condition!

Greetings from the (Internet) Paleolithic!


Apr 3 2012

OS X Lion and MacPorts: how I made it work

Giovanni

Recently I received my new MacBook Air 13″ (sadly my old MacBook Aluminium is almost dead) and among all the problems I have with Lion probably the one I have with MacPorts is the most frustrating!

Someone can object with “why don’t you use Homebrew? It’s much better than Port because BLAH BLAH BLAH BLAH BLAH”, but I don’t care: I want Port working, not something else!

So after some searches around I found something that “magically” fixed everything.

The problem seems to be related to a missing setting after the installation of the Xcode. In particular the installation of the Xcode from the App Store (besides not installing by default the “Command line tools”) doesn’t set the “xcode_folder_path”.

To check if everything works it’s enough to run:

/usr/bin/xcodebuild -version

This gave me back:

xcode-select: Error: No Xcode folder is set. Run xcode-select -switch to set the path to the Xcode folder. Error: /usr/bin/xcode-select returned unexpected error.

Well, now the solution is clear! It’s enough to set the xcode_folder_path!

So I run:

sudo /usr/bin/xcode-select -switch /Applications/Xcode.app/Contents/Developer

where

/Applications/Xcode.app

is the path of the Xcode application installed through the App Store.

Now if you run again:

/usr/bin/xcodebuild -version

you will have

/usr/bin/xcodebuild -version Xcode 4.3.2 Build version 4E2002

All the Ports now should work! Well…. for me now they work!


Oct 11 2011

At school… part #2

Giovanni

It’s a while since I begun my online course! Actually in 3 weeks I’m done!

How is going? Great! I know I don’t know everything about web programming, but this course is really opening my mind!

The great part is that even if it should be dedicated to mobile, there are so many good advices for general web developing that it will be worth even if I’ll never develop anything for the cellphones!

I think I’ll collect some good link and I’ll post them at the end of the course!

Be tuned!