On the terminal

# download
curl -O -L http://effbot.org/downloads/Imaging-1.1.7.tar.gz
# extract
tar -xzf Imaging-1.1.7.tar.gz
cd Imaging-1.1.7
# build and install
python setup.py build
sudo python setup.py install
# or install it for just you without requiring admin permissions:
# python setup.py install --user

source: http://stackoverflow.com/questions/9070074/how-to-install-pil-on-mac-os-x-10-7-2-lion

 

Here’s how you can clone and migrate your WordPress blog to a new server
1. Download the wp-db-backup plugin.
2. Upload to your existing server and activate it via the ‘Plugins‘ menu.
3. Go to the ‘Manage‘ -> ‘Backup‘ menu. Select all the tables (including those tables created by the plugins) and click the Backup button to download the gzip file to your computer.
4.In your computer, extract the gzip backup file. You should now have a sql file.
5. Open the sql file with a text editor. Search for your old url (“http://www.your-old-url.com”)
Replace the url with your new URL. Save and exit.

Using a FTP program, download the whole WordPress folder from your current server to your computer. Keep the folder structure intact, especially the wp-content folder.
Log in to the PhpMyAdmin in the new server
Create a new database for your wordpress and import or run the sql file to the database
Change the database configuration in the wp-config file in the WordPress folder that you have downloaded
Upload the whole WordPress folder to the new server.

Done. You can now proceed to your wp-login page at the new server and login with the same username and password. All the configuration and settings will be the same as before.
If your WordPress database (the sql file you have created) is more than 2MB, the above method might not work since PhpMyAdmin only allows a maximum of 2MB file import.

source : http://maketecheasier.com/clone-and-migrate-wordpress-blog-to-new-server/2008/01/30

Tagged with:
 

This post is specifically created for my reference.
These are the main methods that I have been using to make ajax calls to the server using jquery.

Populating Dropdown list with json:


$.getJSON('/Dashboard/GetAthletesByTeamID/' + $("#TeamId > option:selected").attr("value"), function (data) {
                     //Clear the Model list
                     $('#ddlAthlete').empty();
                     $("#ddlAthlete").append("Select");
                     //Foreach Model in the list, add a model option from the data returned
                     $.each(data, function (index, optionData) {
                         $("#ddlAthlete").append("" + optionData.Value + "");
                     });
                 });

Dump return html into specific div:

 $.ajax({
                 url: "/Dashboard/GetAthletesTreeByAthleteId/" + $("#AthleteId > option:selected").attr("value"),
                 type: 'GET',
                 dataType: 'html', //
                  success:  function doSubmitSuccess(result) {
                                     $('div#athletesTree').html(result);
                            }

Posting Information and getting json back


$.ajaxSetup({ cache: false });
var selectedItem = $(this).val();
$.post("/Account/GetStates", { id: selectedItem, extra: data },
         function (data) {
                           if (data.length > 0) { //do your stuff }
         }, "json");
         });


Tagged with:
 

I few days ago I found myself having to build a tree of checkboxes, so the user could select items from it. Special case was that it could only have one root selected.

I found a very nice plugin – checkboxtree based on query

Unfortunetely it didnt have this specific option (single root selection)
Here is my implementation to achieve the functionality of single root selection with multiple children selected.

To Initialize:


$('#tree8').checkboxTree({
   initializeUnchecked: 'collapsed',
   multipleChildren: 'true',
   onCheck: {
      ancestors: 'check',
      descendants: 'uncheck',
      others: 'uncheck'
   },
   onUncheck: {
      descendants: 'uncheck'
   }
});

CheckBoxtree Example
jquery.checkboxtree-0.5.2.custom
patch for version 0.5.2

Tagged with:
 

Source : http://www.ro.me/tech/


 

I just added some stuff to my learning project of iOS dev.
Still have a lot of bugs but the purpose is to learn anyways, so is OK!

source code cal1.1

 

Hoje decidi que gostaria de monitorar minha rede. Ver quanto de bandwidth estamos usando na nossa rede. Para isso fiz uma pesquisa rapida e encontrei uma ferramenta chamada bandwidthd, no qual funciona como um sniffer na rede, monitorando os packets enviados e recebidos das maquinas conectadas.

Para instalar, você precisará de uma maquina com alguma distribuição linux, estou usando Ubuntu 8.04. Siga os seguintes passos para instalar a aplicação e o servidor web apache onde você terá acesso a alguns relatorios:

  1. apt-get install bandwidthd
    A instalação ira pedir para escolher qual interface esta conectada com a rede.
  2. apt-get install apache2
  3. cd /var/www e crie um soft link para o diretorio htdocs  que o bandwidthd usa (veja /etc/bandwidthd/bandwidthd.conf)
    ln -s /var/lib/bandwidthd/htdocs bandwidthd
    onde bandwidthd é o nome do link
  4. restarte o servidor apache /etc/init.d/apache2 restart (e o bandwidthd se necessario /etc/init.d/bandwidthd restart)
  5. acesse bandwidthd no seu browser
    http://<localhost ou IP>/bandwidthd

http://sourceforge.net/projects/bandwidthd/

Tagged with:
 

Last month I bought a box media player and I filled with I bunch of movies that were stuck in my laptop. I realized that if a invite my friends to watch a movie, it would be nice to have the trailer so I don’t have to tell them what’s the movie is about.

So I wrote this little script which given a movie name or a file with a list of names, it will search for it and download to the current directory.

All trailers will be downloaded from www.apple.com/trailers but the links are provided by http://www.hd-trailers.net/

what you need:

- Python
- Wget

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
#!/usr/bin/python

import urllib
import re
import sys
import os
import string

from urllib import FancyURLopener

class myOpenUrl(FancyURLopener):
    version = 'Mozilla/5.0 (Windows; U; Windows NT 5.1; it; rv:1.8.1.11) Gecko/20071127 Firefox/2.0.0.11'

#strap movie url from html
def getMovieUrl(movieName, resolution):

    moviePageUrl = getMoviePage(movieName,resolution)

    f = urllib.urlopen(moviePageUrl)
    s = f.read()

    s = re.findall(r'http.+apple.+'+resolution+'.+mov', s)

    if s:
        return s[0]
    else:
        print "Trailer not found"

#strap movie page from google search
def getMoviePage(movieName, resolution):
    try:

        myopener = myOpenUrl()
        page = myopener.open('http://www.google.com/search?q='+ string.join(movieName.split(), "+") + "+site:http://www.hd-trailers.net/")
        html = page.read()

        s = re.findall(r'href=['"]/url.q=([^'"& >]+)',html)
        return s[0]

    except e:
        print "Search failed: %s" % e

def main():

    #if you want you can change to 720 or 1080, but is not garantee that it will find it
    resolution = "480"

    movieNameList = []
    if len(sys.argv) > 1:
        if (sys.argv[1] == "-h"):
            print "usages: ./trailerDownloader.py"
            print "OR"
            print "usage: ./trailerDownloader.py listOfMovie.txt"
            sys.exit(0)
        source = open(sys.argv[1], 'r')
        movieNameList = source.readlines()
        source.close()
    else:
        movieName = raw_input("Name of the movie : ")
        movieNameList.append(movieName)

    for movieName in movieNameList:

        print "Searching for '"+movieName+"'..."
        movieUrl = getMovieUrl(movieName,resolution)

        if movieUrl:
            try:
                print "starting to download : "+ movieUrl
                cmd = 'wget -U QuickTime/7.6.2 ' + movieUrl
                os.system(cmd)
            except e:
                print "Error when trying to download : " + movieName
        else:
            print "movie not found"

if __name__ == '__main__':
    main()

source

to run the script first you have to give permission

$ chmod +x ./trailerDownloader.py

to run you have 2 options:
1) if you want to download only one trailer, the script will ask you for the name.
./trailerDownloader.py

