pikopong

it’s all about knowledge

About the IT Department in Hospital Universiti Sains Malaysia

with one comment

Information System Unit of HUSM was established in year 2000 due to the specific needs of IT implementation in hospital. At that moment, there were only 4 people working, but today, the numbers has grown up to 25 people. Since the beginning of establishment, the unit has extensively developing applications software for the hospital. Lead by En. Azuddin Bin AB Rahman and his team consisting of 7 IT Officers, 13 programmers and 4 technicians, they have delivered more than 10 systems for various purposes. As computer science graduates, the team believes that they can build any application without the needs to acquire one from external sources. With that mindset, the software development alone has saved the hospital millions of ringgit.

Read the rest of this entry »

Written by mree

April 8th, 2009 at 9:21 am

Posted in husm

Top 5 Subtitle Websites

with one comment

These are my favourite websites for movies/tvseries subtitles.

  1. TVsubtitles
  2. Subscene
  3. Podnapisi
  4. SubtitleSource
  5. OpenSubtitle

For TV Series, I recommend the first site, usually subtitle will be released on the day of the scene release, easier to see too if you want to see the latest release (just keep hitting the Reload button). For movies, use the third one, and the 6th will provide you with an automatic app to download your subtitle. If you have other good website, just post it in the commment, thanks :)

Written by mree

April 7th, 2009 at 4:47 pm

Posted in mis

Reading Mifare 1K Card using Java in Linux

with 21 comments

At the end of last year, my friends and I were tasked to read our staff card. The main objective was pretty simple, to create a library where we don’t have to depend on the vendor everytime we want to read our own staff card and the library should also be working on Windows and Linux (that means Java to us).

Working Environment

  1. Slackware 12.2
  2. JDK 6 Update 11
  3. Netbeans 6.5
  4. libusb 0.1.12
  5. Windows Binary of JPC/SC Java API 0.8.0
  6. Your contactless smartcard reader’s driver

Read the rest of this entry »

Written by mree

February 11th, 2009 at 4:27 pm

Posted in programming

My First Experience using Canon 40D

with 2 comments

On the 5th of September 2008, I bought my first DSLR gears during my trip to Kuala Lumpur. The items are Canon 40D, Canon Speedlite 580EX II, Canon 50mm f/1.8 and some other things for about RM 5,000 which I don’t think is a really good bargain, but definitely better than what I’ll get if I bought them in Kelantan.

Ever since that purchase, I’ve been reading the manual whenever I got free time as I thought how am I supposed to be a better photographer if I don’t know the full potential of my camera ? I also managed to get some pirated book about the camera such as Canon EOS 40D Digital Field Guide. I was actually preparing myself for my uncle’s engagement event on the 3rd day of Hari Raya Aidilfitri. However, another event added to my list which is my cousin’s wedding event. I’m pretty happy that I finally had the chance to try whatever I learnt to the real world since using the chair in my room as a model is getting boring.

So, fast forward to my cousin’s wedding day. The main event that day was “Akad Nikah” which took place at a mosque near her house. Sadly, on my first try out as a photographer using my new camera, I made a lot of mistakes, lots of them. These are the mistakes that I knew (there are definitely more):

  1. I didn’t identify the main characters for the event thus there are only a few photos of them.
  2. Overuse of f/1.8 resulting a very bad group photos.
  3. Always beware with the additional characters such as children playing around which spoiled my shot with their blur movement.
  4. Wrong setting for shutter speed whenever I want to capture a candid moment such as hugging, shaking hands and so on.
  5. I need to ask them to look at me whenever I want to take photos (yes, I forgot to ask them to do that every time there are other photographers around).
  6. I need to know in advance the settings for the indoor and outdoor. Almost all of my outdoor shots after the event (which took place indoor) were overexposed as I didn’t have the time to test the correct settings.
  7. Always test other flash exposures even though the initial setting is OK at the first try.
  8. I should’ve known the limitation of my 50mm lens.
  9. I should not feel shy whenever I want to get close the subject.

