If any of the usb devices is formatted in ntfs, you best install ntfs-3g:
sudo apt-get install ntfs-3g
Now let’s edit our file system table, so that the usb stick & external hard drive are mounted every time the system boots:
sudo nano /etc/fstab
As you can see in the screenshot above I’ve used the disk UUID as name to find it. This way, if you unplug your usb flash drive and put it in another usb port, it still works. As type, make sure to use ntfs-3g.
Now you just need to reboot and the disks are both mounted!
For completeness, you could also mount the usb stick just once with this:
sudo mount -o uid=pi -o gid=pi -t ntfs-3g /dev/sda1 /mnt/usb1
This library takes the pain away when you want to scan for iBeacons on Android. You register the iBeacons you are interested in and via a callback you are notified when you enter or exit the range of an iBeacon.
While I agree that a Singleton shouldn’t be used to often, I do want to share my favourite way to implement the singleton pattern for reference.
public class Example
private static Example instance;
// this class cannot get instantiated
public static Example getInstance()
if (instance == null)
instance = new Example();
In October of 2015, my girlfriend and I went to Peru. One of the highlights of the trip was our trek to Choquequirao! I want to share what we have learned about this fantastic trek!
They call it the sister of Machu Picchu! It’s a city built by the Incas and abandoned in 1572 because of the Spanish invasion. In regard to Machu Picchu, the city is not sacred. Probably more like a civil centre, a city for the nobility. The location is awesome, it’s located in the Andean at 3000 kilometres. You really feel like close to the gods!
You can’t get there by car, bus or cable lift. Despite that this will probably change in the near future, now is the perfect moment to go there!
The hike is really exhausting, the path is about 15 to 20 kilometres and you have the cross a valley. This means 1 kilometre down and up. Unfortunately there is only 1 way, so you will walk the same path twice. The view of the Andean along the way is really stunning and the city itself is amazing because how hard it is to get there!
A porter with some mules to carry all the equipment and your spare stuff.
A cook who makes brilliant food.
A guide (in our case, he was a big disappointment).
If you have a good guide he will take care of you and tell loads along the way. Because there is so much to like:
Kolibries & other awesome birds!
Spending so much money on this guided trek was a big mistake, given the poor service we have got. This is why I wrote this article, so you can do it on your own!
How busy is it?
There are not too many people, but you are also no longer alone on this trek. Adventurous people start to know, and it’s only normal! Most people we have met prefer Choquequiroa above Machu Picchu!
Being on the same path, you will see the same people quite often again because most people have about the same pace but take breaks on different spots. About half of the people we met were doing this on their own!
Do it by yourself!
With a trekking organisation you can easily pay about 1500 soles per person to the organisation, and like 50 for water and other (not included) things. And on top of that you should also pay tips, like 150 or more soles. So this could total 1700 more or less.
Whereas if you walk on your own you probably have enough with 200 – 500 soles. The difference is big!
You have to use public transport to go to Cachora. You can easily ask this in the Tourist Office of Cuzco. A bus or 2 will you take there, and it is absolutely cheap!
Renting a small tent is possible in Cuzco, one French couple told us they paid 140 soles to rent a very good looking tent for 5 days. We went in spring, and a regular sleeping bag should be enough. I used a very small one to save space. Only 1 night I had cold, and wearing clothes inside my sleeping bag has enough to not feel the cold. And please you don’t need walking sticks. Many Peruvians leave their bamboo walking sticks at the first shop/restaurant where the path really begins.
Every 3 hours you almost meet a place where you can camp. As you can see on the map. They are very welcoming, sleeping was 5 soles a night and included the toilet and cold shower.
Food and drinks
Don’t bring too much water. The most expensive water we bought from one of the shops was 12 soles for 2 litres. Given the effort to get the water there, that’s a very fair price I think. Most of the camp sites offer food and can prepare you a good meal. They also sell snacks and coke. And don’t worry, you only need to speak a few Spanish words. If you can say “Hi” and can count you will be fine. Don’t worry about this, many tourists walk this trail, so if needed you can always ask help from them, as they maybe speak more Spanish.
If you want to compare if plain old java objects have the same properties, it is easiest to override the equals method. This way, if you initialise objects on different places, you can be certain when comparing that they are the same.
We will show you how to do it with this simple class:
public class Insect
private int legs;
private int eyes;
private int colour;
private String sortName;
public boolean equals(Object o)
if (this == o)
if (o == null || this.getClass() != o.getClass())
final Insect that = (Insect) o;
if (this.legs != that.legs)
if (this.eyes != that.eyes)
if (this.colour != that.colour)
if (this.sortName != null ? (this.sortName != that.sortName) : (that.sortName != null))