Saturday, October 24, 2009

Program java, API, JVM, OOP, GUI


Java
Java is a programming language using the term or machine code interpreter in java programs that can run on different computers, including mobile phones. Platform is a hardware or software environment in which a program can run in it. Example platform is Microsoft Windows, Linux, Solaris OS and Mac OS. A platform is usually a combination of operating system and a set of hardware. Java terminology not only referring to a language program. But also as a platform. But the Java platform consists of software components (without any hardware component).
Language Programs
As a programming language, java has a syntax (in human language is the vocabulary, Grammar and sentence) is similar to the language C. Machine paradigm is Object Oriented Programing (OOP) or object-oriented programs. The emphasis is not on the line (structure) but the object, property and state-state owned by the object. Here Java is present to overcome the constraints (complexity) predecessor and eliminates the language barriers between the operating system. Java has a very popular jargon that is write once run anywhere is abbreviated by Wora.
As a Virtual Machine
Java Virtual Machine (JVM) is a machine that interprets bytecode virtaul-java bytecode into machine language. Java bytecode file is a compilation of java code (the file extension is. Class). If a java program called ProgramA.java compiled the result is ProgramA.class (this is called bytecode java). Actually the program machine paradigm in a way to Interpret the code (in java is the bytecode) according to experts is less good than the performance (speed). But JVM tries to overcome this problem by applying the techniques just in time (JIT) compilation of java bytecodes directly compiled into machine language for the program code is executed repeatedly.

Application Programming Interface (API) is a collection of software components (classes and interfaces java) ready for use with various uses and capabilities different. A set of classes and interfaces related organized in a library. This library is called the package (package).

excess using java program :
  1. Automatic garbage collection, has a facility setting memory usage so that the programmers do not need to do direct memory settings (such as in C + + language is widely used).
  2. such as C + + programs, a programming language syntax such as [C + +] that attract a lot of C + + programmers moving to Java. We have so many Java users, mostly C + + programmer who moved to Java. Universities in the United States also began to move to teach Java to students who just because they are more easily understood by students and can be useful also for those who are not majoring in computer.
  3. OOP (Object Oriented Programing) which means that all aspects contained in Java is Object. Java is a programming language is purely object-based. All types of data derived from the basic class called Object. It is very easy for programmers to design, create, develop and allocate fault to the base of a Java program is faster, precise, easy and organized. This excess makes Java as one of the easiest programming language, even for the advanced functions such as communications between computers though.
  4. Multiplatform. The principal advantage of Java is to be run on multiple platforms / operating system, in accordance with the principle write once, run everywhere. With these advantages enough programmer to write a Java program and compile (modified, from the understandable human language into machine language / bytecode) once and then the results can be run on multiple platforms without changes. This excess allows a java-based programs work on Linux operating system but it runs well on Microsoft Windows. Supported platforms so far are Microsoft Windows, Linux, Mac OS and Sun Solaris. The reason is that each operating system uses its own program (which can be downloaded from the Java site) to interpret the bytecode.
Lack of java programs :
  1. The main problem in netbeans platform is he controlling class loader with the mechanism itself, so if we work with Spring, hibernate, jpa will arise a fairly complicated issue and need a little hack.
  2. Easy to compile. compilation is the reverse process of the code so the source code. This is possible because the code is a Java bytecode that stores many attributes of high-level language, such as class names, methods, and data types. The same thing happened to Microsoft. NET Platform. Thus, the algorithm used to program more difficult to hide and easily hijacked / direverse-enginer.
  3.  There are still some things that are not compatible between the platforms of the other platforms. For J2SE, for example SWT-AWT bridge that until now does not work on Mac OS X.
Phase Compiling Java :
  1. Write / Modify. Programmers to write programs and store it in the media in the form of file '. Java'.
  2. compile the bytecodes of the program to form a shape file '. class'
  3. consists of bytecodes to load classes into memory.
  4. verification ensures bytecodes do not interfere with the security system of Java.
  5. translates bytecodes into machine language. 
