Comments vs. Self-documenting

Recently I had few talks with my co-workers about the "problem" of writing code comments.
There ware arguments like: "When you use Python you don't need to write comments because it is Self-documenting language". But is it really true? Or the "problem" in fact is only inborn human laziness? What is the purpose of comments?

Impromptu extension updated

Recently the jQuery Impromptu developer Trent Richardson released new 4th version of this plugin.

New version add's advanced event handling, more about it at Trent's blog:
http://trentrichardson.com/2012/03/05/impromptu-4-0-is-more-eventful/

But there is still lack of possibility to use enter key inside prompt's form - it is blocked by default.
So I updated my extension which add this functionality and now it is compatible with jQuery Impromptu 4.x versions.

More here:
http://dobiatowski.blogspot.com/p/impromptu-extension.html

Great solution for text-overflow: ellipsis problems

I have just created page about my new project on GitHub. It's called FastEllipsis.

There was many approaches of how to nicely fit certain amount of text inside fixed-size HTML blocks. For example when it comes to show a list of short descriptions often your layout want to have exactly 300px width and maximum 3 lines of text per description. I made one more JavaScript solution for that problem.

For more go the the text-overflow: ellipsis - Extremely fast implementation in JavaScript

Rubber Duck method of debugging


This is brilliant!
We called it the Rubber Duck method of debugging.  It goes like this:

Kanban - organize your and your team work

Lately I went at 4Developers conference in Warsaw.
One of the most interesting talk was about Kanban provided by Paweł Brodziński.
I want to show you my white board - before and after Kanban "implementation" :)

Loading CSS and JS async in jQuery - Code snippet


Cast variable to enable autocomplete in NetBeans

Hello, this post is for my own reminder - I bet that in a week I forgot it ;)
I hope someone will find it helpfull too.

One of the most importand tool in any IDE is autocomplete.
You don't need to look in documentation to find method what you are exactly looking for. With autocomplete its extremely faster - well we all knew that.

But the problem in NetBeans comes when you get variable from some method and this variable starts to represent object. Like in this example:
$doc = new DOMDocument();
$doc->loadHTMLFile("examplePage.html");
$form = $doc->getElementsById("myform");
$attr = $form->
So now you want do the magic with new DOMElement object inside $form variable.
You type $form->, hit Ctrl+Space... and NetBeans says 'No suggestions' - what a pity.


jQuery Treeview: Preopened child-node is invisible/hidden

jQuery Treeview is very nice lightweight and flexible transformation of an unordered list into an expandable and collapsable tree, great for unobtrusive navigation enhancements. Supports both location and cookie based persistence.

When I started using Treeview I found problem with pre-opening child nodes. While first level nodes are pre-opening just fine, the chidren of parent nodes do not shows up.

The problem is in prepareBranches function, where script hides all nodes which don't have 'open' class.
Yes, as you probably suspect it hides also parents of node which has this 'open' class.

jQuery Impromptu: How catch form data on submit using enter key event

Just quick post about jQuery Impromptu Extension which I made.

I'm using jQuery Impromptu as my popup/dialog/propmt tool and it's great.

But I run into huge problem with proper form submiting on enter key event.

Enter key event handling inside forms opened via the prompt are missing in jQuery Impromptu 3.1. So, after enter key hit, you could pass form data to submit function instead of page reload.

I had a situation where I had login and registration form on one prompt, and imagine what a problem was when you input your user name and pass, hit enter and...... and nothing happen.

My extension solve this problem. Read more about jQuery Impromptu Extension

Bug in jQuery 1.4.2 toggle() function

jQuery toggle() function don't affect elements hidden by thier parent object.

Background of the problem

In latest project i have build classical order form with fields divided into two groups:
  • payment user data
  • postal user data

Very often postal data are the same like payment so like every other page do i made button "Postal same as payment data". I used jQuery toggle() function to toggle unnecessary inputs. But the problem came when I crossed this functionality with "user or company" option which was toggling some of the company related fields.

Fun staff with Amazon URL

Just want to share with my discover...

when i was reading article about URL at knowledge center i found an example of Amazon URL.

what a nice advantage they did... check those URLs:

http://www.amazon.com/Avatar-Two-Disc-Blu-ray-DVD-Combo/dp/B002VPE1B6/ref=pd_ts_zgc_d_16295751_1_i?ie=UTF8&s=dvd&pf_rd_p=1244297022&pf_rd_s=right-4&pf_rd_t=101&pf_rd_i=193640011&pf_rd_m=ATVPDKIKX0DER&pf_rd_r=0F0NCYHK8871YX8XWSFM

after cutoff all unnecessary stuff we can start play:

http://www.amazon.com/whatever/dp/B002VPE1B6/whatever

http://www.amazon.com/LOVES-eBAY/dp/B002VPE1B6/but-eBAY-dont-care

