Thursday 30 August 2007

humyo vs. mydatabus - online file storage

I believe that online file storage has a future. There're many online file storage providers, however, choosing the right one is not a simple task. Of course, many things depend on what what you expect from online file storage. I'll tell you my experience. Here's what I look for:
  • Free to use. I can live with adverts, and some sane restrictions on my free account. But it should be free and remain free. I am not a heavy online storage user, and I don't want one day to come and find out that my account and data are gone because I missed the payment.
  • Plenty of storage. Well, that's pretty obvious, isn't it? Now, when several GB account is not a miracle, this was the main reason why I dumped Microsoft's Live Drive, providing only 500MB per user.
  • Web access. Almost everyone has it. Who hasn't, out of game for me.
  • Security. These days, it is a must. That's why I look down upon services that use HTTP and FTP (otherwise excellent drivehq goes here). Also, this is the reason I don't look at such things as rapidshare. I just need another kind of service.
  • Protocol support. Web access is fine... as a last resort. However, for a day-to-day life, I'd like my online storage to be mapped and conveniently accessible with my favorite file manager. And I use both windows and Linux machines. Solution - to support standard protocols, such as FTP/SFTP/FTPS/WebDAV/..., or at least provide some proprietary way to accomplish this task (but proprietary solutions usually support Windows only, as for xdrive).
  • Other bells and whistles. Lots of stuff goes here. It is user experience, direct web download, sending file my mail, direct links to files, and so on.
Until now, I was a sole mydatabus user. It was not the perfect solution for me, but, summing up all the pros and cons, this was the best I could get. I used it for online file storage and synchronization, leaving image galleries to picasa, windows backup to mozy, and quick sharing of small files to googlepages. Now, a new player appeared on my horizon - humyo. Here is my opinion of it.
  • The name of the game. While mydatabus brings some associations with file storage, humyo associates with noting. Absolutely nothing. But this is the matter to get used to, I believe (like google).
  • Storage, filesize and bandwidth. This was the thing that caught my attention. While mydatabus gives its users 5GB of storage, 250MB max file size and 1GB/day bandwidth for shared files, the parameters for humyo are unlimited, unlimited, unlimited, in respective order. To be honest, traffic of 1GB/day is something I'd probably never reach in the foreseen future, and I didn't fill up my 5GB yet (but it is just a matter of time). But the 250MB restriction annoys me from time to time (not often, though).
  • Business model. To put it in another words, is this service going to stay the same in the foreseen future, or it may disappear tomorrow? While I can't say for sure, at least I understand mydatabus. They have ads, they have premium accounts. They use Amazon S3 for storage, it is cheap and going to stay for long. I see things going on there, new features are added, technical support is operating. Also, I see more and more restrictions appearing on free account. However, humyo is a dark horse here. They say about some unlimited storage, but I'm afraid to believe such thing from a company nobody knows. They say about selling some premium accounts... hm, maybe, but with all the unlimited stuff they offer, why should many people need one? They don't even have ads...
  • Web interface. Both are pretty good, both are heavy javascripted. Mydatabus has more bells and whistles (which I don't use, to be honest), but humyo works faster on opera (my observation). One thing that annoys me on humyo - it is difficult to see long file names, especially.if.they.don't.contain.spaces. Hint windows as in mydatabus could be superb.
  • Security. humyo is a winner here, whith its full https support. mydatabus supports https for login page only. Still better than nothing...
  • File access. In mydatabus, if my file is not shared, only I (and mydatabus) has access to it. In humyo, I was pretty sure about the same, until I tried to search for some file and found files that I didn't have. I wonder, if others can do the same thing on all my files? That would be VERY bad. Also, in mydatabus I have a place where I can see all my shared files, and manage them. I'd like to have something like that in humyo VERY MUCH.
  • Protocol support. Both suck here. Both promise to have something. While support in mydatabus told me about their consideration for some open standards, humyo says something about a proprietary solution for windows only. That would be a minus, on my opinion.
  • File upload. humyo is a winner here, by all means. The absence of restrictions and file drag and drop support in java version just rock. Some things I've noticed:
    1. ETA could be shown in upload window of java applet
    2. When uploading files, is it via http or via https? I want my security!!! (it is https in mydatabase/s3, by the way)
    3. When java is uanavailable, there could still be support for uploading several files at once, not only one.
  • Direct links. Both have it in one way or another. Both have it rather difficult.
  • Other stuff. Both have direct web upload. mydatabus has file e-mail feature, and humyo does not. That is the one that I use. The upload/download/connection speeds are fine in both, didn't measured them up.
So, what is the conlusion? I didn't find out all the details of humyo, but it seems very promising, and even superb to mydatabus, especially if some features could be added. But until it proves to be commercially stable in the long run, i'd be afraid to trust in it completely.

Wednesday 29 August 2007

Computer people - greatest sadomazo's?

What is sadomasochism? It is when one person likes to inflict pain, and another - to suffer it. How far can it go? Well, when one wants to torture to death, and another wants to be killed that way... Bizarre how it seems, it is not completely out of place, alas.

When speaking about such cases, two of them come to mind, at least. One of them is the case of German cannibal Armin Meiwes, who ate his sweetheart Bernd Juergen Brandes in 2001, on mutual agreement. Another one is the case of Sharon Lopatka. She looked hard for someone to kill her in a painful way, and, finally, Robert Frederick Glass made her dreams come true in 1996.

What struck me in those cases? Well, let's see what those people were:

Armin Meiwes
computer technician

Bernd Juergen Brandes
computer software engineer, worked for Siemens in Berlin

Sharon Lopatka
Internet entrepreneur, website owner

Robert Frederick Glass
computer analyst who worked for the Catawba County, North Carolina, government. He was a productive worker who was responsible for programming tax rolls and keeping track of the gas consumption of county vehicles


See any trends? Being a software engineer working in computer industry myself, I do. Surely, in both cases people found each other on internet, but internet is not just for programmers, is it?

Wednesday 22 August 2007

Mano baitai

Šiandien mane aplankė mūza :) Taigi:

RAM'o baitai buvo du,
Vienas dingo - nerandu.
Man su vienu baituku
Kompas stabdo - negaliu.

Tarp procesų ieškau šudo,
Mano rankos tai nužudo.
Vistiek stabdo kompas mano -
Vistai reikia daugiau RAMo...

Saturday 18 August 2007

Partial template specialization for functions

This post contains highly technical stuff !!!

Recently, I had to create template function with the same name and arguments that would behave in some general way for all data types, except complex numbers. Something like

template<class T> void X(const T& t) { ... }
template<class T> void X(const std::complex<T>& t) { ... }

Nice how it looks (IMHO), such approach does not work. The reason - in C++ template functions do not have partial template specialization. They have overloading. So, basically, I've just created two different functions, and left it up to compiler to choose best one. Since in first case parameter T may as well be complex number, compiler's choice was not what I expected.

The solution: C++ template classes do have partial specialization, use them. The following code would work:

template<class T> struct Y {
  static void Perform(const T& t) { ... }
};
template<class T> struct Y<std::complex<T> > {
  static void Perform(const std::complex<T>& t) { ... }
};

And You may wrap it into the function, something like

template<class T> void X(const T& t) { Y<T>::Perform( t ) };

Thursday 16 August 2007

Mass pinging hosts with the help of standard binutils

To quickly perform mass pinging of hosts on a local network, if you don't have any special tools, the following scripts may be of help:

---- SCRIPT 1 : pingnet ----------
#!/bin/sh

for(( i=0; i <= 255; i++ ))
do
  ping -w 1 "192.168.0."$i
done | `dirname $0`/hostalive
----------------------------------

Give that file rights for execution. You may want to correct "for" condition and address beginning, depending on your network configuration. dirname is standard utility. hostalive is another script, which parses the output of ping and makes a conclusion whether the host is alive or not. For that task, sed is used:

---- SCRIPT 2 : hostalive ----------
#!/bin/sed -nf

# get IP address
/^--- / {
  s/^--- //
  s/ ping.*/ /
  h
}

# is it alive?
/^rtt / {
  g
  s/$/OK/
  p
}

# is it down?
/ 100% packet loss/ {
  g
  s/$/DOWN/
  p
}
----------------------------------

Give this file an executable permissions as well, and put it into the same folder as pingnet. Now you may run pingnet, and with a bit of luck you'll see something like that:

192.168.0.0 OK
192.168.0.1 DOWN
192.168.0.2 OK
192.168.0.3 DOWN
192.168.0.4 DOWN
192.168.0.5 DOWN
192.168.0.6 OK
192.168.0.7 OK
192.168.0.8 DOWN
192.168.0.9 OK

