terça-feira, 29 de setembro de 2015

Config iOS9 for limited data package

If you have a limited data package, my suggestion is turn off Wi-Fi Assist.

1. In Settings, click into Cellular:

2. Scroll down to the bottom of Cellular page to turn off Wi-Fi Assist:

sábado, 22 de agosto de 2015

Dev - Eclipse - Pyton - Appengine - Installing on Mac


1. Download and install Eclipse Standard
    Download: Eclipse Mars 4.5 Standard

1.1 Installing Eclipse
    Install: in terminal, go to where you downloaded the eclise file


gzip -dv eclipse-standard-*.tar.gz

tar -xvf eclipse-standard-*.tar
cd eclipse

With Finder, go to eclipse directory and drag and drop the file eclipse into Dock


To run, click in eclipse icon

=========================================================

2. To install PyDev
From Help menu, choose Install New Software
Click Add and input the Repository:
Name: PyDev
Location: http://pydev.org/updates

Accept any license agreements and restart eclipse.


=========================================================

3. Install AppEngine
Donwload from: https://cloud.google.com/appengine/downloads

=========================================================

4. Install Google Plugin for Eclipse
From Help menu, choose Install New Software
Click Add and input the Repository:
Name: Google
Location: https://developers.google.com/eclipse/docs/install-eclipse-4.4

Select: Google Plugin for Eclipse (required)
            SDKs

Configure Path in Project > Properties > Resources > PyDev - PYTHONPATH > String Substitution Variables
GOOGLE_APP_ENGINE = /usr/local/google_appengine


https://cloud.google.com/appengine/docs/java/webtoolsplatform

=========================================================

have fun =)

terça-feira, 16 de dezembro de 2014

MacOS - how to accentuate the words

Well, when you want to accentuate and not have a special keyboard, you need to use this short keys:

For letter with ^ = option + i and letter
For letter with ~ = option + n and letter
For letter with ' = option + e and letter
For letter with ` = option + ` and letter
For letter ç = option + c

But if you want to do different, go to System Preferences/Language and then select Text/Input sources, after check the box for US International PC. If you don't use multiple keyboard, delete the others keyboard from list and clear the box for Show Input Menu in Menu Bar.  


Voalá, you ready to use! :))


terça-feira, 26 de agosto de 2014

Unix - how you can split a file to n-files?

You could use split command in unix:

split -l[max line number per file] file [prefix]

The default will create PREFIXaa, PREFIXab, ..

If you whan to exchange the lengh of suffixes, use -a [numer]. Will create PREFIXaaaa, PREFIXaaab,... If -a 4.
 

Example to split readme.txt that have 1000 lines into 10 files with name new_000 at new_009

split -l 100 -d 2 readme.txt new_


The man page:

       Output  fixed-size  pieces of INPUT to PREFIXaa, PREFIXab, ...; default
       size is 1000 lines, and default PREFIX is 'x'.  With no INPUT, or  when
       INPUT is -, read standard input.

       Mandatory  arguments  to	 long  options are mandatory for short options
       too. 
 -a, --suffix-length=N
	      use suffixes of length N (default 2) 
 -b, --bytes=SIZE
	      put SIZE bytes per output file 
 -C, --line-bytes=SIZE
	      put at most SIZE bytes of lines per output file 
 -d, --numeric-suffixes
	      use numeric suffixes instead of alphabetic 
-l, --lines=NUMBER
	      put NUMBER lines per output file 
 --verbose
	      print a diagnostic to standard error  just  before  each	output
	      file is opened 
 --help display this help and exit 
 --version
	      output version information and exit 
SIZE may have a multiplier suffix: b for 512, k for 1K, m for 1 Meg. 

quinta-feira, 8 de maio de 2014

VIM: using accent in portuguese

How you can see and use accent in VIM for portuguese language?
Como ver e usar acentuação no VIM para língua portuguesa?

Have two way to do this in *Unix.

1. In Bash profile (~/.bashrc), set the environment variable LANG to latin1 or one of this below:

  • latin1
  • pt_BR.UTF-8
  • iso-8859-1
  • utf-8


2. In VIM profile (~/.vimrc)

  • set encoding=latin1
  • set fileencodings=latin1
  • set termencoding=latin1
  • set nocompatible


You can test in terminal to see if it is ok:

in bash:
    export LANG=latin1
    vim
    write something with accent (e.g. Português)

in vim:
    :set encoding=latin1
    write something with accent (e.g. Português)


terça-feira, 1 de abril de 2014

C++ - Opening a windows with the man page for the word under the cursor - VIM

How to get help when stay developing in VIM?
Como obter ajuda quando estiver desenvolvendo em VIM?

Put the cursor at the word that you want and click "shift + k", the man page of specific command will open
Coloque o cursor na palavra que deseja e click "shift + k", a página do comando específico irá abri

Is the same that you do in command line:


    man 3 <word>

Section of man page on Unix:


Section
Description
1
General commands
1M
System administration commands and daemons
2
System calls
3
C library functions
4
File formats and conventions
5
Miscellanea
6
Games and screensavers
7
Special files (usually devices, those found in /dev) and drivers







Unix Command - How to see library dependencies of programs? - ldd

Viewing library dependencies of programs in Unix with ldd:

command:

     ldd <path_of_binary>


We would see something like this:


 ldd /bin/grep

        linux-vdso.so.1 =>  (0x00007fffad1ff000)
        libpcre.so.0 => /lib64/libpcre.so.0 (0x00000032fe600000)
        libc.so.6 => /lib64/libc.so.6 (0x00000037eaa00000)
        /lib64/ld-linux-x86-64.so.2 (0x00000037ea600000)




The environment var to load the library is LD_LIBRARY_PATH whether some library was not loaded.