2)if you want to download more than you.
$ ./trailerDownloader.py listOfMovies.txt

Feel free to improve the script, and please let me know so I can update here.

And of course, use it at your own risk

Leave your comments :)

Tagged with:
 
Infelizmente, a Apple ainda não liberou ( e provavelmente não ira ) a instalação de aplicações (para teste) em devices  iOS para aqueles que não são membros do programa de desenvolvedor.
Para se afiliar como membro do programa de desenvolvedor Apple você devera pagar uma taxa de US$99/ano o que te dará a habilidade de instalar via adhoc sua aplicação em ate 100 devices.
Mas existe uma solução se o seu iphone, ipad ou ipod é jailbroken.
Siga as seguintes instruções:

Criar Self-Signed Certificado

Primeiramente você devera criar um self signed certificate e patch seu iPhone SDK para possamos usa-lo:

  1. Execute Keychain Access.app. Com nenhuma item selecionado, no Keychain menu selecione Certificate Assistant, então Create a Certificate.
    Name: iPhone Developer
    Certificate Type: Code Signing
    Let me override defaults: Yes
  2. Clique ContinueValidity: 3650 days
  3. Clique Continue
  4. Deixe em branco o campo do Email .
  5. Clique em Continue até o final.Você devera ver no final, algo do tipo “This root certificate is not trusted”. Isso era de se esperar, não se preocupe.
  6. Configure o iPhone SDK para utilizar self-signed certificate :

    sudo /usr/bin/sed -i .bak ‘s/XCiPhoneOSCodeSignContext/XCCodeSignContext/’ /Developer/Platforms/iPhoneOS.platform/Info.plist

Este comando ira criar um backup do arquivo Info.plist e modificar a opção necessária, se quiser voltar para a configuração normal, você devera renomear o arquivo somente.Se o Xcode estava aberto, feche e abra novamente para que carregue as novas configurações

Deployment Manual via WiFi

Os seguintes passos necessitam openssh e uikittools instalados primeiramente no devices.

Para compilar manualmente e instalar sua aplicação no seu device como uma system app:

  1. Project, Set Active SDK, Device e Set Active Build Configuration, para Release.
  2. Compile seu projeto normalmente (usando Build, e não Build & Go).
  3. Na pasta build/Release-iphoneos você encontrar seu app bundle.
  4. Use seu método preferido (via ssh) para transferir sua app para a pasta /Applications no device.
  5. Avise SpringBoard que uma nova aplicação foi instalada:

    ssh mobile@myiphone.local uicache

    Isso somente deve ser feito quando você adiciona ou deleta aplicações. aplicações atualizadas não precisam desse passo.

Note que se você desejar deletar a aplicação, a mesma não poderá ser feita via SpringBoard interface, você terá que usar ssh para deletar e atualizar o SpringBoard:

ssh root@myiphone.local rm -r /Applications/myApp.app
ssh mobile@myiphone.local uicache

Agora é só abrir sua aplicação e enjoy it!
Abracos

fonte:http://stackoverflow.com/questions/37464/iphone-app-minus-app-store

Tagged with:
 

Hello guys this is my first app in iOS 4. Is a simple calculator. Feel free to ask question about the code. Right after I finished this app I learned about dot notation in Object-C so I still have to implement it.

Enjoy.

Minha primeira aplicação em iOS4. Se tiver qualquer duvida ou pergunta não exite em deixar um comentário.

download : source code

Tagged with: