Tuesday, October 19, 2010

The best summary of visualisations techniques ever

Thanks to Sorin Mocanu, I saw this comprehensive overview about interesting visualisation techniques.

Monday, September 6, 2010

Design with Intent

Wow! This is sooo interesting! Have you ever wondered how to influence someone with small things?

Design with Intent wiki page - this may give you a hint on what is small around you and matters.

By the way, maybe that will change the way you think about things.

Saturday, September 4, 2010

Placek jabłkowy (polish)

[I think I should find a different place for posts like that.]

Z okazji przyjazdu mego dziewczęcia postanowiłem przygotować słodką niespodziankę. Przy podanej tutaj ilości składników można wykarmić cały batalion, więc proponuję następujące poprawki:
- ilość wszystkich składników podzielić przez 2;
- zrobić więcej ciasta (około połowy więcej).

Wychodzi więc na to, że trzeba użyć składników w następującej ilości:


  • 2 i ćwierć szklanki mąki 
  • 5 łyżek cukru
  • 1 kg jabłek
  • 15 dag orzechów
  • 10 dag rodzynek
  • 3 jajka
  • 3/8 szklanki oleju, a więc nieco mniej niż pół
  • 3/4 cukru waniliowego (cały też może być ;-))
  • 3/8 startej cytryny, a więc nieco mniej niż pół
  • 3/4 łyżeczki proszku do pieczenia z czubkiem
  • 3/4 łyżeczki sody
Smacznego!


Po upieczeniu wygląda znacznie lepiej.

Why PHP sux (polish)

If you we're thinking of a couple of good reasons why PHP sucks, here's a handy summary (in polish, brought to you by yanoo).

Why I don't like Java's finals

Although I favor immutability over mutability, I must say that I don't like Java's finals. The intention when introducing it was definitely great and good, but I think it does more harm than provides benefits.

Consider the following.

Finals prevent you from mocking classes.
Yes, they do. I hardly know any framework that is capable of mocking class that is final; you can play with some workarounds like unfinalizers or framework extensions to do the trick, but it comes for the price of a test / test set-up complication (at least) and an additional cost (running time, introduction time).

There are people who suggest that you don't need to mock classes for your tests, but I hardly find it acceptable: imagine yourself writing unit tests for class that uses a "final" server as a parameter:

class LogCollector {
   public LogCollector(LogServer server) {
     // whatever
   } 
}


I personally prefer to use fine-grained tests before running large test routines (requiring real server instance set up, for example), but given the server is final, I have no choice - I am left with large tests, with all their costs.

Finals lie to you.
Consider the following code:

final Set customers;

It's true, that once assigned, the customers set cannot be assigned once again, but you can still modify the set anyway - it's a matter of calling customers.add(Customer). Unless you're using an UnmodifiableSet, nothing prevents you from changing it's contents.

Finals force you to predict future.
I'm not much of a subclassing fan, but it is understandable to subclass something from time to time to enhance a bit the functionality already given. With finals, you can't do that by design. Thus, you have to predict the possible future use of your objects - and I feel no one was able to do that for something more complicated than a primitive type.

Disabling subclassing may also be a pain in an inflexible type system like Java's:

class NoisyCar {
   void run() {
     System.out.printl("BRRRRRRUUUUUUM");
   }

   // other methods 
}



class QuietCar {
   void run() {
     System.out.printl("brrrrrruuuuuuum");
   }

   // other methods, same as in Car 
}

X rentedCar = carRentan.getAvailableCar(); // We don't know what do they have available, but we need a car immediately

What's the type X?

Possible solution 0: Ducktyping. Not in Java.

Possible solution 1: We could use an interface Car, but then we get some serious code duplication (we would have to either copy-paste other methods or refactor out common code to a separate class, which may - in this case - seriously complicate your life).

Workaround: If we had functions as first-class values, we could probably come up with not a bad workaround and carry on with finals, but... well, we don't have them in Java.

Possible solution 2: Allow removing final, introduce a superclass and let NoisyCar and QuietCar subclass it.

Any other ideas?

Finals prevent you from flexible debugging.
I've found out that recently: while debugging, you cannot change the value of the final variable (it's not a surprise, though). What's the problem? You cannot experiment - while debugging, you cannot change the value of an interesting variable and thus you're sticked to a certain path of execution. Bad, if you encounter it in real life.

Finals encourage bad practices.
Namely, they encourage you to expose fields of a class. Since no one can change them, what's the big deal? Well, there is. You're explicitly saying the class users: this field is publicly available. You can use it. Once you change your mind and, for example, decide to provide an active getter (fetching missing data, for example) with some decoration around it (like sanity checks) you can't - someone uses the field already. And you cannot deprecate a field to let users know it's going to be gone, can you?

On one hand, it's bad to create not-fully-initialized objects. On the other, lazy evaluation may be a great optimization. It's all up to the case you're dealing with. Will finals help you? Well, they limit your flexibility and let the implementation leak, so you may have trouble.


That's my 2 cents. Please read both why finals should be deprecated and why they shouldn't and make up your mind. In my personal opinion, they rarely are worth using.

Edit: there is some follow up on this post here.

JavaScript quirks explained

Ha! It's good to see that blog to help you in understanding what are you playing with when hacking JavaScript. Check out the references (1, 2), too!

Friday, August 13, 2010

Interview hints

I find these interview hints useful (thanks to mpetrsson)

My first Google blog trail

I didn't expect my first trail on Google blog to be like that...

Wednesday, July 28, 2010

Git tricks

A couple of nice git tricks by Mislav Marohnić.

Tuesday, July 27, 2010

How leaders inspire action

This is great (and complementary to Tribes book by Seth Godin) video on how leaders inspire action, what is necessary to make success, and the Diffusion of Innovation Law:

Simon Sinek: how great leaders inspire action

By the way, if you haven't tried TED, make sure you do so.

What motivates us

Given my experience as a President of Computer Science Students' Association at my university and my recent readings (be careful! Hardcore evangelism!), I started to investigate a bit about successful, modern leadership. If you're interested, have a look at this video:

The surprising truth about what motivates us

Wednesday, July 21, 2010

Installing Skype for Fedora 13

Installing Skype on Linux is always a pain. After installing Fedora 13 x86_64, the following solution worked:

And, the good thing is, my mic and camera worked out of the box with it!

I hope it will work for you too.

Saturday, July 17, 2010

Why you should speak perfect English in IT

I bet you've heard that at least a couple of times: "Learn English, man, it's crucial in industry". Indeed, it is. No doubt about that. But how far should we go? We're never going to be able to challenge native speakers anyway, right?

You're not going to like the answer.

Level 1 - local backyard

English is crucial for a couple of reasons. First of all, it's a lingua franca of computer science and software engineering (actually, not only there, as you may have noticed). You talk English with team mates, you read reports written in English, you read blogs (guess the language!), you write code in English (don't dare to tell me you don't!)... English, English, English.

