After reading the post by Seif Lotfy about the design of an interface that makes it easy for users to access files without the need to explore their file system, I have created a mock-up of the interface that I would like to use.
Obviously, the idea is not new (which is part of the appeal that this approach would have) and the main work would not have to go into the design but the underlying search algorithm.
As Seif said in his post, exploring the file system (or bookmark hierarchy or application menu...) is not an ideal way of finding the documents you are looking for. But exploring the application or places menu to find the search application to then search for the document is also not the best way to handle this.
So, how can this be made easier? By using an intelligent search, something very similar to the ubiquity project. A search that knows that "google world cup 2010" means a google search, but "world cup 2010" might be a search for a file or something else, that "gimp" means simply launching the application and "email this to marc" would suggest a list of marcs from your contacts and launch the default email application with a new email to that contact and the current clipboard as the content or attachment. (This is the way ubiquity does it if you use googlemail, really cool!)
The search (if it worked) would replace the file browser (when the file browser is used to explore the file-system in a search for a file), it would replace the desktop as a file and launcher holding place, it would replace the current three menus "Application, Places, System".
And it should also be obvious that this search is the place to start.
To me the answer is clear. It should be at the center of your view, large, and free from any clutter: just like the google interface.
So here is my first mock up of the desktop.
(Note: this is the desktop, not an application in front of the desktop).
And to demonstrate how such a search could look like, there is another mock up that shows the autocompletion or tips
And also the result of a search, if you actually hit enter or press the search button. The results should be ordered by a mixture of relevance and last accessed. Maybe even taking into account what the user did some minutes ago and so on (powered by zeitgeist
Note that the search should be always in reach, so, since it replaces the three menus as the standard way to get into your computer, there could be a shortcut to the search at the menu position (as you can see in the pictures). Alternatively, there should be a keyboard shortcut which gets you to a clear desktop and places the focus on the search field.
Today Nokia and Intel announced the merging of maemo and moblin to form MeeGo (TM).
While this might sound good to some, it is a bit sad for me. The first thing I'm sad of is the focus on C++ and Qt. As you might know, maemo 5, the operating system of the N900, is based on gtk and clutter.
Quote:
GTK and Clutter are also included for application compatibility.To me this sounds like: will be dropped in the next version.
But the biggest loss in this merge is the packet management system, which will be rpm.
Quote:
So: today I lost the urge to learn to develop software for my N900...Will MeeGo use .rpm or .deb as its packaging system?
MeeGo will use the .rpm format
I have had some trouble to figure out how to use a class as a decorator for a method (as opposed to a decorator for a function). Here is a script that prints some useful information about what is called when and with what parameters.
#!/usr/bin/env python
print "Classes as Decorators of Methods\n"
print "-----Parsing dec"
class dec(object):
def __init__(self, a):
print "----- dec init"
print type(a)
print "decorated method: ", a.__name__
self.a = a
def __get__(self, inst, cls):
print "-----dec get"
self._inst = inst
self._cls = cls
return self
def __call__(self, p):
print "-----dec call"
print type(self)
print type(self._inst)
print type(self._cls)
return self.a(self._inst, p.upper())
print "-----Parsing C"
class C(object):
def __init__(self):
self.X = "Hello"
@dec
def run(self, p):
print p,
print self.X,
return "world"
if __name__ == "__main__":
print "-----Object creation"
c = C()
print "-----Object method call"
print c.run("This is a decorator ")
#!/usr/bin/env python
print "--- Parsing dec"
def dec(f):
print "--- Run dec"
print f.__defaults__
def x(*args, **kwargs):
print "--- Run x"
print f.__name__
print args
print kwargs
f(*args, **kwargs)
return x
print "--- Parsing foo"
@dec
def foo(a, b=3):
print "--- Run foo"
print a, b
print "--- Calling foo"
foo(1)
print "--- Calling foo"
foo(2, 4)
Which outputs:Today I realized that the django way of internationalization is not as good as I had thought. Here are two areas where it could be improved:
Django has no default way of translating fields in models. This is a known shortcoming and was addressed in many plugins (transdb, transmeta, multilingual>, multilingual-model, translate, ...) and in a Google Summer of Code project by Marc Garcia.
As I see it, the translation of any kind of data should not be in a seperate table or in a metaclass. Why? Because translation should not be the way to think in the first place. If you have a piece of information that is not universally understandable (like an photograph), than you can assign a language or culture to that information. If your site should be available in several languages, then there is no good reason why one language should be superior (and allowed in the model), while other languages are inferior (and have to go into a translation table). So there is no translation of a first, superior string but there is a piece of information in different, equally important languages.
So, with regard to this poll, the only good option would be to state "this field is language specific" and django should create a field for every supported language (mainly like multilingual-model).
The admin interface should display these fields and a bonus would be to be able to create a report based on the missing translation fields.
But there are other fields where internationalization is also important and where I couldn't find any plugins or snippets. It's the url resolution. Your apps should have human-readable urls that don't change over time. Suppose you have this url in your shop: "/smartphone/linux/N900" and suppose that "smartphone" is a category that was not planned when the shop was planned but rather entered in the admin as a (translatable) categorization of a specific phone. Now if you want to make this translatable, you have to create a pattern like
"(?P
but how is that supposed to be distinguished from
"(?P
if these things should also be translatable? So the point is: the regular expressions in the url resolution mechanism are not translatable (if the strings are dynamical db content).
The could be an url manager that can receive signals about a change in the urls patterns. And there should be an attribute (db-field, function, ...) in every model or view which can take translatable fields as parameters and create and update the corresponding urlpatterns.
If you work in Astronomy, you will likely have a lot of fits files lying around. Although the FITS format is absolutely not an image-only format, I would still like to see a preview in my filemanager if there is an image encoded in the file. The standard thumbnailers for Xubuntu don't do this, so here is how to create your own:
/usr/share/thumbnailers/fits-thumbnailer.desktop
[Desktop Entry]
Version=1.0
Encoding=UTF-8
Type=X-Thumbnailer
Name=FITS Thumbnailer
MimeType=image/x-fits;image/fits;application/fits;
X-Thumbnailer-Exec=python /usr/lib/thunar-thumbnailers/fits-thumbnailer.py %i %o %s
/usr/lib/thunar-thumbnailers/fits-thumbnailer.py
#!/usr/bin/env python
import pyfits
import matplotlib.pyplot as plt
import sys
try:
infile = sys.argv[1]
outfile = sys.argv[2]
except:
exit(1)
try:
size = sys.argv[3]
except:
size = 256
hdul = pyfits.open(infile)
data = None
# Is the primary HeaderDataUnit an image with data?
if (hdul[0].header["NAXIS"] != 0):
data = hdul[0].data
else:
# The primary had no data, so we search for the first image!
for hdu in hdul[1:]:
if (hdu.header["XTENSION"] == "IMAGE"):
data = hdu.data
break
if data != None:
plt.imshow(data)
plt.savefig(outfile, transparent=False, format="png")
/usr/lib/thunar/thunar-vfs-update-thumbnailers-cache-1
There are actually a lot of cases, where this will not work, it will not take WCS into account and is in general not very sophisticated, but it works for me (TM). For more information about Thunar thumbnailers see:
Additional thunar thumbnailers
Freedesktop thumbnailer spezification
Freedesktop desktop-entry spezification
In a Latex figure environment, the label command has to follow the caption command. Otherwise referencing the figure will result in the section number (where the figure appeared) to be printed. Sometimes Latex is not very user friendly...
\begin{figure}[!th]
\centering
\includegraphics[width=2.5in]{some_filename}
\caption{some caption}
\label{fig:some_image}
\end{figure}
Update 2009-11-13: more notes on the greek input
I use the AUCTex mode in Emacs, which has lots of useful features. Here is a mix of commands and additions that help me improve the Emacs-Latex experience: RefTex (actually you will already use this if you use AUCTex mode), Greek Emacs input, PDFSync and Orgmode tables.
There is much to say about reftex. But I'll just show the two commands that I use regularly:
C-c =
This will open a buffer where you can navigate through your document's toc.

This comes very handy for large projects like PhD thesis :-). With python I use something like outline mode for roughly the same purpose, but this is perfect for my latex documents.
The other shortcut I use is:
C-c [
This command will ask you for your citation style

and for a regulare expression for searching your bibtex file to find the reference.

Then you can navigate through the matching references and choose the one that you want.

With a single bibtex file containing about 1000 references (managed with referencer) this feature is very handy.
If you are using texlive / xetex, then you have full utf-8 support built-in. Now you need a way to use it :-) If you write in a language other then english, you probably already use this feature.
Just typing
äöüß
instead of
\"a\"o\"u\ss{}
is already good. But being able to also type:
$αβγ = 3μm$
instead of
$\alpha\beta\gamma = 3\mum$
is really a good thing, both for readability and for typing speed.
Update: actually it's not that simple. But it got simpler with TexLive 2009. I have something like this in the preamble of my documents:
\usepackage{mathspec}
\setmainfont[Mapping=tex-text]{CMU Serif}
\setsansfont[Mapping=tex-text]{CMU Sans Serif}
\setmathsfont(Greek,Latin){CMU Serif}
\setmathsfont(Digits){Neo Euler}
To insert greek characters in emacs, just type:
C-\ greek RET
From then on, the
C-\
will switch between greek input and your normal input.
Sometimes in larger documents, you want to jump directly from a line in your latex file to the corresponding line in the pdf file. With pdfsync and xpdf, this is possible (note that with TexShop the other way is also possible, but not with emacs at the moment).
In you Latex file, insert the following:
\usepackage{pdfsync}
Now just type:
C-c C-v
and the line will be displayed in xpdf. Nice.
The Emacs Org mode is a great mode for table editing (and other things). The table editing mode can be called separate from the complete Org mode, which is a great tool for example for Latex, where the table editing is something very unpleasant! The following work flow helps a lot, but check out the full example here for more advanced options: OrgMode Manual
Let's start with a Latex file with the comment package (the org mode table is within a comment environment, so your latex does not get messed up!):
\documentclass{article}
\usepackage{comment}
\begin{document}
Hallo!\\
\end{document}
Then type:
M-x orgtbl-mode
M-x orgtbl-insert-radio-table
This will ask you for a table name, let's say: atesttable
Now the document looks like this:
\documentclass{article}
\usepackage{comment}
\begin{document}
Hallo!\\
% BEGIN RECEIVE ORGTBL atesttable
% END RECEIVE ORGTBL atesttable
\begin{comment}
#+ORGTBL: SEND atesttable orgtbl-to-latex :splice nil :skip 0
| | |
\end{comment}
\end{document}
And then you can change the table using the great OrgMode capabilities! Once you have done this, type
C-c C-c
This will update the latex table to something like this:
\documentclass{article}
\usepackage{comment}
\begin{document}
Hallo!\\
% BEGIN RECEIVE ORGTBL atesttable
\begin{tabular}{rll}
Times [sec] & Names & something else \\
\hline
3 & John & hi \\
4 & Elisa & ho \\
5 & Nobody & hiho \\
& & \\
\end{tabular}
% END RECEIVE ORGTBL atesttable
\begin{comment}
#+ORGTBL: SEND atesttable orgtbl-to-latex :splice nil :skip 0
| Times [sec] | Names | something else |
|-------------+--------+----------------|
| 3 | John | hi |
| 4 | Elisa | ho |
| 5 | Nobody | hiho |
| | | |
\end{comment}
\end{document}
Given that a and b are positive, the calculation:
a:1.2345678e-30
b:5.5889944e-28
The real result is: 6.89999252062032 e-58
What do the following programs tell me?
#include <math.h>
#include <stdio.h>
int main(){
double a = 1.2345678e-30;
double b = 5.5889944e-28;
double c, d;
c = a * b;
d = exp(log(a)+log(b));
printf("a * b = %.20e \n", c);
printf("exp(log(a) + log(b)) = %.20e \n", d);
return 0;
};
a * b = 6.89999252062031977189e-58
exp(log(a) + log(b)) = 6.89999252062023345995e-58
The real result is: 6.89999252062032
import math a = 1.2345678e-30 b = 5.5889944e-28 print "----------math----------" print "a * b = %s" % repr(a*b) print "exp(log(a) + log(b)) = %s" % repr(math.exp(math.log(a)+math.log(b))) import mpmath mpmath.mp.dps = 20 a = mpmath.mpf(1.2345678e-30) b = mpmath.mpf(5.5889944e-28) print "---------mpmath---------" print "a * b = %s" % repr(a*b) print "exp(log(a) + log(b)) = %s" % repr(mpmath.exp(mpmath.log(a)+mpmath.log(b)))
----------math----------
a * b = 6.8999925206203198e-58
exp(log(a) + log(b)) = 6.8999925206202335e-58
---------mpmath---------
a * b = mpf('6.8999925206203201922352e-58')
exp(log(a) + log(b)) = mpf('6.8999925206203201919869e-58')
The real result is: 6.89999252062032
6.89999252062032e-58
6.899992520620233e-58
| Language | Results |
|---|---|
| c: |
6.89999252062031977189 e-58 6.89999252062023345995 e-58 |
| python (math): |
6.8999925206203198 e-58 6.8999925206202335 e-58 |
| python (mpmath): | 6.8999925206203201922352 e-58 6.8999925206203201919869 e-58 |
| scheme: |
6.89999252062032 e-58 6.899992520620233 e-58 |
| R |
6.89999252062032e-58 6.899992520620233e-58 |
| gcalculator and windows calculator: | 6.89999252062032 e-58 |
| the real result: | 6.89999252062032 e-58 |
I have a lot of unsorted scientific papers! Their filenames don't resemble their titles and they are stored in a bunch of places. I tend to download them as I search the internet for papers that help me with a problem and sometimes I even DownThemAll.
Weeks, month later, I try to find the *one paper* that was so interesting and cite it via BibTex in my Latex file. But I can't remember the filename, title, author, year or journal (in any combination).
Or I see a paper, know that I read it, but can't remember if it was that good...
Using a search engine (Tracker), a bibliography manager (Referencer) and a file manager (Thunar).
With Thunar, I can mark files as interesting.
With Tracker I can search the text of a document and tag it.
With Referencer I can tag a paper and export the meta-information to a Bibtex file.
It seems that Tracker, Referencer and Thunar don't use the same location to store meta-information about the documents. They all seem to use different databases.
I would have to write a plugin for two of them to get the three of them working together.
Not good.
Numdisplay is one of the cool python astronomy packages that lack documentation! What I want to do is display an image from the python shell (easy and well documented) and this image shall contain WCS information, because otherwise I could as well use matplotlib (really hard and NOT documented).
Much better :-)
Python is a good language for scientists. It basically replaces proprietary software like IDL, Matlab or SAS. What it lacks at the moment is an easy way to display astronomical data saved as fits files containing WCS information.
WCS information standardizes the transformation between pixel coordinates and world coordinates (e.g. position in the sky). There is a good library, pywcs, that deals with this information.
Matplotlib, a good choice for plotting data with python, includes Basemap, a toolkit to display maps (of the earth) in various projections. What is missing is a link between these two!
| Basemap name | FITS Code WCS | Names | |
|---|---|---|---|
| AZP | Zenithal perspective | ||
| SZP | Slant zenithal perspective | ||
| Gnomonic Projection | TAN | Gnomonic | |
| Stereographic Projection | STG | Stereographic | |
| SIN | Slant orthographic | ||
| ARC | Zenithal equidistant | ||
| ZPN | Zenithal polynomial | ||
| Lambert Azimuthal Equal Area Projection | ZEA | Zenithal equal area | |
| AIR | Airy | ||
| CYP | Cylindrical perspective | ||
| CEA | Cylindrical equal area | ||
| Cassini Projection | CAR transverse case | ||
| CAR | Plate carree | ||
| Miller Cylindrical Projection | CAR with unequal scaling | ||
| Mercator Projection | MER | Mercator | |
| Transverse Mercator Projection | MER transverse case | ||
| Oblique Mercator Projection | |||
| Equidistant Cylindrical Projection | |||
| Sinusoidal Projection | SFL | Sanson-Flamsteed | |
| PAR | Parabolic | ||
| Mollweide Projection | MOL | Mollweide | |
| AIT | Hammer-Aitoff | ||
| COP | Conic perspective | ||
| Albers Equal Area Projection | COE | Conic equal-area | |
| Equidistant Conic Projection | COD | Conic equidistant | |
| COO | Comic orthomorphic | ||
| Lambert Conformal Projection for sperical earth = COO | |||
| BON | Bonne's equal area | ||
| Polyconic Projection | PCO | Polyconic | |
| TSC | Tangential Sperical Cube | ||
| CSC | COBE Quadrilateralized Spherical Cube | ||
| QSC | Quadrilateralized Spherical Cube | ||
| Azimuthal Equidistant Projection | |||
| Orthographic Projection | |||
| Geostationary Projection | |||
| Robinson Projection | |||
| Gall Stereographic Projection | |||
| Polar Stereographic Projection | |||
| Polar Lambert Azimuthal Projection | |||
| Polar Azimuthal Equidistant Projection | |||
| McBryde-Thomas Flat Polar Quartic | |||
| van der Grinten Projection |
Stefan wrote: This is a test comment.


Comments: