Saturday, September 6, 2008

OOo2GD (OpenOffice.org2GoogleDocs) 1.2.2

In new version you may find two fixes, and one small cosmetic change.
Fixes:
  • for WebDAV, from now possible is uploading of files with space in name
  • for WebDAV, fixed problem with showing message "File Uploaded" when it wasn't uploaded
    Cosmetics:
  • windows with progress bar and information about uploading in progress will be placed near right bottom screen corner [on primary screen]

    Download


    Similar postsbeta
    OpenOffice.org2GoogleDocs 1.0.3
    OpenOffice.org2GoogleDocs 1.4.0
    Export documents to Box.net from your OpenOffice.org with OOo2GD :-)
    OpenOffice.org2GoogleDocs 1.2.1
    OOo2GD 1.8.2
  • Monday, September 1, 2008

    OpenOffice.org2GoogleDocs 1.2.1

    OK, sorry, I forget to write it here ;-)

    Version 1.2.1 is ready to download.

    It have some cosmetic changes, and small fix for better handling of WebDAV server paths [if user will forget to add ending "/" to path, AddOn will do it automagically]

    Download OOo2GD 1.2.1


    Similar postsbeta
    OOo2GD 1.4.2
    Export documents to Box.net from your OpenOffice.org with OOo2GD :-)
    OOo2GD (OpenOffice.org2GoogleDocs) 1.2.2
    OpenOffice.org2GoogleDocs 0.7.1
    OOo2GD 1.2.3

    Sunday, August 31, 2008

    Stupid me....

    I was always amazed why I never got any comment on this blog........

    Now I know ;-)

    I'm stupid, and I forgot to set in Blogger settings e-mail address for comments notification.

    Sorry for all.


    Similar postsbeta
    Just testing my new Android app for blogging on Blogger :-)
    OOo2GD 2.3.0 - new documents, and autoupdate in work ;-)
    Bloggeroid 1.0 :-)
    Google Buzz - let's mark some comments as not spam ;-) or how to unhide "hidden" comments ;-)
    Math is stupid....

    Calculation of SSD life time in EEE PC

    [Update: 9/1/2008, I was wrong :-) Most of flash devices uses special algorithms to avoid situation when change of value in "logical" cell means every time change of cell in hardware. Those algorithms instead of altering data in cell try to rewrite it to another area of disk, and thanks to this heavy writing to one and the same logical cell means that truly those writings are spread over some number of cells, and thanks to this after 10000 writes any of those cells did not reach this limit, and any of those cells isn't even near of this limit]

    OK, over Internet you may find many articles about lifetime of SSD in EEE PC.

    Known facts:
    Limit of SSD in EEE PC is about 10 000 cycles, we know it from FAQ on Asus page:

    Problem
    Eee PC SSD has the life time, how long is it?

    Answer
    Eee PC SSD has the life time to be read or written 10,000 times averagely.
    To prolong the life time, the virtual memory function has been disabled in Linux system.

    http://support.asus.com/faq/faq_right_second_detail.aspx?kb_guid=CDA67F35-6C97-9CEE-5E95-9ED03F435F91&SLanguage=en-us


    Base on this I performed my own calculation, and experiment.

    My first method of calculation based on the fact, that my own EEE PC 900/XP has 4 GB On-Board SSD. This SSD is formated in NTFS, with about 1 million allocation units [each 4096 bytes].
    My assumption is that if we write to allocation unit, we at least write to it's first bit. So Instead of analzying of more then 64 billions cells we need only made calculations for 1 million cells.
    My simulations shows what we need about 1 billion writes on disk [with assumption that distribution over disk surface is equal] to achive situation when 1 of cells be written more then 10 000 times. [Simple multiplication of cells number and limit gives almost the same results ;-)]
    10 billion writes with average speed of 10 allocation units per second [this gives us about 340 MB per day] will reach limit after about 31 years.
    So in this model 10 years of life is a safe assumption.

    My second method base on suppose that operating system may write data to same disk areas much often then it may be supposed from previous model.
    To test it I used JPC emulator [it's PC emulator writen in Java], which I modified in this way that it write to log file each write operation on hard drive.
    As an operating system I used Linux with kernel 2.4, it's Linux from image shiped with JPC.

    My experiment shown that in each start, and shutdown this Linux write some data to sector number 2 on the hard drive.

    It narrows our lifespan to about 5000 start/shutdown cycles.
    If we restart our EEE PC about 1 time per day, and we do it each day of the year, those 5000 cycles limit will end after about 13.5 year. If we will have 4 start/shutdown cycles in the day this limit will be reached after about 3.5 year.

    This 5000 start/shutdown cycles limit was determined by me for Linux, but my assumption is that Windows XP isn't significant different then Linux in this area.

    My conclusion is that safe limit for EEE PC is about 4-5 years with normal usage, and about 10 years with rare usage.

    Of course if system haven't some other areas which it likes even more ;-)

    And with assumption that SSD in EEE PC haven't some special features which will increase those limits [example, maybe SSD have some build-in "table" where it tries to count how many writes was performed for some areas of "surface", and when given area reach its limits it may remap this area to some other reserved surface. If only 1% of disk surface is used in havy way, adding this mechanism will increase life time of SSD about 2 times, with only about 1% surface lost].

    Similar postsbeta
    Which language is fastest? ;-)
    Programmers love to over complicate...
    How to get negative number from size() in LinkedList in Java? ;-)
    Buzz Troll Remover v0.3.2
    CallLoger ;-) Invigilate yourself ;-)

    Sunday, July 6, 2008

    Recursion is evil ;-)

    Recursion is evil :-)

    I'm playing with Google riddle from some code.jam event.

    As a result of play I have function [here without any optimization and argument checking]:

    public long findMaxF(long d, long b) {
    long f = 0;
    if (b==1) {
    f=d;
    } else if (b==d) {
    f=(1<<d)-1; // 2^d - 1
    } else {
    f = findMaxF(d-1,b)+findMaxF(d-1,b-1)+1;
    }
    return f;
    }

    I have even less complicated version giving identical results:

    public long findMaxF(long d, long b) {
    long f = 0;
    if (d<b) b=d;
    if (b==1) {
    f=d;
    } else {
    f = findMaxF(d-1,b)+findMaxF(d-1,b-1)+1;
    }
    return f;
    }


    I know that it is possible to calculate it without recursion... but I don't know how ;-) My only idea for now was to "simulate" some kind of stack ;-) with keeping list of directions how we moved on recursion tree, but I don't like this idea ;-) d and b may be really big, not simply thousands but also millions and billions [but if b is greater then 32 this method will return something bigger then 2^32 so more then 4 billions with something following]

    My code works great with small set of data but totally fails with large :-) For now it fails because StackOverflowError :-) but why not if d is counted in millions ;-)
    Even my idea with simulated stack will fails with such big values.......

    I feel that it should be possible to not only avoid recursion [this is sure ;-)] but that this should be done in "linear" way, with 1 pass algorithm....

    OK, I divide with you my sadness ;-) I feel better now ;-)

    [Update: 09/07/2008]
    Yesterday I decided that it cannot be in this way that I cannot do this ;-)
    I decide to analyze this function. I thought in this way, first of all, if we will draw 3d chart of this function and as x we will use d, and as y we will use b, this function will have results only in are between y=1 and line described by y=x.
    Additionally when y = 1, this function will return value d [so value of x], and on this line y=x [b=d] it will take value 2b-1. So I'm interested what kind of function describes value of this function with fixed b value....
    I printed results for function for d=20 and b from 1 to 20....
    I put it into spreadsheet and checked what if I will calculate f(n)-f(n-1).... :-)
    I got some results, and those results was symmetrical... It was a clue ;-)
    Difference between next values of function was described by binomial coefficient :-)
    Binomial coefficient is described by:
    n!/(k!(n-k)!)

    So I needed to calculate factorial.... Thought by sad memories from fighting with recursion for original function I decided to use "linear" algorithm ;-) When I was using BigInteger it was working, and was able to calculate binomial coefficient for almost anything in finite time.... but this finite time might be counted in decades ;-)
    I analyzed formula to calculate coefficient, changed code, this worked but still was slooooowwww.
    Finally I found in Wikipedia article about binomial coefficient in programming languages. I used it, and it's working :-)

    Similar postsbeta
    How to create valid file name?
    How we may use Google Earth Plugin? :-)
    How to get negative number from size() in LinkedList in Java? ;-)
    Abuse of Booleans ;-)
    Which language is fastest? ;-)