Secondly, almost all knowledge in this industry is presented in English, and the only reasonable way to take advantage of it is to learn the language (don't bother yourself with waiting for everything to be translated - that is simply impossible). If you want to be a better engineer, you have to read in English.

Thirdly, you'll have to speak from time to time with foreign employees, and the easiest way would be to use English, since everybody speaks it.

The basics of English should suffice, right? You can read, you can write, you can talk with other people. You'll survive.

Unfortunately that's true for a company far less international that you would expect.

Level 2 - facing the real world

When you get to a real international company, basic English is not enough. After joining a company that hires lots of people of different nationalites, you get exposed to real English. English spoken every day, every minute. You just have to be fluent - otherwise, you'll be totally worn out by the end of the day, being tired of translating everything both ways. You may get exhausted even sooner, if you're not lucky or qualified enough. That hinders you from expressing properly your thoughts and ideas, you loose your self-confidence, you make mistakes - both while talking to other people and coding. That boils down into one serious problem: you seem to be underqualified for other people. They get a bad impression about you. You loose points.

If your English is not good enough, you may run into problems with dealing with other people. You will simply be unable to communicate with them, solve problems or simply conduct design discussions. You won't be able to defend your ideas. You won't be able to even present and - worse - sell them.

And, most of all, you'll find it hard to become mates, and that may result in isolation and/or slower progress at work.


Fluency in English is also crucial for sucessful leadership. It's not an advice useful for PMs only. Without being able to communicate fluently, you won't be able to lead your co-workers. You may be pushed aside a bit. You won't have influence. Having no influence will be frustrating and you'll get the bonuses related to frustration, like getting bald soon.

Someone experienced, during one of his talks to students at my university, gave a hint how good your English should be:

You should be able to give this presentation in English as fluently, as you would do in Polish.

That's a good hint, but I believe this is the lower bound. Personally, I think you should not only be able to give a presentation in English as fluently as in Polish, but also be able to make it as enjoyable as you would do if you present something that you're really into.

That's all about selling.

Imagine you are speaking English with all of your co-workers (native speakers and people who actually do that: you can skip the excercise, and the whole rant as well). Imagine yourself not being able to get the jokes, come up with a funny reply, defend your position in the tribe. Will you achieve the same thing - position, status, respect? I seriously doubt. And what happened to the people that did not get the jokes?

Level 2.5 - emmigration

If it happened to you that you had to emigrate, you may have found that speaking fluently with people living at the place you just moved in (I assume that's a place where local yokels speak different language than you do) is somehow crucial to make them become your new friends. And making new friends outside of your home country is hard. It's all a matter of psychology - in the long run, you'll need these people so that you have someone to chat with or enjoy local events. It's not a problem of having a wife or not - people are social and enjoy packs, usually of size bigger than 2. It's also a bit different thing than at work, where it is a matter of being succesful. Here it is a matter of (enjoying) your life.

Conclusion

Speak English and never stop improving - that would be the general thought. We may not be able to challenge native English speakers in literacy or poems - but we may be able to joke with them, sell our ideas and buy theirs. We may be able to hold a position in the crowd - and not fade out in the both work.

Sunday, July 4, 2010

Zueri faescht

The Swiss know how to party.

Thursday, June 17, 2010

Dinosaurs are not extinct



I've found it somewhere in the internet. 

Thursday, May 27, 2010

Weird TextBox.AutoCompleteCustomSource problem

It's been a while since I posted anything here, but please forgive me - I'm in the middle of finishing every project I'm currently working on before I'm gone for my internship (hooray!). Since there's a lot to be done, this time I'll leave just a short note on some weird problem I've just encountered.

So, not to prolong too much, here's the thing:

If you have encountered a "The specified cast is not valid" when running tests (I'm using NUnit) that have anything to do with TextBox AutoCompleteCustomSource (namely, when you add something to the autocomplete source via .Add(string) method), mark your test with annotation RequiresSTAAttribute. No one explained what is wrong, but the solution works. Maybe I'll investigate what's going on when I'm over and done with all of my current engagements (read it as: never ;-)).

By the way, I'm using .NET 2.0, but it may still be a problem in higher versions.

Thursday, May 6, 2010

Possible refactorings reference list

I've recently encountered a catalog of possible refactorings created (mostly) by Martin Fowler. Although the author is a great authority known for some complex (yet brilliant!) solutions, this list is mostly consisting of the obvious refactorings you do (or even unconsciously implement along the way) on a daily basis. Although mostly simple, I encourage to get familiar with them  in your spare time as there may be some things you may have missed in your (self-)development.

I would consider this catalogue a checklist of "things one should know about refactoring".

By the way, I encourage you not to follow these suggestions blindly, as there are situations in which the result of refactoring is not the desired situation (note the dual refactorings!).

Enjoy.

Innowacyjny produkt nie musi kosztować milionów

Moja ostatnia delegacja zaowocowała publikacją na nierobcietegosami.pl. Zapraszam!

Tuesday, May 4, 2010

Template metaprogramming being useful part I - Self-inlining anonymous functions in C++.

Recently - thanks to the course conducted on my University - I've become interested in template metaprogramming. During some of the discussions on that topic, I've been told that metaprogramming (and even templates!) are too complex for business use. With my previous proffesional experience in C++ (which is currently none) I couldn't obviously argue with that statement; nevertheless, I've found an interesting article accounting for usefulness of template metaprogramming - Self-inlining anonymous functions in C++, which I believe makes it worthwile to learn how to use this functional language hidden in C++ templates.

edit: thanks to Rafał, another interesting source can be found here.

Monday, May 3, 2010

lifedev.net - o kreatywności, innowacji i programowaniu

Świetny blog z przemyśleniami o tym, jak tworzyć, jak nie stracić zapału i wszystkim, co związane z efektywną kreatywnością.

lifedev.net.

Polecam uważać, bo wciąga niesamowicie.

W szczególności programistom przyda się uzupełnienie do wykładu Marcina Brodziaka w Instytucie Informatyki z 31 marca 2010.

Friday, April 30, 2010

Znów o słuchaniu

Udało mi się popełnić drugą część swojego artykułu o tworzeniu prezentacji. Zapraszam!

Wednesday, April 21, 2010

How SQLite is tested

Interesting article showing that even open-source software can be tested professionally. What is stunning - there is 679 times more test code (counted in SLOC) that in the application itself!

Thanks to Arek for showing me that article.

A word about bug reporting...

... which is somehow obvious when said, but it's not a common knowledge yet.

How to write a good bug report

Friday, April 16, 2010

A nice mock-up tool

During one of my recent projects I had an opportunity to try out MockingBird. I must say that - yet still a bit limited - it is a wonderful tool to mock up interfaces and try them out on regular users.

Unfortunately, I have not tried out other tools (this one sufficed) - of which I've heard of balsamiq - but it seems that this one is really worth mentioning.

Let me know if you have your own experiences with these tools!

23.04.2010 - Grzesiek has posted the list of 10 Excellent Tools  for Creating Web Design Wireframes on the buzz. Thanks!

Thursday, April 15, 2010

O prelekcjach słów kilka, czyli nowy wpis na nierobcietegosami.pl

Udało mi się spłodzić kolejny wpis na nierobcietegosami.pl, tym razem o przeprowadzaniu prelekcji. Mam nadzieję, że Wam się spodoba i podzielicie się swoimi spostrzeżeniami na temat opowiadania ludziom o ciekawych rzeczach.

Friday, April 9, 2010

Mind mapping tool

This is going to be an advert. Let my fascination be the excuse.

ConceptDraw MindMap/Project/Pro tools.

Really cool!

Thursday, April 8, 2010

A word about software metrics...

This article gives a nice and exhaustive overview of metrics used in software (code) evaluation. I'm a fan of the cyclomatic complexity and test coverage metrics, but I was unaware of the other ones. After reading this article, let me ask: which metric do you use to evaluate your software, Developer?

Update: even more metrics (coverage-related) here.

Java object serialization - 5 things you should know about

This is an article that a Java developer should be awared of. It's not really innovative; it just points out the basics that one should know when it comes to serializing an object in Java. For more exhaustive lecture (covering many more important issues related to Java programming), I suggest reading Effective Java by Joshua Bloch.

By the way, if you didn't read Java Generics and Collections by Maurice Naftalin and Philip Wadler (homepage), you really should.

Monday, April 5, 2010

Friday, April 2, 2010

Recent readings

Holidays gave me some time to catch up with some articles I've decided to read, but was unable to due to "things-that-have-to-be-done-right-now" ;-) Having some spare minutes, I read the following:
One more to go: JavaScript closures, but not for today. I'll get to it when I'll start playing with Javascript (which I'm going to do soon).

All are worth reading (maybe except from C++ Template FAQ and Javascript closuers, if you're not interested), I think.

Sunday, March 28, 2010

NieRóbcieTegoSami startuje!

Kilka dni temu wystartowała inicjatywa NieRóbcieTegoSami. Graficznie jeszcze jesteśmy w powijakach, ale pierwsze teksty już się piszą :-) Już niedługo także i mój debiut na tamtym blogu. Stay tuned!

Sunday, February 28, 2010

Nathan's blog

Because it's worth mentioning.

Nathan's blog.

Tuesday, February 23, 2010

JavaScript scopes

At a first glance I was asking myself: why the hell one has designed scopes that way?

Javascript: The Scope Pitfall

I'm still in affection, but I'll try to find the positives of both resigning from block scopes and having pointer-based closures.

By the way, this seems to be a good article about JavaScript closures.

Thursday, February 18, 2010

Inspiration

Not so true for me, but...

Wednesday, February 17, 2010

Tossing a coin may really solve your problem...

 ... in either of two ways:

or, when you did not realize what you were hoping for, you're simply satisfied or dissatisfied with the result.

[by the way, http://zebrastojacanatylnychnogachwlesie.soup.io/ rox]

Tuesday, February 9, 2010

SHIRA - simple way to understand user needs

This is a nice introduction to the idea of structured and hierarchical requirement analysis when designing a product:

SHIRA - Structured and Hierarchical Interview for Requirement Analysis

Seems easy and effective.

Sunday, February 7, 2010

It's going to be about motivation today

Have you ever had a feeling that these corporate mottos and missions statements are just a way to make the management feel that they're doing good job? Here is a short and simple explanation, why you had such a feeling.

Thanks to Marcin for showing me that.

Naleśniki na piwie

Egoistycznie przyznam, że ten post zostawiam tutaj myśląc nieco bardziej o sobie. Ściślej rzecz biorąc - po to, żebym nie musiał go później szukać :-)

Naleśniki na piwie
Składniki:

  • 1/2 l mleka
  • 1/2 l piwa
  • 2 jajka
  • szczypta soli
  • 1 łyżeczka cukru
  • mąki - ile zabierze /ok.1/2 kg/
  • 3/4 szklanki oleju roślinnego 
Przygotowanie:
Banalnie proste - wymieszać (ubijaczką, łyżką, mikserem) - tak, by nie było grudek - i odstawić (aby ciasto odetchnęło) i zwyczajnie usmażyć naleśniki. Nie należy lać zbyt dużo masy na patelnię, gdyż brzegi ciasta wyjdą cienkie i kruche!

 Smacznego!

PS. A całość wzięła się z tego przepisu, który mi - niestety - nie wyszedł :-(

.NET SplitContainer panels do not deserve a name?

For some time now I've been coding for a world-wide company called Zehnder. I'm implementing some logistic solutions for their Polish office workers. Technology limits: .NET 2.0.

Some part of the work includes UI - that is, Windows Forms. In order to split the form into two spaces, it seems obvious to use SplitContainer control especially designed for that purpose. Everything seems fine if one does not write unit tests for the UI. When it comes to doing so, a small shortcoming becomes visible - neither of the panels of the split container have a name! Unfortunately, the assumption of NUnitForms is that each control or form has it's own name; that is, one has to make sure that each control has a name. That is not a problem to name a control; it's a matter of simple assignments:

this.SplitContainer1.Panel1.Name = "Panel1";
this.SplitContainer1.Panel2.Name = "Panel2";
 
Not a big deal. But hey, where should one put that code? Is it the InitializeComponents() method body, which is strictly forbidden to be modified manually, a good place for that? Maybe. Until the Designer decides to overwrite this code. All in all, it seems that adding a separate method, let's say - InitializeSplitContainerNames() - and calling it after the InitializeComponents() method (in the form/control constructor) is the best solution (with all of the drawbacks this solution has).

I think.

Java IAQ

I guess this is is a must-read for Java developers.

Java Infrequently Answered Questions

Saturday, February 6, 2010

Friday, February 5, 2010

Moje pierwsze risotto

W ramach wspólnego spędzania czasu udało nam się zmontować nasze pierwsze w życiu risotto.

Risotto z warzywami i kurczakiem [inspiracja]
Składniki (na 4-5 "męskich" porcji!):
  • 1 średnia cebula
  • 2 łodygi selera naciowego (pojedyncze)
  • 1 czerwona papryka 
  • 250 g pieczarek 
  • 250 g groszku z puszki lub mrożonego 
  • 250 g piersi z kurczaka
  • 3 łyżki oleju 
  • 400 g ryżu 
  • 1,5 l bulionu drobiowego 
  • 20 g masła 
  • sól, pieprz, estragon, curry, inne przyprawy
Przygotowanie
Kurczaka pokroić w drobną kostkę, natrzeć odrobiną curry, przyprawić solą i pieprzem. Przysmażyć, odsączyć i odłożyć na później.

Cebulę obrać i posiekać na średniej wielkości kostkę; podobnie z selerem i papryką (po uprzednim umyciu i usunięciu gniazda nasiennego z papryki) i pieczarkami. Groszek przepłukać (lub przynajmniej odsączyć :-)).

Dalej już jak w przepisie:
W dużym rondlu (garnku) rozgrzać olej, wrzucić cebulę i seler, smażyć mieszając na małym ogniu przez ok. 2 min. Dodać paprykę, groszek i pieczarki, wymieszać, przykryć, smażyć jeszcze przez 5 min (i doprawić).

Wsypać ryż, smażyć mieszając przez l min. Wlać łyżkę wazową bulionu, gotować, nie przerywając mieszania (lubi się przyklejać do dna!), aż zostanie wchłonięty płyn. Wlać następną łyżkę wazową bulionu, a potem kolejne. 


Pod koniec gotowania do risotta dodać kurczaka, tuż przed podaniem masło, przyprawić solą i pieprzem, wymieszać.


Wnioski po przyrządzeniu: 
  • lepiej użyć groszku mrożonego (nie powinien się rozmazać)
  • ryż arborio lepiej podsmażyć osobno, aż do osiągnięcia przezroczystości. 
  • jest naprawdę dobre :-) 


 

Wednesday, February 3, 2010

Daily FTW.

Dzisiejsze daily rządzi tak bardzo, że aż je tu pokażę.

Sunday, January 31, 2010

NUnitForms a testowanie plików exe

Traf chciał, że ostatnimi czasy realizuję zlecenia pewnej firmy mającej siedzibę we Wrocławiu. Ze względu na technologie stosowane w tejże firmie, rozwiązania które tworzę ze swoimi partnerami są oparte o .NET. Nadszedł taki moment, że trzeba było napisać testy do Windows Forms, które tworzą UI naszej aplikacji. Dość rozsądnym wyborem wydawał się być NUnitForms i na jego użycie się zdecydowaliśmy.

NUnitForms ma tą własność, że nie lubi testować plików EXE - z założenia wszystkie formatki miały być zapakowane w plik DLL aby NUnitForms mógł je testować. Zanim jednak ślepo wydzieliliśmy formatki do osobnej biblioteki dynamicznej, zastanowiliśmy się, jak testować sam plik EXE.

Da się to zrobić.

PS. I tak zmuszeni byliśmy wydzielić bibliotekę dynamiczną z formatkami. Powód był prozaiczny: nasza aplikacja była zależna od początkowych ustawień (pamiętanych w pliku konfiguracyjnym z pomocą narzędzi z przestrzeni System.Configuration). Ustawienia te były wstrzykiwane do formatki głównej programu. A teraz pytanie: jak wstrzyknąć taki obiekt z innego programu? :-) Nie przyszło nam żadne rozsądne rozwiązanie do głowy i postanowiliśmy podzielić projekt. Swoją drogą, jeśli ktoś zna jakieś ładne rozwiązanie tego problemu - z chęcią posłucham :-)

