“Eastern” Bangkalan (9 April 1938)

October 26th, 2012, posted in Others

An old book found on my grandma’s house. It’s a show at a Theater in Bangkalan City, East Java – Madura that nowadays doesn’t exist anymore. >o<

  • Muziek, Dans & Tooneel-Opvoering, dari SPORT-VEREENIGING.
  • “Eastern” Bangkalan combinatie Hua Chiao Tsing Nien Hui Sectie Soerabaia.
  • Poenja pertoendjoekan amal pada tanggal 9 April 1938-djam 8.30 malem di gedong NOLLY THEATER BANGKALAN.
  • Pendapetan keoentoengan bersi oentoek:
    • 50 % Sport Vereeniging “EASTERN”, Bangkalan.
    • 20 % Muziek South Sea Rhythm Boy’s, Bangkalan.
    • 12 1/2 % Tiong Hoa Hak Hauw, Bangkalan.
    • 12 1/2 % Hollandsch Chineesche School fonds, Bangkalan.
    • 5 % Vg. Tong Gie Hiap Tjioe, Bangkalan.

我的梦想

October 23rd, 2012, posted in Others

今天晚上我很想写一个文章,可是想写什么都不出来。所以,突然我记得在大学的时候我谢了一这个文章,就是我的文章在印尼“千岛日报”的报纸(2011年6月11日)。请你们看看。就是我的铭言:“和谐,创造更美好的世界”。感谢对刘老师已经帮我写这个文章。


我的梦想
林美健 Jimmy Julius Harijanto
玛中大学信息系统专业二年级学生

每个人都有一个梦想,有的人想成为很有钱的老板,有的人想成为很有名的名人。可是小时候,我的梦想是当一名清洁工。为什么我要当一名清洁工呢?因为小时候我看电视,我第一次听说了“清洁工”。那个时候我还不知道清洁工是什么,是做什么的。后来我才知道清洁工就是帮人家打扫卫生的人。

但是从接触电脑以后,我的梦想不再是当清洁工,而是要和比尔盖茨竞争。现在我在玛中大学学习电脑信息系统,我想很努力学习。我要成为一名非常厉害的程序设计员,然后我才可以与他竞争。

后来,我慢慢喜欢上学习语言。我又希望自己会讲很多种语言啊!比如,英文、中文、法语、韩文和日语,特别是我很喜欢中国的方言,比如福建话、广东话、湖南话。不过现在我只会讲英文和中文,别的还不会。中国方言也都只会几句。不过我会为了自己的梦想努力。

我相信有一天我的梦想可以成真!我相信在玛中我会离自己的梦想越来越近。我觉得,每个人都要有个梦想,让梦想做一支彩笔,给我们的生活增添颜色!

<指导老师:刘志敏>

Basic MySQL Trick: Keep tracking the user’s working place based on the time-range

September 22nd, 2012, posted in PHP, Website Development

Hey guys, it’s been a long time no post since I’ve been on my blog. Just a quick update for everyone dropping by on my blog and keep wanted for your reply on my blog. =)

It’s been 3 months since I’ve got a nice job. A lot of new friends and it means, A LOT OF EXPERIENCES you’ve got! There are so many things that you’ll never get while you are sitting on the uni. You’ll get a bunch of new experiences and chances to boost your skills to solve the real-world problem that can’t just solve by implementing your theory you’ve got from uni. So far, it was really nice to broaden up our horizon about all things.

A simple study-case that recently I got while I am working at my current job is:
“You have to record every transaction on the company. The problem raised is that you will have to keep track the user’s movement of working place, it means, person A on a range of time is working on Department A, and on another time is working on Department B. Let’s get into a real sample: George is starts to work on Department A on July 10, 2012. He makes a transaction of TRX0001. On August 15, 2012, George is move to Department B, and makes another transaction. On the history, you have to show that on TRX0001, George is to be shown works at Department A. But after August 15, 2012, George is to be shown works at Department B”.

