martedì, novembre 10, 2009

Problemi ADSL? Non c’è problema! Li ignoriamo!

Scrivo questo post per sfogarmi un po’ dalla rabbia accumulata in questi giorni.

Sono abbonato con il mio operatore ADSL da circa 3 anni ormai l’ attivazione è avvenuta infatti il 21 febbraio 2007, e considerando che avevo fatto la richiesta in data 9 novembre 2006 posso considerarmi fortunato, poco più di tre mesi per tirare un cavo solo dati :)

C’è da dire che mi sono orientato verso questo operatore per una tanto decantata banda minima garantita che mi avrebbe permesso di utilizzare la linea di casa per un uso professionale, e devo ammettere che per i primi due anni non ho avuto granché problemi, se non forse due o tre guasti nel suddetto arco temporale risolti in meno di ventiquattro ore.

I veri problemi sono iniziati da quando quest’ azienda ha cambiato politica, infatti ha introdotto nel suo listino delle linee, passatemi il termine, “castrate” del p2p introducendo, per altro, delle policy di QoS (Qualità del Servizio) che hanno, dal mio punto di vista, peggiorato la situazione, non tanto per il fatto del QoS in se, quanto per via che fornendo linee a minor prezzo si è creata una situazione per cui le linee sono di fatto sature.

Ciò che affermo è facilmente riscontrabile dai grafici che tale azienda mette a disposizione di tutti, questo avrebbe dovuto far scattare un fanalino d’ allarme in chi gestisce l’azienda e far si che si prendesse provvedimenti.

Evidentemente di provvedimenti non ne sono stati presi o comunque sia non in modo significativo visto che il problema è cresciuto, per ciò che mi riguarda, in maniera esponenziale.

Nell’ ultimo periodo, infatti, ho un guasto che mette down la mia linea anche per lungo tempo, in particolare sono in una situazione dove la mia linea ADSL (che, da contratto, dovrebbe viaggiare a 7 Mega) o non viaggia proprio, o quelle volte che riesco ad accedere ad internet va a velocità risibili, ciò mi impedisce l’ uso professionale di cui sopra, ma non solo, mi crea dei disagi notevoli dal momento che non riesco di fatto ad utilizzare i seguenti servizi:

  • Mail: il servizio basilare per chi è nel campo dell’ IT, il serviizio di mail non mi è accessibile
  • Banking: Ho un conto online è mi è necessario poterci accedere in qualsiasi istante, poiché è il mio unico modo di gestire il mio conto corrente, quindi ho difficoltà nel mandare pagamenti tramite bonifico, fare trading online, fare ricariche telefoniche ecc..
  • Videoconferenza: Mi è impossibile chiamare tramite Skype non solo la mia ragazza che sento ogni sera (che adesso sono costretto a sentirla solamente per telefono), ma anche con persone che mi permettono di lavorare o di approfondire tematiche relative al mondo IT e che aumenterebbero il mio know-how
  • Tutte le risorse IT disponibili in internet (google gruppi, stackoverflow, reddit, ecc): non avendo accesso alla documentazione relativa ai strumenti informatici che utilizzo per programmare mi viene fortemente limitata la mia produttività casalinga :)
  • Servizi di blogging: Non posso accedere ad HTML.it, per cui non riesco a scrivere nel Blog in cui collaboro, questo mi crea un danno d’ immagine: potrebbe sembrare che io abbia voluto prendere un impegno che non rispetto
  • Servizi di connessione remota: non posso utilizzare ne VNC o RDP ne tantomeno servizi minori come ssh e telnet


Ricapitolando ho danni economici, danni dal punto di vista lavorativo, danni di immagine e danni morali, nonché perdite di tempo, tempo che ho perso inutilmente per cercare di capire se il problema era mio oppure no (cambio di router, cambio di cavi, cambio di configurazione dei router, test su diversi sistemi operativi ecc...)
Per tutti questi motivi e considerato che avevo aperto il guasto il cinque ottobre e a tutt’ oggi (più di un mese!) il guasto si ripresenta tale e quale e da allora ad oggi ogni giorno la linea va in DOWN (numerosi LCP down visibili dal log del router) per diverse ore, spesso quando ne ho bisogno, i pacchetti che “pingo” vengono persi sistematicamente, la velocità non si avvicina minimamente a quella contrattuale, ho deciso di inviare la qui sotto riportata diffida ad adempiere:

