Davide Zanotti

This user hasn't shared any biographical information

Homepage: http://www.daveoncode.com


Posts by Davide Zanotti

Get hours, minutes and seconds from a number without maths operations

5, Friday f, 2010 - 8:09 am

Tags: ,
Posted in actionscript | No comments

Today I’m gonna show you a secret ninja technique to extract hours, minutes and seconds from a number (representing an amount of seconds). In my example I will show an Actionscript code, but this can be implemented in JavaScript and maybe other languages too.
So, the scenario is the following: we have a number representing seconds [...]

Debugging PhoneGap applications using Xcode console

12, Tuesday f, 2010 - 3:13 am

Tags: , , ,
Posted in phonegap | 2 comments

When I started to play whit PhoneGap, my greatest issue was: “how can I debug my code?”, I use often tools such FireBug and JavaScript debugger included in Internet Explorer 8 (which is the first good thing IE has to offers!) but write and test my code on iPhone simulator is completely different. Fortunately PhoneGap [...]

How to solve CSS conflicts using jQTouch

2, Saturday f, 2010 - 9:55 am

Tags: , ,
Posted in css | 2 comments

In these days I’m developing my first iPhone application, using frameworks like PhoneGap and jQTouch. This aims to be a powerful app, not a mere widget, so I’m writing a lot of code and I’m using several libraries and components in order to create a really native-like application.
Unfortunately, due to a bad CSS approach, I [...]

Google Closure’s idiocies: Ajax can’t be synchronous :(

31, Thursday f, 2009 - 4:02 am

Tags: , ,
Posted in google closure | No comments

While I love Closure tools and the possibility to write a better organized and OOP based JavaScript, I’m facing some weakness and inexplicable choices in the library. The last discover is that is impossible to make synchronous ajax call using the provided classes, since I didn’t find nothing about synch/asynch options by reading API reference, [...]

“Not authorized” error due to Safari “private browsing” mode! :P

27, Sunday f, 2009 - 7:26 am

Tags: ,
Posted in browsers | No comments

This is just a quick post to share my misadventure with Safari and the “private
browsing” mode. I’m working on a small JavaScript library which has the goal to abstract SQLite database api and allow users to create table, insert, update and delete
records easily… my code seems to work very well, but this morning during [...]

Extending Eclipse using JavaScript and Monkey Script engine

16, Wednesday f, 2009 - 9:20 am

Tags: , ,
Posted in javascript | No comments

I was wondering how to wrap a string with quotes in Eclipse by using a shortcut, then I realized that there is not such command, so I started thinking for a solution and initially I created an Aptana’s snippet, but I was not satisfied, because I want to have an handy shortcut to invoke my [...]

.cjs (Compiled JavaScript): an idea for a new file extension

10, Thursday f, 2009 - 9:54 am

Tags:
Posted in javascript | No comments

Due to the growing diffusion of tools to compress and optimize JavaScript files (such Google Closure), I feel the need of an introduction of a standard way to identify and differentiate them (compiled files) from other uncompressed files. Basically, I would adopt a different file extension like CJS (which stands for compiled/compressed JavaScript). In this [...]

Custom JavaScript classes and packages using goog.provide() and goog.require()

1, Tuesday f, 2009 - 8:38 am

Tags: , ,
Posted in google closure | 2 comments

I will repeat it until the dead, the real power of Goolge Closure is the mechanism and the tools behind it, not the classes and methods written for you, but the possibility to write your own better JavaScript code! Today I’m gonna show you how to create and use your custom JavaScript classes and to [...]

goog.i18n.NumberFormat: Formatting numbers to localized strings

26, Thursday f, 2009 - 3:54 am

Tags:
Posted in google closure | No comments

By using Closure’s NumberFormat class (located under goog.i18n package) is relatively easy to format numbers and print readable strings. All we have to import is goog.i18n.NumberFormat:
123<script type="text/javascript">
    goog.require("goog.i18n.NumberFormat");
</script>
Then, we have to create an instance of that class and specify the type of format to apply, by choosing among: CURRENCY, DECIMAL, SCIENTIFIC and PERCENT. Assuming [...]

Automatically compile JavaScript applications using Google Closure and Ant

23, Monday f, 2009 - 3:06 pm

Tags: , ,
Posted in google closure | No comments

As I said on insideRIA, the power of Google Closure is represented by the additional tools provided by Google: the Java compiler (which compress and optimize your javascript files) and the python script (which calculates dependencies). This tools however are not so user friendly, because you have to rely on the terminal and invoke them [...]