4-142g

In questo numero si inizia una nuova serie di articoli sulla programmazione iPhone; questa volta spiegherò come creare una TODO list, una lista delle cose da fare, nel secondo e terzo articolo (usciranno purtroppo con un mese di pausa dovuta ad un problema di spazi sulla rivista) parlerò di gestione della memoria, di retain, retainCount, release, dealloc,  Autorelease Pool etc: in pratica tutto quello che bisogna sapere su questo aspetto, che si rivela la causa di quasi tutti i bug quando si inizia a programmare su questso dispositivo.

The 3.0 firmware added many features, for my taste I’m missing some of them.

Without Cydia and other hacks il’d like to have:

1) video controls
2) photo controls (image size and quality, and, why not, rule of third grid)
3) options to choose if mail should or not download the emails attachments and or set a limit the max size to avoid download
4) mms image resize options to limit their size
5) simple theme selection to change the boring blue of the interface to the color I like (when developing is allowed why not allow to set in the options for all the components?)
6) 5 or 6 icons on the quick access bar (bottom bar) instead of 4.
7) a simple task manager to see the available RAM and to force a memory to be clear to avoid device shutdown to get the max free ram
8) quick wifi enabler/disabler button
9) possibility to cancel an app download
10) ability to know how many satellites are seen by the device
11) ability to disable a particular location service
12) battery life…longer….

Io Programmo
In questo numero il secondo articolo sulla programmazione iPhone e due pagine dedicate alle novità introdotte con il nuovo firmware 3.0; c’è una precisazione riguardo il componente per inviare le email, il quale è stato spostato da Apple , dopo la redazione di questo articolo, da semplice figlio di UIViewController (come descritto nell’articolo) a figlio di UINavigationController, comunque resta sempre in tale catena di ereditarietà.

Io Programmo - Cuda

CUDA, ecco la tecnologia, creata da Nvidia, di cui mi stavo interessando per il nuovo articolo.

Questa tecnologia permette di spostare tutti i calcoli onerosi nella scheda video, lasciando scarico il processore.

Update: dopo l’uscita dell’articolo ho notificato Nvidia
a riguardo, hanno risposto e hanno richiesto la copertina della rivista per utilizzarla nelle presentazioni in giro per l’Europa: bella soddisfazione.

I managed, after about an hour of work on it, to run the wiidesktopvr (developed by Johnny Chung Lee) on my Vista 64bit.

NOTE: i’m planning to release an updated version that uses 1.8beta library which supports wiimotion plus 🙂

BLUESOLEIL USERS: update to the latest version to avoid problems running the application!!!

Causes:

  1. The software is unable to start because the compiler predefined target machine is set to 64bit and you can’t change inside visual c# express […]
  2. The software is unable to find my wiimote (proper connected, i checked using WiimoteLib_1.2.1 (and also the 1.2) utility wiimotetest.exe), this issue went away switching the wiimote lib to 1.2.1 instead of the embedded 1.1

Prerequisites

  • Wii Remote
  • Bluetooth Enabled and wii sync-ed
  • Wii control bar / Home made control bar
  • Visual c# 2008 Express
  • DirectX SDK April 2007 or later (i’m using November 2007), if i’m not wrong the visual c# asked to download in the installation phase, check if is true in the Add/Remove Programs after the visual c# installation.

Simpler way

FIXED LINK::download the package i created (about 2MB);

Not so simple way

:: follow the instruction below:

Begin:

  • download wiidesktopvr and wiimotelib sources 1.2.1 (developed by Brian Peek),
    (if you use the 1.2 you will have to remove ir3 and ir4 calls, two if/else that checked these infrared devices and an event capture, i managed to run both but the 1.2.1 avoid to modify the code) ;
  • unpack both zip in different folders;

