Last 5 entries:

 Blog 

Swype

Hmmm ... ok ... for those who have no idea what swype is, you can check out this link or look at the official site :)
Since I started with this keyboard, I'm an extremely happy puppy. All was good ... but for the fact it worked only in english (well, and spanish actually). So, there I was, rather happy, but wondering why don't they have it for hebrew as well, while I was trying different keyboards that can handle hebrew (went through hackers keyboard, smart keyboard pro, and something else as well).
Surfing the forums, I found a whole forum of people asking the developers to add hebrew to the application, but still, couldn't find it.

And then, out of the blue, I found a swype version with hebrew!! ah ha !!! good android ... quickly, I downloaded the apk (the exe equivalent for android, or what you'll usually run in order to install an application).
Now, being a totally n00b android user ... I said to myself ...listen ... what if you fuck this up? Once I asked myself that question, I planted the seed of doubt in my own mind. So, I went and did a backup to my swype version, before I proceeded to happily instal my new hebrew speaking swype :)

Round 1:
Browse to apk file, double click.
Result -> FAIL.
scratching head ... check instructions ... silly me ... should uninstall old version first.

Round 2:
Fidget with system settings, find swype, hit "uninstall".
Result -> FAIL
wtf? what good is having "uninstall" if it doesn't work?!. What now ... K, get online, send messages to my android guru friend. She's not online ... scratch head again ... Ok, back to basics ... swype is obviously a system program. Might need special permission to remove it.
Friends get online, suggest the same thing, and tells me there's an application that does it.
Some more reading suggests there are 2 files that need to be deleted from system folders, and that should take care of "uninstalling" swype.

Round 3:
Try to find folders.
Result -> FAIL
WTF?!?! k ... system folders won't show with normal file browser. Guru suggests Root Explorer. I find, install, run.
Finally, got rid of 2 files. Ha ha! victory is mine. I go to apk file again, double click, and watch hebrew swype install (well, not roally hebrew swype. More like a homemade version with english hebrew and russian).
Installations succeeds. Open swype. Nothing happens. No keyboard appears. W T F ?! Open settings ... application force closed on me (FC from this point on).
More head scratching, cursing, and internet searching. Can't find my original version to reinstall. The backup doesn't work (what ... da ... fuck?! you call this backup?!). Eventually I find some beta version I can download. At least I'll have a working english swype.

Round 4:
Install beta swype.
Result -> FAIL
By now, you should be saying "WTF?!". It doesn't work. Backup doesn't work. Trying to run it will FC in a loop. At this point, what you have is a very unhappy puppy, cursing in the dark around 1am. Did I mention unhappy and WTF?
More searching and suggestions from guru bring up Root App Removal. Yet more searching and digging in forums reveals a small tiny thing that failed to be mentioned before. A small tiny file, hidden in some temp folder, that should be deleted as well.

Round 5:
Armed with the best of the software for hunting files and play with the core of the system, I track the rogue file amidst the swampy jungles of the system. File select ... File delete ... "Are you sure?" box ... Godamnit, yes I'm sure, I just selected that !! (it's a good box usually, but I wasn't in the mood for it at the moment. I guess my rant so far explains why :)

Round 6:
Find hebrew version again, run the apk file.
Result -> Finally ... Great success.
Now I have a working version of swype, with hebrew support.

Aftermatch Aftermath:
WTF?! I was sure it's match ... which makes sense ... but no ... no "c" goes in aftermath it seems.
K, I traded a working english/spanish swype with an english(working) / hebrew (working, but a bit of a pain) / russian (completely useless for me) one.
My opinion about the hebrew is that since it has no vowels, it's much less accurate than the english one. It's still nice to have, and at the moment I'm busy teaching it words that it should have known to begin with ... Let these be my troubles in life :).

If you're interested, here are some links for you:
Hebrew swype can be found here.
How to remove installed swype can be found here. It's in the last message in that page.
How To Install Apk Games & Apps On Android Device tutorial can be found here.

I think I'll open an android section ... or something like that ... We'll see.
K, back to real life time for me ... Have fun :)

 Blog 

C++, optimization, and other random bits