http://www.amazon.com/dobiatowski-great-deal/dp/B002VPE1B6/

Lets promote some funny URL by back-linking to it. :-)) who is interested?

P.S.
Myślę, że wszyscy zrozumieli co i jak. Więc powtórzę tylko:
Może by tak wypromować jakiś śmieszny adres, ktoś zainteresowany?

Caffeine w końcu uruchomione!

Google poinformowało, że Caffeine, nowy silnik wyszukiwarki, jest gotowy. Dostarcza o 50% świeższych wyników wyszukiwania niż ostatni indeks. A co z działaniami SEO?

W sierpniu ubiegłego roku pojawiły się pierwsze informacje na temat Caffeine. Ideą przyświecającą programistom Google było przyspieszenie wyszukiwarki, zwiększenie przydatności wyników i ich wszechstronności. W grudniu system wydawał się gotowy, ale nie został wprowadzony. Google ogłosiła właśnie, że system Caffeine został ukończony. przekonuje, że udało im się osiągnąć swój cel: wyniki wyszukiwania mają być tak dokładnie jak nigdy wcześniej. Stary silnik wyszukiwarki składał się z szeregu warstw, a jedne były aktualizowane częściej niż drugie. Caffeine natomiast analizuje sieć w małych porcjach i aktualizuje wyniki wyszukiwania nieprzerwanie i globalnie. Po odnalezieniu nowych stron, czy nowych informacji na już istniejących stronach, mogą być one dodane wprost do indeksu. A to ma oznaczać jeszcze świeższe informacje w wynikach. Google podzieliło się również kilkoma statystykami dotyczącymi Caffeine. Wiemy na przykład, że w każdej sekundzie analizowane są równolegle setki tysięcy stron, a sam system wykorzystuje blisko 100 mln gigabajtów przestrzeni w jednej bazie danych, dodając każdego dnia informacje na poziomie setek tysięcy gigabajtów. Google nie poinformowało czy Caffeine pojawi się u wszystkich w jednym czasie i kiedy to się stanie, czy raczej zmiany będą wprowadzane stopniowo. Firma zapowiedziała tylko, że w ciągu najbliższych tygodni będzie miała więcej do powiedzenia w tym temacie.

Można zapytać na koniec: a co z SEO, które wyrosło na bardzo poważną gałąź e-biznesu? Choć z oficjalnymi analizami poczekać trzeba będzie do pełnego startu Caffeine, to już teraz można powiedzieć, że zamieszanie będzie spore, bowiem nowy system bierze pod uwagę nieco inne kryteria i miejsca w wynikach wyszukiwania mogą się znacząco różnić od tych dostępnych dziś.

Źródło: http://gospodarka.gazeta.pl/gospodarka/1,60488,7991319,Google__silnik_Caffeine_gotowy.html

Kupony promocyjne do konta AdWords

Hej

Dzisiaj znalazłem w internecie taki oto wpis na blogu:

http://hillelstoler.com/2010/01/03/free-google-adwords-promotional-code-coupons-2010/

Autor utrzymuje, że po umieszczeniu linka do jego bloga odeśle w zamian kupon promocyjny o wartości 200NIS - czyli około $50.

Po przeczytaniu komentarzy i informacji, że linki mogą zawierać rel='nofollow', dałem się przekonać. Dam znać jak tylko dostanę od niego odpowiedź.

Czy jestem naiwny? :)

Aktualizacja (2 dni później) 

Przeczucie mnie nie myliło, właśnie zasiliłem moje konto kwotą 156zł.
Nasz blogger, który rozdaje kupony odpisał do mnie po niecałych 24 godzinach. Niestety pierwsze podejście się nie powiodło. Przy próbie użycia kuponu, AdWords odpowiedziało, że został on już zrealizowany. Pomyślałem sobie: "HA, NAIWNIAK". Wysłałem jednak info o tym do pana Hillera, od którego dostałem pierwszy kupon. Po kolejnych kilku godzinach miałem już nowy numer. Tym razem wszystko zadziałało tak jak powinno.

NIS (Israeli New shekel) to waluta pochodząca prosto z Izraela, a jej obecny kurs w stosunku do Euro to 5,16, stąd po przewalutowaniu powstała właśnie kwota 156zł.

BING opublikował nowe wskazówki dla webmasterów

Na blogu Webmaster Center Binga pojawiła się informacja o zaktualizowanej wersji wskazówek dla webmasterów. Dla mnie osobiście jest to pierwszy kontakt z tym dokumentem. Również Google udostępnia taki "przewodnik". Myślę, że większość z nas (webmasterów) już się z nim zapoznała. Poniżej możecie ściągnąć oba PDFy: BING Webmaster Center FAQ Google Search Engine Optimization - dostępne także po polsku

Hejka!

Na początek powiem tylko cześć! ;) A co będzie dalej to się okaże.