step 1: compile under x64 enviroment

  1. open the wiidesktopvrfolder, and double click the wiidesktopvr.csproj, let the visual c# 2008 and let it convert (don’t let it create backup files, you have the zip)
  2. close visual c# and in the wiidesktopvr folder open with notepad/text editor the wiidesktopvr.csproj file: search for
    (there are two occurrences of these entries one for debug and the other for release so replace both for security)image_16

    and add the following line

    image_18

Now, when you build/rebuild the project it will be x86 and will works. But for me this wasn’t enough.

step 2: Replacing wiimotelib from 1.1 to 1.2.1

  1. now we need to replace the 1.1 lib with the 1.2.1 version.
  2. with the wiidesktopvr project open, on the right exclude from the project (right click ->exclude from project) except
    image_12
  3. Keep only these:
    • datatype.cs
    • events.cs
    • hidimports.cs
    • wiimote.cs

image_2

  1. close the c# editor
  2. if there is the wiimotelib folder inside the wiidesktopvr folder, enter and delete all files left inside (sometimes it happens because i keep them opened with other appz),otherwise create WiimoteLib folder again (must be empty) under the wiidesktopvr main folder (the path is WiiDesktopVR\WiimoteLib)
  3. copy all the files from the WiimoteLib_1.2.1_src\src\WiimoteCS\WiimoteLib into the wiimotelib folder inside wiidesktopvr folder (the folder created before wasWiiDesktopVR\WiimoteLib). Below the new content of the folder (overwite if asked):
    image_20
  4. reopen wiidesktopvr project with visual c# (if you find some files with exclamation marks the solution is to right click on those files  again ->Exclude from project or delete them) remember always to keep those 4 .cs files.
  5. You will get some errors due to some changes in the lib interface:
    1. GetBatteryLevel() not found -> replace with getStatus() (for remote2 and remote instances)
    2. OnWiimoteChanged -> replace with WiimoteChanged (for remote2 and remote instances)
  6. You’ll get now after compiling only 5 warning on “error list” tab: don’t care.

Finally:

  1. Build project, and start it.

If you get a wii not connected or unable to find it in HID list (to close these messages if your mouse doesn’t work, alt+F4 twice and you will go back to the project) : resync your wiimote, and check using wiimotelib utility (taken from the runtime library package) if the wiimote transmit.

Addendum: error opening in design mode wiidesktopVR.cs or other gui files

If you try to open WiiDesktopVR.cs form you will get the following error:

image_8

C# express 2008 needs the visual class on top of other classes.

The solution is to cut and paste the top class that isn’t the gui class under the gui class, keeping the gui class on top; in this case, having only two classes into the file we need to put at bottom of the file :

class Point2D
{
public float x = 0.0f;
public float y = 0.0f;
public void set(float x, float y)
{
this.x = x;
this.y = y;
}
}

needs to be moved to (reach the end of the file):

}
}
}
}

//End of file

put the point2D class here:

}
}
}


}

//End of file

so it will be:

}
}
}

class Point2D
{
public float x = 0.0f;
public float y = 0.0f;
public void set(float x, float y)
{
this.x = x;
this.y = y;
}
}

}

Save e reopen the wiidesktopvr.cs, now you’ll see without errors:

image_10

…ieri era bella come non me la ricordavo da tempo. Le dissi stupito “guarda quante stelle” mentre sporgevo la testa verso il finestrino.

Era talmente felice che solo starle accanto mi faceva sentire meglio. Trasmetteva una tale gioia di vivere che bastava per tutti e due. C’era tanta di quella “vita” nell’aria che avremmo potuto creare una stella solo stringendoci forte. In quei momenti ho una tale paura di perdere tutto questo che mi sento perduto in questa vita così transitoria…e allora cerco di mangiare meglio, guidare più piano, stare più attento al mondo che mi circonda, evitando rischi inutili perchè se mai succedesse qualcosa a me lei proverebbe la peggiore delle angosce…

Era prima di me e sarà dopo di me…sarà la madre dei miei figli, la sorella che non ho mai avuto, la madre che perderò, l’alba che mi desterà con le sue nuvole disegnate con gli acquerelli.