Wednesday, January 27, 2010

Tuesday, January 26, 2010

Herzlich wilkommen in Freistaat Bayern, czyli co zrobić z białą kiełbasą i cebulą

Dzisiaj zapanowały bardziej południowo-niemieckie klimaty. Odgrzebałem w lodówce białą kiełbasę, podwędziłem współlokatorowi dwie cebule, skoczyłem po piwko... i było.

Przepis będzie mało oryginalny, bo niezmodyfikowany przepis znaleziony w sieci.

Biała kiełbasa w sosie piwno-cebulowym

Składniki
  • 1 kg białej kiełbasy
  • butelka jasnego piwa
  • 2 cebule
  • łyżka margaryny
  • łyżka mąki
  • sok z 1 cytryny
  • cukier puder
  • sól, pieprz
Przygotowanie 
Cytując: na dnie garnka układamy całą kiełbasę (jedna warstwa).Piwo mieszamy pół na pół z wodą i zalewamy tym kiełbasę. Dodajemy pokrojoną w plastry cebulę i gotujemy na wolnym ogniu przez pół godziny. Mąkę zarumieniamy na patelni i rozprowadzamy ją wywarem spod kiełbasy [jakkolwiek to stwierdzenie jest dla mnie wciąż enigmatyczne, to sam po prostu zagęściłem sos tą mąką, uprzejmo wyciągając z niej kiełbasę]. Dodać do smaku soli, pieprzu, soku z cytryny i szczyptę cukru [tu mała modyfikacja: ja sobie cukier odpuściłem...]. Sos powinien być w smaku słodko - kwaśny i w miarę gęsty [... a co za tym idzie, sos nie był słodki].

