(à partir des données du RENASS, Résau National de Surveillance Sismique )
Ce post est un "Google docs export" => page orginale à jour ici, dossier KML(s)
> KML des derniers tremblements de Terre
| |
Part of the externalization of my cognitive functions ... what ?
(à partir des données du RENASS, Résau National de Surveillance Sismique )
Ce post est un "Google docs export" => page orginale à jour ici, dossier KML(s)
> KML des derniers tremblements de Terre
| |
Publié par
francois schnell
à l'adresse
06:54
0
commentaires
Publié par
francois schnell
à l'adresse
07:32
0
commentaires
Python on OS X 10.5...
It is not recommended to mess-up with the Python 2.5 installed by default, and while wanting to install PIL and WxPython, I discovered and lost myself in the jungle of Python "distros" and their prerequisites (Fink, MacPorts, DarwinPorts, AciveState, MacPython ...)
In a hurry? go to the source: python.org (MacPython)
1) search and install the universal installer for OS X:
http://www.python.org/download/
This new Python will be the default one when you invoke "Python" in a shell.
It's installed in "/Library/Frameworks/Python.framework"
(the original OS X python is in: "/System/Library/Frameworks/Python.framework").
The new libs are in "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages"
2) download and install PIL, WxPython (or other packages) from:
http://pythonmac.org/packages/py25-fat
More informations about MacPython:
http://wiki.python.org/moin/MacPython
An interesting read about the Python distributions (especially in a scientific context)
Publié par
francois schnell
à l'adresse
03:00
0
commentaires
Flash player (used by Flex) has a very strict security policy: it's not possible to access public data from another domain than the one where your swf stands (unless a crossdomain.xml file is present on the distant server you want to access).
If the crossdomain file doesn't exist it is always possible to copy a minimal proxy file on your server (where your swf is present). This way flash player will communicate locally with the proxy, the proxy will give the result back to flashplayer, and there won't be any remote domain seen by flashplayer.
How-to use a proxy with Flex and Action Script3? (code and example)
Publié par
francois schnell
à l'adresse
09:41
0
commentaires
I was surprised by the lack of documentation( and working example) for this simple task.
Here's what I've got so far:
Publié par
francois schnell
à l'adresse
13:07
4
commentaires
Blogger is not really code friendly. You need to "escape" each tag (replacing <>). Also spaces disappear and you may need to add a "pre" tag.
As I'm learning Flex/Air I've developed a small on-line tool to automate the process if you need to paste HTML or tags/code:
BloggerPaste:
http://francois.schnell.free.fr/tools/BloggerPaste/BloggerPaste.html
If you have any comments or feature request thanks to let me know.
Publié par
francois schnell
à l'adresse
15:12
1 commentaires
Libellés : blogger flex
Google Earth is a powerful and beautiful application. Being able to control the globe, with few lines of Python code, makes you feel like you've got some god-like powers ;)
I've drafted here a short guide to show you how to start controlling Google Earth with Python (through its API COM):
http://docs.google.com/View?docid=dgqhgsgm_933rjw93
Publié par
francois schnell
à l'adresse
04:15
0
commentaires
Libellés : google-earth, python, windows
Most interesting tutorial I've found: http://boodebr.org/main/python/all-about-python-and-unicode
Keypoints:
* http://www.jorendorff.com/articles/unicode/python.htmlfrom my wikinote
* http://evanjones.ca/python-utf8.html
* http://vim.sourceforge.net/tips/tip.php?tip_id=246
* http://farmdev.com/thoughts/23/what-i-thought-i-knew-about-unicode-in-python-amounted-to-nothing/
Publié par
francois schnell
à l'adresse
13:20
0
commentaires
Iron Python Studio is a free IDE for Iron Python (Python for .Net).
You can develop command-line applications, Windows forms and WPF/XAML applications (see the project IronPythonScreenCast (wmv)).
Iron Python Studio has a visual designer for your GUI, code completion, debugger, etc (the usual tools of Visual Studio which makes in particular GUI development so simple).
It can use all the classes of .Net and also use the classic CPython (version 2.4 for now since this first version of the Studio is based on Iron Python 1.1)
More informations on my wiki note
Publié par
francois schnell
à l'adresse
14:11
0
commentaires
Libellés : .Net, IDE, IronPython, python
"Folder Guide" is a handy windows freeware to keep the most common folders you use at your fingertip.
Folder Guide is a free handy utility that provides fast access to your frequently used and favorite folders. It can operate as the part of your context menu in your Windows Explorer.
Publié par
francois schnell
à l'adresse
10:03
0
commentaires
I find optparse much better than getopt to get command line options.
The beast is explained here:
http://python.org/doc/lib/module-optparse.html
For example:
from optparse import OptionParser
parser=OptionParser()
parser.add_option("-f", "--file",dest="filename",help="a file to process")
parser.add_option("-r", "--repeat",dest="repeat",help="an integer")
parser.add_option("--dp",dest="directory",help="picture directory")
parser.add_option("-v",help="verbosemode",action="store_true",
dest="verbose",default=True)
(options,args)=parser.parse_args()
print options.filename
print options.repeat
print options.verbose
print options.directory
For flags, 'action' can be "store_true" or "store_false"
Publié par
francois schnell
à l'adresse
11:01
0
commentaires
To search for .jpg files in the folder "myfoder" you can do:
import os,fnmatch
for fileName in os.listdir ( "myfolder" ):
if fnmatch.fnmatch ( fileName, '*.jpg' ):
print "Found fileName ",fileName
Publié par
francois schnell
à l'adresse
08:52
0
commentaires
Exiftool is a Windows/Mac command-line app (or a muti-plateform Perl librairy) to read and write EXIF metadatas on certain file types.
In the following I will use .jpg files from my camera and the Windows .exe version of Exiftool that I will control in a DOS shell.
Want to see some EXIF metadata in your picture ?
$ exiftool mypicture.jpg
Want to extract the precise date and time when this picture was taken ?
$ exiftool -CreateDate mypicture.jpg
( Returns something "2007:02:10 21:19:43")
Want to write your picture was on the Eastern part of Greenwich meridian ?
$ exiftool -GPSLongitudeRef="E" mypicture.jpg
Want to write the exact the longitude value ?
$ exiftool -GPSLongitude="7.422809" mypicture.jpg
Want to write your picture is in the northern latitudes ?
$ exiftool -GPSLatitudeRef="N" mypicture.jpg
and give the exact latitude value ?
$ exiftool -GPSLatitude="48.419973" mypicture.jpg
Obviously you can combine the four tags above in just one line.
You can check everything went well with another exiftool mypicture.jpg (warning: if the app. doesn't understand what to do it didn't return me any error message by default ).
More informations about the GPS tags can be found here.
With this Free Software GPL command-line version it's now easy to integrate geolacalisation capabilities in a Python script for example.
I can upload my pictures on Flickr and they will show on the Flick maps but I still need to use the geocoding bookmarklet if I want to add the geotagged tags and the google maps.
PS: -n option gives you the latitude/longitude in the decimal form when reading these tags
PS: Python also have a nice similar library but I didnt' succeed to write GPS data with it,
http://www.emilas.com/jpeg/
Publié par
francois schnell
à l'adresse
10:43
0
commentaires
Libellés : command-line, flickr, geo, gps
From the wikipedia article:
In computer programming, a callback is executable code that is passed as an argument to other code. It allows a lower-level software layer to call a function defined in a higher-level layer.
Usually, the higher-level code starts by calling a function within the lower-level code passing to it a pointer or handle to another function. While the lower-level function executes, it may call the passed-in function any number of times to perform some subtask. In another scenario, the lower-level function registers the passed-in function as a handler that is to be called asynchronously by the lower-level at a later time in reaction to something.
Publié par
francois schnell
à l'adresse
00:53
0
commentaires
A quick solution using popen :
import os
result=os.popen('command').read()
print result
where command is your command (expl. on windows: dir,ipconfig,...)
If you expect more than a line and want each word in a list:
import os,string
result=string.split(os.popen('dir/w').read())
Source of this
Publié par
francois schnell
à l'adresse
09:28
0
commentaires
Two useful free software to complete my list of windows utilities :
Ditto is a very useful Open Source clipboard:
- history of text copies, images, screenshots
- enable hot keys, network sync, etc
SIW is a freeware which stands for "System Information for Windows"
- no installation required (can run on a USB key)
- hardware informations, temperature sensors, license keys, process, etc, etc.
Publié par
francois schnell
à l'adresse
06:28
0
commentaires
Pydoc
Python comes with a "pydoc" utility. On windows it is lacated in C:\Python2X\Lib (you may want to add this directory to your system path)
To produce an html documentation of a script or module type in a DOS shell (at the level of your script) :
pydoc.py -w nameOfYourScript
Warning:
- don't type the .py extension in the command above
- respect the uppercase and small caps even on windows.
- your script must have some docstrings
The above command produce a nameOfYourScript.html doc with the classes, methods, functions, etc.
Epydoc
For a more powerful and complete alternative I use the excellent Epydoc that you can download here:
http://epydoc.sourceforge.net/
On windows after the installation you can find the epydoc script in C:\Python2X\Scripts (you may want to add this directory to your system path)
To use epydoc just type in a shell in the folder containing your script(s):
epydoc.py scriptNameWithoutPyExtension
This will produce an "html" folder : read the index.html in your browser and enjoy :)
Publié par
francois schnell
à l'adresse
08:18
0
commentaires
A selection of useful Firefox extensions (updated 19 Fev 2007):
* Google Toolbar 3 (beta)
* Gutil a "Google Start Menu"
* Super DragAndGo for tabs
* Greasemonkey
* Flashblock
* gTranslate
* Key Scrambler
* Python Sidebar
Publié par
francois schnell
à l'adresse
00:36
0
commentaires
When I'm using a WinXP desktop I'm searching for an equivalent "Linux experience". Here's what I find useful so far (a mix of freeware and Free Software).
1) Look and feel
I don't like WinXP theme. CristalXP.net have great themes, wallpaper, icons, etc. I use the Microsoft "Royale Noir" a nice dark and sober theme.
Also very handy is iColorFolder to manage folders icons and the ability to quickly set their color for a better visual organisation.
You may also be interested by a Virtual Desktops Manager or want to access the "contextual" command line window from a right click on a folder or maybe to customize completely you're right click menu.
2)Shell and processes
This was the weakest point of winXP for me. Microsoft now released Power Shell and I must admit I find it good (it is just a little long to start). There are also aliases for usual Linux command (ls, pwd, cd /, etc) but I think Power Shell commands are very neat and clear.
Also, if you want to see the running processes in a graphical way Process Explorer is a great tool to replace the Task manager.
3)Copy/Paste and Screenshots
WinXP doesn't keep an history of your cut and paste actions and this can result in a loss of data. Cliptray is a freeware which solve this problem.
Linux distros always come with handy screenshots utilities. Cliptray can also do it but I prefer to use irfanview (tuto).
4)Security
Microsoft OS is unfortunately a big target. Apart from an antivirus and a firewall I feel safer to use Firefox and this KeyScrambler extension against eventual data loggers for login/passwords.
5)Applications
Software are not a problem since I'm using either web services (gmail, google reader,etc) and/or multi platform software (Vim,Python,OOo,Firefox,etc).
Also to work with a Linux PC or server Putty and WinSCP are a must.
WinDirStat for windows is an excellent Free utility (GPL):
- visualize disk usage per folder of per file types
- click on a box (file or folder) for properties, edition commands, contextual explorer or command prompt
A really nice and useful tool to organize and know more about what's really on your Hard Drive.
http://windirstat.info/
Publié par
francois schnell
à l'adresse
13:35
0
commentaires