Showing posts with label fun. Show all posts
Showing posts with label fun. Show all posts

Wednesday, January 22, 2014

That was a long night

Wow, how hard is that! Getting back to work after quite a while. Things like setting up a Debian virtual guest seem to be tricky. No step can be made without a google search. And why am I not cheetah fast on my vim? Ups... the client is waiting, so at least there is a whip.

I stepped out of programming in Ruby when the version was... OMG! I've completely lost the track on software versions and it was just a year and a half. So I read magic like: The current stable version is 2.1.0. I remember a talk by (wait, what was his name), right, Matz! Yes, in 2011 in Berlin, he said something about Ruby 2.0. I've left around 1.9.4 I guess. Rails was before version 4. Jesus.

My market value went from 50k €/year to 6k (in programming field). I've changed, OK. Let it be. But still, I'm a third engineer in line after my grandfather and dad. So I'll fight for the family name as if it was a Game of Thrones season five.

I've travelled and I ended up meeting people from Jiva Institute. Ou, I remember – I stepped out of programming to become a human system engineer (gems, magic, reiki...) and now I go to India to work as a software team lead/brainstormer on Ayurvedic ideas. At the end, not everything got vanished, I've just lost the sense of a productive software developer. Well, the internal journey had to happen and it has a price. And value.

It's not that bad. I've looked through my past posts and different blogs I've managed. They surprised me and made me happy – there is nothing about myself. It's just work and interests. They are like a footprint that stands for – this guy was very curious about the world. That's good. Now it's just about time management and finishing tasks one by one.

In the meantime I wrote a book (releasing this year), I've sold everything and traveled with a backpack (which you can check at soldnpacked.com), I had a lot of fun and finished off gracefully like a brave Apache. Changing continents soon and posting on WIFI! Cheers from Peterborough, Cafe Nero.

Wednesday, January 11, 2012

Refactoring approach story

I have a feeling that everyone is omitting the shit. Or maybe they just not shout when they found it . Every time we find shit we need to shout - it makes others pay attention to it and stare at it for a while. It may happen that is was actually not a shit, but a similar looking pile painted in brown for some very important reason. Then maybe someone who made it can explain his/her intentions. Otherwise it should be cleaned as a regular shit.

Points are not given by stepping over the shit, only by cleaning it and being sure that some other shit was not dependent on it. If you think its faster to just run and jumping over all the piles than I asure you that you will find yourself in the air with a scary face expression, anticipating the fall into so cold 'deep shit' or 'big browny'. Jumping is allowed only when shit is not ours, or we cannot clean it. 'Cannot' refers only to a situation when the shit is not ours.

If you can't recognize the shit by how it looks, you need to smell it. If you are not sure of the smell you can ask others and then we will smell it together. It's always better than omitting it. To make yourself able to distinguish the shit from a not shit you need to be sometimes in the shit-free places. And learn how it is not to smell it. Otherwise you can just get used to it.

Friday, August 12, 2011

Basic needs of programmers

If anyone thinks that the most important thing for programmers is the ability to code - they're wrong. Even if it is a super interesting project that involves millions of users it will fail if programmers have no possibility to meet their basic needs. And I'd like to stress the word possibility.



How many of us, programmers, were sitting in front of a computer for hours without eating, drinking or going to the toilet? Do you remember this project that you had once, when you just have to finish in three day and one test is not passing or you want to make this query run even faster that it could? Or just refactor the code before pushing it so it shines more that it needs? And you were this hacking-freelancer that will do the best project ever! Yes - a freelancer working from home.

It works completely different in the office. You start working with a coffee, water, little chitchat with everyone. You see people going one after another to the toilet, eating snacks, walking around. And then on of them brings the news: there is no running water in the builiding! OMG!! Panic!! How are we gonna pee after first three coffees? We have to go home!! Everyone needs to pee in the exact same moment! Dear God!! I didn't drink anything but maybe I'll need to pee! I have to go home! There is no water running!! NO WATER!!

Forget about programming. This is not freelancing at home, this is working in the office. Even if you don't have to pee, you will leave just because the toilet is out of order. And there is always that argument of Maslow's pyramid.

BTW. I need to pee (excrete) and I'm the only one left in the office... shit...

Thursday, August 11, 2011

Khan Academy subtitles

Thanks to sharing knowledge and open-community I discovered a very badly page ranked website called Khan Academy. Of course if I had followed TED more carefully I would have known about it before.

I mentioned open-community because it was Melodie, friend from Couch Surfing, who showed me the Academy. Moreover, we found it in a paperback Creative Commons magazine... just saying that I was there because of ECOOP 2011 (programming conference) makes me dizzy. Too much knowledge sharing! I will write a summary of ECOOP soon, but let me get back to Khan Academy now.