Diffida ad adempiere ( avvalendosi della risoluzione di diritto concessa dall' art.1454 del codice civile )
Alla spettabile
Signora Ditta che mi porta l’ adsl in casa

Io sottoscritto
Cristian
Carlesso
Via dei matti numero 0

con la presente Vi INTIMO di provvedere all'adempimento del contratto con Voi
stipulato relativo alla linea adsl associata al numero contratto che poi sarebbe il mio riguardante il servizio di fornitura in modo continuativo del servizio ADSL Specifico del mio caso.

Adempimento che da parte vostra è venuto meno con il guasto verificatosi in data 05/10/2009 e regolarmente segnalato al
vostro Servizio Clienti contattato tramite form on-line
in data 05/10/2009. Ma nonostante tale segnalazione ad oggi sono spiacente di
constatare che non avete ancora provveduto alla relativa riparazione.

Visto che gli usi non prevedono termini più lunghi, per il ritorno da parte
Vostra all'adempimento del contratto già citato con la presente è richiesto un termine
massimo di 15 giorni dalla Vostra ricezione della presente intimazione, facendo fede il timbro postale.
Decorso inutilmente tale termine il contratto di fornitura del servizio adsl Specifico del mio caso stipulato con Voi sarà considerato risoluto di diritto, ai sensi
dell'art. 1454 del codice civile, con la cui presente intendo avvalermi.
Chiedo inoltre la massima celerità nel rendere disponibile dopo la risoluzione
del contratto il numero di linea ad oggi impegnato dal contratto ADSL in essere con Voi.


Adesso se entro quindici giorni dal ricevimento della raccomandata non mi aggiustano la linea il contratto si risolverà per l’ articolo 1454, articolo che impone il rispetto dei vincoli contrattuali, ora vedremo se mi aggiusteranno la linea, comunque sia vi terrò aggiornati, poiché sembra che scrivere un po’ di righe sulla cosa mi abbia aiutato a far calmare i bollenti spiriti, si , perché anche in questo momento (da un paio di ore) sono sconnesso da internet (sfilza di LCP down nel router)…

Speriamo bene! ;)

mercoledì, luglio 08, 2009

So, I want to learn at least a functional languag....hey, wait! I already know it! XSLT!

So, latelly on the web I've read about functional languages and how they will simplify the way to write complex multithreading/multicore programs, so I think that for be a good developer I need to learn at least one functional language, just for understand what is all this about.

WHY FP?
The bigger benefit from Functional Programming is that since in this style of programming the output depends only from the input parametesr, function have no side effects, and this allow simpler multithreading.

HOW FP WORKS?
Basically you describe a set of function ad tell the function what output give based on its input parameters.


but, hey! wait! if in the last sentence you substitute set of function with set of templates and input parameters with matches you can get that the concept here is very similar of how XSLT works...

In fact, in xslt a given template when feeded with the same input always produce the same output!
Xslt,by the way, under the hood use multithreading so seems that xslt have a lot in common with functional programming language...

mmm...

So, to recap, you can say that XSLT templates are the equivalent of FP functions...
... not quite really, since XSLT templates can't be passed across templates by refence ...

TILL...

... I found this paper !

The examples are not very clear (and font-size are weird on that site), so I write a little Example XSLT here:

<?xml version="1.0"?>
<!-- Here I define a defn namespace, we will need it to define our function-->
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:defn="my-functional-xslt-example"
>

<xsl:output method = "text" />

<!-- here I will define 2 functions add3 and add4 -->

<defn:add3 />
<xsl:template match="defn:add3">
    <xsl:param name="parameter" />
    <xsl:value-of select="3+$parameter" />
</xsl:template>

<defn:add4 />
<xsl:template match="defn:add4">
    <xsl:param name="parameter" />
    <xsl:value-of select="4+$parameter" />
</xsl:template>

<!-- ok, now I will define a function that accept a reference of another function and execute that -->
<xsl:template name="execute">

<xsl:param name="function" select="/.."/>
<xsl:param name="parameter" />

<xsl:variable name="result">
    <xsl:apply-templates select ="$function" >
        <xsl:with-param name="parameter" select="$parameter" />
    </xsl:apply-templates>
