Got regex mojo? Not so fast!

If you think you’re a regex person (not following what XKCD has told us), and that most problems can be solved with simple (yet always too simple) regular expressions, I’ve got a challenge for you:

I know a bit of regexes (use them quite a lot with VI’s search, but it’s not ECMAscript), and I’m stuck at abba.😀 Gotta study a bit more, or learn how to think again. I could match all the “should not match” words, would be a matter of inverting the match, but I couldn’t find a way to invert the search… thanks, ECMAscript!🙂

I hope you have better regex mojo, you’ll need it!

Back, and with hitboxes!

Hello there! After a short break, I’m finally getting back on track! This last month has been quite a ride, so many new experiences and, while not busy busy busy, been lazy lazy lazy.🙂 Truth is, I’ve been resting or running errands when not working, and the little time I had at home I used to relax and rest a bit.

Can’t say it didn’t work out, after all, here I am once again!😀

I took some time to also beat some S3&K with Super Tails (on the cellphone, touchscreen gaming is hard!) and Warcraft 2 (only did it before on the PlayStation, the PC version seems to be much nicer, although more rough), things I’ve wanted to do for quite a while!

While we’re at it, another game-related thing is my new commit on the MM3 repository! I’ve finally been able to test hitboxes (even the “debug” mode works now!) and it works great! It’s not a JAWS feature, but my implementation will do. I still need to adjust its size for the current animation (different shapes, different boxes), but that’s work for another commit.

Beside everything, now that I’m a full time Java developer, I’m learning more and more about its design patterns and how things go together on large systems. It’s been a wild ride, but I’m quickly getting used to.🙂 Gives me the creeps to look at some of my old implementations, they desperately need refactoring!😀

See ya!

Utter, voice actions for the Moto X impaired

Hello there! Tonight I’m going to talk about a new app that I’ve found, reading on some blog around the interwebs… quite a generic sentence. It is a really nice and useful app called “utter!”. It claims to be a voice assistant app, but more useful than the iOS’s Siri, which is quite a claim! One of its main differences is that utter! supports offline actions (using Google’s offline voice recognition feature).

It is still under heavy development, but it has potential to be one of Andoid’s killer apps, that if we’re not counting on the improvements of Google Now’s usefulness (which still doesn’t offer offline support). Even still being a BETA app, if you need to use your device while driving, or cooking, or running, or simply having your hands busy, it is THE app to install, since it handles most day-to-day needs.

About the voice actions, it has plenty. From telling you what time it is, to setting alarms and replying messages, seemed quite complete to me (it still needs to support Hangouts better). It also offers Tasker integration, which is a really really nice thing, if you bought the app, unlike me.🙂 For the power users out there, it allows you to customize new commands and to call actions such as Android activities and applications, simplifying the “action calling” process. That alone makes it very very useful. I found some minor hiccups using it on my Nexus 4 (such as a small conflict with “always listening wake-up” and playing music at the same time) but nothing that prevented me from using it. Even with these minor defects, it is still more useful than the Google Now + OpenMic+ combo.

You should check it out, it’s free! Share your review, and don’t forget to report bugs using the internal tool, so you can reach the developer in an easy way, leaving the Play Store alone. Well, that’s it for tonight, I’m going to check out so, take care. Also this post was entirely dictated, minus a few corrections of course, using my phone at a Google Keep note. Bye.

Learning a lot, working a little more…

Hey there again. Well, the new project is going OK, but… while the first week was great, the second came with a surprise bomb, and now we’re trying desperately hard to beat a tight deadline for an out-of-mind scope. At least I’m learning more Java than I thought I would.

No clue that this post is just a small “bump” for the blog, since I’m quite busy and I don’t even have time to update this thing (it’s also of course not near my “top priority”). Anyways, see you in a few days. I’ll probably be able to write a bit by Friday. Let’s see how it goes.

Ancient Android root attempts on a chip RockChip tablet

Hello there! I’ve probably mentioned earlier that I’ve got two cheap tablets, and I got to root one of them. At least I was able to update it to 2.3 (I guess, don’t remember) with the Uberdroid distro image. Well, the other one has a RockChip chipset, and that’s quite harder to do, since z4root couldn’t trick it. I’m trying some other root methods, but for now, no success.

If after these new sideload attempts I’m still not successful… well, I’ll try some ADB methods with Windows applications. But that would be the last resort. Anyway, I’m playing a lot of music and taking care of pets/home when not at work, so, not much time to write and create new code. Let’s see how it goes.🙂

JenPop and Genetic Algorithms on the loose

Hey there! I’ve committed a new class on JenPop, and it’s called “Individual”. It was made to represent the rules of typical genetic algorithms:

I’ve read a bit more on the subject and figured that genetic algorithms, although being able to achieve good solutions with little computing, are only suitable for problems where brute-forcing isn’t feasible. For instance, they do a nice job on combinatorial problems such as the classic knapsack problem, where you have a list of items with value v and weight w, and you must figure what’s the maximum value you can carry in a knapsack of capacity wc by combining different amounts of those items.

And that problem was chosen to serve as the first example. At this kind of problem, a naive approach can easily become unfeasible as the input list grows. With an evolutionary approach there’s a bigger probability that it will result in a better solution, given the same time limits. And even if the solution isn’t better, it will be a decent solution. The more time you let it roll, bigger is the chance of getting a great result.

For the classic scenario with a knapsack with wc = 15, and a (v,w) item list of (4, 12), (2, 2), (2, 1), (1, 1), (10, 4), I was able to achieve the following results:

30 iterations: Best result was { 0, 0, 4, 0, 2 } (v 28, w 12)
100 iterations: Best result was { 0, 3, 0, 9, 0 } (v 15, w 15)
500 iterations: Best result was { 0, 7, 1, 0, 0 } (v 16, w 15)
1000 iterations: Best result was { 0, 3, 4, 4, 0 } (v 18, w 14)
3000 iterations: Best result was { 0, 1, 1, 5, 1 } (v 19, w 12)
5000 iterations: Best result was { 0, 0, 5, 2, 2 } (v 32, w 15)

You can see that while none of those runs delivered the optimal solution, which would be { 0, 0, 3, 0, 3 } (v 36, w 15), they got close enough to provide good solutions. Also, it becomes clear that randomism takes a nice part in this, giving us the chance of achieving a great solution with only 30 iterations. These results also show that the more you let it run, bigger is the chance of getting better results.

Anyway, see you!😀

New project at work = more free time = more hobby development

So, at last, I’ve joined the new project team, reading documentation and “first steps” to develop the new application. They seemed pretty organized so far, and I was able to solve all the hickups I’ve had when starting to install the development environment. Since I started by the end of tthe day, I didn’t have much time to do it and might finish tomorrow.

Since forever, my HabitRPG (they started running ads now?) is telling me that I must do four tasks (and I plan to kill them tomorrow):
– Put Carlin’s Explosion on GitHub;
– Establish a JenPop goal;
– Commit new code into it;
– Put Clonix (my attempt at a 2d physics game engine) on GitHub.

I’ll try to create some new tasks (and honor them, FFS) to better document and maintain those projects. But let’s see how things go. Anyway, tomorrow’s a big day so, see you then!