snippetjournal

– notes, snippet codes, and my journal

Archive for October 2012

Extends Inner Class, Example

leave a comment »

Dsini saya membuat suatu class public yang berisi 2 class lainnya, kemudian 2 class ini akan mengextends masing masing class di atas nya.

Ada cara yang berbeda ketika kita akan mau menextends class yang bukan public dan class ny sendiri adalah inner class.

berikut ini contoh nya :


package ASN.Coders;

/*
 * example how to extends inner class
 *
 */

public class Kampretos1 {

private String galau1;

public Kampretos1() {

}

private String methodkampretos(){
 galau1 = "class Kampretos1 <parent>";
 return galau1;
 }

protected class Kampretos2 extends Kampretos1{
 private String galau2;

private String methodsatu(){
 galau2 = "class Kampretos2 <child of parent>";
 return galau2;
 }
 }

protected class Kampretos3 extends Kampretos2{
 Kampretos3(){
 Kampretos1.this.super();
 }

 // membuat contstructor yang akan membuat instance class dari class kampretos1
 // yaitu mengambil reference dari parent pertama.
 // jika tidak begini inner class yang mengextends tidak akan bisa menemukan reference nya parent.


private String galau3;

private String methoddua(){
 galau3 = "class Kampretos3 <child of child of parent>";
 return galau3;
 }
 }

public static void main(String[] args) {
 String string;

Kampretos1 kampretos1 = new Kampretos1();
 string = kampretos1.methodkampretos();
 System.out.println("get variable value from method ==>> "+string);

Kampretos2 kampretos2 = kampretos1.new Kampretos2();
 string = kampretos2.methodsatu();
 System.out.println("get variable value from method ==>> "+string);

Kampretos3 kampretos3 = kampretos2.new Kampretos3();
 string = kampretos3.methoddua();
 System.out.println("get variable value from method ==>> "+string);

}
}

Written by snippetjournal

October 21, 2012 at 2:14 am

Posted in Programming

Tagged with , ,

BASIC NOTE : VARCHAR and NVARCHAR2

leave a comment »

SQL Server provides both datatypes to store character information. For the most part the two datatypes are identical in how you would work with them within SQL Server or from an application. The difference is that nvarchar is used to store unicode data, which is used to store multilingual data in your database tables.

Other languages have an extended set of character codes that need to be saved and this datatype
allows for this extension. If your database will not be storing multilingual data you should use the varchar datatype instead. The reason for this is that nvarchar takes twice as much space as varchar, this is because of the need to store the extended character codes for other languages.
http://www.geekinterview.com/question_details/34134

The NVARCHAR2
<http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/sql_elements001.htm#i45685&gt;

datatype was introduced by Oracle for databases that want to use Unicode for some columns while keeping another character set for the rest of the database (which uses VARCHAR2). The NVARCHAR2 is a Unicode-only datatype.

One reason you want to use NVARHCAR2 might be that your DB uses a non-Unicode character and you still want to be able to store Unicode data for some columns. Another reason might be that you want to use two Unicode character set (AL32UTF8 for data that comes mostly from western Europe, AL16UTF16 for data that comes mostly from Asia for example) because different character sets won’t store the same data equally efficiently.

http://stackoverflow.com/questions/4508351/difference-between-varchar210-char-and-nvarchar210

Both columns in your example (Unicode |VARCHAR2(10 CHAR)| and |NVARCHAR2(10)|) would be able to store the same data, however the byte storage will be different. Some strings may be stored more efficiently in one or the other.

Written by snippetjournal

October 21, 2012 at 2:07 am

Posted in Programming

Tagged with

Example Email Reschedule Interview

with 2 comments

Pernah  mengalami panggilan interview melalui email, tetapi anda tidak bisa menghadiri nya dan perlu reschedule waktu interview anda.

Walaupun sebenar nya melakukan reschedule interview adalah langkah yang kurang bagus, tetapi kadang cara ini tidak dapat di hindari.

berikut ini point point penting yang harus anda deskripsikan dalam email reschedule interview anda :

  • ucap kan terima kasih terlebih dahulu.
  • meminta maaf lah karena karena anda akan me-reschedule jadwal interview anda.
  • berikan alasan yang jelas kenapa anda melakukan reschedule ulang.

berikut ini beberapa contoh yang saya padu padan kan dari beberapa sumber.

sample 1

Dear Mrs Yanti.

Thank you for the opportunity to have interview with your company.
but my apologies for asking the cancellation and rescheduling of my job interview.

on monday, x october 2012 i have an appointment that can not be postpone.