</xsl:variable>

<xsl:value-of select="$result" />
</xsl:template>

<xsl:template match="/">

<!-- ok, now I will obtain the reference of our function, and I will store that in two variables -->
<xsl:variable name = "add3" select = "document('')/*/defn:add3" />
<xsl:variable name = "add4" select = "document('')/*/defn:add4" />

<!-- and this is how call the function passing add3 -->

<xsl:call-template name="execute" >   
    <xsl:with-param name="function" select="$add3" />
    <xsl:with-param name="parameter" select="10" />
</xsl:call-template>

<!-- and this is how call the function passing add4-->

<xsl:call-template name="execute" >   
    <xsl:with-param name="function" select="$add4" />
    <xsl:with-param name="parameter" select="20" />
</xsl:call-template>

</xsl:template>

So seems simple (but verbose) to pass around function references.

You will argue that this example works only on MSXML, but on the FXSL page you will found the saxon / xalan corrispondence.

on msxml you can obtain a similar results using msxml:script but this require a little javascript code and JSCRIPTxxx.dll and ,for example on pda, this could be a issue.

So, at the end I can say I already know at least a functional programming language... a sort of... or not? ;)

martedì, febbraio 10, 2009

[jsn] isNative: a.k.a. the windmill war

Long long time ago me and Andrea Giammarchi have nothing better to do to understand if there was a way to understand if you were using a safe function in javascript or if you use a fake one.

We try very hard to make something reliable, and without fail we manage to crack every single code we wrote.

I gave up but since then every now and then I recall that days in which we enjoyed this "windmill war".
Since when I gave up I had an idea, I just tried to see if that I can work out something to make that idea work.

What IDEA?


Basically since we cannot know if a function is real I thought to make the browser fail if I try to eval some code, make the eval code call himself in an infinite loops.

<script type="text/javascript">
eval = function(str){
eval(str);
}

eval("alert('hello, proof');"); //too much recursion on FF, stack overflow on IE ;)
</script>


Basically if I extend this logic to all the string evaluating function
(Function object, eval, Object.eval, setTimeout, setInterval) made them using only one function It should work.

example:

eval = function(){
return function(code){
(new Function(""+code))();
}
};


in this way if I try to use eval to rewrite Function I just can't because Function is called inside eval for the same principle of the first snippet I posted.

So why a windmill war?


Caching.
Function caching to be precise,
in javascript I can write this code:

var f = eval

eval = function(str){
alert("I' m an evil functions! bwahahaha!");
f(str);
}


So I don't need to use Function anymore to rewrote eval, I just Spoof the code,
I can send The spoofed code around using http request (for example a src in images...).

To recap, bear this in mind:
Javascript is so powerful in the way it leaves you modify its behaviour that is totally unreliable.

domenica, novembre 16, 2008

[jsn] IE Javascript REAL speed tester

After reading the John Resig post about javascript time accuracy, I decided to make a simple IE wrapper that expose throught the window.external interface an high resolution timer for testing IE Javascript performance

The project is a very basic .net 3.5 window form project written using VS 2008 express,
it will require .net 3.5 installed.

I released the project on codeplex, you can found it at http://www.codeplex.com/IEJst

lunedì, novembre 10, 2008

AVG Aggiornamento kamikaze del 9/11/2008 ripristino XP

Ieri Avg ha rilasciato un aggiornamento a dir poco kamikaze, infatti per un falso positivo, Avg rileva la user32.dll come malevola ed affetta da un trojan ... e chiede di rimuoverla, ovviamente una buona parte di utenti si è trovato a dir : "Sì, rimuovila pure, grassie!"

...

Poi al riavvio del pc non son più riusciti ad accedere ad XP (...chissà come mai...)

Allora vediamo di far notare con chiarezza la cosa:
Se AVG vi dice che il file user32.dll è infetto da "PSW. banker4.APSA" (o qualcosa di simile) non cancellate, ne spostate nulla!!!

Il mio consiglio è di passare ad Avira free (http://www.free-av.com/) che si è dimostrato recentemente migliore di avg / avast, se invece volete rimanere ad avg mettete il file c:\windows\system32\user32.dll tra le eccezioni dell' antivirus...

Ho inavvertitamente cancellato user32.dll e non mi parte il pc, e adesso???

Allora, semplicemente prendete il cd di installazione di XP (dovete averlo ;) ) e inseritelo, assicuratevi che il vostro BIOS permetta l'avvio da CD/DVD rom e riavviate il pc.

