Sunday, October 24, 2010

passing arguments to evaluated javascript (so you got a string to execute...)

var a = "hello";
var b = " world";

var func = "function(param1, param2) { document.write(param1 + param2); document.write('<br />'); return 42; }";

document.write(eval(" ("+func+")(a, b) ")); // this one does it anonymously, not garbaging context with temp functions
document.write('<br />'); 

var func2 = "function sub(param1, param2) { document.write(param1 + param2); document.write('<br />'); return 42; }";
onEvent(a, b);

function onEvent(e, v) {
     var ff = eval(func2);
     sub.apply(this, arguments); // this one uses args explicitely

Thursday, October 14, 2010

1.0.1 aka Tsechu

So it's done. Smoke test's green and first update to Mediation tracker is alive. Let's see how will it work.

Tuesday, October 12, 2010

it's coming

The second release of the meditation tracker is near. It's not a major one, even really minor, but nevertheless important.

The thing that's about to change is visual appearance. Thanks to the friends, Metitation tracker has now more unified look. Other important point is that it's our first upgrade. I've done it so far on two devices and all went smooth. But it makes sence to have your data not only in the phone anyway, so before upgrading, record somewhere states of your practices.

Tuesday, September 21, 2010

paperless office

Funny enough we don't lack software solutions to build paperless offices, but electronic paper to get rid of the real one. We're solving the problem from the wrong end.

Monday, September 13, 2010

autumn is for mushrooms dot get

Looks like google got bored with their market for android and that's why they silently push("this ice cream is so disgusting, I'll better go make my own") people to create alternative ones. I don't see other rational explanation why official market is still in such lame stage and why custom markets (aka app stores) appear like mushrooms.

Apart from being a mistake of course.

Wednesday, September 8, 2010

oldest guild

Affordable expert-programmers from India (15€ an hour)

Some time ago it was just a joke that software development jobs are not that far from prostitution.


Wednesday, September 1, 2010

Meditation tracker 1.0.1 & 1.1

 So. There were no crash reports so far, we have about hundred real users and I'm waiting for the final images to pack into current version and re-release it as not-beta-testing-anymore.

As for the next version (1.1), here's what I have in mind about changes (updated as mind fills up):
  1. Move start/stop timer buttons in menu in practice window
  2. Custom mala size per practice
  3. Auto-silent mode during practice and corresponding setting 
  4. Proper calculation of the no-scroll-list's height
  5. Display values of dialog-based settings (i.e. mala size: 108, timer duraion 20min etc)

Nice to haves (not in 1.1):
  1. Gallery with standard images
  2. Cloud storage/sync for at least current state for backup


Wednesday, August 18, 2010

some statistics

"top ten per cent applications in iTunes get about 75,000 downloads, the next ten per cent only 9,000 and the vast majority fewer than 1,000"

OK, I know it's not fair, but we've got 135 downloads already with almost no publicity and no complaints/bug reports (wow? I guess wow!)

That means that in next couple of weeks (a month tops) there will be proper 1.1 release with adequate graphics, polished interface and I guess at least one translation into Russian. I don't feel like mixing bug-fix and new-feature releases so next one will have no new functionality.

Wednesday, August 11, 2010

Meditation tracker technical post

In this post I'll try to keep current state of development of the aforementioned1 application.

Here's what I've got so far:

1. All screens layouts:
    a. main - done
    b. add - done
    c. practice - done
    d. preferences - done
    e. schedule - done

2. add/edit form
    1. resize/crop image - done
    2. save big and thumb in private storage - done
    2.5 add/edit db action - done
    3. handle edit params  - done
    4. insert/update persistence - done/done
    5. little icon/ big icon issue - done
    6. edit currentCount bug - done

3. main form
    1. smart id/url image display - done
    2. practice long-press context menu with
        a. open, - done
        b. edit, - done
        c. delete - done
    3. show statistic sub-text - done

4. practice form
    1. start practice - done/temp
    2. schedule - done
    3. edit - done
    4. update scheduled date sql - done
    5. big picture's not loading - done
    6. properly format dates - done

5. schedule form
    update date picker - done

6. icon - done

7. session form
    1. layout - done
    2. timer/clock action ? test in real dev - done
    3. handle mala count - done
    4. handle date change - done

        current count reset after schedule edit - done
        crash on save new - done
        last practice date is one month ahead - done
        crash after taking picture on NEXUS
        custom picture's thumb not showing in main list - done
        scheduled date is one day behind - done
        handle screen rotation for session - done

        no-scroll list unjust height calculation
        prevent screen from lock during session - done

    custom mala size
    remove temp image from sd after shot

1 using this word is absolutely irresistible. I just envy the bureaucrats.

And here we go

Somewhat unexpectedly for me the first application I've published on android market is my the most recent side project. So, three weeks of relaxed development, some testing and here we go.

click me to install
Meditation Tracker for Android phones
Meditation Tracker helps you keep track of progress of your practices.
It comes with predefined preliminary practices group (can be switched off in settings). You can create your own practices and create practice schedule based on date you aim to compete practice or number of daily repetitions. It also contains a session timer - simply set timer to required length and you'll be notified when that time has passed. You can be notified by sound or vibration. Each session data (time, repetitions) is stored in database.1

My primary aim was to create visual and functional copy of the same application created for iPhones.

The big idea is to have several coordinated teams bringing same experience to users of different platforms. These applications are in no way ports of each other, they share look, functionality and hopefully feel.

So the Meditation Tracker.

Not much to say at this moment. As I said already this is test-release. In order to help testing - ... well use it and when it crashes, please post somewhere here a bug report including how to reproduce the issue and also the log file is found on the very root of your SD-card of the device (called meditracker.crash.log) - please attach it.

So far there's one known issue: on Nexus One there's an error after taking a photo so I'm really looking forward for error report on that.

Also have a look here. This should be the centralized place for both applications, at least I've talked to them and they find it a good idea.

1 This description is shamelessly copied from the iPhone's application. But intentions are good. I think it's not a bad excuse.

Friday, June 11, 2010

just use this one if you need per-thread smart(produces ints if can) parsing of json numbers:

trait SmartJsonNumberParsing {
  val doubleRe = """.*\..*""".r
  scala.util.parsing.json.JSON.perThreadNumberParser = { n : String => n match { case doubleRe() => BigDecimal(n) case int => BigInt(n) }}

Thursday, June 10, 2010

functional programming

Meanwhile "folding" is awesome. If you're from the non-functional-programming background, like me - learn one. Really blows mind as OO used to in the good ol' days.

blogging is about complaining isnt'it?

And here I come, ma.
Scala is a beautiful language which compiles to JVM's or CLR's byte code. Cool? Cool. But it also means that it inherits all the ... little things from those VMs. And Java's biggest thingy I know so far is type erasure.
Compatibility with old code? Great. Support code for win3.1 apps in XP? Perfect idea for marketing dept.
Before getting out of home, check your winkdoodle, because 400 years ago someone didn't and got bitten by the dog. It was huge.
Well, they run XP code in VM on Vista-shmista these days, okay, an option. What do we have in java these days?

scala> List[Pair[String, Any]]("a" -> 2) match { case (h :: t) if h.isInstanceOf[Pair[Int, Any]] => "match!" case emp => "nada" }  :6: warning: non variable type-argument Int in type (Int, Any) is unchecked since it is eliminated by erasure
List[Pair[String, Any]]("a" -> 2) match { case (h :: t) if h.isInstanceOf[Pair[Int, Any]] => "match!" case emp => "nada" }
res1: java.lang.String = match!
And those people disallow me picking in nose and call that language type safe? Yeah! Way to go for the backward compatibility!

Saturday, June 5, 2010

even though results seem to look same, refactoring is joy of getting things right, migration is pure pain in the ass of just making it work.

Monday, May 10, 2010

future now

they often say like "future now!" future is by definition the thing that never comes, an unreachable horizon. don't forget* this when they sell you future products.

* there's one exception though. the electric kettle was actually invented in year 3026 and landed in our time because of a simple mistake.