Friday, July 31, 2009

"Information animal" ;-)

Two day ago or so I made test on, I was curious who I might to be in US Army ;-)
And results are interesting ;-) it looks that my way of life should be work with information in intelligence ;-)

My results are here:
  • Human Intelligence Collector (35M) - The Human Intelligence Collector is primarily responsible for supervising and conducting information collection operations. They are integral to providing Army personnel with information about enemy forces and potential battle areas.

  • Intelligence Analyst (35F) - The Intelligence Analyst is primarily responsible for supervising, coordinating and participating in the analysis, processing and distribution of strategic and tactical intelligence.

  • Signals Collector/Analyst (35S) - The Signals Collector/Analyst is primarily responsible for performing and supervising the detection, acquisition, location and identification of foreign electronic intelligence.

  • Signals Intelligence Analyst (35N) - An Signals Intelligence Analyst listen to and intercept foreign radio transmissions and relay that information by producing combat, strategic and tactical intelligence reports.

It's nice to read something like this :-) I was never interested in military career, and I think I'm too talkative to work in intelligence but those results are nice ;-)
I always liked to thing about myself as "information animal" ;-) and it looks that it is something in this ;-)

Similar postsbeta
Calculation of SSD life time in EEE PC
Buzz Troll Remover v0.3.2
Vacation in progress ;-)
Which language is fastest? ;-)
CallLoger ;-) Invigilate yourself ;-)

Wednesday, July 29, 2009

OOo2GD 1.7.1

New version OOo2GD 1.7.1 is available :-)
  • fixed problem with file names, when document has some strange characters in name OOo2GD will try to convert those characters to underscore "_"

  • fixed problem with opening documents with spaces in name on Mac OS [not tested]

Download :-)

Similar postsbeta
OpenOffice.org2GoogleDocs 0.9.2
Mac OS users - call for help :-)
OOo2GD 1.8.2
How to create valid file name?
OpenOffice.org2GoogleDocs 1.4.0

Saturday, July 25, 2009

Mac OS users - call for help :-)

Dear Mac OS users I need your help :-)
For now biggest problem for OOo2GD on Mac OS is opening downloaded documents in

I can do it for files without spaces in name, but I want to add possibility to open files with spaces in name.

And here I need your help. Here you may find ZIP archive with two files.
Those two files are:
plik ze spacjmi w nazwie.ods [it's in Polish "file with space in name.ods", but word space is misspelled ;-)]

You need to unpack it somewhere on your HDD, and click on MacOsTester.jar.
After click you should see something like this:

Next you need to click on all buttons from Metoda 1 to Metoda 11. You should note all buttons which will open your with spreadsheet looking like this:

For test you will need on Mac OS :-) and Java 5.0.

Fell free to share with results in comments to this post or send me e-mail to address .

Similar postsbeta
OpenOffice.org2GoogleDocs and Apple - first try ;-)
OOo2GD 1.7.1
Codename: Stokrotka - next test version of 1.7.0, this time without bug ;-)
OOo2GD - surveys results
Early access version of OOo2GD 1.7.0 with partial MacOS support

Tuesday, July 14, 2009

What sux in G1?

Really, HTC should think about version with battery ;-)
Current one is similar to UPS, it helps between short moments when you are not connected to proper power source ;-)
With old Nokia or Alcatel [both proud European companies :-)] I had about a week of work without charging, with G1 it's a day.

Finger marks on screen.
When you see G1 which is used by someone else you start to wonder why this person didn't wash her hands. Whole screen is covered with marks of fingers. It looks disgusting.
When you owe G1 you start to understand it ;-) Wash your hands and next try to input unlocking pattern ;-) But even with those clean hands your fingers will left ugly tracks on screen.

Or rather the fact that from time to time you may met on G1 lack of responsiveness. Here are some hard moments when you can see your wallpaper and you need to wait.... and wait... and wait....
But here it is common behavior of many mobile devices. For me it looks that during development those devices are quick and everything works nice and smooth, but in next phase when those wonderful devices are converted to versions for real world market they met physics laws, and what become worser, economy laws. So designers throw out from those devices quicker CPUs because users have strange habit to keep phone disconnected from power line, they threw out also normal batteries, because those batteries costs more, and weights more too ;-)

But considering all this, I must say that G1 is coolest piece of mobile equipment I ever had. It's true GeekPhone :-)

Similar postsbeta
Vacation in progress ;-)
I want my Android back!!!!
Programmers love to over complicate...
Biggest problem with WhatsApp, Telegram, Allo, Duo and so on
Bloggerid cannot post images....

Monday, July 6, 2009

How to create valid file name?

During development of OOo2GD I met some non-trivial problem.
In Google Docs you may use almost all characters in title of document, but you cannot use all those characters in file name. This means that when user wants to download document to local machine you need sometimes to convert title to file name.... And of course we want to make sure that file name will be as much similar to document title as it is possible.

I thought about two possible ways, first by creating smallest common caharset for all operating systems [or rather file systems]. Second by narrowing available charset in steps.
I choose 2nd way, and decided that first I will try to remove only ":", if it will not help I will try to remove some bigger set of characters, and if it will not help too I will keep only latin letters and digits.

Here is code which I'm using :-)
public static String findAvailableFileName(String destFileURI) {
String destFileName = destFileURI.substring(0,destFileURI.lastIndexOf("."));
String destFileExt = destFileURI.substring(destFileURI.lastIndexOf(".")+1);
int count = 1;
File f;
while ((f=new File(destFileURI)).exists()) {
String fName = f.getName();
String fPath = f.getParent();
// Now we need to check if given file name is valid for file system, and if it isn't we need to convert it to valid form
if (!(testIfFileNameIsValid(destFileURI))) {
List forbiddenCharsPatterns = new ArrayList();
forbiddenCharsPatterns.add("[:]+"); // Mac OS, but it looks that also Windows XP
forbiddenCharsPatterns.add("[\\*\"/\\\\\\[\\]\\:\\;\\|\\=\\,]+"); // Windows
forbiddenCharsPatterns.add("[^\\w\\d\\.]+"); // last chance... only latin letters and digits
for (String pattern:forbiddenCharsPatterns) {
String nameToTest = fName;
nameToTest = nameToTest.replaceAll(pattern, "_");
destFileName = destFileURI.substring(0,destFileURI.lastIndexOf("."));
destFileExt = destFileURI.substring(destFileURI.lastIndexOf(".")+1);
while ((f=new File(destFileURI)).exists()) {
if (testIfFileNameIsValid(destFileURI)) break;
return destFileURI;

private static boolean testIfFileNameIsValid(String destFileURI) {
boolean valid = false;
try {
File candidate = new File(destFileURI);
String canonicalPath = candidate.getCanonicalPath();
boolean b = candidate.createNewFile();
if (b) {
valid = true;
} catch (IOException ioEx) { }
return valid;

Here nicer form of sources ;-)

Because whole operation in code above is performed on file path in first step I remove all / and \...

Additionally this code returns "first free" file name. So if you are trying to save file "test.odt" to directory where file with this name exists, this code will test first if "test.odt" is available, if not it will try "test(1).odt", next "test(2).odt" and so on.

Feel free to comment :-)

Similar postsbeta
How many i 1+1 in Java? ;-)
The Secret Life of String ;-)
Recursion is evil ;-)
Abuse of Booleans ;-)
How we may use Google Earth Plugin? :-)