Saturday, March 14, 2009

How to use POP3 to read email in Hotmail accounts

Microsoft has just announced on March 12, 2009 that now everyone can connect to Hotmail account to check email using POP3 protocol. Before this service in announced, for example, if you need to connect to your Hotmail using Microsoft Outlook you will need to install Outlook Connector. By providing POP3, you can now use your favorite email client (such as Evolution; your mobile phone: iPhone, Blackberry, etc.; or even other web-based email: Gmail, Yahoo, etc.) to check your email.

To use your favorite email client to connect to Hotmail using POP3, you will need to set up the following configurations:
POP server: pop3.live.com (Port 995)
POP SSL required? Yes
User name: Your Windows Live ID, for example yourname@hotmail.com
Password: The password you usually use to sign in to Hotmail or Windows Live
SMTP server: smtp.live.com (Port 25 or 587)
Authentication required? Yes (this matches your POP username and password)
TLS/SSL required? Yes
Note: If you are using Outlook Connector, keep using it. Outlook Connector is a better way to connect to Hotmail from Microsoft Outlook.

For more information: Windows Live Hotmail Blog

Wednesday, February 18, 2009

OSSPAC 09 Day 2



The second day at Open Source Singapore Pacific-Asia Conference & Expo. (First Day : OSSPAC 09 Day 1)

Python - Bring Fun Back into Programming

In this session, I learned some basic Python and got to know how easy Python is. For example, to read web page as HTML text in Python, you would write:

import urllib2
site = urllib2.urlopen("http://www.google.com")
lines = site.readlines(2000)
print lines

First, you import urllib2 from the standard library included in Python. Then, read it by calling urlopen. After that read at a maximum of 2000 lines and put it in lines. Finally, print them out to the console.

The speaker (Mervin Beng) used Pyshell to write and run all his codes.




PHP in Enterprise

This session provided basic overview of PHP.



Getting Started with Google Android

Sean Sullivan really gave us a great overview of Android. I think this session is one of the most popular session here. If you want to look at his slides, click here. His website is here.




Exhibition Hall

IBM



Sun Microsystems





redhat




Oracle




Novell (OpenSuse Linux)



Tersus : Software for developing web based application without the need to write a single line of code. Tersus website.





A team from Taiwan
DBRL : A tool that let you boot linux remotely similar to thin client scheme but all the computation are executed locally at each client. All the files are stored on servers, so the clients don't need to have their own hard drives.
Clonezilla : An opensource hard drive cloning tool similar to Norton Ghost.



OpenBravo : Opensource Enterprise Resource Planning (ERP)



Zend : PHP framework



Evening reception


Tuesday, February 17, 2009

Android G2 has arrived


Android G2 / HTC Magic is officially launched at Mobile World Conference 2009. Here is its specification:

  • CPU Qualcomm 528 MHz
  • ROM 512 MB, RAM 192 MB with microSD slot supporting SDHC
  • Weight 118 grams (Battery included)
  • 3.2 inches touch sensitive screen (not sure whether it supports multitouch or not) Resolution: 320x480
  • There is a trackball
  • Quad-band GSM, HSDPA/WCDMA 900/2100 MHz
  • GPS, Electronic Campass, WiFi B/G, Bluetooth 2.0 EDR, Accelerometer
  • Camera 3.2 m. Pixel AF
  • No more physical keyboard

Source : http://news.cnet.com/rumor-has-android-g2-in-the-works/

OTimeline : your personal timeline

What is a timeline?
A timeline is a graphical representation of a chronological sequence of events, also referred to as a chronology. It can also mean a schedule of activities, such as a timetable.
(wikipedia)

20th century timeline from Microsoft Encarta (C) Microsoft Corp.

Have you ever think of creating your own timeline so that you can record memorable events?
OTimeline provides each and every user to create a chronology of their history in the Internet. As each person has their own interesting tale to tell for every passing day, we want to capture their beautiful and meaningful moments in life with our unique timeline gadget that can be easily installed and implemented whether it is in your blog, facebook account or any other web 2.0 application.
See for yourself : http://www.otimeline.com/

Wiki Simple Explanation