Developed by Sun Microsystems and published in 1995.
java.lang: Appropriation class basic elements.
java.io: Appropriation input and output classes, including the use of the file.
java.util: Appropriation supplementary classes, including classes and data structures class calendar class.
java.net: The Appropriation class TCP / IP, which enables to communicate with other computers using TCP / IP network.
java.awt: base class for applications with a user interface GUI (Graphical User Interface).
java.applet: base class interface application to apply to a web browser.
READ MORE - Program java, API, JVM, OOP, GUI

Friday, October 23, 2009

VBS (Visual Basic Scripting)




Visual basic 2008

VBS stands for Visual Basic Scripting is developed by Microsoft in 1996, VBS is derived from Visual Basic, VBS can not be used for stand-alone programs, but combined with other programs such as HTML. VBS same Javascript function passing through HTML, VBS walking with a kind of website programming or with others, such as PWS in IIS on Win9x and Win2x or above.

Microsoft Visual Basic. Net is a programming used to develop and build-based applications. Net using the BASIC language. with this program you can create ASP.NET-based web application, this program is obtained apart from a few products that have been issued the previous Microsoft, Visual Basic.Net language identical to Microsoft Visual Basic before that first circulated.


 Visual Basic
'Create a Hover Button pd Applications

Public Sub sysControlHighLight (CTL as Control, X As Single, Y As
single, OriginalBackColor As Long, NewBackColor As Long)
As Long Dim Hittest
On Error resume Next
nHitTest = ctl.hwnd if Err.Number <> 0 Then
exit sub
with ctlIf (X <0) or
(y <0) or (x>. widht) or (Y>. height) thenReleasecapture
  . Backcolor = OriginalBackcolor
  Else SetCapture.hwnd
  . BackColor = NewBackColor
  end if On Error Goto 0
End Sub

Private Sub Command1_MouseMove _
(button As Integer, Shift As Integer, X As Single, Y As Single)
SysControlHighLight Command1, X, Y, vbBlue, vbRed
end Sub


Create a form be ahead

Declare Function SetWindowPos & Lib "USER32" (ByVal hwnd As Long, ByVal hWndInsertAfter As Long, ByVal x As Long, ByVal y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long)

Private Sub Form_Load ()
  this code makes the window stay on top
  Rtn = SetWindowPos (OnTop.hwnd, -2, 0, 0, 0, 0, 3)
End Sub


Changing the display size of the form
'Paste this code in the module

Declare Function GetWindowLong Lib "USER32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long
Declare Function SetWindowLong Lib "USER32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Public Const WS_EX_TOOLWINDOW = & H80 &
Public Const GWL_EXSTYLE = (-20)