I would appreciate if you can reschedule the interview to wednesday, x october 2012.
Thank you for your prompt attention to this matter.

regards
aditya satrio N.

sample 2

Dear [Name of the hiring coordinator]

My apologies for asking the cancellation and rescheduling of my job interview
Because of [xyz], I am sending you this written notice to request the cancellation of my job interview for the job of [position] at [location, department] with [Name].

I would appreciate if you can reschedule the job interview as soon as possible.
Thank you for your prompt attention to this matter.
Sincerely,

[Your name]

sample 3

Dear [Name of the hiring coordinator]

I regret that I must cancel our appointment or , I am sorry to ask for canceling my meeting [job interview]

on [Date] with [Name] at your corporate office as [reason].
I would like to reschedule the appointment and therefore ask to fix up a new time for it.

Sincerely,

[Your name]

sample 4

Dear Mr. Potter:

I am most excited to receive your letter of December 12, 2004 informing me of
the upcoming interview on December 17 in connection with my application for the
position of Project Coordinator.

However, I am writing to inquire if there is any possibility of rescheduling the
date for the interview. I am very much interested in this position, yet unfortunately, I
have a professional certification exam scheduled for the same day. This exam is held
only twice a year, and I would have to wait until next June if I miss this one.

I apologize for any inconvenience that the rescheduling might cause you, but
I ask for your understanding and assistance in making another appointment for our
meeting. Thank you very much.

Respectfully

Emi

sample 2-4 saya himpun dari search di google, dan saya lupa sumber link nya. credits to the original author 😀

Untuk menjadwal ulang ada baik nya hanya anda lakukan sekali saja, lebih dari sekali akan membuat “image” anda kurang baik terhadap interviewer, jika anda tidak yakin dengan jadwal interview anda yang terbaik adalah lebih baik menolak dari awal. Berat memang tapi resiko ini pernah saya ambil.

Ada cerita teman yang me-reschedule jadwal sampai 2 kali dari perusahaan yang terbilang bagus (perusahaan IT asing) alhasil reschedule untuk kedua kali nya dia di tolak mentah mentah oleh perusahaan tersebut, karena di anggap tidak serius.

Jadi untuk teman teman pikirkan baik baik dalam me-reschedule interview 😀

Written by snippetjournal

October 7, 2012 at 4:54 am

Membalik Kalimat (Java)

with 3 comments

Beberapa hari yang lalu saya mengikuti test di salah satu perusahaan multi-international di jakarta, yang menarik beberapa soal test yangs saya kerjakan terdapat beberapa kategori pertanyaan, seperti pemahaman kita dengan SDLC, dan Test Case, selebih nya logika dan programming.

Yang akan saya tampilkan di sini adalah soal dari programming, yang kebetulan saya salah menjawab dalam test tersebut, tapi saya jadikan pembelajaran, karena hidup adalah belajar bukan ? 😀

karena saya penasaran akhir nya saya mencoba untuk menjawab pertanyaan tersebut dengan berbekal eclipse tentu nya, dan taraaa, ternyata lebih mudah menyelesaikan masalah dengan ngoding langsung berhadapan dengan eclipse 😀

saat itu saya di berikan soal kurang lebih sepert ini :

jika di berikan kalimat seperti ini

SAYA DAN KAMU  output nya adalah KAMU DAN SAYA

dan begini lah hasil ngoding dengan java :


import java.util.Scanner;

public class BalikKalimat {
 public static void main(String[] args) {
 System.out.println("masukan kalimat = ");
 Scanner scanner = new Scanner(System.in);
 String sentences = scanner.nextLine().trim();
 String[] strings = sentences.split(" ");

 StringBuffer buffer = new StringBuffer();
 for(int i = strings.length; i > 0; i--){
 buffer.append(strings[i-1]).append(" ");
 }

 System.out.println("Kalimat Di balik = "+buffer.toString());
 }
}

Written by snippetjournal

October 7, 2012 at 4:41 am

Posted in Programming

Tagged with ,

Random Quote #2

leave a comment »

Masing masing dari kita Berjuang, berjuang dalam perbedaan.

Masing masing dari kita berjuang, dalam satu perjuangan.

Masing masing dari kita pejuang,tetapi dalam jalur perjuangan yang berbeda.

Salam bagi pejuang kehidupan.

Written by snippetjournal

October 5, 2012 at 12:25 pm

Posted in Random Quotes

Random Quote #1

leave a comment »

Terkadang ada saat nya harus nekat, tapi ada beberapa hal yang memang dalam melakukan sesuatu haruslah dipikirkan secara matang

Written by snippetjournal

October 5, 2012 at 12:24 pm

Posted in Random Quotes