How to solve that problem? Let’s have the table on mysql.

And take an example to fill the table:

What you are going to show is a table like:

It should be done by running below query:


SELECT th.TrxID, th.Date, th.UserID, muh.UserName, Dept.DeptName FROM trxheader th		
INNER JOIN mstuserheader muh ON (th.UserID = muh.UserID)		
INNER JOIN mstuserdetail mud ON (th.UserID = mud.UserID)		
INNER JOIN ( SELECT md.DeptID, md.DeptName FROM mstdept md) AS Dept ON Dept.DeptID = mud.DeptID		
WHERE mud.Date = ( SELECT MAX(mud.Date) FROM mstuserdetail mud WHERE mud.UserID = th.UserID AND mud.Date <= th.Date)

Explanation of the code:

Let’s break down the code we have:

This part of code is to show the first part of the table (shown on the image above as numbered 1):
SELECT th.TrxID, th.Date, th.UserID, muh.UserName, Dept.DeptName FROM trxheader th

And we join it with the mstuserheader table (shown on the image as numbered 2):
INNER JOIN mstuserheader muh ON (th.UserID = muh.UserID)

And also join this table (as numbered 3):
INNER JOIN mstuserdetail mud ON (th.UserID = mud.UserID)

And the last table to show the department (as numbered 4):
INNER JOIN ( SELECT md.DeptID, md.DeptName FROM mstdept md) AS Dept ON Dept.DeptID = mud.DeptID

The most important code to filter the date based on the transaction date is (between two gray lines):
WHERE mud.Date = ( SELECT MAX(mud.Date) FROM mstuserdetail mud WHERE mud.UserID = th.UserID AND mud.Date <= th.Date)

Hope it helps and inspires you. If you have any ideas or suggestions about the code (have another better ways to make it), pls let me know by sharing your comment below. I’ll be really gladful if you would like to. =)

Stay reading my blog and, cheers... :)

Throwing Away Your “‘System.IO.File’ does not contain a definition for ‘ReadAllLines’” Error Message!

August 18th, 2011, posted in Mobile App, Windows Phone

Note: You can also read this post on http://students.netindonesia.net/blogs/mrjimoy_05/archive/2011/08/18/throwing-away-your-quot-system-io-file-does-not-contain-a-definition-for-readalllines-quot-error-message.aspx

It’s a simple post but hope it’s helpful for you who need it. Recently I am in doing my project (using Microsoft Visual Studio 2010) and it was annoying! I can’t throw away these message after trying a lot of fixing. Take a look on the code below:

      if (File.Exists(_file))
      {
        string[] linesArray = File.ReadAllLines(yourFile);
        _lines = linesArray.ToList();
      }

For some computer, maybe the error doesn’t appear and the solution running slightly without any constraint. But if you get an error message sounds: ‘System.IO.File’ does not contain a definition for ‘ReadAllLines’, look at the figure below:

Then try to change your code become:

      if (File.Exists(yourFile))
      {
        using (StreamReader sr = new StreamReader(yourFile))
        {
          string line;
          while ((line = sr.ReadLine()) != null)
            _lines.Add(line);
        }
      }

It will fixed your problem :)

Notes: If you have anything to say about the article, please leave a comment. Please show a detail explanation (just like if you’ve got any error, attach the error message) so it should be easier for me to help you.
(attach the file if needed (Only: jpg, jpeg, png, gif, zip files can be uploaded)).

A Simple Graphic Movement Build on XNA

August 10th, 2011, posted in Mobile App, Windows Phone

Note: You can also read this post on http://students.netindonesia.net/blogs/mrjimoy_05/archive/2011/08/10/a-simple-graphic-movement-build-on-xna.aspx

XNA is a set of tools with a managed runtime environment provided by Microsoft that facilitates video game development and management (Wikipedia.com). This article will covered the very basic of game development before you can building the real game :)

It will be very simply displaying a moving graphic on the screen from left to right. If you are familiar with HTML then it will be so easy, just adding a snippet code <marquee> and close it with the </marquee> and voila!

