.

Saturday, April 28, 2012

[PHP] If-Then-Else Syntax

          Hello, Reader ^^! Back again with source code. This time is a basic syntax If-Then-Else in PHP programming language. This source code is to show how to do If-Then-Else statement in PHP language. Here's the template:


if <condition> {
       <statement if true> 
} else {
       <statement if false>
}


Okay, that's all I can say. Thank you for reading ^^!








[PHP] If-Then Syntax

          Hello, Reader ^^! Back again with source code. This time is a basic syntax If-Then in PHP programming language. This source code is to show how to do If-Then statement in PHP language. Here's the template:


if <condition> {
       <statement if true> 
}


Okay, that's all I can say. Thank you for reading ^^!








Friday, April 27, 2012

[Ruby] Random Choice With Hash Table

          Hello, Reader ^^! Back again with source code. This time is Random Choice With Hash Table which is made using Ruby programming language. This shows how to do a random number and use hash table combined into choosing output of hash table by randomize the choice. The input of the left side of the hast table must be integer type. Other still work, but you need to hash it before randomizing hashing it. Okay, that's all I can say. Thank you for reading ^^!









[Javascript] [Crafty] Draw Image

          Hello, Reader ^^! Back again with source code. This time is Draw Image which is written in Java script programming language and Crafty extension. This shows how to draw image in Crafty screen. You need Image and 2D object in the Crafty object for image and positioning. You also need linking with an image in the folder you want. Okay, that's all I can say. Thank you for reading ^^!













[Javascript] [Crafty] Text Example

          Hello, Reader ^^! Back again with source code. This time is Text Example which is written in Java script programming language and Crafty extension. This shows how to write text inside Crafty screen. You need to include 2D, Text, and DOM Crafty object first. Then you set the position and the text which want to be written. Okay, that's all I can say. Thank you for reading ^^!













[Java] If-Then-Else Syntax

          Hello, Reader ^^! Back again with source code. This time is a basic syntax If-Then-Else in Java programming language. This source code is to show how to do If-Then-Else statement in Java language. Here's the template:


if <condition> {
       <statement if true> 
} else {
       <statement if false>
}


Okay, that's all I can say. Thank you for reading ^^!








[Java] If-Then Syntax

          Hello, Reader ^^! Back again with source code. This time is a basic syntax If-Then in Java programming language. This source code is to show how to do If-Then statement in  Java language. Here's the template:


if <condition> {
       <statement if true> 
}


Okay, that's all I can say. Thank you for reading ^^!








[Java] [JSP] Login and Logout

          Hello, Reader ^^! Back again with source code. This time is Login and Logout which is written in Java programming language and JSP extension. This one demonstrates how to do login and logout. It uses session to persistent the information between pages and MySQL to get user data from database. Okay, that's all I can say. Thank you for reading ^^!











Thursday, April 26, 2012

[Java] [JSP] Insert Data to MySQL

          Hello, Reader ^^! Back again with source code. This time is Insert Data to MySQL which is written in Java programming language and JSP extension. In this one, it shows how to insert data input from html page into mysql query. The input itself is processed in jsp page using mysql library. This example also shows error if any of the input is null value, returning to the input page. To ensure that the input is really inserted, after submitting input, it will redirect to view page showing the query in the database, if you see your input, that means the inoput is successfully inserted into MySQL database. Okay, that's all I can say. Thank you for reading ^^!













[Java] [JSP] Search Based Similarity (Substring)

          Hello, Reader ^^! Back again with source code. This time is Search Based Similarity (Substring) which is written in Java programming language and JSP extension. In this one, it shows how to do a search based on similarity of word using substring. In this case is title. If the title contain the substring, it will be included in query. Btw, you need MySQL library to call it before you can use it. Okay, that's all I can say. Thank you for reading ^^!











Wednesday, April 25, 2012

[Ruby] Dancing With the Googlers (Google Code Jam 2012)

          Hello, Reader ^^! Back again with source code. This time is Dancing With the Googlers problem solver which is written in Ruby programming language. The case is from Google Code Jam 2012: Qualification Round. I participated in the qualification and fortunately I can go to Round 1 :D. This one easy but a bit tricky. See the detail at the Extra Credit. Okay, that's all I can say. Thank you for reading ^^!






Extra Credit