Declare Function SetWindowPos Lib "USER32" (ByVal hwnd As Long, ByVal hWndInsertAfter As Long, ByVal x As Long, ByVal y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long
Public Const SWP_FRAMECHANGED = & H20
Public Const SWP_NOMOVE = & H2
Public Const SWP_NOZORDER = & H4
Public Const SWP_NOSIZE = & H1


'Paste this code in the form code

Private Sub Form_Load ()
Dim xx As Long

xx = GetWindowLong (hwnd, GWL_EXSTYLE)
xx = SetWindowLong (hwnd, GWL_EXSTYLE, _
xx Or WS_EX_TOOLWINDOW)

SetWindowPos hwnd, 0, 0, 0, 0, 0, _
Or SWP_FRAMECHANGED Or _ SWP_NOMOVE
SWP_NOZORDER Or SWP_NOSIZE
End Sub


Calling your favorite links
'Paste this code in the Module
Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
Public Const conSwNormal = 1

'Paste this code on CommanButton
ShellExecute hwnd, "open", "http://oom-vb.blogspot.com", vbNullString, vbNullString, conSwNormal


'Oom - How to know speed access form (VB6)
'You can look your speed access form With simulation. This is very useful If 'you want to know access "speed" you form. Very Simple and easy.

'**************************************
'Name: How to access the form knowspeed
'Description: This code just to know "speed" access form.
'By: oom
'Paste This code in the module do in Form_Load
'Change the Start object as a sub main
'For speed check form:
'Run the form for the first time and look how many
'You get access on speed form.
'Step two loads or large picture in picture form and
'Then check again how many forms speed is u get.
'**************************************

Private Declare Function GetTickCount Lib "kernel32" () As Long

Sub main ()
As Long Dim lSpeedTime
SInfoSpeed As String Dim
lSpeedTime = GetTickCount
Load Form1
Form1.Show
lSpeedTime = GetTickCount - lSpeedTime
'This is only simulation
     If lSpeedTime <= 50 Then
         SInfoSpeed = "[Very Fast]"
     ElseIf lSpeedTime> = 50 And lSpeedTime <= 100 Then
         SInfoSpeed = "[Normal]"
     ElseIf lSpeedTime> = 100 And lSpeedTime <= 200 Then
         SInfoSpeed = "[Slow]"
     ElseIf lSpeedTime> = 200 Then
         SInfoSpeed = "[Very Slow]"
End If
Form1.Caption = "Time Speed Form:" & lSpeedTime & "milliseconds -" & SInfoSpeed
End Sub


Creating scrolling like credit title
  Create a new project in Visual Basic. Form1 is created by default.
  Add the following code to the General Declarations section of
  Form1 (note that the Declare statement must be typed as a single
  line of code):

3D Const SRCCOPY = & HCC0020
Const ShowText $ = 3D "This line of text vertically Scrolls."

Private Declare Function BitBlt Lib "GDI" (ByVal hDestDC As Integer,
    ByVal X As Integer, ByVal Y As Integer, ByVal nWidth As Integer,
    ByVal nHeight As Integer, ByVal hSrcDC As Integer,
    XSrc ByVal As Integer, ByVal YSrc As Integer,
    DwRop ByVal As Long) As Integer

Dim ShowIt%

Private Sub Timer1_Timer ()
     Dim Ret As Integer
     If (ShowIt% = 3D 30) Then
         Picture1.CurrentX = 3D 0
         Picture1.CurrentY = 3D Picture1.ScaleHeight - 30
         Picture1.Print ShowText $
         ShowIt% = 3D 0
     Else
         3D ret = BitBlt (Picture1.hDC, 0, 0, Picture1.ScaleWidth,
             Picture1.ScaleHeight - 1, Picture1.hDC, 0, 1, SRCCOPY)
         ShowIt% = 3D ShowIt% + 1
     End If
End Sub

 Microsoft Visual Basic abbreviated as VB, is a programming language that offers Integrated Development Environment (IDE) to create visual-based application program Microsoft Windows operating systems using programming models Common Object Model (COM). Visual Basic is a BASIC derivative language, access to the database using Data Access Objects (DAO), Remote Data Objects (RDO), or ActiveX Data Objects (ADO). Some scripting languages such as Visual Basic for Applications (VBA) and Visual Basic Scripting Edition (VBScript), VB.Net, much like Visual Basic, but the way it works differently.

"Vbs code starting from
READ MORE - VBS (Visual Basic Scripting)

SQL server


SQL (Structured Query Language) server is a database program that can accommodate the data to be stored to support programs such as Delphi, java, visual basic or the other.
In general, SQL consists of two languages, namely Data Definition Language (DDL) and Data Manipulation Language (DML). DML is used to manipulate existing data in a table. Common commands are:
  1. SELECT to display the data.
  2. INSERT to add new data. 
  3. UPDATE to change the existing data.
  4. DELETE to delete the data. 
SELECT is the most common commands used in SQL, so the query term is sometimes attributed to the SELECT command. SELECT is used to display data from one or more tables, usually in the same database. In general, the SELECT command has a complete form:

  • SELECT [nama_tabel|alias.]nama_field1 [AS alias1] [, nama_field2, ...] FROM nama_tabel1 [AS alias1] [INNER|LEFT|RIGHT JOIN tabel2 ON kondisi_penghubung] [, nama_tabel3 [AS alias3], ...] [WHERE kondisi] [ORDER BY nama_field1 [ASC|DESC][, nama_field2 [ASC|DESC], ...]] [GROUP BY nama_field1[, nama_field2, ...]] [HAVING kondisi_aggregat]
Aggregate functions

Some have SMBD aggregate functions, namely the specific functions that involve a group of data (aggregate). In general, aggregate functions are:
SUM to calculate the total nominal data
COUNT to count the number of times the data
AVG to calculate the average group data
MAX and MIN to get the maximum value / minimum of a group of data.
Aggregate function used in the SELECT. Requirements for aggregate functions are placed in the HAVING, not WHERE.

Implementation of DDL and DML is different for each database management system (SMBD).
CREATE is used to create database objects and database. SQL is commonly used are:

CREATE DATABASE nama_basis_data

CREATE DATABASE to create a new database.

CREATE TABLE nama_tabel

CREATE TABLE create a new table on the basis of current data. In general, this command has the form

CREATE TABLE [nama_tabel]
(
nama_field1 tipe_data [constraints] [,
nama_field2 tipe_data,
...]
)

or

CREATE TABLE [nama_tabel]
(
nama_field1 tipe_data [,
nama_field2 tipe_data,
...]
[CONSTRAINT nama_field constraints]
)

with:

nama_field is the name of the column (field) which will be made. Some database management systems allow the use of spaces and characters in the name column nonhuruf.

depending on the implementation tipe_data database management system. For example, in MySQL, can be a data type VARCHAR, TEXT, BLOB, ENUM, and so on.

constraints are constraints that are given for each column. This also depends on the implementation of database management systems, such as NOT NULL, UNIQUE, and so on. This can be used to define the primary key (primary key) and foreign keys (foreign keys).

One table may not have a primary key at all, but it is advisable to define at least one column as primary key.

Example:

CREATE TABLE users
(
username VARCHAR (30) CONSTRAINT PRIMARY KEY,
passwd VARCHAR (20) NOT NULL,
tanggal_lahir DATETIME
);
READ MORE - SQL server

Thursday, October 22, 2009

Database, server


DBMS (DataBase Management System) adalah sistem yang secara khusus dibuat untuk memudahkan pemakai dalam mengelola basis data.

 Tipe data
  1. Character (Visual dBASE), Char (SQL), Text (Access), Alpha (Paradox) untuk menyimpan deretan karakter seperti nama orang atau nama mobil.
  2. Memo (Access dan Visual dBASE), Text (PostgresSQL) Untuk menyimpan deretan karakter dengan ukuran yang besar (melebihi 256 karakter).
  3. Number (Access), Numeric (Visual dBASE) Untuk menyimpan data bilangan.
  4. Date/Time (Access) Untuk menyimpan data jam dan tanggal.
  5. Date (Visual dBASE), Date (PostgresSQL) Untuk menyimpan tanggal.
  6. Time (PostgresSQL) Untuk menyimpan data jam.
  7. Currency (Access), Money (Paradox) Untuk menyimpan data uang.
  8. Yes/No (Access), Logical (Visual dBASE), Bool (PostgresSQL) Untuk menyimpan data logika (benar atau salah)
  9. OLE (Visual dBASE), OLE Object (Access) Untuk menyimpan OLE. Dapat berupa objek seperti gambar atau bahkan suara.
  10. Binary (Visual dBASE) Untuk menyimpan data gambar atau suara.
  11. Graphics (Paradox) Untuk menyimpan data gambar.
  12. Hyperlink (Access) Untuk menyimpan data hyperlink.
READ MORE - Database, server
 
THANK YOU FOR VISITING