Google Translate

English French German Spain Italian Dutch Russian Portuguese Japanese Korean Arabic Chinese Simplified by : BTF, ed. by JRD (me!)

venerdì 17 giugno 2011

linux all the way for compiling!

So I've never had much experience in compiling with C# or C++. I just recently had a try at it, I was interested in Google Talk and Google Voice functionalities, Google gives you their library libjingle to compile. They don't give it to you ready and compiled, you have to compile it.

Ok, so let's go for it. I have Visual Studio Express (the light free version), so I try downloading all the necessary components and I try compiling it. Guess what. You can't with Visual Studio Express. It doesn't have all the necessary libraries. So you either have to get into the libjingle code and modify it so it'll work with VS Express, or you get the Professional version of Visual Studio with the full libraries. Guess what. I find out that Visual Studio 2010 Professional costs 1 grand. $1,000 ? No, I'm just joking. It doesn't cost a thousand dollars. It costs $ 12, 000 dollars! And this time I'm not kidding. Yup, 12 GRAND.

Now is that crazy or what? Yup, that's crazy. That's what makes me say, Linux all the way. I've had a look at Linux in the past few years, though I never did get into it a whole lot because I only have one computer to work with, and I do use quite a bit of Microsoft Windows functionality, especially when it comes to video / audio compositing. No, not editing. Compositing. There are some Linux tools out there, but they aren't quite the thing you can find on Windows. Unfortunately, you have more possibilities on Windows when it comes to that. Or for 3d design. Yeah, you have Blender for 3d design... But Blender isn't Cinema 4d for example. Simply said, I'm unfortunately still stuck on Windows.

But $ 12,000 dollars to be able to compile a library? I'm not a developer who works for a company that produces software to sell. I don't get anything out of it economically. I just like to learn. And who knows, I might offer some free services if I get to know enough about certain technologies. I'm a freelancer and nothing, I mean $0 and no cents goes into my pockets.

So $12,000 to compile a library is absolutely absurd for me. But I guess not only for me. Even for developers who do put something into their pockets this seems to be pretty far-fetched. It's a sign that Microsoft is just a money guzzling, avid company. They don't seem to be very wise about competition either. They're losing ground very quickly. Here's what developers have to say (some of which work for Microsoft from what I read): http://www.dotnet247.com/247reference/msgs/46/231461.aspx

martedì 22 marzo 2011

Where not to go to ask questions about php or javascript programming

Wooooooooowww, I just had a heck of an experience trying to create a worthwhile dialog on a php forum to clear up a few of my own doubts. Through Google Groups comp.lang.php came right up into sight, so I figured it might be a good place to ask a question, I figured there would be a number of people who know their stuff and get me off on the right track.

So I pose my question, very simply and straightforwardly. Well well well, some know-it-all stuck up geeks start answering me and write comments about everything EXCEPT the main point of my question. I stood up to this and tried illustrate my situation and my question as explicitly as possible so as to avoid any misunderstandings as to what I was actually asking, and what do I get? Another series of answers about how I'm stuck up, know-it-all, and too condescending when I'm the one who doesn't know what he's talking about and they know their stuff and all...

And guess what, after going back and forth a few times I actually began getting some results. Until someone joined in on the conversation and brought down to the mud again. What a bickering bunch of folks over there on usenet! It must be a big group of 60-70 year olds who all they know how to do is show off, pick on people, try as hard as they can NOT to help, bicker, and then stomp their legs because you don't humiliate yourself enough in front of their great wisdom and knowledge.

Guess what usenet, you can bathe in your own egotistical closed-minded confrontations that don't lead anywhere and don't actually build anything on the web. If the world wide web is going anywhere nowadays, it's notwithstanding you guys that's for sure.

What a completely useless conversation that was. I think it should be called uselessnet, not usenet.

Finalmente il calendario liturgico di rito latino in formato iCal!