Although you have installed Visual Studio 2010 for Windows Phone on your computer, you needs a software called Zune. While you’re running the solution without the application, you will receive an error message. Zune is used for all data transfer and synchronization between your PC and your device (Phone/Emulator). Moreover, Zune is a great application you can used for playing your library content such as MP3, your video, pictures, etc. You can download it on http://www.zune.net/.

Open your Visual Studio 2010 for Windows Phone, select the XNA Game Studio 4.0 (Visual C#) and then select the template for Windows Phone Game (4.0), and give your project and solution a name, or just leave it default, then click OK. Right-click the content project node on Solution Explorer, sort “Add” then select “Existing Item“. Choose a graphic file, for example a round image or others. Select “Add”.

Based on the figure above, I am using smiley.png as my graphic file. Make sure your Game1.cs open in the code editor. The object type for the graphic file we stored is Texture2D. Declare the Texture2D object below the spriteBatch declaration.

public class Game1 : Microsoft.Xna.Framework.Game
    {
        GraphicsDeviceManager graphics;
        SpriteBatch spriteBatch;

        private Texture2D _smileyTexture; // the Texture2D object for the graphic
        private Vector2 _smileyPosition; // a variable to hold the position of the graphic
        // ... //

Set the initial position for the graphic by creating a new procedure called ResetGame.

private void ResetGame()
        {
            // Set the initial smiley position
            _smileyPosition = new Vector2(100, 100);
        }

To get this code to run, call the procedure from the existing Initialize procedure.

protected override void Initialize()
        {
            // TODO: Add your initialization logic here            
            ResetGame(); // Reset the game

            base.Initialize();
        }

Then, we need to load the graphic into the variable that we’ve created on LoadContent procedure (note this procedure has been generated automatically).

protected override void LoadContent()
        {
            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch = new SpriteBatch(GraphicsDevice);

            _smileyTexture = Content.Load<Texture2D>("smiley"); // load your content here
        }

The next step is to display the content loaded on the screen on Draw procedure.

protected override void Draw(GameTime gameTime)
        {
            // Clear the background
            GraphicsDevice.Clear(Color.CornflowerBlue);

            // Declare a position for the graphic using a Vector2 structure
            Vector2 position = new Vector2(100, 100);

            // Begin a sprite batch
            spriteBatch.Begin();
            spriteBatch.Draw(_smileyTexture, _smileyPosition, Color.White);
            spriteBatch.End(); // End a sprite batch

            base.Draw(gameTime);
        }

Set the back buffer size and orientation on Game1() class contructor, below the TargetElapsedTime.

public Game1()
        {
            graphics = new GraphicsDeviceManager(this);
            Content.RootDirectory = "Content";

            // Frame rate is 30 fps by default for Windows Phone.
            TargetElapsedTime = TimeSpan.FromTicks(333333);

            // Set backbuffer size and orientation
            graphics.PreferredBackBufferWidth = 480;
            graphics.PreferredBackBufferHeight = 800;
        }

Finally, we need to change the position stored in the _smileyPosition variable so the graphic moves. The bigger value you provide, it looks faster the graphic moves. So, we will try to give it 5 and will move on Y axis. If you want to moves your graphic horizontally, then try to changes Y to X.

protected override void Update(GameTime gameTime)
        {
            // Allows the game to exit
            if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed)
                this.Exit();

            // Update the game state
            _smileyPosition.Y += 5;
            if (_smileyPosition.Y >= Window.ClientBounds.Bottom) _smileyPosition.Y = 0;

            base.Update(gameTime);
        }

Run it!

If you get your graphic moves, then you have succeed to create your application :)

Thanks for reading.

Notes: If you have anything to say about the article, please leave a comment. Please show a detail explanation (just like if you’ve got any error, attach the error message) so it should be easier for me to help you.
(attach the file if needed (Only: jpg, jpeg, png, gif, zip files can be uploaded)).