Mei 2012
S S R K J S M
« Okt    
 123456
78910111213
14151617181920
21222324252627
28293031  

Halaman

neutrino qnx: Cara liat log sistem

Oktober 17th, 2008 by zulfajri

Aku kira perintah untuk melihat log sistem pada sistem Neutrino qnx sama dengan keluarga unix lainnya. Nyatanya sangat beda. Perintah yang digunakan tidak lagi dmesg tapi sloginfo. berikut ini sinopsis dari perintah tersebut:

sloginfo

Print messages from the system log

Syntax:

sloginfo [options] [filename]

Runs on:

Neutrino

Options:

-c
Clear the log buffer after displaying all waiting events.
-h
Print unformatted entries in hexadecimal. By default, they’re printed in decimal.
-m code
Display events with this major code (default: display all).
-s 0..7
Display events with this severity or lower (default: 7). The lowest severity is 7 and the highest is 0.
-t
Print time for events with millisecond resolution.
-w
Wait for more events to arrive.
filename
The name of the file containing raw events (default: /dev/slog).

Description:

The sloginfo utility prints the contents of the system log buffer managed by slogger, which must be running to record these messages.

By default, sloginfo prints all messages and exits. You can use the -w option to have it wait for more messages.

You can use the -m and -s options to filter the messages to print. There are 16 million major codes, with 4096 minor codes for each major code. Selecting a major code displays messages with any of the minor codes for the specified major code. You can use the major codes to display messages for a specific area, such as TCP/IP. The major codes are defined in the file /usr/include/sys/slogcodes.h.

If a filename is specified, sloginfo takes its input from that file instead of /dev/slog. It’s assumed that the file contains raw system log data saved by a program or is the file specified in the -l option to slogger.

Examples:

Print out all system log messages and exit:

sloginfo

Print out all system log messages and wait for more to arrive, printing them as they do:

sloginfo -w

Print out all system log messages, clear the log, and exit:

sloginfo -c

Display only system log messages with a severity of 0, 1, 2, 3, or 4:

sloginfo -s 4

Display the system log messages stored in a specific file:

sloginfo /var/logs/slog0

Files:

/dev/slog
The default system log file.

Posted in Tak Berkategori | 1 Comment »

Membuka registry yang terkunci

September 3rd, 2008 by zulfajri

 Jalankan di Start –> Run

REG add HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\System /v DisableRegistryTools /t REG_DWORD /d 0 /f

Posted in Tak Berkategori | No Comments »

vb.net: Set busy cursor

Agustus 11th, 2008 by zulfajri and tagged

Aplikasi yang kita buat kadangkala membutuhkan waktu yang lama. Oleh karena itu perlu menghadirkan tanda ke pengguna bahwa program sedang sibuk. Berikut ini petikan programnya:

Cursor.Current = Cursors.WaitCursor ‘<–set busy cursor

Cursor.Current = Cursors.Arrow ‘<–unset busy cursor

Posted in Programming | No Comments »

vb.net: Konversi integer ke char dan sebaliknya

Agustus 8th, 2008 by zulfajri and tagged

Dim kar As Integer = AscW(”C”)

Variabel kar akan berisi nilai ASCII dari “C“.

Dim s As String = ChrW(kar)

Selanjutnya, variabel s berisikan karakter dari integer kar.

Posted in Programming | No Comments »

vb.net: Insert data into Microsoft Access

Agustus 6th, 2008 by zulfajri and tagged ,

Microsoft Access memiliki format berkas berakhiran .mdb. Jadi koneksi ke basisdata tipe ini dilakukan secara langsung dengan membaca file .mdb tersebut. Berbeda dengan basisdata berbasiskan client-server.Misalkan berkas yang ingin kita gunakan adalah Akuntansi.mdb. Berkas tersebut berada satu lokasi dengan berkas executable kita.

Imports System.Data.OleDb

namespace ini wajib di-import untuk penggunaan OleDbConnection

Dim baseDir As String = Application.StartupPath & “\”

Variabel baseDir berisi path dari aplikasi kita nantinya. Sehingga dimanapun kita pindahkan aplikasinya, maka otomatis variabel tersebut menunjuk ke lokasi terkini.

Dim con As OleDbConnection
con = New OleDbConnection(”Provider=Microsoft.Jet.OLEDB.4.0;Data Source=” & baseDir & “Akuntansi.mdb;”)

Dim sqlStr As String
Dim Command As OleDbCommand

sqlStr = “INSERT INTO Proses VALUES(’” & noCab & “‘,’” & noRek & “‘,’” & nama & “‘,’” & jumlah & “‘,’” & kode & “‘)”

Cuplikan kode diatas menggambarkan variabel sqlStr yang berisi query untuk menyimpan data-data kedalam tabel Proses.

Command = New OleDbCommand(sqlStr, con)
Dim icount As Integer
icount = Command.ExecuteNonQuery

Setelah dieksekusi, maka tabel proses telah berisi data-data yang ingin kita masukkan sebelumnya.

Posted in Programming | No Comments »

vb.net: Menjalankan aplikasi

Juli 19th, 2008 by zulfajri and tagged

Jika diperlukan untuk menjalankan aplikasi lain seperti browser atau Microsoft Word, gunakan kode berikut ini:

System.Diagnostics.Process.Start(”IExplore.exe“, “http://www.microsoft.com“)

Program Internet Explorer akan berjalan dengan membuka situs  http://www.microsoft.com.

System.Diagnostics.Process.Start(”Winword.exe”, “c:\tulisanku.doc”)

Program Microsoft Word akan membuka berkas tulisanku.doc.

Posted in Programming | No Comments »

vb.net: Menambah item ke dalam combobox

Juli 19th, 2008 by zulfajri and tagged

Misalnya ComboBox1 merupakan combobox pada form.

ComboBox1.Items.Add(”tes”)
ComboBox1.Items.Add(”tes1″)
ComboBox1.Items.Add(”tes2″)

Tambahkan sebanyak yang anda mau.

Posted in Programming | No Comments »

vb.net: Edit file excel

Juli 17th, 2008 by zulfajri and tagged

Langkah-langkah melakukan editing file Excel adalah:

  1. Tautkan referensi ke interop excel. Caranya pada References –> Add.. -> .NET, pilih Microsoft.Office.Interop.Excel.
  2. Pada awal program, lalukan import namespace ini. 

Imports Microsoft.Office.Interop

Dim xlApp As Excel.Application
Dim xlWB As Excel.Workbook
Dim xlWS As Excel.Worksheet

xlApp = New Excel.ApplicationClass
xlApp.Visible = True
xlWB = xlApp.Workbooks.Open(”tes.xls“)
xlWS = CType(xlWB.Worksheets(”worksheet1“), Excel.Worksheet)

Maka otomatis program akan membuka berkas excel dengan nama berkas “tes.xls” dengan worksheet “worksheet1“.  Jika ingin mengisi cell C5 dengan tulisan “hello world!” maka berikut ini perintahnya:

xlWS.Range(”C5″).Value = “hello world!”

Banyak lagi perintah-perintah yang bisa dilakukan untuk melakukan editing di berkas excel seperti mem-format cell dan chart.

Posted in Programming | 4 Comments »

vb.net: Menghitung umur

Juli 15th, 2008 by zulfajri and tagged , ,

Berikut ini serpihan program untuk menghitung umur:

Dim age As Integer
age = Date.Now.Year - dtpTTL.Value.Year

Ket:

Date.Now.Year digunakan untuk memperoleh tahun saat ini.

dtpTTL merupakan tipe kelas dari DateTimePicker.

Posted in Programming | No Comments »