Vi verrà chiesto se volete avviare da cd, premete invio per proseguire
aspettate un po che carichi il menù, ad un certo punto vi verrà chiesto qualcosa,
voi premete R per entrare in console di riparazione e ripristino
a questo punto dovrebbe venirvi scritto qualcos' altro, non ricordo voi continuate finché uscira una roba con dei numeri, nella maggior parte dei casi premete 1 (la spiegazione è sicuramente troppo tecnica)

bene
ora guardate, quello è un prompt XD
ammiratelo con sacro rispetto per 2 minuti dopodiché digitate (premendo invio ogni comando)


D:

dir /ad


se tra le cose che vi vengono scritte c'è un I386 proseguite al punto G
altrimenti provate scrivendo


E:

dir /ad


se prima non c'era qui dovrebbe esservi un I386, altrimenti andate avanti con l'alfabeto finché troverete la prima I386 dopodichè potete anche voi passar al punto "G"


Punto G
a sto punto scrivete (ricordo sempre l'invio)


cd I386

expand user32.dl_ c:

copy c:\user32.dll c:\windows\system32


da notare l'underscore (il trattino di sottolineatura) nel comando expand

bene ora potete riavviare e una volta fatto potete (S)cancellare il file user32.dll in c:\ (non quello in c:\windows\system32 però)

se AVG vi tedia ancora dicendo che c'è un virus fate la famosa "finta da pomi" (cioè ignoratelo)

martedì, settembre 30, 2008

Vi presento un nuovo recensIONISTA di giochi! :D

Ho iniziato una collaborazione con il sito Gameszone.it, per cui scrivo per loro alcune recensioni di giochi che provo in anteprima :D
I primi 2 giochi che ho avuto in carico di recensire sono S.T.A.L.K.E.R.: Clear Sky e X3: Terran Conflict.
Il primo è il prequel molto atteso di S.t.a.l.k.e.r.: Shadow of Chernobyl, che è un FPS con alcuni elementi RPG di stampo survival horror, il secondo invece è una simulazione di vita nello spazio, che in realtà è anch' essa a sua volta un seguito, in particolare trattasi di un' espansione standalone di X3: Reunion;
X3 mi ricorda per certi versi un gioco del '94 dove si colonizzava lo spazio (che volevo fare lo sborone citandolo, ma che in questo momento non mi sovviene il nome) comunque mentre quello era un gioco strategico a turni questo è tutto in real time, ma real time vero, tutto calcolato in tempo reale.

Entrambi i giochi sfoggiano una grafica mostruosa, e sono pure avidi di risorse, Stalker al massimo dettaglio fa fare fatica al mio nuovo PC (un quadcore con 4gb di ram e una 8800gt!!!) comunque, giochi a parte, per me è stata un esperienza nuova, vedere pubblicate le proprie recensioni dà una soddisfazione senza eguali, è stata una gioia dedicarmici e spero in futuro di poterlo fare sempre più, vi invito,
se vi interessa, a leggere le recensioni di S.T.A.L.K.E.R.: Clear Sky e di
X3: Terran Conflict
e di lasciare, in caso, qualche commento qui, suggerimenti, critiche, idee eccetera tutto è bene accetto.

Ps. Questa piccola avventura ha già portato i suoi frutti, infatti sto migliorando il mio modo di scrivere, che era arrugginito dalla sindrome SMS / Chat.
Risulta infatti difficile scrivere un qualcosa correttamente dopo essersi (MALE!) abituati alla scrittura veloce da messaggini, mail e sms vari, son però contento perché tutto torna utile :D

martedì, luglio 08, 2008

Dustin Diaz Programming Brain Teaser

TEST : http://www.dustindiaz.com/programming-brain-teaser/

A solution:

arr.join("")
.replace(/(.)(\1)((\1)+)/g,'$1$1[$3]')
.split("")
.join(" ")
.replace(/\[\ /g,"<span>")
.replace(/\ \]/g,"</span>")


obviously it can be simplified, but for me that's enought ;)

domenica, maggio 04, 2008

pensavo di scrivere male... e invece!

Questo è il risultato del test applicato sul mio blog,
è un test di leggibilità, come potete vedere per leggere il mio blog non occorre essere indottrinati :D, buon per voi, :lol:!

blog readability test

sabato, febbraio 09, 2008

MEGA SCOOP!!!

Fonti certe mi hanno confermato che sta per tornare in pompa magna niente popò di meno che il Vero programmatore più scoppiettante che mai..
Dovrà darsi forza per recuperare un anno di inattività, ma son certo che ce la farà,
mi auguro solo che non sparisca subito di nuovo...

martedì, gennaio 22, 2008

[jsn]A simple JS IoC example code

Inspired by Ninject documentation I decided to port the c# example code to my JS IoC.
Here are the code:

var
shuriken = {
hit:function(who){alert("pierced the "+who+" armor");}
},

sword = {
hit:function(who){alert("Chopped the "+who+" in half");}
};

function Samurai(weapon){
return {
Attack:function(who){
weapon.hit(who);
}
}
}
container.register("samurai",Samurai);
var warrior1 = container.byConstructor("samurai",shuriken),
warrior2 = container.byConstructor("samurai",sword);

warrior1.Attack("The evildoers");
warrior2.Attack("The evildoers");


So simple, So clear!

[jsn]JS IoC on GoogleCode!

Today I moved my JS IoC source on GoogleCode,
and for the occasion i made a little change in the code, so now JS IoC
is perfectly compatible with MooTools ( I tested the beta, but it should work on the current also ) with the Class Module selected.
So now you have 2 choice, or use the old (and perfectly working) code and use
Andrea Giammarchi extend script (I put that also on Google Code) or if you
already use MooTools you can simply take the 1.0MT version and you're ready to go!

martedì, gennaio 08, 2008

Human Japanese

Chi mi conosce sà che il mio nickname deriva da quel gran maestro che è
Kentaro Miura, autore del celebre Berserk manga che non molto tempo fa ha spopolato
in tutto il mondo.

Negli anni ho imparato a coltivare una passione per quel bel paese che si chiama Giappone, che ha una cultura tanto diversa dalla nostra, che per molti diventa quasi difficile comprenderla.

Il Giappone mi ha sempre affascinato, il mio desiderio è di farci visita un giorno,
prima però sarà bene che almeno impari le basi della loro lingua, altrimenti farei
solamente una grama figura.

Ho cercato di imparare la lingua un po per volta, provando varie strade, tra cui
una è ascoltare i podcast (eccezionali sono quelli di japanesepod101), reperire documentazione in internet e guardare qualche anime in lingua con i sottotitoli
(che è un esperienza che consiglio vivamente a tutti, l' espressività dei giapponesi nel doppiare gli anime non è paragonabile a niente al mondo).

Purtroppo senza una scuola di giapponese è molto difficile imparare questa lingua che sembra ostica, ma che in realtà per certi versi è più facile di tante altre lingue.

Per chi, come me, ha un po di dimestichezza con l' inglese il compito risulta facilitato per la quantità di informazioni che è possibile reperire in internet.

L' altro giorno, un po per caso mi sono imbattuto in un sito che vende un prodotto software per imparare questa lingua, incuriosito ho notato che non solo era possibile scaricare la demo, ma è anche possibile provare gratuitamente in internet una versione live
che riproduce fedelmente la versione per pc, seppur in maniera limitata.

Di primo impatto, essendo un professionista del web ho notato come il sito fosse ben fatto sia a livello grafico sia testando il sito con Firefox, Explorer e Safari.

Leggendo poi le lezioni disponibili online ho deciso di scaricare la demo gratuita, scoprendo che l'unica limitazione imposta era relativa al tempo, in pratica è possibile controllare tutte le lezioni(e i relativi esercizi) contenuti.

Mi sono poi soffermato su alcuni dettagli tecnici, ovvero che il programma è fatto in .NET (presuppongo in c#) e che non è null' altro che un custom browser che fa girare le pagine delle lezioni, i test invece sono scritti in Flash, quindi è richiesto il player di Adobe.

A differenza di software didattici analoghi e costosi (per esempio Rosetta Stone) dove si cerca di insegnare la lingua per associazioni mentali, Human Japanese si propone come una guida, una specie di libro, che ci permette di seguire un filo logico per imparare il giapponese, ed è questo che mi ha colpito maggiormente di questo software (forse perchè è ciò che stavo cercando io).

Questo unito al fatto che il software ha un prezzo veramente basso ($24.95) mi ha fatto propendere al suo acquisto.

Per finire aggiungo che per i blogger c'è la possibilità di un ulteriore sconto a patto che scriviate un articolo su tale software (potete anche parlarne male), di 10$.

sabato, dicembre 22, 2007

Bleach, The Film

I'm going to make a film on Bleach, obviusly I gonna to interprete Kurosaki Ichigo,
did you think I'm joking? ok, take a screenshoot of the film:


Me, Hollow by ~kentaromiura on deviantART







Ps. ok, i was kidding, but if someone would make a film on Bleach, please take me in consideration, I'm the Perfect Kurosaki Ichigo ;D

martedì, dicembre 04, 2007

24ways - Capturing Caps Lock

Today i read this interesting Post on 24 ways: Capturing caps lock
Stuart use the Shift status to understand if Caps Lock in On or Off,
is a very good script, but it miss some particular cases:

when someone type the ascii code using ALT + code,
for example ALT + 65 is the same to write capital A,
so if we wrote ALT 65 on the form, the form alert us that we have CAPS lock on :D
Since i think nobody wrote password using Ascii code (unless they write strange character) this code is a big usability and accessibility tricks!

lunedì, ottobre 29, 2007

[jsn]getElementByClass revisited

Today me and my friends Andr3a had a talk about getElementsByClassName,
I had the idea to write my own implementation since 1 year ago,
in that time I first saw firefox document.evaluate and I blogged to remind myself that I must wrote a better implementation.
The original one was based on Dustin Diaz works.
Seems that the day is come for me, so I've taken my previous work and i've done a lot of optimization, i think now is one of the fastest that you can find around the net
...here the code:


getElementsByClassName.js

/*Kentaromiura 1.0 version*/
document.getElementsByClassName = function(searchClass,tag,node){
var p = function(){
if([].push)return function(a,b){a.push(b)};
return function(a,b){a[a.length]=b}
}();

node = node || document;
tag = tag || '*';

if(document.evaluate){
var xpr = document.evaluate([".//",tag,"[contains(concat(' ',@class,' '),' ",searchClass," ')]"].join(''),node, null, 0, null),
t = true,
els = new Array();
while(t=xpr.iterateNext()){
p(els,t);
}
return els;
}


var els = node.getElementsByTagName(tag),
pattern = new RegExp(["(^|\\s)",searchClass,"(\\s|$)"].join('')),
ce = new Array();

for (var i = 0, max = els.length; i < max; i++) {
if(pattern.test(els[i].className))
p(ce,els[i]);
}
return ce;
}


Tomorrow I will test it more, for now i only can say that it will work on
IE7, FF 2.0.x.x and safari 3.0.3
Teoretically it should work with IE4+, NN 7+,opera 8+ ff 1+ but keep this as not sure
since I can't test it right now.
So if you can leave a comment with your browser I would be grateful.

Ps. since I share my ideas with andr3a, he had wrote his own implementation,
it is very similar to my approach but it's different in some way, so be sure to take a look at his work

bye ;D

sabato, ottobre 20, 2007

post informativo: eliminazione adsense

Come potete notare ho eliminato adsense dal mio blog, mi è servito nel breve periodo in cui l'ho utilizzato a fare alcune statistiche, ho lasciato comunque la barra di ricerca di google perchè ho visto che è stata utilizzata diverse volte.

ho aggiunto comunque analitycs per vedere se il blog necessita di modifiche al layout o se, come penso, i contenuti sono accessibili senza troppi problemi..

sto inoltre rivalutando l'ipotesi di riabilitare i commenti anonimi in un futuro prossimo, faccio però notare che l'iscrizione a blogger è gratuita.

Alla prossima

domenica, ottobre 14, 2007

[jsn]Adobe Flex Presentation - Behaviour - Business Logic

Before I start I would say that I never seen an action script line
before today, day in which I started playing around with FLEX.

Since the Hello World example is old fashioned, I have the great idea to start
with something a bit harder, but just a bit since I want to separate my action script
code from the mxml.
basically i would to use mxml as a presentation layer,
an external file for all the logic (I called it BI.as)
and another AS file for handle the behaviour of my code



Seems that doing so i didn't respect the K&R commandments #0 that is
c:\> Thou shalt not start to learn a language without write THE proper hello world_

so, for that, i had to pay a big pain!
but in the end I'll be forgive and I come to a solution.


here the MXML:
kentatest.mxml

<?xml version="1.0"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" creationComplete="oncreation();">
<mx:Script source="BI.as" />
<mx:Script source="behaviour.as" />
<mx:Panel title="kenta template" paddingTop="10" paddingBottom="10" paddingLeft="10" paddingRight="10">
<mx:TextArea id="area1" />
<mx:Button id="btnSubmit" label="Submit" />
</mx:Panel>
</mx:Application>



and here the code, first the Business logic file:

BI.as

public function hello():void{
area1.text='Hello.kenta()';
}


and now the Behaviour file:

behaviour.as

private function oncreation():void{
btnSubmit.addEventListener('click', function (event:MouseEvent):void{
hello();
});
}


so in the end seems that I did i...what?!? why I put that lines in orange?
basically it was the fault that cause all of my pain trying doing this, without that lines
nothing work.
that lines is the same thing of write <body onload="oncreation"
on a HTML page.

so even if I can't completely separate actionscript code from the mxml presentation,
in this way I can add events externally in the behaviour file,
after that i tried to use addEventListener('creationComplete',...
but seems that flex didn't recognise the addEventListener function.

martedì, ottobre 09, 2007

Sorry? what time is now in UK?


THANK YOU FOR ORDERING IN RAINBOWS. THIS IS AN UPDATE.

YOUR UNIQUE ACTIVATION CODE(S) WILL BE SENT OUT TOMORROW MORNING (UK TIME). THIS WILL TAKE YOU STRAIGHT TO THE DOWNLOAD AREA.

HERE IS SOME INFORMATION ABOUT THE DOWNLOAD:

THE ALBUM WILL COME AS A 48.4MB ZIP FILE CONTAINING 10 X 160KBPS DRM FREE MP3s.


Just because I simply can't wait!

sabato, settembre 15, 2007

uIoC - A WINCE IOC library for compact framework 2.0

In these days at workplace i'm working on a WINCE project,
I had to do some optimization to my old code and I wish to make it more readable,
so bearing in mind this I start to Google around
searching for an IoC container/framework that works on Compact framework 2.0 but
I was embittered since i cannot find any IoC implementation for Compact Framework.
Since i haven't special needs instead of using frameworks like spring.net or Windsor
i would use something simple but straightforward, like picocontainer
or this one ;D :
kentaIOC
I start to thought how complex could be to write my own IoC implementation for Compact Framework, I was dazzled when I see that what i needed was so simple to achieve!

So i write my own implementation that let register object and initialize that by constructor.

For now is very basic, need some extra works but since, at least for me,
it do its dirty work i thought to share my efford.

I think somebody can find it useful, so
i opened a project on codeplex, you can find the project page at this address:
uIoc and you can download the source
on the Release page

giovedì, settembre 06, 2007

[jsn]Configuring JSUnit for Visual Studio 200X

I want to share this things, because today it take me a while to get the hang of it.
I now going to explain how to integrate JSUnit into your visual studio 2005/2008 Express/Standard/* version.
the procedure is the same, so now I show you what you need:

I only get this method work on firefox, probably because an IE restriction on file: protocol,
is not mandatory but i reccomend to install this both plugin for Firefox:
Firebug and web developer toolbar

Ok,
  1. open up Visual Studio

  2. On the menu go under Tools (Alt+T)- External Tools (E)

  3. Click on the Add button

  4. in the title box write "JSUnit"

  5. click on the "..." button to search your firefox executable (probably under "C:\Program Files\Mozilla Firefox\firefox.exe") and fill the Command Box

  6. on the Arguments box write "file://path/to/jsUnit/testRunner.html?testPage=$(ItemPath)&autoRun=true"

  7. Click on the OK button



where path/to/jsUnit is the path where you install your jsunit copy.


to test it open the file
path/to/jsUnit/tests/jsUnitAssertionTests and from Tools select JSUnit.

ps.following the instruction on this page
you can also install javascript lint :D