As you know (if you read the last post), I've been working on a Sudoku solving program, using C++. It amused me to find out in the end that the brute force way was sometimes quicker than the logic way. Mind you, it took much more time, pain, debugging and thought, to program the logic way, but obviously, if the goal was simply solving the sudoku, I guess going brute force should have been the way to go.
Since that wasn't my goal, I don't care much. The goal was getting back to programming and brushing up my C++ skills, and for that the logic way was much more helpful :)
In any case, even though I don't have much time for it, and I lacked the internet for some research, I eventually sat down and ran some optimization to my sudoku code.
Some things that seemed trivial took several days (and hours of frustration), thanks to things like the syntax of the language, and lack of sleep.

The first thing I noticed was that output to the screen took a LONG time, and that running the program without output to the screen was much faster (I did output the result to a file though). Now, to get things in perspective, in the time you will blink, the program would have run 5 to 10 times, according to which article about blinking you read on the net (I just learned it takes some 300-400 ms in average according to Wikipedia). With no output, it would run 4 times as fast.
This led me to think how else I can optimize the code, since this felt like cheating. So, I change the way I held the data, tweaked a couple of things, and eventually managed to get it running 3 times as fast, which would be the time it takes a medium-sized hummingbird to flap it's wings.

Anyhow, I remember that looking for answers on the net for how fast output is didn't help me, so I decided to run some tests.
On my machine (I7 2600k, 4GB ram), it seems to take about 3.8 e-05 (or 0.000038 seconds) to print a character to screen (printing a large amount, and doing averages, of course).
Printing random numbers took about the same (up to 4.23 e-05), and it seems that strings in C++ are a bit quicker using operator +=, than pushback() (even though it's really a small difference, up to 7% at most).
I then found some sites where people found out that printf is quicker than cout (their code ran true, but in my tests it gave the same speeds using printf and cout) and that fwrite is quicker than fprintf which is quicker than ofstream.

During the time I was intending to write this, I ran into several other interesting things (you might think otherwise, but that's your right :)
First we have an article about vaccinations. I think it raises a valid point.
Then we have one about circumcision. I don't agree with them on that.
And as usually happens, I managed to get to completely different areas, such as why are manhole covers round and Reuleaux polygons which would also be useful for manhole covers, since it means the cover can't fall into the hole :).
I think that's plenty for today, I wish you a great day/night, and I think it's bed time for this baby :)

 Blog 

Sudoku

Wow ... been a while since I sat down to write ... Good thing nobody noticed :)
Started getting back to coding about a month ago. Not easy, taking into consideration I got back from work around 8-10 PM, exercised somedays, and woke up every morning to go to work.
Anyways, the language I choose was C++. Quite quickly I remembered why it wasn't my language of choice :) ... It can be messy ... Supposed to be faster though ... Anyhow, not interesting ...
The project I decided to work on was Sudoku. In case you wonder why, since there are plenty of programs to solve them, the reason is because I always said I'll write one one day. Also, it's a good way to sit and code.

The project took me way longer than I thought it would. After reading my comments and watching the timestamps, it makes more sense. Most of the work was done between 12 and 3 AM :).

The first bit was doing it by logic ...which was a pain because you actually need to use logic, and taking into account the fact I was rusty and didn't use C++ for ages, that I did it when I was suppose to be asleep ... It's rather nice to see it's working.
It'll solve a sudoku in some 0.03 seconds ... Mind you, I got a rather fast computer to begin with.

Once that was done, I sat and made the brute force version. Much easier to code, let the computer work the hard way ... To my surprise ... it takes a bit less than the logic way to run ! .

Besides some nasty bugs I ran into (which were sometimes hard to find, and sometimes just plain embarrassing, like having the wrong bound check on an array, the whole experience has been enlightening.
Will create a small graphic user interface, and move on to the next project :).

 Blog 

Passover

Not much going on. Been sick for a week or so. The usual trip to the doctor, then being send to do blood tests, having the bad luck of being there the day before passover, so there were only 3 nurses taking blood, and the line was endless and took forever (also managed to forget my wallet the first time I went ...meh)
Used the extra time being sick and in bed to finally watch True Blood, which have been sitting around for a long while now (not too bad) and finish some games.
Anyways, wish you all a happy passover / easter.

 Blog 

Time