The Academy is simply a great place to learn. One teacher, good teacher, trying to explain the magic of math, physics, biology, chemistry, organic chemistry, astronomy, economics, banking and more in a very approachable... especially math. I realize that many people know about it, but I didn't so I'm still under its influence. By now I have gained around 130,000 energy points, and 67 badges! What a great way to make humans want to learn. Shame that I cannot share my rank using some kind of a widget.

As I finished a degree in computer science, I must say that the way this guy explains math is just awesome. Anyway... there are subtitles. Everything is subtitled in English, which is a base language for others. I translated first video to Polish! I was shocked when I saw that this is the first video translated to Polish on the Academy. Ever!

We Polish people need this Academy for our kids! It should be subtitled in Polish to terminate the stagnation of our education system! OK... I don't believe in that, but it can start something, can't it? Why didn't I have a teacher like that when I was in high-school? Or better, why the hell didn't my teachers know about it? It is already 5 years old!

I think I'll write a petition to students' governments of English Philology departments around Poland. Who knows, maybe together we can translate it in one term, cause by myself I'd need 46 years to finish...

Polacy, do roboty! :)

Thursday, July 7, 2011

Fast! iterative algorithm for generating permutations from sets' single elements

I like it. I like this one. Last algorithm for this problem (here) was O(n^3). Now it's O(n). It may mean two things: first one was very shitty, or that the second one is really good. Probably both are true.

I came back home, without a laptop. With one hand holding the Algorithms book (I really recommend that one) and with notebook and a pen in the other. I choose notebook and pen. It did the trick.

I know I masturbate on that issue, but it's fun. After some furious paper programming I got here:


I asked myself 3 questions at the beginning:
  1. How many times "1" will be first?
  2. How many times "4" will be in the result?
  3. How many times "5" will be in the result?"

I wanted to answer that questions without the use of any offset indexes kept in memory in other array. Keep it simple: what do I know about my input data?
So my answers were like that:
  1. If I take all the sizes of following tables and multiply them, I'll get 12.
  2. Always, cause it's a single element array, so 36 (total possible permutations.
  3. The same as answer number one. 6 times in cycle of 3, 18.

The main conclusion was that I can fill the results array column by column instead of row by row. All permutations will be fully calculated at once, at the very end. No gathering the permutation by permutation and then pushing it to the results. No no no, that needs indexes and traveling across the array many times. This idea dropped the complexity from O(n^3) to O(n).

Cycles, subcycles, offsets. The most important thing was to calculate a proper index in the result table and stick the current argument element exactly there (IBID). No more talk, code is below and benchmark is on the gist comment.

Tuesday, July 5, 2011

Iterative algorithm for generating permutations from sets' single elements

My friend asked on facebook for a iterative algorihm that would generate all possible strings from given sets in a way that for ex. given {a,b,c}, {d,e}, {f} should produce {adf, aef, bdf, bef, cdf, cef}.



There is still a recursive call moved to bump_next method. I'm trying to get rid of that one and make it fully iterative.
That was much fun doing it, as it has some tricky parts. Probably faster algorithm for that already exists, but I couldn't find any. Lots of fun.

Sunday, July 3, 2011

Do you find this post helpful?

I remember the last November. I tried to export my photos from Picassa. My requirements were: keep the folders structure and the changes I made with the Picassa tools. Anyone would do it faster than me, because in Picassa you can export only one folder at the time. But I didn't want to do it sequentially. I was looking for an automated tool to handle this process. Unfortunately I didn't found one. Querying Google for an answer showed that many people failed searching for this functionality.

So I expressed my frustration.

It is funny and sad to see that 10 out of 10 people found this answer helpful.
Reasons:
  1. How could my answer possibly help anyone?
  2. If it actually didn't help them, then the functionality of the "Was that helpful?" button is ambiguous. It works more like voting on stackoverflow. Actually, as a side-effect of it's ambiguousness, it works exactly like voting, saying: Yeah! Damn right! We feel the same! which has nothing to do with answering the problem itself.
  3. People frustrated by software seem to solidarize, ready to support someone who expresses their own frustration.

For me, the important conclusion from that silly story is that I would never use "Was that helpful?" on any of my applications. The question, I guess, should be more narrow, for instance Did that answer helped you to solve your problem? or Did this answer your question?. I think it's an issue for social informatics study.

Saturday, July 2, 2011

Croissant equation and Prolog.

Computacional geometry and computer graphics are subjects I rarely play with, but I like their connection with the real matter. Today in CosmoCaixa museum I found mathematical equation for a croissant. That was quite amazing - full exhibition devoted for math and equations describing natural shapes. I see croissants often in Spain and I have to admit that I never thought about their shape as a mathematical expression.


This can be ordered like that:


This can be expressed as:



and be calculated with use of:
I wouldn't recommend to find solutions for this equation in Ruby, so the example is in ECLiPSe CLP. It is a great tool (environment) for solving contraint logic problems. It's also fun. For me.