sk@supernova:~/ > source ~/.zshrcor, even shorter:
sk@supernova:~/ > . ~/.zshrc
Software Engineering, Psychology & Design.
sk@supernova:~/ > source ~/.zshrcor, even shorter:
sk@supernova:~/ > . ~/.zshrc
enum Cardsuit { CLUBS, DIAMONDS, SPADES, HEARTS };That is pretty basic and probably everyone learned that in Java 101. What was new to me, though, is that you can customize the enum { } pretty much like a class.
if ( Cardsuit.CLUBS.compareToString(xmlString) ) { .... }Of course there would have been many other ways to do this, but this solution seems quite clean and elegant to me.
Name of the file signaling the media scanner to ignore media in the containing directory and its subdirectories. Developers should use this to avoid application graphics showing up in the Gallery and likewise prevent application sounds and music from showing up in the Music app.
nc -lk $ip $port
sk@supernova:~/ > nc -lk 0.0.0.0 8080
POST /rpc HTTP/1.1
Accept: application/json
Content-type: application/json
Accept-Encoding: gzip
Host: 192.168.2.3
Content-Length: 152
Connection: Keep-Alive
{"id":3,"jsonrpc":"2.0","method":"sendTestMessage","params":{"clientVersion":"0.11.4-debug","user":"sk@geekmind.net","imei":"32420214181983746","message":"This is a test message :-)"}}
curl -v -i -X POST -d $data $uri
sk@supernova:~/ > curl -v -i -X POST -d '{"id":1,"jsonrpc":"2.0","method":"sendTestMessage","params":{"clientVersion":"0.11.4-debug","user":"sk@geekmind.net","imei":"1111111111111111111"}}' http://android.geekmind.net/rpc
* About to connect() to android.geekmind.net port 80 (#0)
* Trying 74.125.43.121... connected
* Connected to android.geekmind.net (74.125.43.121) port 80 (#0)
> POST /rpc HTTP/1.1
> User-Agent: curl/7.19.7 (universal-apple-darwin10.0) libcurl/7.19.7 OpenSSL/0.9.8l zlib/1.2.3
> Host: android.geekmind.net
> Accept: */*
> Content-Length: 157
> Content-Type: application/x-www-form-urlencoded
>
< HTTP/1.1 200 OK
HTTP/1.1 200 OK
< Content-Type: text/html; charset=utf-8
Content-Type: text/html; charset=utf-8
< Cache-Control: no-cache
Cache-Control: no-cache
< Expires: Fri, 01 Jan 1990 00:00:00 GMT
Expires: Fri, 01 Jan 1990 00:00:00 GMT
< Date: Fri, 08 Apr 2011 09:19:32 GMT
Date: Fri, 08 Apr 2011 09:19:32 GMT
< Server: Google Frontend
Server: Google Frontend
< Transfer-Encoding: chunked
Transfer-Encoding: chunked
<
* Connection #0 to host android.geekmind.net left intact
* Closing connection #0
{"jsonrpc": "2.0", "id": 1, "error": "1", "message": "ERROR: user and IMEI do not match!"}}
| Shortcut | Action |
|---|---|
CTRL + A | Move to the beginning of the line |
CTRL + E | Move to the end of the line |
CTRL + [left arrow] | Move one word backward (on some systems this is ALT + B) |
CTRL + [right arrow] | Move one word forward (on some systems this is ALT + F) |
CTRL + U (bash) | Clear the characters on the line before the current cursor position |
CTRL + U (zsh) | If you're using the zsh, this will clear the entire line |
CTRL + K | Clear the characters on the line after the current cursor position |
ESC + [backspace] | Delete the word in front of the cursor |
CTRL + W | Delete the word in front of the cursor |
ALT + D | Delete the word after the cursor |
CTRL + R | Search history |
CTRL + G | Escape from search mode |
CTRL + _ | Undo the last change |
CTRL + L | Clear screen |
CTRL + S | Stop output to screen |
CTRL + Q | Re-enable screen output |
CTRL + C | Terminate/kill current foreground process |
CTRL + Z | Suspend/stop current foreground process |
| Command | Action |
|---|---|
!! | Execute last command in history |
!abc | Execute last command in history beginning with abc |
!abc:p | Print last command in history beginning with abc |
CTRL + R to search through the history. Continue pressing CTRL + R until you find the entry you're looking for. Press [ENTER] to execute the current expression. Press [Right Arrow] to modify the current expression. Press CTRL + G to escape from search mode.Terminal -> Preferences -> Settings -> KeyboardALT or OPTION key, select use option as meta keyCTRL + [left arrow] and CTRL + [right arrow] shortcuts, selectcontrol cursor left and set it to \033b andcontrol cursor right and set it to \033f.![]() |
| Colored Logcat Output |
mkdir ~/bin cp ~/Downloads/coloredl chmod +x ~/bin/coloredlogcat.py
export PATH=$HOME/bin:$PATH
adb -d logcat "*:S MyApp:D" | coloredlogcat.pyShow only WARNING, ERROR and FATAL output. Great for checking on exceptions.
adb -d logcat "*:W" | coloredlogcat.pyReferences
sk@ubuntu:~# sudo ifconfig wlan0 upIf you do a rfkill list all you should get an output similar to this:
SIOCSIFFLAGS: Operation not possible due to RF-kill
sk@ubuntu:~$ sudo rfkill list allDepending on the state of your WiFi button the Hard blocked will either be yes or no. Press the WiFi button and run rfkill list all again to make sure the value for Hard blocked changes.
0: hp-wifi: Wireless LAN
Soft blocked: yes
Hard blocked: no
1: phy0: Wireless LAN
Soft blocked: yes
Hard blocked: no
sk@ubuntu:~$ sudo rfkill list allIf you then run ifconfig wlan0 up (or enable the wireless via your desktop's network manager) you should be able to connect to a wireless network again without any further issues.
0: hp-wifi: Wireless LAN
Soft blocked: no
Hard blocked: no
1: phy0: Wireless LAN
Soft blocked: no
Hard blocked: no
![]() |
| UI Design (Photo by Lucas Mascaro) |
Interfaces are commonly used in the Java language for callbacks. Java does not allow the passing of methods (procedures) as arguments. Therefore, the practice is to define an interface and use it as the argument and use the method signature knowing that the signature will be later implemented.I will explain it with a simple example. Lets say we create our own custom view for our new innovative user interface that is a bit more complex so that a normal Android Button just isn't satisfactory enough for our needs. Lets say we want to have something like a color picker in it:
android:layout_width="fill_parent" android:layout_height="fill_parent"in your mydialog.xml layout file. However, that doesn't seem to have any effect at all.