W gotowym sosie dusimy jeszcze przez chwilę kiełbasę pokrojoną na kawałki i podajemy jako ciepły posiłek.
 

Polecam z dobrym piwkiem i pieczywem posmarowanym masełkiem osełkowym :-)

Ach, zdjęcia nie będzie, bo nie nadawało się do publikacji.

Monday, January 25, 2010

Testowanie aplikacji webowych - testy akceptacji

Ostatnio zainteresowałem się odrobinę rozwijaniem aplikacji webowych. Jestem w tej materii kompletnie zielony, ale dłubiąc tu i tam staram się poznać np. Django. Z racji mojego prawie religijnego podejścia do testowania swoich produktów, regularnie zastanawiam się, jak dobrze testować takie aplikacje. Traf chciał, że natrafiłem na to:

 Charming Python: Easy Web data collection with mechanize and Beautiful Soup

Autor tekstu wykorzystuje tutaj mechanize oraz Beatiful Soup do zbierania informacji z serwisów internetowych. Jednak, jeśli przyjrzeć się składni, to czy to nie wygląda na piękny framework do pisania testów akceptacji dla aplikacji webowej? Jeszcze tylko je zautomatyzować, ubrać w jakiś pyUnit... i mamy testy akceptacji.

Oczywiście zapewne istnieją jakieś lepsze frameworki do testów akceptacji (Selenium?) ale czytając artykuł o mechanize wydało mi się on całkiem niezłym narzędziem.