Warning, disturbing music ahead !

This week we ran into Rebecca Black - Friday. This is a terrible terrible video. It's actually more funny to watch than the parodies about it because it's so bad.
It's mainly used to annoy other people in the office and to laugh about how bad it is. When we heard it first, it had "only" some 25 million hits. Now it has almost 50 million.
Now, the only thing more impressive than this, is the fact that this video generates more hate than a mosque filled with Al-Qaeda fanatics on an especially hot friday. 90% of the people who voted, hated it.
I do feel a bit sad for the little girl, but then again, I also feel sorry for myself for having listened to it.
One thing led to another, and if you speak hebrew, you are welcomed to listen to this This kid , realize that Rebecca is not the worst out there, and then watchthis video responce which is hilarious and actually good :)

Warning, disturbing math ahead !

Anyhow, using the law of small numbers, and some healthy curiosity, I started browsing the world wide web, and here is what I learned:
First of all, if you'll calculate the total time wasted by people liseting to her song (and this is only on youtube) you'll get some 325 years. If you can go back in time by this amount of time, you'll hit the date when Sir Isaac Newton wrote his Philosophić Naturalis Principia Mathematica.

One thing led to another, and during that time I learned about Auto tune, which is a software that help singers to hit that perfect pitch .
The next thing is having a look at youtube's top 10 watched videos. This was highly dissappointing since it took away what little faith I have in human society (On the bright side, it also made me install office, so I can play with excel).
If you'll do the same calculation for the top video there (I'll put a list at the end, just in case you feel like wasting your time like the other billions of human beings out there), and go back in time the required amount of time, you'll hit the good old days of Tutankhamun. Here are some facts you probably didn't know about him:

  • He lived some 3400 years age
  • He became king when he was 9 (yes, talking about my small faith in humanity ...)
  • He died at the age of 19.
  • He married his half sister.
  • He broke a leg before he died, and suffered from Malaria.
If you want to read more, do it yourselves, I provided you with the link.

If you aren't disturbed enough, I'll point out the fact that this video isn't the one who wasted the most of humanity's time. It's actually the 2nd one who did (by roughly 40 years) which brings us to the Mycenaean Greece (Don't ask me what's interesting there). Last, but not least, I took the trouble (since I doubted you will) to calculate the total time wasted by youtube's top 10 songs, did the math (multiply hits by lenght, divide by seconds, hours, days, years, and google up the results) and traveling back in time by that amount of time will bring us to the late stone age.
Yes my dear friends, we are talking about almost 20,000 man years. So, if youtube wouldn't exist, and mankind would have put his time to bettering humanity (after the usual wars, religions, and other things he tend to do with his spare time) instead of watching youtube's top 10 videos, you could have expected the same amount of advance is life style and science that happened since the stone age.

K, I feel that even if not to the extent of youtube, I did made my small contribution to wasted time in the world (but I think it's far better than most of the videos on the list).
Here's the top wasters list:

1. Justin Bieber - Baby ft. Ludacris476504704 views, 3399.71 man years
2. Lady Gaga - Bad Romance351620853 views 3434.14 man years
3. Shakira - Waka Waka(This Time for Africa)309961284 views 2073.87 man years
4. Eminem - Love The Way You Lie ft. Rihanna296974332 views 2325.99 man years
5. Charlie bit my finger - again286339624 views 508.46 man years
6. Justin Bieber - One Time222161184 views 1711.85 man years
7. Eminem - Not Afraid206729645 views 1697.83 man years
8. Miley Cyrus - Party In The U.S.A.198227782 views 1263.43 man years
9. Pitbull - I Know You Want Me (Calle Ocho)167844208 views 1309.28 man years
10. Evolution of Dance166110666 views 1896.24047945205 man years

Analyzing it by time wasted instead of popularity,places 1 & 2 change places, and the same goes for couples 3 & 4, 5 & 10 and 8 & 9.
So Lady Gaga is the biggest time waster (per song), but Justin beats her easily since he has 2 songs there (5111 man years), and then there's Eminem (with 4023 man years)

Oh! And last, but not least, Miley Cyrus is hot. So time spent watching her video (8th) is not wasted time :)
The list (and links) is here .

Click here to read older posts.