So, what about the mistakes that I’ve done during my uncle’s engagement day ? This is the list:

  1. All the previous mistakes ;)

However, one thing for sure, I really need to start saving and buy a wide angle lens. 50mm is great for portrait shots, but not for group shots or even two people at some distance in a cramp room. *Sigh*, there’re still so many things to learn.

Written by mree

October 7th, 2008 at 8:59 am

Posted in photography

Printing to PDF Using CUPS

without comments

  1. Install CUPS-PDF based on your distro, you can download if from here.
  2. Click this link http://localhost:631 or type it into your browser.
  3. If the page requested a username and password, just enter your root username and password.
  4. Go the “Administration” tab and select “Add Printer” in the Printer section.
  5. For “Add Printer” page, put a name for your virtual PDF printer, any name will do. Then click “Continue”.
  6. For the second page, that is “Device for a”, you should select “CUPS-PDF (Virtual PDF Driver)”. If it’s not there, then you haven’t execute Step 1 successfully.
  7. In the 3rd page, choose “Generic” as the Make and then click “Continue”.
  8. 4th page, choose “Generic CUPS-PDF Printer (en)” as the model and then click “Add Printer”. You’re done, but we need to customize where the file will be located when you printed it.
  9. Edit /etc/cups/cups-pdf.conf in your favourite editor.
  10. Put these lines at the end of the file and save it (both can be customized):
  11. 1
    2
    
    Out /home/${USER}/Desktop
    Label 1
  1. The first line actually tell CUPS to print your file to the Desktop and the second line will make sure your file won’t be overwritten by the newer one.
  2. Restart your CUPS, for Slackware users, you can type this command /etc/rc.d/rc.cups restart
  3. So, that’s all and good luck !

Tested on Slackware 12.1, CUPS 1.3.7

Written by mree

September 10th, 2008 at 10:01 am

Posted in linux

Java Printing Fix for Linux with CUPS

with 16 comments

Apparently, there’s a bug in Java where people using newer version of CUPS cannot print (can’t even display the print dialog) due to a null pointer exception and this is actually a known bug. So, how do we fix this? For people who use Gnome, you can refer to this page.

However, for people who uses non gui environment such as Fluxbox, Openbox and etc (Gnome and KDE user can use these steps too), you can fix it by editing your CUPS printers configuration file. You can get edit the file at /etc/cups/printers.conf

<DefaultPrinter Printer>
# Printer configuration file for CUPS v1.3.7
# Written by cupsd on 2008-09-08 11:24
.
.
.
Option orientation-requested 3
</Printer>

Make sure you add line 7 to every configuration for every printer you’ve installed. If you cannot find the file, you probably haven’t configured any printer yet.

This fix is simply to make sure CUPS will provide a page orientation setting to Java.

The exception:

Caused by: java.lang.NullPointerException: null attribute
        at sun.print.IPPPrintService.isAttributeValueSupported(IPPPrintService.java:1147)
        at sun.print.ServiceDialog$OrientationPanel.updateInfo(ServiceDialog.java:2121)
        at sun.print.ServiceDialog$PageSetupPanel.updateInfo(ServiceDialog.java:1263)
        at sun.print.ServiceDialog.updatePanels(ServiceDialog.java:437)
        at sun.print.ServiceDialog.initPrintDialog(ServiceDialog.java:195)
        at sun.print.ServiceDialog.(ServiceDialog.java:124)
        at javax.print.ServiceUI.printDialog(ServiceUI.java:188)
        at sun.print.RasterPrinterJob.printDialog(RasterPrinterJob.java:855)
        at sun.print.PSPrinterJob.printDialog(PSPrinterJob.java:421)

Refer to some of the discussions here:

UPDATE: I forgot to add, you need to restart your CUPS after editing the configuration (Thanks to Brandon Bell)