Simple explanation of Wiki - Content Management System (CMS)
(I saw this for the first time at OSSPAC. It's quite fun.)

Monday, February 16, 2009

OSSPAC 09 Day 1

After waiting for a long time, IBM representative contacted me saying that I won a trip to OSSPAC from dW Game Challenge. IBM sponsors air transportation (Singapore Airlines), hotel (Traders Singapore) and OSSPAC conference fee for me. After all the confusion about travel arrangements, finally I am here.

Open Source Singapore Pacific-Asia Conference & Expo






Registration Desk




IBM Session : Extending Open Source Capabilities For Enterprise Environments



Exhibition Hall (open on Day 2)







Lunch Buffet









Wondering why they put those plastic rings on the side of plates? It is used for holding wine glass.

Sunday, January 18, 2009

Change Voicemail number in iPhone

How to change Voicemail number in iPhone?

Call : *5005*86*123456789# where 123456789 is the number you want to call when you press the Voicemail button.

For example, you can set your Voicemail number to your own iPhone telephone number. When pressing it, you will always get a busy tone. Thus, this will prevent accidentally calling Voicemail number.

Credits : http://janandjanuary.multiply.com/journal/item/68/68

Sunday, January 11, 2009

Read Request Body in Filter

Is it possible to intercept HTTP Request in order to read HTTP Request Body (HTTP Request Payload) before it is served by target servlet or JSP?

The answer is yes. You can use Servlet Filter to read, "filter" or modify ServletRequest (HTTPServletRequest) object before the request object is sent to and serve by the final servlet.

What if I read a request body within a servlet filter, is the body still going to be available to be read again by the servlet, or can it be read only once?

Yes, but it is a little bit tricky.
Because of the fact that the request body can be read only once. If you read the body in a filter, the target servlet will not be able to re-read it and this will also cause IllegalStateException. You will need ServletRequestWrapper or its child: HttpServletRequestWrapper so that you can read HTTP request body and then the servlet can still read it later.

public class MyRequestWrapper extends HttpServletRequestWrapper {
private final String body;
public MyRequestWrapper(HttpServletRequest request) throws IOException {
super(request);
StringBuilder stringBuilder = new StringBuilder();
BufferedReader bufferedReader = null;
try {
InputStream inputStream = request.getInputStream();
if (inputStream != null) {
bufferedReader = new BufferedReader(new InputStreamReader(inputStream));
char[] charBuffer = new char[128];
int bytesRead = -1;
while ((bytesRead = bufferedReader.read(charBuffer)) > 0) {
stringBuilder.append(charBuffer, 0, bytesRead);
}
} else {
stringBuilder.append("");
}
} catch (IOException ex) {
throw ex;
} finally {
if (bufferedReader != null) {
try {
bufferedReader.close();
} catch (IOException ex) {
throw ex;
}
}
}
body = stringBuilder.toString();
}

@Override
public ServletInputStream getInputStream() throws IOException {
final ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(body.getBytes());
ServletInputStream servletInputStream = new ServletInputStream() {
public int read() throws IOException {
return byteArrayInputStream.read();
}
};
return servletInputStream;
}

@Override
public BufferedReader getReader() throws IOException {
return new BufferedReader(new InputStreamReader(this.getInputStream()));
}

public String getBody() {
return this.body;
}
}

The first step is to create a class that extends HttpServletRequestWrapper. Then, use the constructor to read HTTP Request body and store it in "body" variable. The final step is to override getInputStream() and getReader() so that the final servlet can read HTTP Request Body without causing IllegalStateException.

Here's how to use RequestWrapper in the filter.

public void doFilter(ServletRequest request, ServletResponse response,
FilterChain chain) throws IOException, ServletException {

Throwable problem = null;

MyRequestWrapper myRequestWrapper = new MyRequestWrapper((HttpServletRequest) request);

String body = myRequestWrapper.getBody();
String clientIP = myRequestWrapper.getRemoteHost();
int clientPort = request.getRemotePort();
String uri = myRequestWrapper.getRequestURI();

System.out.println(body);
System.out.println(clientIP);
System.out.println(clientPort);
System.out.println(uri);

chain.doFilter(myRequestWrapper, response);
}

IBM ASEAN dW Game Challenge




IBM ASEAN dW Game Challenge (IBM ASEAN DeveloperWorks Game Challenge) is a maze-quiz game sponsored by IBM. During the game, you will need to navigate King Darwin out of the maze and to his castle. If you encounter a yellow box, you will need to answer an IT-related multiple-choice question in which its answer can be found on IBM developerWorks website. Once answer correctly, you will gain 300 points. If you answer it wrong, you will lose 150 points. When you start the game, you will have 3000 points. Each seconds during the play, except when you are attempting to answer each question, will cost 1 point.

This is the official rules and description from the website:

About the Game

King Darwin is trapped in a maze and needs to find his way back to the dW Castle. Your challenge is to help him out in the shortest time possible, through pushing of crates and tackling of quiz questions whereby answers can be found within the IBM developerWorks portal.

So are you up to the ASEAN dW Game Challenge? Play the game now to find out!


How to Play

Your task is to help King Darwin maneuver through the maze by pushing crates out of his way. There will be metal boxes along the way that cannot be moved.
You are required to answer a multiple-choice quiz question whenever King Darwin steps on a glowing golden tile, which could be exposed or hidden under the crates.
Answers to the quiz questions can be found within the IBM developerWorks portal. A hint will be provided for each question.


Scoring System

You will own 3000 gold coins at the start of each game, whereby 1 gold coin represents 1 second.
The timer will be activated once you start the game and one gold coin will drop for each second that passes.
The timer will be paused when King Darwin steps on a glowing golden tile and you are prompted to answer a quiz question. The timer will resume upon submission of your answer to the quiz question.
If a quiz question is answered correctly, the bonus will be an addition of 300 gold coins to your total number of gold coins at that point of time.
If a quiz question is answered incorrectly, the penalty will be a deduction of 150 gold coins from your total number of gold coins at that point of time.
The objective of the game is to collect the most number of gold coins at the end of the game.
You can play the game multiple times and submit your best scores with your personal information for a chance to be one of our top 3 winners.

The top 3 winners at the ASEAN level will be awarded with the following prizes.



The ASEAN dW Game Challenge was opened till 31 December 2008.

I played the game and as of December 31, 2008, luckily, I am the first place. Until final announcement, I hope it won't change.
:)