Complicated calculations usually take a lot of time. So how to know the progress status to estimate how much time the program still needs to finish?
So far, I always printed some debugging stuff. So I knew how much is done and what is still to do, but that isn’t a nice solution if you plan to share your application with others (the guys in your dev team or the whole public in general).
The first solutions to indicate the status is just printing something like an iteration number:
Ok, works but sucks ;-) Some days ago I read about an Unicode trick to build a clock on the prompt. Using this the next possibility for status indication is:
It’s much less line consuming. Of course there is also a lot of space to prettify it, for example:
In order to write this article I searched for some more solutions and found one that, more or less, equals my last piece of code.
txtProgressBar is part of the built-in
The last progress bar I want to present is a visual one and comes with the package
The code for this article is attached.
In times of microblogging you all should have heard about URL shortener. There are a dime a dozen. The bad thing about public shortener: They are tracking everything… So why not installing your own one!?
There are a lot of shortener available out there, e.g. shorty, lessn, open URL shortener, PHP URL shortener, phurl, or kissabe, just to name some of them. Of course you can also create your own one. I took a look at some of these tools and decided for YOURLS. It’s very easy to install and comes with a nice API. I thought about providing this service for the public, but unfortunately the public always tend to exploiting these good deeds…
Of course I have some further intentions to use such a shortener, but you’ll read about it in some further articles ;-)
Go out and shorten the f$cking long internet! My blog is now also reachable at http://s.binfalse.de/1.
The problem is the width of his articles. The content is only about 400 pixel. Since Pierre often blogs about programming projects his articles are very code-heavy, but lines of code are usually very long and word-wrap isn’t appropriate in this case. So you have to scroll a lot to get the essential elements of his programs, see figure 1 as example from the article Visualizing my twitter network with Zoom.it.
I also added a small feature to hide the friendfeed widget, I don’t like it ;-)
If you have installed Greasemonkey you just have to click the download-link below and Greasemonkey will ask if you want to install the script. To stretch the site by more/less pixel just change the content of the first variable to match your display preferences. If you set
true the friendfeed widget will disappear.
So far, have fun with his articles!
When I found an interesting script and just want to see a small part of it I’m always arguing why I have to download the full Perl or Bash file to open it in an external program… And then I realized the configuration of my web servers is also stupid.
See for example my monitoring script to check the catalysts temperature. Till today you had to download it to see the content. To instead display the contents I had to tell the apache it is text. Here is how you can achieve the same.
First of all you need to have the
mime module enabled. Run the following command as root:
You also need to have the permissions to define some more rules via
htaccess . Make sure your
Directory directive of the
VirtualHost contains the following line:
Now you can give your web server a hint about some files. Create a file with the name
.htaccess in the directory containing the scripts with the content:
So you defined scripts ending with
.pl contain only plain text. Your firefox will display these files instead asking for a download location…
.htaccess file is recursive, so all directories underneath are also affected and you might place the file in one of the parent directories of your scripts to change the behavior for all scripts at once. I installed it to my wordpress
With ChemDoodle it’s very easy to display a molecule. Just download the libs and import them to your HTML code:
To display a compound you need its representation as MOL file, include it in less than 10 lines:
Here is a sample with caffeine:
If your browser is able to display WebGL you should see a stick-model. Use your mouse to interact. Very easy to use! Of course you can load the MOL data from a file, but that is beyond the scope of this article.