VândPupăză

Icon

Bine o zis cine o zis cand o zis ce o zis

JavaScript: Keep your sanity with JSON, use parseInt()

I had a recent problem when using some values passed on after a JSON eval(). The situation was simple: compare two numbers out of the JSON then take a course of action based on the result.

Always make sure you are using the correct data type!
If you think you are using numbers, make sure they’re not strings by passing them through either parseInt() or Number() .
You can check for the data type using the JavaScript typeof operator.

The JSON format implies that you send / receive a valid string. So any reference to numeric values might be changed to strings in the process, depending on your JSON’s structure.
Checking for the correct data type will save you a lot of time and it will keep your WTF count to a minimum.

Important note:
eval() is dangerous! It means converting string to script.
This means interpreting and running whatever you pass on to it
(no security checks whatsoever)!

Use eval() only when you are totally in control of what goes into it.
Even then, be cautious!

WTF count
When someone else looks over your script the WTF count can be a good code quality indicator :)

A fost wurbe#7

Si chiar a fost misto!

Am facut o prezentare despre usability (Setting User Expectations – Usability on the Web) care, desi a fost spre finalul intalnirii, inclin sa cred ca nu a plictisit participantii :)

Daca ma insel, please feedback. Chiar as vrea sa aud niste opinii.

Mi-a facut placere sa fiu in fata si sa prezint. Mi-a adus aminte de participarea la concursuri de web in timpul liceului. The good ol’ days!

Prezentarile au fost interesante. In pauze am facut cate un foosball, pentru ca in sfarsit ne-a venit masa.

Foosball table

Pe cand sa prezinte Silviu Postavaru ni s-a luat curentul dar au pornit imediat generatoarele, presupun. Cu ocazia asta s-au putin blocat si usile de la intrare. High-tech, cu senzori, laser frate, dar ciuciu fara curent.

S-a adunat deja un calup de poze de la intalnirea wurbe7.
Am pus un set de poze si in galeria mea de pe flickr dar e mai saracacios.

PS: da, m-am tuns. M-am tuns!
Manca-m-ar mama ce tunsoare de Prison Break mi-am facut.

Razvan Caliman speaking at Wurbe7

FanOctaviaTour Video

FanOctaviaTour este un proiect mai vechi care in timp a prins aripi. Site-ul e o comunitate a fanilor Skoda Octavia Tour dar inseamna mai mult decat un loc de intalnire online. Ionut a facut un montaj foto care ilustreaza unde a ajuns comunitatea.

[youtube O4x8s5KuK3g nolink]

Adobe AIR release

adobe air logo

Today Adobe AIR goes live with version 1.
Without any further mumbo-jumbo, have a look and discover some awesome uses for it!

Tutorials: detailed description or hands-on examples

During the past few moths I’ve been working closely with Java Script and other web-related technologies.

Because I feel I gained a lot of knowledge from other blogs and forums I believe I should join in and share some of the things I learned over time.

I decided to start a tutorials section on this blog and I’d like to know your opinion on how you’d like content delivered. I’ll try to steer clear of basic examples and just share some interesting methods, tips and tricks I learn over time. Future content will assume you have at least some basic knowledge of web concepts and technologies.

So, do you prefer:

A. Detailed tutorials like smart use of the Java Script substr() method
B. Hands-on examples like the ones on W3Cschools.com with TryIt Editor. + source files.

Feel free to leave your opinion and preference in a comment.

I do have a busy work life so I can’t guarantee frequent posting but, over time, I’ll try to put together a decent resource with tutorials, examples, tips and tricks.

All tutorial content will be in English in order to effectively reach a wider audience.

Leapsa cu pagina 123

Am primit-o de la Vladootz si suna cam asa:

1. Ia cartea care este cea mai aproape de tine.
2. Deschide-o la pagina 123.
3. Găseste a 5-a propozitie/frază.
4. Postează pe blog textul următoarelor 4 propozitii/fraze cu aceste instructiuni.
5. Nu îndrazni sa scotocesti prin rafturi după cartea aceea foarte deosebită sau “intelectuală”.
6. Da leapsa mai departe la alti 6 prieteni.

“The $.ajax() method accepts a single argument, which is an associative array of options, not unlike Prototype’s Ajax.Request constructor. This options object is made up of the following properties:”

si mai departe e bullet list care o sa plictiseasca deci nu mai scriu.

Zilele astea citesc “Professional AJAX” 2nd Edition. E o carte interesanta cu ceva istorie despre XMLHttpRequest object, metode antice (hidden frames and iframes), exemple clare, concepte noi si comparatii intre diferite librarii care includ si support pentru AJAX.

Majoritatea prietenilor mei deja au primit leapsa asa ca o dau mai departe doar la Shock

Imaginea unei zile stresante

tsk la adobe romania

Poza nu are nici o tenta de parodie la adresa titlului. Chiar era o zi stresanta in care IE6 imi chinuia viata si trebuia sa schimb modul de abordare.

Am lucrat prin diferite birouri, pe jos, in chill-room, dar pana la urma m-am cuibarit cu picioarele pe sus si castile pe urechi.

Daca ma cauti in februarie

ar trebui sa stii ca intre 2 si 10 sunt plecat la Adobe 2008 Technology Summit in San Jose, California.

Evenimentul de anul acesta este concentrat pe tehnologii de la Adobe gen AIR si FLEX care ma intereseaza in mod deosebit in ultima perioada.
Offtopic: s-ar putea sa iti placa AIR ;)

Vor mai fi si sesiuni despre RIA, usabilitate si concepte de programare. Tutorialele se arata foarte interesante iar o calatorie in US, prima in afara tarii pentru mine, vor fi cu siguranta o experienta deosebita.

Am sa incerc sa fac ceva live blogging de la eveniment pentru cine este curios.

Update: evenimentul este intern deci tot ce se discuta acolo ramane in Adobe, asa ca nu va fi live-blogging.

Am scos link-ul pentru ca nu este accesibil in afara retelei Adobe.

Elicopterele de la Adobe Romania

Am scris pe myadobe.ro un articol despre noile jucarii de la birou.

Preview:

mini elicopter adobe

Freelancer Bolnav

Desi am un job stabil, inca mai urmaresc Freelance Switch.

Azi dimineata am prins un comic distractiv avand in vedere ca majoritatea colegilor mei de la Adobe au revenit raciti din vacanta.