20140330
Make more than costs.
Use wisdom to filter people, businesses and ideas.
Think long term.
Know when to cut losses and sunk costs.
Learn how to say no in a polite way.
Put yourself in the other person's shoes.
Learn the written and unwritten rules of the game you are playing.
Be honest with yourself.
Simplify.
Ask yourself whether you control the power, money, information and/ or relationship.
Think of all the possible risks first.
Don't be greedy.
See the world for what it is.
Forgive, but don't forget.
There are always options.
Follow the flow.
Trust your intuition.
There are times when you have contradictory thoughts, learn to make a decision based on the situation.
Learn to control your temper.
Follow the actions, follow the money.
Be punctual.
Listen 100 times more than talking.
Observe with your eyes, heart and mind.
Be humble because pride comes before a fall.
Work hard and smart in the direction of increasing happiness.
Use time wisely.
When you are down, remember who are your true friends.
Remember the people who tell you what you need to hear.
Learn to be yourself in all situations.
Preserve a balance.
Take care of what you eat, drink and breathe.
Exercise regularly.
Learn about trends.
Trust and verify.
There are times when everything seems out of control. Remember S.O.S. S for Stop, O for Organize, S for Securing resources.
Help the people around you become great.
Tuesday, April 15, 2014
Friday, September 20, 2013
Cyberduck and S3
I found the user interface of S3 a bit irritating:
Cannot rename files (capital letters in filenames and extensions kept tripping me)
Cannot easily move and copy files
Luckily, there's Cyberduck.
Go to your account and generate a access key ID and secret access key.
Start Cyberduck and select "Open Connection".
Select "Amazon S3" for the connection.
For username, enter the access key ID.
For password, enter the secret access key.
Click connect.
Cannot rename files (capital letters in filenames and extensions kept tripping me)
Cannot easily move and copy files
Luckily, there's Cyberduck.
Go to your account and generate a access key ID and secret access key.
Start Cyberduck and select "Open Connection".
Select "Amazon S3" for the connection.
For username, enter the access key ID.
For password, enter the secret access key.
Click connect.
Hosting your own static site and mail hosting - Using Amazon S3, Amazon Route 53 and Zoho Mail
For fun, I tried using S3 to host our new site www.axo.sg.
Configuring S3 and Route 53 for static website hosting
http://docs.aws.amazon.com/AmazonS3/latest/dev/website-hosting-custom-domain-walkthrough.html
Not exactly simple, but doable if you follow the steps slowly.
Configuring Zoho Mail
Go to the newly created hosted zone under Route 53.
Add the following mx records:
yourdomain.com
10 mx.zohomail.com.
20 mx.zohomail.com.
Configuring S3 and Route 53 for static website hosting
http://docs.aws.amazon.com/AmazonS3/latest/dev/website-hosting-custom-domain-walkthrough.html
Not exactly simple, but doable if you follow the steps slowly.
Configuring Zoho Mail
Go to the newly created hosted zone under Route 53.
Add the following mx records:
yourdomain.com
10 mx.zohomail.com.
20 mx.zohomail.com.
Wednesday, July 31, 2013
Notes from the Arduino SparkFun Inventor's Kit - Sketch 01 to Sketch 05
Arduino programs are called Sketches, which are uploaded to the board. They are written in Processing, which is a subset of C++.
Exercise: Sketch 01
Learning points:
Each Arduino board must have 2 functions - setup() and loop().
void setup() initializes the Arduino board. It only runs once.
void loop() is the function that runs continuously.
Functions:
pinMode(pin_number, mode)
e.g. pinMode(13, OUTPUT);
digitalWrite(pin_number, mode)
e.g. digitalWrite(13, HIGH)
delay(time)
e.g. delay(1000) // delay 1000 msecs
Exercise: Sketch 02
Learning points:
An Arduino can accept analog and digital inputs. We are using a variable resistor in this circuit.
Functions:
analogRead(pin_number)
e.g. sensorValue = analogRead(sensorPin)
Exercise: Sketch 03
Learning points:
Putting "const" is like "final static" in Java.
The white LED has 3 pins for RGB, ranging from 0 to 767.
Functions:
for (x = 0; x < 768, x++)
{
function_A();
}
analogWrite(pin_number, int value)
e.g. analogWrite( RED_PIN, redIntensity)
Example: Sketch 04
Learning points:
Arrays in Processing
int ledPins[] = {2, 3, 4, 5, 6, 7, 8, 9};
Functions:
random(limit_value);
e.g. int index = random(8); // picks a number randomly from 0 to 7
Exercise: Sketch 05
Learning points:
Boolean logic using digital pins for input
Connect the pin of the pushbutton to GND and the other pin to a digital pin. Use a 10K resistor in between the pin of the pushbutton and the digital pin so that when the pushbutton is not pressed, the pin will read as "HIGH".
Functions:
A == B
A != B
A && B
A || B
!A
Exercise: Sketch 06
Learning points:
Using photoresistors
Functions:
map(initial lower bound, initial upper bound, ideal lower bound, ideal upper bound);
e.g. map(0, 1023, 0 , 255) // map values from 0 to 1023 to 0 to 255
constrain(range of values, lower bound, upper bound);
e.g. constrain(lightLevel, 0, 255)
Exercise: Sketch 07
Learning points:
Using temperature sensors
Do not connect the temperature sensor in the opposite direction (Vin to the GND pin of the temperature sensor)! The sensor heated up till over 260 degrees and I got burnt. Ouch..
Serial transmission
Functions:
Serial.being(baud rate)
e.g. Serial.begin(9600)
Serial.print(string or variable)
Exercise: Sketch 08
Learning points:
Using servos
Importing libraries
Functions:
#import <>
servo1.attach(pin);
Exercise: Sketch 09
Learning points:
Using the flex sensor
Functions:
flexposition = analogRead(filexpin);
Exercise: Sketch 01
Learning points:
Each Arduino board must have 2 functions - setup() and loop().
void setup() initializes the Arduino board. It only runs once.
void loop() is the function that runs continuously.
Functions:
pinMode(pin_number, mode)
e.g. pinMode(13, OUTPUT);
digitalWrite(pin_number, mode)
e.g. digitalWrite(13, HIGH)
delay(time)
e.g. delay(1000) // delay 1000 msecs
Exercise: Sketch 02
Learning points:
An Arduino can accept analog and digital inputs. We are using a variable resistor in this circuit.
Functions:
analogRead(pin_number)
e.g. sensorValue = analogRead(sensorPin)
Exercise: Sketch 03
Learning points:
Putting "const" is like "final static" in Java.
The white LED has 3 pins for RGB, ranging from 0 to 767.
Functions:
for (x = 0; x < 768, x++)
{
function_A();
}
analogWrite(pin_number, int value)
e.g. analogWrite( RED_PIN, redIntensity)
Example: Sketch 04
Learning points:
Arrays in Processing
int ledPins[] = {2, 3, 4, 5, 6, 7, 8, 9};
Functions:
random(limit_value);
e.g. int index = random(8); // picks a number randomly from 0 to 7
Exercise: Sketch 05
Learning points:
Boolean logic using digital pins for input
Connect the pin of the pushbutton to GND and the other pin to a digital pin. Use a 10K resistor in between the pin of the pushbutton and the digital pin so that when the pushbutton is not pressed, the pin will read as "HIGH".
Functions:
A == B
A != B
A && B
A || B
!A
Exercise: Sketch 06
Learning points:
Using photoresistors
Functions:
map(initial lower bound, initial upper bound, ideal lower bound, ideal upper bound);
e.g. map(0, 1023, 0 , 255) // map values from 0 to 1023 to 0 to 255
constrain(range of values, lower bound, upper bound);
e.g. constrain(lightLevel, 0, 255)
Exercise: Sketch 07
Learning points:
Using temperature sensors
Do not connect the temperature sensor in the opposite direction (Vin to the GND pin of the temperature sensor)! The sensor heated up till over 260 degrees and I got burnt. Ouch..
Serial transmission
Functions:
Serial.being(baud rate)
e.g. Serial.begin(9600)
Serial.print(string or variable)
Exercise: Sketch 08
Learning points:
Using servos
Importing libraries
Functions:
#import <
Exercise: Sketch 09
Learning points:
Using the flex sensor
Functions:
flexposition = analogRead(filexpin);
The Gap - What haunts me daily
The gap between what I could be and what I am currently haunts me daily, incessantly, relentlessly.
Monday, July 29, 2013
Starting Arduino with Ubuntu 12.04
Bought an Arduino Starter Kit 2 days ago and started with the tutorials.
Note when starting Arduino on Ubuntu: If you are using Ubuntu 12.04, you do need to add Arduino as a user and restart in order to access the serial port.
It's fun to make LEDs light up =)
Note when starting Arduino on Ubuntu: If you are using Ubuntu 12.04, you do need to add Arduino as a user and restart in order to access the serial port.
It's fun to make LEDs light up =)
Hardware Product Design - FreeCAD
I used SolidWorks during my engineering days, but now that I no longer have access to SolidWorks, I had to find an alternative CAD software. Hopefully, something that runs on Windows and Ubuntu.
Just started using FreeCAD, which is not as user-friendly as SolidWorks, but I'm not complaining.
Coming from someone who has used SolidWorks before, I think the easiest method to get started was to watch the video tutorials on FreeCAD.
I started with a new document, under the "Part" mode (not "Part Design").
I found the menu a bit confusing. You have to choose the mode that you are in to access the tools.
For navigation, I selected the "Blender" navigation mode.
For rotation of objects and parts, I used "Edit -> Placement" and selected either Yaw, Pitch and Roll (google for the relevant axis of rotation).
I haven't tried "Assembly", which is similar to "Mate" in Solidworks, where you can align 2 parts to each other using either faces, edges or points.
Just started using FreeCAD, which is not as user-friendly as SolidWorks, but I'm not complaining.
Coming from someone who has used SolidWorks before, I think the easiest method to get started was to watch the video tutorials on FreeCAD.
I started with a new document, under the "Part" mode (not "Part Design").
I found the menu a bit confusing. You have to choose the mode that you are in to access the tools.
For navigation, I selected the "Blender" navigation mode.
For rotation of objects and parts, I used "Edit -> Placement" and selected either Yaw, Pitch and Roll (google for the relevant axis of rotation).
I haven't tried "Assembly", which is similar to "Mate" in Solidworks, where you can align 2 parts to each other using either faces, edges or points.
Tuesday, June 18, 2013
3 free and easily available tools for usability testing
Problem Steps Recorder
Windows 7 comes pre-installed with "Problem Steps Recorder".
Go to "Start", search for "Problem Steps Recorder". Under settings, remember to set the number of steps as 100.
TeamViewer
Allow remote access.
InvisionApp
More for designers, but you can upload a screenshot and let your clients comment on the mockup.
Better than screenshots or emails, saves a lot of frustration.
Windows 7 comes pre-installed with "Problem Steps Recorder".
Go to "Start", search for "Problem Steps Recorder". Under settings, remember to set the number of steps as 100.
TeamViewer
Allow remote access.
InvisionApp
More for designers, but you can upload a screenshot and let your clients comment on the mockup.
Better than screenshots or emails, saves a lot of frustration.
Wednesday, June 5, 2013
Linux server admin - Adding user accounts, resetting passwords
When logged in as your own account and changing your own password:
$ passwd
As superuser (or root), changing the password for other accounts
Find out list of users
$ cat /etc/passwd | cut -d: -f1
Change password for account "guest1"
$ passwd guest1
Add users (with default configuration)
$ useradd guest1
(http://www.thegeekstuff.com/2009/06/useradd-adduser-newuser-how-to-create-linux-users/)
Monday, May 20, 2013
Getting started with Android Studio on Ubuntu 12.04 - tools.jar missing
I tried installing and running Android Studio, but came across the error: "tools.jar missing from classpath. Please ensure that JAVA_HOME points to the JDK, not the JRE."
I tried the following:
Finding where java is installed:
$: whereisjava
$: java -version
$: echo $JAVA_HOME
$: echo $JDK_HOME
For Ubuntu, normally the openjdk version of Java is used.
Editing and saving ~/.bashrc
$: nano ~/.bashrc
JAVA_HOME = /usr/lib/jvm/java-7-openjdk-amd64/
export JAVA_HOME
JDK_HOME = /usr/lib/jvm/java-7-openjdk-amd64/
export JDK_HOME
Reloading ~/.bashrc
$: source ~/.bashrc
$: echo $JAVA_HOME
$: echo $JDK_HOME
Check for the correct version of Java if you are like me, having both Java 6 and 7 installed.
Choose the correct version of Java.
I tried the following:
Finding where java is installed:
$: whereisjava
$: java -version
$: echo $JAVA_HOME
$: echo $JDK_HOME
For Ubuntu, normally the openjdk version of Java is used.
Editing and saving ~/.bashrc
$: nano ~/.bashrc
JAVA_HOME = /usr/lib/jvm/java-7-openjdk-amd64/
export JAVA_HOME
JDK_HOME = /usr/lib/jvm/java-7-openjdk-amd64/
export JDK_HOME
Reloading ~/.bashrc
$: source ~/.bashrc
$: echo $JAVA_HOME
$: echo $JDK_HOME
Check for the correct version of Java if you are like me, having both Java 6 and 7 installed.
sudo update-alternatives --config java
Choose the correct version of Java.
Saturday, May 11, 2013
Increasing your luck and empathy surface area
I had the chance to attend a dialogue session with George Yeo recently and his astute comment struck me (paraphrasing due to my recollection):
"Imagine a room where we are all individuals living in our own small bubbles. If we were to just reach out 1 cm more, we would touch so many people besides us. Reach out, just a little."
"Imagine a room where we are all individuals living in our own small bubbles. If we were to just reach out 1 cm more, we would touch so many people besides us. Reach out, just a little."
Sunday, March 31, 2013
Ruby - syntax error, unexpected $end
You encounter this error when there is a missing "end" somewhere.
Try running "ruby -w example.rb". The "-w" the warning mode for ruby to give more information about the missing "end".
If you are using Sublime Text 2, you can also try to re-indent your code.
Edit -> Line -> Reindent
Try running "ruby -w example.rb". The "-w" the warning mode for ruby to give more information about the missing "end".
If you are using Sublime Text 2, you can also try to re-indent your code.
Edit -> Line -> Reindent
Thursday, March 21, 2013
How to conduct a Structured Creative Brainstorming Sessions
Preamble:
I find that I needed to improve at conducting meetings and discussions. A common kind of meeting required is a brainstorming session. However, I'm sure many people have experienced brainstorming sessions which seemed to be unfocused and resulted in a lack of actionable items.
Much thanks to Ronald Wong, for sharing his thoughts.
How to create a Structured Creative Brainstorming Session
Quality of session depends on the
Diversity of ideas generated
Quantity of ideas generated
Inclusive participation of all the individuals
For facilitator
Before the meeting
Send the agenda out with discussion items, directly responsible individual and timings, with sufficient buffer time
Send background material, if necessary
Prepare the meeting overview
Structure the meeting
Prepare 3 possible solutions/ ideas
During the meeting
Set the context for all participants: 5W, 1H
Set the groundrules
Only constructive comments
No distractions such as mobile phones
Be conscious of the discussion progress
Get everyone's buy-in and conclusion at every stage before moving on
Close the meeting by summarising all the points
Seat in a position such that you are able to see all participants and make sure your body posture is "open"
Techniques
To spur discussion - Ask "How" questions
To be inclusive - Maintain eye contact with everyone and ask everyone around the table to contribute
To draw participants who are drifting - Ask them for their opinion on a certain point
Use props such as the whiteboard and monitor screen
After the discussion
Send the minutes out, with tasklists
Saturday, February 23, 2013
Gotchas during Chapter 8 of the Ruby on Rails tutorial
During the Ruby on Rails tutorial, I encountered several errors during Chapter 8. Luckily, I solved quite a few of them and learnt a few things about debugging along the way.
Problem: Cannot create users
The first thing that caught me was the error regarding creation of users. I could not create the user.
Code: app/controllers/sessions_controller.rb
Reading the logs, I saw this message on the line where "find_by_email" is called. I was extremely puzzled as to why this message occurred.
Error message:
Why it happened:
You can't access the values of "email" and "password" through params[:session][:email].
The sessions hash looks like:
Solution:
You can access the email and password values of the params through 2 methods:
Updated code:
Problem: Cannot authenticate users in authentication_pages_spec.rb
As Postgresql is case-sensitive, we need to make sure the emails are downcased.
Problem: Cannot create users
The first thing that caught me was the error regarding creation of users. I could not create the user.
Code: app/controllers/sessions_controller.rb
def create
user = User.find_by_email(params[:session][:email])
if user && user.authenticate(params[:session][:password])
sign_in user
redirect_to user
else
flash.now[:error] = 'Invalid email/password combination' # Not quite right!
render 'new'
end
Reading the logs, I saw this message on the line where "find_by_email" is called. I was extremely puzzled as to why this message occurred.
Error message:
SELECT "users".* FROM "users" WHERE "users"."email" = NULL LIMIT 1
Why it happened:
You can't access the values of "email" and "password" through params[:session][:email].
The sessions hash looks like:
utf8: ✓ authenticity_token: 1D72gydJcrOzGslhOnfAotmkEUtghtQmOhEZRQGWpiw= sessions: !ruby/hash:ActiveSupport::HashWithIndifferentAccess email: 'user@example.com' password: 'foobar'
Solution:
You can access the email and password values of the params through 2 methods:
params["sessions"]["email"] params[:email]
Updated code:
def create
user = User.find_by_email(params["sessions"]["email"])
if user && user.authenticate(params["session"]["password"])
sign_in user
redirect_to user
else
flash.now[:error] = 'Invalid email/password combination' # Not quite right!
render 'new'
end
Problem: Cannot authenticate users in authentication_pages_spec.rb
As Postgresql is case-sensitive, we need to make sure the emails are downcased.
before do fill_in "Email", with: user.email.downcase fill_in "Password", with: user.password click_button "Sign in" save_and_open_page # useful to see the page that is generated end
The original code wasuser.email.upcase
Saturday, August 25, 2012
My personal evolution - Going from "mono" to "stereo"
One of the biggest personal revelations I have made in the past few months was how much I lacked in empathy. It is almost like I have lived the last 27 years of my life behind a transparent sheet of almost impermeable glass that lets words and images through, but not the emotional nuances.
During a conversation, I tend to focus almost exclusively on the thought process of the person. "What made that person reach that conclusion?" That explains why I am often confused by the irrational way people seem to jump to conclusions, which kind of throws me into an increasing confusion feedback loop trying to understand their thought process even more. I have subsequently made my own life easier by applying the assumption with caveats that most people are irrational and not aware of how they think anyway. This similarly applies to myself.
My friend has commented that I have a highly developed sense for seeing how systems should be designed and the logical way processes should be structured. However, at the same time, I have an almost defunct ability to guess how people will react to my words and actions. This is in contrast to another person whom I work with, who is often able to think 3 - 5 steps in advance during conversations about how to guide the negotiation process forward.
Luckily, I am now fully aware of this deficiency. Now, it is in the realm of "what I know I don't know". For the past few days, I have been more aware of the pauses in speech, people's facial expressions, the tone of voice and body language. It has been an interesting experience, albeit a bit overwhelming, as there are now more bits of information to process in parallel. I have also been looking for resources to beef up my lack of understanding. Lastly, I think I am only learning to be more human (although.. in a relatively more structured way than most people) =)
I wonder how many people are like me, who are unaware that they are seeing without feeling, in their daily lives?
Friday, July 27, 2012
Trying to solve a dysfunctional team?
You might witness teams that do not function well or even be part of teams that are badly broken. If you ever wanted to solve it, you might need to first identify the root causes. I've found the following framework useful:
The 5 Dysfunctions of a Team
http://flpbs.fmhi.usf.edu/pdfs/Five%20Dysfunctions%20of%20a%20Team.pdf
Bullet points:
The 5 Dysfunctions of a Team
http://flpbs.fmhi.usf.edu/pdfs/Five%20Dysfunctions%20of%20a%20Team.pdf
Bullet points:
- Absence of trust
- Fear of conflict
- Lack of commitment
- Avoidance of accountability
- Inattention to results
Sunday, July 8, 2012
Doing it again.. (draft)
I will because the feeling of paying someone for a honest day's work and thanking them for a good job is awesome.
Because surprising your employees is sometimes way better than delighting your customers.
I will first understand the industry's in and outs..
I will aim to find an easy insertion point, then slowly wedge the rest of the business in.
I will focus on building a business, not starting a startup.
I guess I will never stop, it's just too much fun =)
Sunday, June 17, 2012
Questions I have no answers for
Am I making full use of my time?
Are the choices I am making the best?
Am I learning as much as I possibly can?
What do I need to learn?
What are the problems that I should choose to solve?
What are the changes I can bring to healthcare and the environment?
Who do I need to team with?
What are the mistakes I have made?
What are the right decisions I have made?
If I had 5 more years of experience, how would the decisions I make change?
What are the things I think I know?
What are the things I don't know I need to know?
What are the fundamentals I need to learn?
Are the choices I am making the best?
Am I learning as much as I possibly can?
What do I need to learn?
What are the problems that I should choose to solve?
What are the changes I can bring to healthcare and the environment?
Who do I need to team with?
What are the mistakes I have made?
What are the right decisions I have made?
If I had 5 more years of experience, how would the decisions I make change?
What are the things I think I know?
What are the things I don't know I need to know?
What are the fundamentals I need to learn?
Saturday, May 12, 2012
Solved: Missing JDK - Error with Ant (Java build tool)
I ran into 2 errors while trying to build ZXing mainly due to the fact that I only installed the Java 6 Open JRE but I was missing the JDK (looked at /usr/lib/jvm/java-6-openjdk).
Unable to locate tools.jar. Expected to find it in /usr/lib/jvm/java-6-openjdk/lib/tools.jar
As a side note, I find it very useful to document all the major installations done on this blog mainly to aid my fallible memory.
Unable to locate tools.jar. Expected to find it in /usr/lib/jvm/java-6-openjdk/lib/tools.jar
...... /zxing-2.0/javase/build.xml:41: Unable to find a javac compiler;
com.sun.tools.javac.Main is not on the classpath.
Perhaps JAVA_HOME does not point to the JDK.
It is currently set to "/usr/lib/jvm/java-6-openjdk/jre"
Problem solved by installing the JDK from Ubuntu Software Centre.
You can also use: sudo apt-get install openjdk-6-jdk
Platform: Ubuntu 11.10
As a side note, I find it very useful to document all the major installations done on this blog mainly to aid my fallible memory.
Tuesday, April 10, 2012
Error: Piggyback SSL on Heroku - jetty.ssl.keypassword
I was using PiggyBack SSL (Heroku seems to have automatically enabled it for all apps recently) and I came across this error..
"jetty.ssl.keypassword "
Background: I am running a Clojure app (Noir) on heroku for testing. The app starts fine but the error message about the ssl keypassword made the app crash when I make a GET request to a https address under heroku.
Fix: I removed the ssl-port option for jetty options. It does not seem like it's needed.
However, if you have your own SSL certificate (not using PiggyBack), then you should set your own.
(def prod-settings
{:mode mode
:ns 'helen
:session-cookie-attrs {:max-age 3600
:secure false}
:jetty-options {:port (Integer. (get (System/getenv) "PORT" "8080"))}})
;; Removed ssl-port because heroku keeps requiring ssl password
;; Heroku's ssl-port is 443, no need to supply keystore or ssl password if using PiggyBack SSL
Subscribe to:
Posts (Atom)