• 01apr

    Some days ago I started to develop an iPhone application with the latest version of Xcode. When I realized that I need to pay 99 dollars to Apple in order to test my application (that, by the way, I would share freely), I started to search on the web a solution for this problem. Unfortunately all the proposed solutions where about iPhone 2.0, and these don’t work the same with iPhone 3.1.3. Today I found an how-to that worked for me, but with some passages that could be a bit tricky for non-hackers, so I decided to share it here, with some more passages needed to get our final goal: develop an iPhone application with Xcode 3.2.1 without being registered to any Apple Development Service.

    Nothing from this page comes from me, everything was written by KennyTM on his blog: networkpx Project Blog so don’t thank me – if it works – but go to his blog and visit him!

    Only compile the executable

    If you just want to compile the executable, maybe for including it in a .ipa file, or for copying it with scp on your device, just follow the instructions on KennyTM’s blog, under the “I want to compile.” title. It’s simple, clear and understandable (thanks, KennyTM!).

    Also install it on your device

    Well, this part is more tricky, but it’s not so difficult if you know how to use the Terminal (and you know how to use it, right?).

    • The point 1 is quiet simple, just download the executable by following the link, and place it in /usr/local/bin as KennyTM said. Remember to make it executable running
      chmod +x /usr/local/bin/ldid.
    • The point 2 is also simple, but remember again to make it executable, as shown above.
    • Points 3 and 4 are easy.
    • In point 5, in order to copy installd from my device to my mac, I used ssh. I have it since I have a Jailbroken iPod Touch, and I have been able to install OpenSsh with Cydia; if you have an original OS on your device (good for you) check if ssh is available looking in the Preference Panel of the device which is its IP address (you need to connect it at the same network of your mac, obviously) and executing
      ssh root@IP_ADDRESS

      from a Terminal of your mac. The default password for your device is “alpine” (remember to change it with passwd, since it’s the same for all iPhones and iPods). If it works, just run

      scp root@IP_ADDRESS:/usr/libexec/installd ~/Desktop/

      and you have copied installd on your mac.

    • Points 6 and 7 are simple, just follow them.
    • In order to complete point 8, you need to use the iPhone gcc. Looking at some comments on the blog you can find how to do this, but here it is the command you have to execute:
      /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc-4.2 libmiss.c \
      -dynamiclib \
      -install_name /usr/lib/libmiss.dylib \
      -current_version 1 \
      -compatibility_version 1 \
      -Wl,-reexport-lmis \
      -flat_namespace \
      -isysroot /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.0.sdk \
      -arch armv6 \
      -o libmiss.dylib
    • Points from 9 to 12 are simple, just use scp again to copy the modified files from your mac to your device (scp SOURCE DEST).

    Remember to add your device to Xcode. To do that, run it and from the menu select “Window / Organizer”. Connect your device, select it and enable it!
    Now you are able to compile your applications on your device! Happy working!

    Tags: , ,

  • 07mar

    Well, this is not a plugin, neither a standalone or cross-platform application, it’s only a, well, I suppose we can call it workaround…

    Emule collections are files used to store the ed2k link of one or (usually) more files. They can be in two different format, text or byte.

    In the lucky case we have a text based emule collection file and we want to start downloading with mlDonkey all the files linked in it, we have only to copy the content of the file and paste it in the “Direct Link” window of mlDonkey (the one that is shown clicking on “DL” on the top menu, yep, that one). In fact this window let us to start downloading all the links we write in it, one for line.

    Unfortunately, in most cases the files we find on the net are not text-based. In fact when we open them with a text editor we see a lot of strange characters. These files store more information about each file (have a look here if you are curious). We don’t need so much data, so the idea is to extract from the file the only one thing we need: the ed2k link of each file. We can do that with the source code of the amule-emc plugin. This plugin is used by amule exactly for reading emule collection files and using them in the application.

    First of all we need the amule plugin code, we can download it from here: amule-emc download list. I used with the version 0.5.2, the last at the moment. Unpack the archive somewhere and open the plugin folder. We need only some source files, so enter the source folder and compile them with g++ as follows:

    cd amule-emc-x.x.x/src/
    g++ MuleCollection.cpp amule-emc.cpp -o ed2k_exporter

    The amule-emc.cpp file has a main function that reads the file passed as first argument and lists all the links. So now we can execute our new application simply with

    ./ed2k_exporter filename.emulecollection

    where obviously we have to replace “filename.emulecollection” with our file. The result is that we will have all the links printed in our terminal, so the only thing we have to do now is to copy them and use the “Direct Link” window of mlDonkey, as before.

    Tags: ,

  • 03lug

    Yep, it is, MindGapper has been renamed into MooGraph.

    Why? Well, it’s pretty simple, MindGapper was a funny name based on GapMinder, but now MindGapper – MooGraph is a complete software for statistical data, so we decided to change it’s name.

    Sooner or later also the project on SourceForce will be renamed (we hope!), so keep on following us on our trac! And if you have questions, don’t heistate writing them down as comments!

    Tags: ,

  • 04giu

    Your remote_function or remote_form_tag could stop working if you use jQuery into your Ruby on Rails project. This is because the jQuery $ function is different from the prototype one, and RoR uses some particular function that is not available with jQuery.

    For example, you can get an error like this submitting your remote_form_tag:

    $(form).getElementsByTagName is not a function
    http://localhost:3000/javascripts/prototype.js?1239274532
    Line 3483

    To solve this kind of problem, you have to use the jQuery no-conflict method, like explaned on the jQuery site. Simply add theese lines of code in your default layout between into a <script> tag:

    jQuery.noConflict();
    jQuery(document).ready(function($) {
    })

    Now, RoR can use prototype calling the default function $ and you can use jQuery using the jQuery function:

    jQuery("#myId").hide("def");

    Tags: , , , ,

  • 30apr

    If you create a scaffold for your rails project, it will create for you a lot of things; for example, a way to show your object in xml format. But what about adding custom elements to that xml?

    I solved in this way:

    class MyObject < ActiveRecord::Base
      #[...]
      def to_xml(options={})
        cp = attributes.clone
        cp["something"] = "some value"
        cp["another thing"] = self.some_relation.length
        cp.to_xml(options)
      end
    end

    Tags: ,

  • 24apr

    When using wx:TileList with your own ItemRenderer, you have to remember two important things to avoid scrolling problems:

    1. If you override the set data method, remember to call super.data = value.
    2. Remember that the TileList reuses the ItemRenderer instances when scrolling the component! So, if you have a TileList with 5 rows and 5 cols, and an array with 500 elements as DataProvider, it will create about 25 instances of your ItemRenderer, calling the set data method on them when scrolling. So, if you add some child to your ItemRenderer under some data condition (like I did), remember to remove them if the data condition is not valid.

    Tags: ,

  • 05mar

    I love to write my own visual classes in actionscript3. Some days ago I was searching for an undefined loader, like a rotating animated gif. But I thought that it would be great to have something wrote in as3 to do that, so I code it.

    I wrote a simple as3 class that shows some circles that moves from a point to the external of the loader, creating a simple bubble effect.

    Here you can see it in action: UndefinedLoader.swf

    What do we need? Well, I usually use Caurina.Tweener for the animations, you can download it on google code. Download the as3 version and copy it in your source directory.

    After that create a new class extending Sprite and create a simple costructor like this:

    package myControls
    {
        import caurina.transitions.Tweener;
        import flash.display.*;
     
        public class UndefinedLoader extends Sprite
        {
            private var w:Number;
            private var h:Number;
            private var colors:Array = [0xFFFFFF];
     
            public function UndefinedLoader(w:Number, h:Number, colors:Array = null)
            {
                this.w = w;
                this.h = h;
                this.visible = false;
                if (colors != null)
                    this.colors = colors;
            }
    }

    We set the width and height attributes, and if the user want to change the color of the loader we set it.
    We will use the ‘visible’ attribute to indicate if the loader is running or not. So we have to write a get function for that:

            public function get loading(): Boolean {
               return this.visible;
            }

    After that, we need some constants in the class, indicating the minimum and the maximum radius of the circles, the time for the animation, how many circles we want and the type of transition (see the Tweener documentation for the possible values)

            private const NCIRCLES: int = 25;
            private const MIN_DURATION: Number = 1;
            private const MAX_DURATION: Number = 2.5;
            private const MIN_RADIUS:int = 2;
            private const MAX_RADIUS:int = 5;
            private const TRANSITION: String = "linear";

    Ok, now we need the start and the stop functions. When we start the loader, we want to create the circles, storing them into a private array. After that we will call the animation function on each of them. Stopping the loader will only hide it. The animation will automatically stop by itself (see later).

            public function start(): void
            {
                if (this.visible)
                    return; // animazione gia` partita!
     
                this.visible = true;
     
                if (circles.length == 0)
                    for (var i:int = 0; i &lt; NCIRCLES; i++) {
                        circles[i] = new Sprite();
                        addChild(circles[i]);
                    }
     
                for (i = 0; i &lt; circles.length; i++)
                    tween(circles[i]);
     
            }
            public function stop(): void
            {
                this.visible = false;
            }

    Now let we write the tween function: first of all we need to check if the loader is still shown. If it’s not, we will return, doing nothing. Otherwise, we generate randomly the color of the circle, the duration of the animation, the radius and the angle to move on. After that, reset the circles attribute, redraw it, and start the animation. When it will be completed, it will be recalled the tween function, checking if the loader is still working or not.

            private function tween(c:Sprite): void
            {
                if (!this.visible) {
                    return; // fermiamo l'animazione.
                }
     
                var color:int = (colors.length == 1) ? colors[0] : Math.random()*(Math.abs(colors[1]-colors[0]));
                var time:Number = Math.random()*(MAX_DURATION - MIN_DURATION);
                var radius:Number = Math.random()*(MAX_RADIUS - MIN_RADIUS);
                var beta:Number = Math.random()*(2*Math.PI);
     
                c.alpha = 1;
                c.x = 0;
                c.y = 0;
                c.graphics.clear();
                c.graphics.lineStyle(1, color, 1);
                c.graphics.drawCircle(w/2, h/2, radius);
     
                Tweener.addTween(c, {x:w/2*Math.cos(beta), y:h/2*Math.sin(beta),
                                     alpha:0, time:time, transition:TRANSITION,
                                     onComplete: tween, onCompleteParams:[c]} );
            }

    You can download the source code here: undefinedloader.as

    Tags: , , ,

  • 03nov

    I have a MacBook Pro 4th generation (Penryn) and using Ubuntu 8.04 all was  perfect!

    Two days ago I upgraded the operating system to Intrepid Ibex (8.10), and after some hour downloading the packages and installing them, the new Ubuntu was running on my MacBook… But also some problems war running as well! Ubuntu has some audio problem (no sound at all!!) on MacBook Pro…

    The sound card is the Hda-Intel and the kernel module is the snd-hda-intel. The solution? After some search on the net, I found that: help.ubuntu.com

    Here the solution (very easy, really):

    1. Open the file /etc/modprobe.d/options (you need to be root)

    sudo gedit /etc/modprobe.d/options

    2. Add the following line at the end of the file

    options snd_hda_intel model=mbp3

    3. If you have changed /etc/modprobe.d/alsa-base previously, adding something similar to the previous line, comment it.

    4. Reboot (mute your microphone before doing that, or your ears will implore pity!)

    Tags: , , , ,

  • 26set

    In my informatic life I’ve wrote a lot of code lines, and sometimes I’ve spent hours and hours searching on the web the solution to problems, finding them on forums and blogs. But sometimes people that solve their problems don’t write it down their solutions, or sometimes the discussion about how to solve something is very very chaotic.

    I’ve decided to write down the solution to my informatic problem here, hoping that this will help someone to solve their ones.

    Another reason of this blog is that I’ve to improve my english, and the only way to do it is to use it! So first of all, I’m sorry for all the mistakes you will find on this blog, but I’m italian and is known that Italy people like only their own language…

    Tags: ,

   

Recent Comments

  • It's very strange, you're right... The code seems to be ok....
  • it is using its default renderer.. ...
  • I'm sorry but I cannot understand. If you have commented out...
  • hi, am also having this ghost image problem.. problem is tha...
  • Ok, I think I could elaborate on that =) Take this method: ...