Tested on Slackware 12.1, JDK 1.6 Update 7, CUPS 1.3.7

Written by mree

September 9th, 2008 at 10:08 am

Posted in linux

Auto Resize JTable Column Width

without comments

This code should resize your JTable column width based on the contents of the header and data.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
    public JTable autoResizeColWidth(JTable table, DefaultTableModel model) {
        table.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
        table.setModel(model);
 
        int margin = 5;
 
        for (int i = 0; i < table.getColumnCount(); i++) {
            int                     vColIndex = i;
            DefaultTableColumnModel colModel  = (DefaultTableColumnModel) table.getColumnModel();
            TableColumn             col       = colModel.getColumn(vColIndex);
            int                     width     = 0;
 
            // Get width of column header
            TableCellRenderer renderer = col.getHeaderRenderer();
 
            if (renderer == null) {
                renderer = table.getTableHeader().getDefaultRenderer();
            }
 
            Component comp = renderer.getTableCellRendererComponent(table, col.getHeaderValue(), false, false, 0, 0);
 
            width = comp.getPreferredSize().width;
 
            // Get maximum width of column data
            for (int r = 0; r < table.getRowCount(); r++) {
                renderer = table.getCellRenderer(r, vColIndex);
                comp     = renderer.getTableCellRendererComponent(table, table.getValueAt(r, vColIndex), false, false,
                        r, vColIndex);
                width = Math.max(width, comp.getPreferredSize().width);
            }
 
            // Add margin
            width += 2 * margin;
 
            // Set the width
            col.setPreferredWidth(width);
        }
 
        ((DefaultTableCellRenderer) table.getTableHeader().getDefaultRenderer()).setHorizontalAlignment(
            SwingConstants.LEFT);
 
        // table.setAutoCreateRowSorter(true);
        table.getTableHeader().setReorderingAllowed(false);
 
        for (int i = 0; i < table.getColumnCount(); i++) {
            TableColumn column = table.getColumnModel().getColumn(i);
 
            column.setCellRenderer(new DefaultTableColour());
        }
 
        return table;
    }

Example:

1
2
3
// Must pass the model
DefaultTableModel model = new DefaultTableModel();
jTable = autoResizeColWidth(jTable, model);

Tested on JRE v5 and JRE v6

Written by mree

August 13th, 2008 at 2:49 pm

Posted in programming

Japanese Drama: Kurosagi

without comments

Kurosagi

“In this word, there are three types of swindlers. Those who defraud other people’s money, Shirosagi. Those who deceive others by manipulating their feelings, Akasagi. And then, using the Shirosagi and Akasagi as his only source of food, is the ultimate swindler in history. His name is Kurosagi” Pretty cool eh ? That’s the opening text of this drama.

Read the rest of this entry »

Written by mree

June 4th, 2008 at 2:07 am

Posted in vids

Reading MyKad using Visual Basic

with 4 comments

It seems that a lot of people asking how to read MyKad using Visual Basic, but since I don’t have the slightest idea on how to code in VB, I started to search around. To my surprise, Xenon (the one who reverse engineered MyKad to get the APDU) actually wrote a small application in VB to read MyKad. So, for those who can’t afford to buy SDK from commercial company, you can download the code here for FREE !

VB Application to read MyKad


View the discussion
Download the code

Written by mree

May 28th, 2008 at 12:32 am

Posted in programming

Hospital Universiti Sains Malaysia at WCIT 2008

with 2 comments

WCIT 2008

In case you didn’t know, HUSM stands for Hospital Universiti Sains Malaysia and I’m currently working there. Early this year, my head of the department got invited by MDeC to this event. The event took place at Kuala Lumpur Convention Center from 18/5/2008 to 22/5/2008. You can read all the information about WCIT here.

Read the rest of this entry »

Written by mree

May 25th, 2008 at 6:37 pm

Posted in husm