Problem case and example (in B-small-attempt0.in, B-large.in, and Dancing_With_the_Googlers_example.txt) from Google Code Jam 2012 Qualification Round (http://code.google.com/codejam/contest/1460488/dashboard#s=p1)









[Ruby] Speaking in Tongues (Google Code Jam 2012)

          Hello, Reader ^^! Back again with source code. This time is Speaking in Tongues problem solver  which is written in Ruby programming language. The case is from Google Code Jam 2012: Qualification Round. I participated in the qualification and fortunately I can go to Round 1 x3. Now, instead of letting the code unused after helping me facing the competition, I post it in my blog as my thanks for my codes :3. About the case, it is about hashing one-to-one input, but the detail, looks at the extra credit for the link :D. Okay, that's all I can say. Thank you for reading ^^!






Extra Credit
Problem case and example (in A-small-attempt0.in and Speaking_in_Toungues_example.txt) from Google Code Jam 2012 Qualification Round (http://code.google.com/codejam/contest/1460488/dashboard#s=p0)









[Java] [JSP] Search Based Tag

          Hello, Reader ^^! Back again with source code. This time is Search Based Tag which is written in Java programming language and JSP extension. In this one, it shows how to do search based tag. It will return output based on whether the post has the tag which input is received from user. It also calls from mysql database so you might need a .jar before you can use the mysql in jsp. Okay, that's all I can say. Thank you for reading ^^!


(Note: the picture there is 7, but since my monitor is too big or I was too lazy to minimize it, so I crop it xD)









Tuesday, April 24, 2012

[Ruby] [FXRuby] Read (Load) File

          Hello, Reader ^^! Back again with source code. This time is Text Example which is written in Ruby programming language and FXRuby extension. In this one, it will show load file dialogue. It will get the path of the to be loaded/read. However, it only get the file path, it will not load it immediately, so you need to define the read/load in standard ruby after using the file load dialogue. There's example how to do it in the source code. Okay, that's all I can say. Thank you for reading ^^!






Download/View Source Code
Dropbox
Dropbox (Repository)
GitHub
GitHub (Repository) 







[Ruby] [FXRuby] Write (Save) File

          Hello, Reader ^^! Back again with source code. This time is Text Example which is written in Ruby programming language and FXRuby extension. In this one, it will show save file dialogue. It will get the path of the to be saved/written. However, it only get the file path, it will not save it immediately, so you need to define the write/save in standard ruby after using the file save dialogue. There's example how to do it in the source code. Okay, that's all I can say. Thank you for reading ^^!












[Ruby] [FXRuby] User Defined Message Dialogue

          Hello, Reader ^^! Back again with source code. This time is Text Example which is written in Ruby programming language and FXRuby extension. In this one, how to pop up message dialogue using your own defined message dialogue. There is already built-in message dialogue but I prefer to define my own message dialogue so I can define my own message icon in it. Okay, that's all I can say. Thank you for reading ^^!











[Ruby] [FXRuby] Input From Text Field

          Hello, Reader ^^! Back again with source code. This time is Text Example which is written in Ruby programming language and FXRuby extension. In this example, it shows how to get input from a text field. You need to call the FXRuby component as variable to achieve it for calling the variable value. Okay, that's all I can say. Thank you for reading ^^!











[Ruby] [FXRuby] Text Example

          Hello, Reader ^^! Back again with source code. This time is Text Example which is written in Ruby programming language and FXRuby extension. In this example, it will display how to use text. You can use FXLabel to achieve it. That way, there will be text on window form. Its value can be also changed to other text. Okay, that's all I can say. Thank you for reading ^^!











Saturday, April 21, 2012

[Python] If-Then-Else Syntax

          Hello, Reader ^^! Back again with source code. This time is a basic syntax If-Then-Else in Python programming language. This source code is to show how to do If-Then-Else statement in Python language. Here's the template:


if <condition>:
       <statement if true> 
else:
       <statement if false>




Okay, that's all I can say. Thank you for reading ^^!








[Python] If-Then Syntax

          Hello, Reader ^^! Back again with source code. This time is a basic syntax If-Then in Python programming language. This source code is to show how to do If-Then statement in Python language. Here's the template:


if <condition>:
       <statement if true> 




Okay, that's all I can say. Thank you for reading ^^!








Wednesday, April 18, 2012

[C++] If-Then-Else Syntax

          Hello, Reader ^^! Back again with source code. This time is a basic syntax If-Then-Else in C++ programming language. This source code is to show how to do If-Then-Else statement in C++ language. Here's the template:


if <condition> {
       <statement if true> 
} else {
       <statement if false>
}


Okay, that's all I can say. Thank you for reading ^^!







[C++] If-Then Syntax

          Hello, Reader ^^! Back again with source code. This time is a basic syntax If-Then in C++ programming language. This source code is to show how to do If-Then statement in C++ language. Here's the template:


if <condition> {
       <statement if true> 
}


Okay, that's all I can say. Thank you for reading ^^!








[Ada] Procedure Syntax

          Hello, Reader ^^! Back again with source code. This time is a basic syntax Procedure in Ada programming language. This source code is to show how to do Procedure statement in Ada language. Here's the template:


procedure <ProcedureName>(<input1>,...,<inputN>: in <value-type>;<output1>,...,<outputN>: out <value-type>) is
begin
       <Statement>
end <ProcedureName>;

Note:   <input1>,...,<inputN>: in <value-type>   is optional, only use it if there is input required in the procedure, while <output1>,...,<outputN>: out <value-type> if there is output required in the procedure.

Okay, that's all I can say. Thank you for reading ^^!








[Ada] Function Syntax

          Hello, Reader ^^! Back again with source code. This time is a basic syntax Function in Ruby programming language. This source code is to show how to do  Function statement in Ruby language. Here's the template:


function <FunctionName>(<input1>,...,<inputN>:<value-type>) return <value-type> is
begin
       <Statement>
       return <value>;
end <FunctionName>;

Note:  <input1>,...,<inputN>:<value-type>  is optional, only use it if there is input required in the function

Okay, that's all I can say. Thank you for reading ^^!








Tuesday, April 17, 2012

[Ada] Case Syntax

          Hello, Reader ^^! Back again with source code. This time is a basic syntax Case in Ada programming language. This source code is to show how to do Case statement in Ada language. Here's the template:



case <variable name> is
   when <variable condition 1> =>
       <statement 1 if variable fulfills condition 1>
   when <variable condition 2> =>
       <statement 2 if variable fulfills condition 2>
   when <variable condition 3> =>
       <statement 3 if variable fulfills condition 3>
   when <variable condition 4> =>
       <statement 4 if variable fulfills condition 4>
   when <variable condition N> =>
       <statement N if variable fulfills condition N>
   when others =>
       <statement if variable doesn't fulfill any condition>
end case;


Note: " when others" is optional


Okay, that's all I can say. Thank you for reading ^^!








Sunday, April 15, 2012

[Java] [JSP] Reuse Existing Class in Other Jsp Page

          Hello, Reader ^^! Back again with source code. This time is Reuse Existing Class in Other Jsp Page written in Java programming language with JSP extension. This one shows how to use existing class so it can be used in other jsp pages. It will be shown in class's values that shows that the class isn't recreated when   accessing other jsp pages. Okay, that's all I can say. Thank you for reading ^^!

[Java] [JSP] User Input: Text

          Hello, Reader ^^! Back again with source code. This time is User Input: Text written in Java programming language with JSP extension. In this one, it will how how to obtain input from jsp which then it will be passed into other JSP page as the result. It also uses Java class as mediator. Okay, that's all I can say. Thank you for reading ^^!

[C#] If-Then-Else Syntax

          Hello, Reader ^^! Back again with source code. This time is a basic syntax If-Then-Else in C# programming language. This source code is to show how to do If-Then-Else statement in C# language. Here's the template:


if <condition> {
       <statement if true> 
} else {
       <statement if false>
}


Okay, that's all I can say. Thank you for reading ^^!








[C#] If-Then Syntax

          Hello, Reader ^^! Back again with source code. This time is a basic syntax If-Then in C# programming language. This source code is to show how to do If-Then statement in C# language. Here's the template:


if <condition> {
       <statement if true> 
}


Okay, that's all I can say. Thank you for reading ^^!








[Ruby] Procedure Syntax

          Hello, Reader ^^! Back again with source code. This time is a basic syntax Procedure in Ruby programming language. This source code is to show how to do Procedure statement in Ruby language. Here's the template:


def <ProcedureName>(<input1>,...,<inputN>)
       <Statement>
end

Note:  <input1>,...,<inputN>  is optional, only use it if there is input required in the function

Okay, that's all I can say. Thank you for reading ^^!








[Ruby] Function Syntax

          Hello, Reader ^^! Back again with source code. This time is a basic syntax Function in Ruby programming language. This source code is to show how to do  Function statement in Ruby language. Here's the template:


def <FunctionName>(<input1>,...,<inputN>)
       <Statement>
       return <value>
end

Note:  <input1>,...,<inputN>  is optional, only use it if there is input required in the function

Okay, that's all I can say. Thank you for reading ^^!








[Ruby] Case Syntax

          Hello, Reader ^^! Back again with source code. This time is a basic syntax Case in Ruby programming language. This source code is to show how to do Case statement in Ruby language. Here's the template:



case <variable name>
   when <variable condition 1> then
       <statement 1 if variable fulfills condition 1>
   when <variable condition 2> then
       <statement 2 if variable fulfills condition 2>
   when  <variable condition 3> then
       <statement 3 if variable fulfills condition 3>
   when  <variable condition N> then
       <statement N if variable fulfills condition N>
   else (optional)
       <statement if variable doesn't fulfill any condition>
end


Note: "else" is optional


Okay, that's all I can say. Thank you for reading ^^!








[Java] [JSP] Hello World

          Hello, Reader ^^! Back again with source code. This time is Hello World which is written in Java programming language and used JSP extension. With JSP, Java code can be implemented on web pages. Now, in this one, it will show "Hello World" text. It also use JavaBeans. JavaBeans is just standard extension for JSP page. It made class reusable in jsp page. Okay, that's all I can say. Thank you for reading ^^!

[Ruby] If-Then-Else Syntax

          Hello, Reader ^^! Back again with source code. This time is a basic syntax If-Then-Else in Ruby programming language. This source code is to show how to do If-Then-Else statement in Ruby language. Here's the template:


if <condition>
       <statement if true> 
else
       <statement if false>
end


Okay, that's all I can say. Thank you for reading ^^!








[Ruby] If-Then Syntax

          Hello, Reader ^^! Back again with source code. This time is a basic syntax If-Then in Ruby programming language. This source code is to show how to do If-Then statement in Ruby language. Here's the template:


if <condition>
       <statement if true> 
end


Okay, that's all I can say. Thank you for reading ^^!








Saturday, April 14, 2012

[Ada] If-Then-Else Syntax

          Hello, Reader ^^! Back again with source code. This time is a basic syntax If-Then-Else in Ada programming language. This source code is to show how to do If-Then-Else statement in Ada language. Here's the template:


if <condition> then
       <statement if true> 
else
       <statement if false>
end if;


Okay, that's all I can say. Thank you for reading ^^!








[Ada] If-Then Syntax

          Hello, Reader ^^! Back again with source code. This time is a basic syntax If-Then in Ada programming language. This source code is to show how to do If-Then statement in Ada language. Here's the template:


if <condition> then
       <statement if true> 
end if;


Okay, that's all I can say. Thank you for reading ^^!





Thursday, April 12, 2012

Rice with Crispy Snapper and Noodles

          Hello, Reader ^^! Back again with photo of food which I ate the other day. The other day I ate Rice with Crispy Snapper and Noodles. The fish was in crispy taste, added also some sauce which made it had more flavor. With the combination of noodle, it felt like a crispy snapper was swimming in my mouth c:. Okay, that's all I can say. Thank you for reading ^^!








Rice with Spicy Cassava Soto Soup

          Hello, Reader ^^! Back again with photo of food which I ate the other day. The other day I ate Rice with Spicy Cassava Soto Soup. The soup has spicy cassava chips inside the soup. It made the chips gets less harder, but it tasted good especially when the soup is hot and spicy. The rice also was for ensuring the eating is satisfied. Okay, that's all I can say. Thank you for reading ^^!








Wednesday, April 11, 2012

White Nasi Goreng and Two Eggs

          Hello, Reader ^^! Back again with photo of food which I ate the other day. The other day I ate White Nasi Goreng and Two Eggs. That Nasi Goreng didn't use soysauce which made it more brown. But the taste still as good as when with soysauce. It also was added with two eggs which I had egg satisfication twice. Okay, that's all I can say. Thank you for reading ^^!