Skip to content

Silveira Neto Posts

After a lot of problems with my old Galaxy S4 randomly saying “SIM card not detected” and rebooting, I tried to fix the SIM card reader. I ended up breaking it even more. I just replaced it for a new one (~US$5). I wouldn’t go as far as calling it a modular smartphone but it’s nice to own something and be able to fix it yourself.

From Instagram: http://ift.tt/1H067wA

Part of the board games collection at work.. from Instagram: http://ift.tt/1JWf1Ku

Arrogant Bastard Ale – Stone Brewing. from Instagram: http://ift.tt/1JS2WpJ

@suyanevom driving and me as copilot. Copying an Akira Toriyama drawing. #Micron #Pigma #Gimp #drawing #draft

from Instagram: http://ift.tt/1BbQ38x

trail at the Theodore Roosevelt Island.

from Instagram: http://ift.tt/1ebBVBZ

Java, printing arrays

As I keep forgetting, this post is to remind me that Java Java doesn’t have a pretty toString() for arrays objects, and it does for Lists.

[java]import java.util.List;
import java.util.ArrayList;
import java.util.Arrays;

public class ListsExample {
public static void main (String args[]) {
// as an array
String[] list1 = {"a","b","c"};
System.out.println(Arrays.toString(list1));

// as an List provided by Arrays
List<String> list2 = Arrays.asList("d", "e", "f");
System.out.println(list2);

// as an implementation of the interface List
// ArrayList (could also be LinkedList, Vector, etc)
List<String> list3 = new ArrayList<String>();
list3.add("g");
list3.add("h");
list3.add("i");
System.out.println(list3);
}
}
[/java]

The output is:

[a, b, c]
[d, e, f]
[g, h, i]

Tmux: keep same directory in new windows

# open/split windows in the same dir
bind '"' split-window -c "#{pane_current_path}"
bind % split-window -h -c "#{pane_current_path}"
bind c new-window -c "#{pane_current_path}"

In your ~/.tmux.conf.

To source it in your open tmux:
[bash]
:source-file ~/.tmux.conf
[/bash]

Or in any shell:
[bash]
tmux source-file ~/.tmux.conf
[/bash]