Sunday, January 24, 2010

Obiad-z-byle-czego

Są takie chwile, kiedy obiad należy zrobić w miarę szybko, a ma się ochotę na coś dobrego, a nie zwyczajny zapychacz. Tak się złożyło, że tej soboty odkryliśmy pokłady nieużytych dotychczas boczniaków w lodówce... i mieliśmy wskazówkę, co zrobić dalej.

Obiad-z-byle-czego

Składniki
  • 250gr boczniaków
  • średnia cebula
  • nieco ponad pół szklanki wody
  • łyżeczka mąki
  • przyprawy: sól, pieprz, pieprz ziołowy, czosnek granulowany, lubczyk
  • dwie piersi z kurczaka (na 4 filety)
  • kilka plastrów sera do topienia
  • torebka ryżu
  • brokuły
  • bułka tarta
  • 50-100g masła 
Przygotowanie
Cebulę kroimy w kostkę i szklimy na patelni; umyte i pokrojone w kostkę boczniaki wrzucamy do cebuli, zalewamy wodą i przyprawiamy solą, pieprzem, czosnkiem i lubczykiem. Gotujemy aż do otrzymania pożądanej konsystencji.

Ryż gotujemy wedle gustu. My lubimy twardszy ;-)

Brokuły dzielimy na mniejsze części (zostawiamy tylko główki) i gotujemy. Z bułki tartej i masła robimy zasmażkę i dekorujemy nią brokuły.

Pierś z kurczaka oczyszczamy i suszymy (np. papierem). Każdą pierś przekrajamy wzdłuż, na pół - tak, aby otrzymać dwa filety. Przyprawiamy lubczykiem, pieprzem ziołowym, odrobiną soli i czosnkiem z obu stron; smażymy na złoto. Pod koniec smażenia kładziemy plasterki sera na piersiach i czekamy, aż się roztopi.

Voilà! Obiad-z-byle-czego zrobiony i gotowy do spożycia - i jest naprawdę dobry. Podawać z dobrym piwkiem.




PS. Zdjęcie do najlepszych nie należy, ale robione było na szybko - żeby szamka nie wystygła.


   

Event-Driven Programming The Easy Way

O, fajne!

Trellis

Wednesday, January 20, 2010

Kontrowersyjna szarlotka

Za dużo tu informatyki, więc dzisiaj będzie o pieczeniu. Trochę na pół gwizdka, bo nie będzie zdjęć - przynajmniej w najbliższym czasie. [aktualizacja: zdjęcia będą - 19.03.2010] Ostatni raz tę szarlotkę piekłem wczesną jesienią [aktualizacja: upiekłem ją na początku marca].

Kontrowersyjna szarlotka

Składniki (ciasto)
  • 3 szklanki mąki (pszennej)
  • 250g margaryny (do pieczenia)
  • 3 ugotowane jajka
  • 3 łyżki śmietany kremówki
  • pół szklanki cukru
  • 3 lyżeczki proszku do pieczenia
  • cukier puder 
Składniki (nadzienie)
  • 1,2kg jabłek (tak, by po starkowaniu wyszło ich około 1kg) lub 1kg jabłek w zaprawie
  • kilka garści rodzynek, opcjonalnie orzechy laskowe
  • cukier, cynamon 