Lo scorso anno avevo preso contatto con diverse realtà ecclesiali presenti in web, che offrono la liturgia quotidiana, e spiegavo lo standard per il formato calendario "iCal", chiedendo quali potevano essere le possibilità per creare un calendario liturgico in formato iCal, compatibile quindi con applicazioni di calendario tipo Google Calendar, o applicazioni Macintosh... Se il calendario liturgico è appunto un calendario, perché non pubblicarlo in formato calendario standard per il web o per le applicazioni web / mobili / desktop ecc.? Ero del parere (come lo sono tuttora) che era un ottimo modo per condividere e consultare il calendario liturgico. Come diverse case editrici stampano i "calendarietti liturgici" dove troviamo le festività cristiane, le letture del giorno, e indicazioni per la recita della Liturgia delle Ore, perché non trasportare l'idea del "calendarietto liturgico" in formato elettronico standard, in formato iCal?

Non molti mi hanno dato più di tanto retta. Se ne sono interessati in modo particolare Francesca Favero e Roberto Zago del sito laparola.it e abbiamo iniziato una conversazione costruttiva a questo proposito e a proposito di altro.

Ebbene proprio pochi minuti fa ci tornavo sull'idea e ho deciso di googlare: "Calendario Liturgico iCal", e questa volta escono risultati. Qual'è il primo risultato? Dal sito laparola.it !

Potete scaricare qui il calendario liturgico in formato iCal (non ci sono i colori liturgici o indicazioni per la liturgia delle ore; ci sono le festività e i santi con l'indicazione del grado della celebrazione liturgica, e nella descrizione dell'evento ci sono le letture del giorno):

http://www.laparola.it/calendario/CalendarioLiturgico2011.ics

Io l'ho appena importato in Google Calendar, e ora attraverso Google Calendar potrà essere presente anche sul sito parrocchiale http://www.parrocchiasanlino.org.
Se chiunque altro desidera incorporare la versione Google Calendar l'ho reso un calendario pubblico a questo indirizzo:

https://www.google.com/calendar/feeds/g1b2j0emjcmucavtqk4u2nbflg%40group.calendar.google.com/public/basic
(per il feed XML)

https://www.google.com/calendar/embed?src=g1b2j0emjcmucavtqk4u2nbflg%40group.calendar.google.com&ctz=Europe/Rome
(per la versione web)

Per incorporare il calendario nel tuo sito puoi utilizzare questo codice:
<iframe frameborder="0" height="600" scrolling="no" src="https://www.google.com/calendar/embed?src=g1b2j0emjcmucavtqk4u2nbflg%40group.calendar.google.com&ctz=Europe/Rome" style="border: 0;" width="800"></iframe>

Yahoo! AGENDA

Vuoi iscriverti con l'agenda di Yahoo? Se hai già fatto accesso al tuo account Yahoo! basta andare a questo indirizzo: http://calendar.yahoo.com/subscribe (oppure dalla pagina dell'agenda, clicca su "Agende" nella colonna di sinistra, e seleziona "Iscriviti all'agenda"); poi inserisci l'indirizzo del file ics (http://www.laparola.it/calendario/CalendarioLiturgico2011.ics) e cliccare su "Avanti". Nella schermata successiva dai un nome al nuovo Calendario ("Agenda") e Salva. Non poteva essere più facile!

Calendario IPOD / IPHONE

Vuoi importare il Calendario Liturgico nel calendario del tuo Apple Ipod? Segui queste semplici istruzioni prese dal sito della Apple:
Copiare su iPod il documento iCal (.ics).


venerdì 11 marzo 2011

