2009/06/02

Picasa - Delete Annoying ".picasaoriginals" Space Consuming Folders

Did you ever notice that Picasa creates a backup of any picture that has been modified? I could never find an option to suppress that behavior. I mean, I know what I am doing; I do not want to have extra copies of my pictures laying around and taking up all my disk space.

So I built a small applicaiton that lists the ".picasaoriginals" folders location under the folder where the Python script is run from. It lists the content of the ".picasaoriginals" and prompts the user for deletion. You can view the code here. It is only a few dozens lines long so just copy/paste to a .py file if you want to use it. It is written in a Python 3.0.

Here is an example of the command-prompt interation with the program.
python DelPicasaOriginalBackups.py

Folder:
C:\pics\09-01-03 - Montreal\.picasaoriginals
Content:
{IMG_7432.jpg,IMG_7433.jpg,IMG_7434.jpg}

Do you want to delete the following folder and everything in sub-dirs?
C:\pics\09-01-03 - Montreal\.picasaoriginals
N/Y?
Hope it is useful. Feel free to post any comment/suggestion.

2007/09/03

pyWeightWatch: Monitor your Weight Efficiently

pyWeightWatch: Monitor your Weight Efficiently


Installation:



Just unpack the .exe in a directory, then run pyWeight.exe.

The program is going to ask you how much you weight now. Jump on a scale and enter your weight.

The program will automatically generate a graph of your weight over time.




This is what the program generates for me:


Usage:

Enter today's weight and see the graph/save to .png:
pyWeight.exe
Just update the .png file with the data contained in Weight.xml:
pyWeight.exe -u
pyWeight.exe --update

Download:

pyWeightWatch v1.0 (source here)


Future features:

-Interpolation and prediction
-Better labelling
-XML indexed by date and weight, should extract all weightelement and then extract the weight and date.
-Leave some space in graph (not just the extremum of the data)
-Build Weight.xml if not present/valid

[Generated at: 2007_09_02_14h21m16s]

2007/08/30

ScreenSpy: New Release V1.1

ScreenSpy: New Release V1.1




You can download it here:

ScreenSpy v1.1 (Win, Unix, MacOS) -- Includes source code.

ScreenSpy v1.0 (Win, Unix, MacOS) -- Includes source code.


Usage:

java -jar ScreenSpy.jar ftp.domain.com username password 1000

or, for the win32 .exe:

Screenspy.exe ftp.domain.com username password 1000

This would start sending the screenshots to "ftp.domain.com" once every second.


Changes:



V 1.1:

-Smarter naming of pictures (for example: Thu_Aug_30_06-57-19_.jpg)

-Always delete the file on exit. X

-Option to select the amount of time in between screenshots.



V 1.0:

-Initial release





It will run on all major platforms give you have a java virtual machine installed (www.java.com). I also included a win32 binary.



Have fun!

[Generated at: 2007_08_30_07h41m06s]

2007/08/21

Draw simple graphs with DOT

A quick and painless way to generate directed and undirected graphs under windows / Linux.
The DOT language is useful because it can be easily generated by a script and hence can be used to automatically generate documentation.
It is also useful to quickly draw a professional looking graph without having to use a graphical interface.

Example:



Here is a simple graph:


Do you get it? Visit my blog often and you will never need time or ideas again to solve your problems!

Here is the .dot script that generated the graph.

Source Code: [File=Graph.dot]



digraph G
{
Computer -> David;
Problem -> David;
Time -> David;
Idea -> David;

{rank=same; Problem; Idea; David; Computer; Time;}

David -> Blog;
Problem -> You;
Blog -> You [dir=both, color=lawngreen, style = bold];
You -> Solve;

You [shape=box]
Problem [shape=tripleoctagon, color = red, style=filled, fillcolor=yellow]
David [label = "David Malin", shape=box]
Blog [label = "davidmaling.blogspot.com", shape=diamond, fontsize=15, color=steelblue3]
}


The following command will compile the .dot file into a png image:


dot -Tpng -O Graph.dot


Neat no? The program (dot) can be obtained here:
http://graphviz.org/

You can read the wikipedia entry about dot:
http://en.wikipedia.org/wiki/DOT_language

... or download a more complete documentation here:
http://graphviz.org/Documentation/dotguide.pdf

Graph on!

P.S: Send me your home-made graph and I will post it on the blog. :)

[Generated at: 2007_08_21_01h34m18s]

2007/08/16

pyScreenSpy, a Python implementation using Java libraries & JPython

I love Python, I dislike Java. But Java is maintained by a large corporation and has some tools that Python does not. It is possible to write a program in Python, using Python's core library and Java's library in the same program and compile it in a Java bytecode executable. All you need is to download and setup JPython. Here are the implications of developing a program using JPython:

Advantages:

  • Use both Java's and Python's libraries seamlessly in the same program.
  • Will work on all platforms that Java works.
Disadvantages:
  • Java's virtual machine is long to load (~3sec compared to Python's ~0.1 sec)
  • Some functionalities of Java and of Python are not available in JYthon, and the documentation about that is not very good.
As an example, I re-coded parts of the JScreenSpy application that I published a few days ago using JPython in 21 lines. This is just an example, I will re-release a fully working and ameliorated version (1.1) of JScreenSpy in Python in the following days.

Here is the source file, you can execute it using jpython pyScreenSpy.py
#Pythons imports
import os

#Java Imports
from javax import imageio
from java import awt
from java.awt import image
from java import io

#Determine current screen size
toolkit = awt.Toolkit.getDefaultToolkit();
screenSize = toolkit.getScreenSize();
screenRect = awt.Rectangle(screenSize);

#Create screenshot
robot = awt.Robot();

#Take ScreenShot
image = robot.createScreenCapture(screenRect);
imageio.ImageIO.write(image, "jpg", io.File("test.jpg") );
21 lines, in Python, using Java's libraries. How cool is that? Very!