Mąkę posiekać z margaryną i cukrem. Dodać starte na drobno (możliwie najdrobniej) żółtka z jajek, a nastepnie dodać proszek do pieczenia. Dodać śmietanę. Na koniec wyrobić ciasto rękami, podzielić na dwie równe części i rozwałkować - tak, by uzyskane "placki" pasowały do formy, w której ciasto będzie wypiekane.

Jabłka zetrzeć (lub skorzystać z gotowych jabłek w zaprawie), dodać cukier i cynamon do smaku. Rodzynki sparzyć i wymieszać z jabłkami; podobnie z orzechami laskowymi. Osobiście lubię wrzucić sporo cynamonu, aby uzyskać lekko pikantny posmak.

Do normalnej wielkości formy (z natłuszczonym przynajmniej dnem) włożyć pierwszy placek i położyć przygotowane nadzienie. Ostrożnie przykryć całość drugim plackiem (trzeba sprytnie, bo zdarza się mu rwać). Na tym etapie ważne jest, żeby placek możliwie dobrze pasowal do formy - jeśli tak nie jest, trochę wrednie się go dopasowuje. Na koniec należy wziąć widelec i ponakłuwać całość (dość gęsto) by ciasto mogło "oddychać". Tak przygotowane ciasto wrzucamy do piekarnika nagrzanego na 200 stopni na około 40 minut. Pod koniec warto doglądać, czy placek się nie spiekł.

Po wyjęciu należy posypać cukrem pudrem. Podawać na ciepło (lub zimno, jeśli ktoś lubi) udekorowane bitą śmietaną.





Smacznego.

PS. Przepis przekazany mi przez moją mamę.

Friday, January 15, 2010

O portfolio dewelopera

Już rozumiem, czego brakowało w moim CV.
 I, jak to powiedział Jeff Atwood, "It's not our job to be better than anyone else; we just need to be better than we were a year ago." Tak, by zakończyć pozytywnym akcentem.

Thursday, January 14, 2010

Generowanie throbberów

To-Jest-Cudowne.

Generator throbberów

Czasem ma się szczęście do znalezienia dokładnie takiego narzędzia, jak potrzebujesz.

Tuesday, January 12, 2010

Saturday, January 9, 2010

Sunday, January 3, 2010

Code-review, początek rozważań

Ostatnio, jako że mój blog zaczął bardziej przypominać wirówkę, postanowiłem napisać coś od siebie na temat przeglądania kodu (code review). Zanim to jednak nastąpi, pozwolę sobie przedstawić bardzo sensowny artykuł o tym, jak przeprowadzić taki przegląd w sposób socjalnie odpowiedzialny:

Effective Code Reviews Without Pain

Myślę, że każdy powinien to przeczytać zanim zabierze się za dyskusję na temat kodu - czy to własnego, czy też cudzego.

Major C problem

Nie sposób się nie przyznać racji (edit: że to poważny problem). Choć nie mnie to stwierdzać, żaden ze mnie programista C.

C's Biggest Mistake

Quines

Ciekawostka. Czysta gimnastyka myślowa.

Quines list

Saturday, January 2, 2010

Jest już późno...

... lol ;-)


Kilka oczywistych rzeczy o kreacji obiektów w Javie.

Mało zaskakujące.

Mutability, Arrays and the Cost of Temporary Objects in Java

No, może poza tym, że wołanie "values()" na typie wyliczeniowym w Javie nie jest najrozsądniejszym wyjściem. Wygląda na to, że ze względu na nietrwałość/ulotność (lepiej brzmi niż niemutowalność, czyż nie?) zastosowano tzw. defensive copying - choć to już mało istotne.

Reading code top to bottom, not inside-out...

... czyli podsumowując to. Artykuł jest dość stary i przydługi, ale warto z niego zapamiętać jedną rzecz podczas pisania/czytania kodu: kod powinien się czytać od góry do dołu, a nie skacząc po nim wzrokiem niczym młody baranek hasający po zielonej łączce znaków ASCII. Swoja drogą: czy to właśnie nie jest takie goto,  ukryte w myślach? 

Ten post prawdopodobnie niewiele wniesie do Twojego życia - choć to zależy od Twojego programistycznego doświadczenia.

Modyfikacja kodu w locie

That sounds interesting.

JMangler is a framework for generic interception and transformation of Java programs at load-time.

 Nie żeby to była jakaś nowość, ale możliwości tego narzędzia wydają się być naprawdę spore.