D'Orazio's Triangle (or Pascal's Triangle modified)

I think I may have made an interesting discovery.
I have been putting mathematical problems to my programming skills in the past couple weeks on my personal website johnrdorazio.altervista.org . One of the problems that I translated into php code was Pascal's Triangle. I was intrigued to find out that highlighting the odd numbers in Pascal's Triangle creates a Sierpinski Triangle. And I began wondering. What if Pascal's Triangle was slightly different? What other kinds of results can be obtained by highlighting the odd numbers?

So I thought I would try something very simple. You can see an example of Pascal's Triangle here:
http://johnrdorazio.altervista.org/SitoFlatnukePersonale/index.php?mod=problemsolving#pascal3angle


You see that Pascal's Triangle has invisible zero's outside the triangle that are added to the ones along the outer rim.
And I wondered, what if instead of having ones on the outer rim, we had incrementals (1,2,3,4...)? Pascal's has incrementals, but on the second diagonal going inwards, such that the two diagonals with the incrementals cross at the top resulting in two ones right next to each other.
And if instead the two diagonals didn't cross, but started off from the same 1, thus being the outer edges of the triangle? We get slightly different results in the addition that is being done.

So now I try to highlight the odd numbers, and then also mod 3, and I make an interesting discovery: the first 33 lines are sort of like Sierpinski's triangle with a sort of fractal pattern, but from line 33 on we get a hyberbola. Well isn't that awesome! What does it mean? I have no idea. But I thought it was interesting...

------------------------------------------------
UPDATE:
Ok I figured out in the meantime an error in my coding that was causing this behaviour of forming a "hyperbola" when highlighting mod 2 (=odd numbers) or mod 3. It has to do with the way php handles big integers. There is a limit on integer representation in php due to the number of bytes that a large integer occupies. I've read up that x64 machines can represent larger integers then x32 machines, since they have more "byteroom" to represent the integers. After that limit is reached, all larger integers will be represented as a float rather than in decimal notation. Float numbers don't have the same precision as decimal integers, so this inexact representation, when modded, turns out to have not more and more odd numbers, but more and more "odd looking" numbers (!). The amount of these "odd looking" numbers grows pretty constantly, which gives a hyperbola look to the highlighted cells.
Even though it's an "error" in the php math, which can be corrected using other math functions provided by php such as bcmath, I still think it's sort of neat. I suppose it could be interesting to consider the bitwise representation of these large integers, which leads to the hyperbola look (odd numbers can usually be determined by examining the bit-endings in the binary value of the integer: a 0-bit ending represents an even number and a 1-bit ending represents an odd number; the php bitwise operator "&" can be used for this purpose). Perhaps more experiments can be done with binary representation rather than with decimal representation to see what comes of that.

Instead the correct way of coding the php math functions (using bcmath, which utilizes string representations of large integers so that they will not lose their precision, and in such a way that there is practically no other limit than the available memory for calculation) gives us an odd-number highlighting a little different from Sierpinski's triangle, because the highlighted triangles seem to grow almost exponentially...

giovedì 3 febbraio 2011

Flatnux 2 in arrivo!

Per il momento il mio sito personale http://johnrdorazio.altervista.org, che uso più che altro per la sperimentazione (non sono ancora arrivato ad usarlo come archivio personale), non è molto accessibile... Infatti comincio a provare le prime versioni "beta" o test di una nuova versione di Flatnux che Alessandro Vernassa sta sviluppando. Non soltanto un ultimo aggiornamento, ma una riscrittura vera e propria. Pare che questa versione sarà tutta basata sul nuovo motore (classe php) xml database scritto da Alessandro Vernassa, e dovrebbe pertanto presentare notevoli migliorie per amministratori di sito flatnux e soprattutto per sviluppatori flatnux.
La nuova versione userà di default il mod rewrite per presentare all'utente finale url più "belle" da vedere, senza tutti i parametri per le variabili php GET.
Pare che darà anche la possibilità di caricare le sezioni via ajax, scelta oculata a mio parere perché velocizza il caricamento delle sezioni evitando di ricaricare ogni volta tutta la pagina durante la navigazione. Certo che non sarà semplice implementarlo in maniera completa e affidabile quando ci sono informazioni che vengono scambiate tra sezioni e blocchi per esempio.
Altra caratteristica è che tutto il codice del CMS è diventato rispettoso del XHTML strict, e direi che questo è un ottimo passo in avanti perché gli standard del web stanno migliorando sempre e già si comincia a guardare verso l'HTML5, che non è però ancora del tutto definito. Intanto adeguarsi al XHTML strict è una scelta molto utile, soprattutto quando ci si serve di strumenti serviti da API esterni (per fare un esempio, la "barra sociale" di Google Friend Connect richiede per forza un DOCTYPE XHTML strict, e così anche le funzionalità XFBML di Facebook Connect).

Questo cambiamento potrebbe comportare per tutti i "flatnuxiani" un periodo di transizione onde aggiornare i propri siti alla nuova versione, perché non è possibile installare la versione 2 come aggiornamento dal pannello di controllo, necessita di un'installazione "pulita", ex novo. Pertanto bisognerà transizionare i contenuti dai propri siti nella nuova installazione. Ci vorrà un po' di pazienza ma credo che ne varrà la pena.

Una nota pertanto anche ai "parrocchiani" di San Lino, vorrà dire che in un prossimo futuro anche il sito parrocchiale http://www.parrocchiasanlino.org (che non ha al momento aiuti per l'aggiornamento dei contenuti!) subirà la transizione alla nuova versione del CMS, bisognerà pertanto ri-elaborare i contenuti del sito.

Anch'io da parte mia dovrò rivedere il tema "open social" che ho cominciato a sviluppare per Flatnux, per adeguarlo a Flatnux 2, considerando che anche le funzioni di base del CMS verranno ridefinite e la stessa struttura del CMS subirà delle modifiche.

Seguirò man mano lo sviluppo per aiutare Alessandro con osservazioni su eventuali errori / bug / correzioni da apportare, attendiamo speranzosi i risultati! Si possono scaricare le ultime versioni di test alla pagina http://flatnux.altervista.org/download.html.

sabato 2 ottobre 2010

Nuova istruzione in php 5.3 "goto"

Meno male! Lo speravo da tempo... Io che ho iniziato da ragazzo con il BASIC e GW-BASIC e QUICKBASIC e poi VISUAL-BASIC, ero abituato all'istruzione "GOTO" che rientrava in una logica di programmazione, dove si suddivideva il codice in "routines" e "sub-routines" e a seconda di certe condizioni che si verificavano potevi rimandare a certe sezioni del codice da eseguire con l'istruzione "GOTO". Finora in php si doveva ricorrere a un altro "workflow", ebbene ora hanno pensato che forse non era male il tradizionale "GOTO" e l'hanno re-incorporato. Penso che lo utilizzerò di sicuro in più circostanze!

http://www.php.net/manual/en/control-structures.goto.php
What's the worse thing that could happen if you use goto?

mercoledì 18 agosto 2010

Using javascript's ternary operator with multiple statements or commands

Today I made a new discovery in javascript that does not seem to be very well documented. Maybe it's so obvious that it's given for granted. Well I'm self-taught so I can't take anything for granted. My discovery has to do with the use of the ternary operator, a kind of shortcut for conditional statements, with multiple statements. The ternary operator is a compact way of writing conditional statements, instead of writing out fully an "if...then...else" statement, that is "if (condition) { statements; } else { statements; }", you just write  "(condition) ? statement : statement;", which corresponds like this: "(if) ? then : else;". Now I was trying to use the ternary operatore but I needed to give multiple statements or commands in case of a postive result. And in javascript multiple statements should be separated by a semicolon, but a semicolon in the middle of a ternary operator will interrupt it. Well I found a solution: you just have to chain the statements or commands with a plus sign "+". Maybe some people already know that, I didn't. Here are some examples that illustrate concretely these usages.


Example of a conditional statement with a single command:

if(1==1) { alert("Hello") }
else { alert("Goodbye") }



Example of a conditional statement with multiple commands:

if(1==1) { alert("Hello"); alert("World!"); }
else { alert("Goodbye"); alert("Sky!"); }


Example of a ternary operator with a single command:

(1==1) ? alert("Hello") : alert("Goodbye");


Example of a ternary operator with multiple commands separated by a semicolon:

(1==1) ? alert("Hello"); alert("World!"); : alert("Goodbye"); alert("Sky!");

This form is not correct because the semicolon within the ternary operator will interrupt it.

Instead in this way it is possible to have multiple commands in the ternary operator:

Example of a ternary operator with multiple commands chained by a plus sign "+":

(1==1) ? alert("Hello")+alert("World!") : alert("Goodbye")+alert("Sky!");

I had no problems with this method, I've tried in a couple of circumstances and it's worked great.