Monday 13 August 2007

CSS image map

You know what client-side image map is - you assign a map to an image where you specify links for some regions on that image. Different from putting an anchor on image, user gets to different places depending on where on image (s)he presses.

It appears that the same effect may be achieved with HTML + CSS. I've tried it only with rectangular regions. Why reinvent the wheel? Well, CSS allows much more customization of what you do: compare the same task implemented using image maps and CSS. Actually, the studying of the sources of those two pages is the best, but here are the ideas behind CSS implementation:
  1. Image map is a bunch of links on the image - so you'll need a bunch of links as well, on something as well. I used anchors on div, but I think anchors on paragraph would also do. But anchors are a must, if you want :hover event to be detectable on most browsers and not use JS. Some people use similar technology to represent various lists graphically, by putting <a> into <li>.
  2. Now comes the CSS part. Image for an image map will go as BG image for div. Make div position absolute. For all the links, make their position absolute and display block. If the position of div starts at (0,0), you may use same coordinates as in image map, which is great, since there's is a software to create image maps. Note that in image maps coordinates are left right top bottom, while in CSS it is left right width height.
  3. The core is done, some polishing follows. I wanted selected area to differ, so I added a BG image for a:hover. Since I didn't want to create separate image for every link, I've just created small gif with every second pixel transparent. It creates an effect of pseudo transparent shadow on top of real image. Using png image with alpha channel looked better, but not all browsers support it :(
  4. The contents of the link should be empty, otherwise it will clutter the image. Don't worry, links will be clickable, since their size is set explicitly. However, such a map will be unusable on text-only browsers. I've put a contents of links in span, which I made invisible in CSS. So, in browsers that support CSS, we have clear view, while text-only browsers produce a list of nice links.

Friday 10 August 2007

Changing all HTML tags to lowercase

I'm a big fan of VIM text editor. I use it for editing HTML files as well. While I am not going to argue or prove that VIM is the best HTML editor ever (I use it a lot for HTML editing, but not just VIM), there're things where VIM shines. Really.

One part of converting from HTML to XHTML is changing all the tags to lowercase. If you open your HTML file in VIM, this task may be done with this piece of VIM magic:

:%s/<\/\?\zs\(\a\+\)\ze[ >]/\L\1/g

Note that this will change tag names only. To change tag attributes to lowercase as well, use this command:

:%s/\(<[^>]*\)\@<=\<\(\a*\)\ze=['"]/\L\2/g

Thursday 9 August 2007

Pop-up menu from button

Recently I had to create a pop-up menu when pressing a button, as shown on the picture.

Here is the code for this task to complete in Borland Delphi.
case PopupMenu1.Items.Count of
0 : // no menu items
begin
MessageDlg( _( 'No items to show' ), mtInformation, [mbOK], 0 );
exit;
end;
1 : // only one item - execute
PopupMenu1.Items[0].Click;
else
with BitBtn1, ClientToScreen( Point( 0, Height ) ) do
PopupMenu1.Popup( X, Y );
end;
BitBtn1 is the button to be pressed, PopupMenu1 contains the menu items to pop up. If there's no menu items, a message is shown, if only one menu item, it is launched by default, if more - popup menu appears.

Wednesday 8 August 2007

Forwarding Remote Desktop Connection via SSH

A problem: there's a remote Windows machine A which you need to access. You don't have direct access to that machine, however, you can SSH to some server B which does have access to A.

Solution: since Remote Desktop Connection uses single port 3389 for connection, it is just possible to make local SSH forwarding of, say, your port 3389 to the A:3389. Then use your Remote Desktop Connection client to connect to localhost (assuming that you don't have RDserver running on your current machine), and you are done. Right? Not always.

For me, the solution above worked if my current machine was a linux box. Also, I know some people, for whom this solution worked on Windows machines too. But for me, the scenario above produced complaint from standard Windows Remote Desktop Connection client:

The client could not connect. You are already connected to the console of this computer. A new console session cannot be established.

I've found the solution for this problem here. The idea is that if you use putty as your SSH client, the current version allows to bind local ports not just to localhost (127.0.0.1), but also for something like 127.0.0.2 (127.*.*.*). The configuration of putty connection should look like this (substitute target for the name of your machine):


Now, the connection configuration for RDC client must look like that:


Well, that's all. You should be able to connect to machine A now from your Windows box.

Tuesday 7 August 2007

Иван Купала - lietuviskai

Vienu metu man labai patiko rusų grupė "Иван Купала". Žmonės sumaišė senas rūsų liaudies dainas su šiuolaikiniais bumčikais - ir laimėjo.

Neseniai išgirdau kažką panašaus, tik lietuviškai. Žinoma, liaudies dainos irgi lietuviškos. Atlikėjai Rasa ir Jonas. Albumas "Saulala Raudona". Šaunuoliai!!!

Last.fm'e reikėjo užsiregistruoti - patingėjau. Bet kelios jų dainos yra Youtube:

http://www.youtube.com/watch?v=AGkojFAV_DM

Monday 6 August 2007

Using internet browser as calculator

Most modern internet browsers support JavaScript. JavaScript may be executed in various ways, one of them - through pseudo url javascript:some_code. If this JavaScript code returns some value, the contents of all current web page is replaced with the result, converted to text (Safari on Windows v. 3.0.3 does not support this, apparently...).

Since JavaScript has means to perform mathematical operations, the internet browsers may be used as calculators. For example, to calculate 2+2 you could enter the following URL: javascript:2+2

Some more advanced math is possible, but it is not as straightforward, because advanced math functionality resides in JavaScript object Math. For example, to calculate number Pi, you should enter something like that: javascript:Math.PI , to calculate e10, you need the following line javascript:Math.exp(10), and so on.

P.S. And, speaking about browsers and calculators, don't forget about calculator built into google search engine. Just try googling for 2+2 ;)

Saturday 4 August 2007

Lietuviškos radijo stotys internete WinAMP'ui

Čia yra playlist su Lietuviškomis radijo stotimis internete, skirtas grotuvui WinAMP.

WinAMP'e reikia :
  1. pasirinkti "Add new URL",
  2. nurodyti šį adresą: http://100files.googlepages.com/radio_LT.m3u
  3. Pasirinkti, kokią iš 40+ radijo stočių klausytis :)
Daugiau info galima rasti:
  1. Radijo stočių puslapiuose
  2. http://www.klausyk.lt/lt/visos_radijo_stotys/
  3. http://www.audio.lt/tiesiogine-transliacija/
  4. http://www.radijo.info/
  5. http://audio.mums.lt/
  6. http://www.fm.lt/lt/ltlist/
  7. http://dsl.zebra.lt/radijas.php
  8. Google

Thursday 2 August 2007

Installing the BDE

Recently I had to install the BDE (Borland Database Engine) for an old software.

There's a stand-alone BDE updater named bde511en.exe, which is available from this page. Note that you'll have to scroll till the bottom of the page. However, this one is good only if you already have some older version of BDE. You may have it installed with some old installer of BDE-enabled application.

If You want to install BDE on the fresh machine, BDEInfoSetup.zip will help. It is available from here. It will install you BDE version 5.2, the last one at the moment. Theoretically, it is possible to check updater page if some new versions are available, however, since BDE is not developed any more, this will probably be of no help. After install, you may need to run bdeadmin.exe to set up aliases. BDEadmin should be available here:

"c:\Program Files\Borland\Common Files\BDE\BDEADMIN.EXE"

Also, at about.com there's a paper on how to install BDE manually. I've never tried it, actually, as long as the internet is available and installer is accessible online, but it could help in some situation, i guess.

Wednesday 1 August 2007

ReportManager version incompatibility

There's a freeware report generator ReportManager, that I do use a lot. Starting from some version (don't remember which, but 2.6a has it), the generated report files are incompatible with the older versions (again, I don't remember till which, but 2.4e has this problem).

After some investigation, the problem seems to have a fix. Report files are essentially a Delphi forms (a kind of resources for Borland Delphi programs), in plain text. The incompatibility is originated by 2 new properties of report parameters:
  • ErrorMessage
  • Validation
After all, these properties are good and extend the functionality of ReportManager. Besides, RM is free, so you can just download the latest version and be well off. However, if you don't use these new features, and want your report to work with older versions of RM engine, just open your *.rep file in any text editor (notepad will do, but I personally prefer VIM), and delete all lines that look like

ErrorMessage = ''
Validation = ''

in VIM, this could be done with the following commands:

:gl /^ *ErrorMessage *=/ del
:gl /^ *Validation *=/ del