The Honest Truth About Dishonesty shows how people rationalize their dishonest actions and what factors increase or decrease dishonesty. Why should you read it? In the words of the author "recognizing our shortcomings is a crucial first step on the path to making better decisions, creating better societies, and fixing our institutions."
Saturday, August 08, 2015
Wednesday, August 05, 2015
The Making of the Atomic Bomb
The Making of the Atomic Bomb provides the background of scientific progress and WWII thinking that lead to nuclear weapons.
The 1986 edition that I read has a nice epilogue (40 pages long) which is missing in 2012. That's a huge loss in content because the epilogue has interesting content.
The book is
- Fun: Example: comparing Chadwick's temperament with the properties of the neutron he discovered.
- Informative: How much thought and hard work is invested into and how many small and large difficulties have to be surmounted before a scientific discovery, how good theory is needed to both design a proper experiment and correctly interpret its results (How the Curies were not able to discover the neutron even though they did the experiment first). How scientific openness in the early 1900s led to rapid progress.
- Inspiring: Kindled my interest in Chemistry (Otto Hahn, discoverer of nuclear fission was a chemist). How scientific openness could be a model for government of humanity (Niels Bohr's hope). For me, the book shows what good science and engineering is, with nuclear weapon development as a case study. Any technically inclined person would enjoy this book a lot and be motivated to do some science (hopefully for peaceful purposes).
- Horrifying: Effects of a nuclear weapon on its victims is described in graphic detail. The risk of an accidental or terrorist nuclear war is unacceptably large and the results of a wide scale war would be the end of intelligent life on Earth.
Monday, August 03, 2015
iWoz: Computer Geek to Cult Icon
"iWoz: Computer Geek to Cult Icon", by Steve Wozniak with Gina Smith, is the autobiography of Steve Wozniak. I only knew little about him, like he was the other Steve who got Apple started. After reading this book, I admire him as a person and can relate to him a lot (I myself am a software developer), especially the portions about having an open mind, not trusting authorities and trying to build a better/just world. It also gave me ideas about how to spark interest in my 3 year old son.
Tuesday, July 28, 2015
The Fall of the Ottomans
The Fall of the Ottomans by Eugene Rogan details the events on the Ottoman front during the First World War. I came to realize how complex the events were and that it would be very difficult to behave in any other way. It is a saddening and sobering read that helps in getting rid of the propagandist tales simplifying history to such a degree that the only explanations left are treason, stupidity and barbarism of the enemy.
Wednesday, July 15, 2015
Model-View-Controller
When applying the MVC pattern, I make the graphical components in the View class private so that there is no possibility of using them directly from the Controller. This enhances information hiding/encapsulation (i.e. knowing only the minimum about another class) and modularity.
Let's say that you have a View with an input text field, a button to add 10 to the input value and an output text field to display the result:
The Controller should not directly access the text field to get the value. Instead, the View class should have a get method which the controller should call. The same applies for output. After the model has finished calculations, Controller should get the output from Model and set it to the view using a set method without directly accessing a graphical component.
When you must access the view over the network (e.g. view is on a different machine), then you obviously cannot call methods of view from controller which means taht you cannot set listeners. In that case you send all state data (e.g. mouse up/down, mouse position) as JSON from view to controller, you parse the data in controller and perform appropriate actions and send data back to view.
Let's say that you have a View with an input text field, a button to add 10 to the input value and an output text field to display the result:
The Controller should not directly access the text field to get the value. Instead, the View class should have a get method which the controller should call. The same applies for output. After the model has finished calculations, Controller should get the output from Model and set it to the view using a set method without directly accessing a graphical component.
public class Controller {
public static void start() {
Model model = new Model();
View view = new View();
ActionListener add10ActionListener = (ActionEvent evt) -> {
int input = view.getInput();
int output = model.add10(input);
view.setOutput(output);
};
view.setAdd10Action(add10ActionListener);
view.setVisible(true);
}
public static void main(String[] args) {
Controller.start();
}
}
public class View extends javax.swing.JFrame {
public int getInput() {
return Integer.parseInt(jtfInput.getText());
}
void setOutput(int output) {
jtfOutput.setText(String.valueOf(output));
}
void setAdd10Action(ActionListener add10ActionListener) {
jbAdd10.addActionListener(add10ActionListener);
}
...
public class Model {
public int add10(int input) {
return input + 10;
}
}
I think of the Controller as the boss, i.e. the class that assigns event handlers and knows the order of steps. The Model contains algorithm implementations and the View is reponsible for graphical input/output.When you must access the view over the network (e.g. view is on a different machine), then you obviously cannot call methods of view from controller which means taht you cannot set listeners. In that case you send all state data (e.g. mouse up/down, mouse position) as JSON from view to controller, you parse the data in controller and perform appropriate actions and send data back to view.
Friday, May 08, 2015
Self learning update for May 2015
See my autodidact post for an introduction of what this is about.
04 May 2015: Took one week off to port my Java game to Android (50% of my time), hobby electronics (25% of my time) and German improvement (25% of my time). I started with Developing Android Apps course but made no progress due to technical difficulties:
06 May 2015: Started using KanbanFlow.
Android: Android Studio emulator still not working, still not recognizing Nexus 10. Tried to build unsigned apk, success! Realized that my laptop does not recognize my Nexus 10. Installed universal adb driver, disabled USB debugging on Nexus, success. Copied apk to Nexus via USB, install, success. I still cannot see my real Nexus 10 on Android Studio. I might need a better computer. Main source of video lectures: Android Studio Tutorial by Derek Banas.
German: Two practices on Duolingo (20XP)
Electronics: Managed to control a DC motor.
07 May 2015:
Android: Wrote an app that counts from 0 to 9 with 500ms delay. I first tried Thread (which is usual for desktop Java apps), but Nexus said "the application stopped". Then I used postDelayed and finally it worked. This means that my existing Java library knowledge is not of much use, I have to learn new libraries. My tiring workflow was (without any debugging capability):
- Android Studio is painfully slow on my laptop, Samsung ATIV Book 9 Lite (NP905S3G). Specs: Windows 8.1, Quad Core 1GHz, 4GB RAM, 40GB free disk space.
- When I tried to use the emulator, I got "ERROR: x86 emulation currently requires hardware acceleration". Tried to install Intel HAXM, got "Computer does not support Intel Virtualization Technology (VT-x)". Checked BIOS, VT-x was enabled.
- Plugged in my Nexus 10, Android Studio did not recognize it.
- I don't know what else to do.
06 May 2015: Started using KanbanFlow.
Android: Android Studio emulator still not working, still not recognizing Nexus 10. Tried to build unsigned apk, success! Realized that my laptop does not recognize my Nexus 10. Installed universal adb driver, disabled USB debugging on Nexus, success. Copied apk to Nexus via USB, install, success. I still cannot see my real Nexus 10 on Android Studio. I might need a better computer. Main source of video lectures: Android Studio Tutorial by Derek Banas.
German: Two practices on Duolingo (20XP)
Electronics: Managed to control a DC motor.
07 May 2015:
Android: Wrote an app that counts from 0 to 9 with 500ms delay. I first tried Thread (which is usual for desktop Java apps), but Nexus said "the application stopped". Then I used postDelayed and finally it worked. This means that my existing Java library knowledge is not of much use, I have to learn new libraries. My tiring workflow was (without any debugging capability):
- Work in 25 minute blocks.
- Build app (~2min the first time, ~30s afterwards)
- Copy apk_debug.apk to Nexus.
- On Nexus install apk_debug.apk.
- Run apk_debug.apk.
- Repeat until you get what you want.
German: 20 XP
Book: Capital in the Twenty-First Century
"Capital in the Twenty-First Century", Thomas Piketty
This is a 500+ pages book. The first 200 pages were full of very similar looking data and tables. It became interesting after page 200, and riveting after page 300. I like books that show how ignorant I am and this is definitely one of them.
Read it if the following questions are of interest to you:
This is a 500+ pages book. The first 200 pages were full of very similar looking data and tables. It became interesting after page 200, and riveting after page 300. I like books that show how ignorant I am and this is definitely one of them.
Read it if the following questions are of interest to you:
- What is the source of income inequality and how does it harm society?
- How should the income from production be divided between labor and capital?
- Why is it so difficult to tax the super rich and multinational corporations?
- Is publicly available financial information enough to form a healthy opinion about financial matters?
Update, January 11th 2016: Paul Graham says that we should not attack inequality (which is an indirect effect), but directly poverty and the questionable ways of getting rich:
Subscribe to:
Posts (Atom)

