Mungkin kita pernah pengen share sintak program (Java, PHP, VB, dll) dengan menampilkan di halaman web atau blog, tapi kadang sulit untuk menampilkannya dengan rapi dan menarik.
Solusinya pake SyntaxHighlighter yang bisa di download disini
Gini nih hasilnya
Thursday, March 24, 2011
Tuesday, March 22, 2011
VBA Pada Ms. Excel Untuk Mencetak Daftar File
Terkadang perlu ingin melihat seluruh isi file pada sebuah folder, klo pake cari ketik satu-satu ngga efisien banget. Ini ada cara pake VBA Excel, berikut kodenya :
Sub TestListFilesInFolder()
Workbooks.Add ' create a new workbook for the file list
' add headers
With Range("A1")
.Formula = "Folder contents:"
.Font.Bold = True
.Font.Size = 12
End With
Range("A3").Formula = "File Name:"
Range("B3").Formula = "File Size:"
Range("C3").Formula = "File Type:"
Range("D3").Formula = "Date Created:"
Range("E3").Formula = "Date Last Accessed:"
Range("F3").Formula = "Date Last Modified:"
Range("G3").Formula = "Attributes:"
Range("H3").Formula = "Short File Name:"
Range("A3:H3").Font.Bold = True
ListFilesInFolder "E:\SPMA\LAIN-LAIN\", False
' list all files included subfolders
End Sub
Sub ListFilesInFolder(SourceFolderName As String, IncludeSubfolders As Boolean)
' lists information about the files in SourceFolder
' example: ListFilesInFolder "C:\FolderName\", True
Dim FSO As Scripting.FileSystemObject
Dim SourceFolder As Scripting.Folder, SubFolder As Scripting.Folder
Dim FileItem As Scripting.File
Dim r As Long
Set FSO = New Scripting.FileSystemObject
Set SourceFolder = FSO.GetFolder(SourceFolderName)
r = Range("A65536").End(xlUp).Row + 1
For Each FileItem In SourceFolder.Files
' display file properties
Cells(r, 1).Formula = FileItem.Path '& FileItem.Name
Cells(r, 2).Formula = FileItem.Size
Cells(r, 3).Formula = FileItem.Type
Cells(r, 4).Formula = FileItem.DateCreated
Cells(r, 5).Formula = FileItem.DateLastAccessed
Cells(r, 6).Formula = FileItem.DateLastModified
Cells(r, 7).Formula = FileItem.Attributes
Cells(r, 8).Formula = FileItem.ShortPath & FileItem.ShortName
' use file methods (not proper in this example)
' FileItem.Copy "C:\FolderName\Filename.txt", True
' FileItem.Move "C:\FolderName\Filename.txt"
' FileItem.Delete True
r = r + 1 ' next row number
Next FileItem
If IncludeSubfolders Then
For Each SubFolder In SourceFolder.SubFolders
ListFilesInFolder SubFolder.Path, True
Next SubFolder
End If
Columns("A:H").AutoFit
Set FileItem = Nothing
Set SourceFolder = Nothing
Set FSO = Nothing
ActiveWorkbook.Saved = True
End Sub
Workbooks.Add ' create a new workbook for the file list
' add headers
With Range("A1")
.Formula = "Folder contents:"
.Font.Bold = True
.Font.Size = 12
End With
Range("A3").Formula = "File Name:"
Range("B3").Formula = "File Size:"
Range("C3").Formula = "File Type:"
Range("D3").Formula = "Date Created:"
Range("E3").Formula = "Date Last Accessed:"
Range("F3").Formula = "Date Last Modified:"
Range("G3").Formula = "Attributes:"
Range("H3").Formula = "Short File Name:"
Range("A3:H3").Font.Bold = True
ListFilesInFolder "E:\SPMA\LAIN-LAIN\", False
' list all files included subfolders
End Sub
Sub ListFilesInFolder(SourceFolderName As String, IncludeSubfolders As Boolean)
' lists information about the files in SourceFolder
' example: ListFilesInFolder "C:\FolderName\", True
Dim FSO As Scripting.FileSystemObject
Dim SourceFolder As Scripting.Folder, SubFolder As Scripting.Folder
Dim FileItem As Scripting.File
Dim r As Long
Set FSO = New Scripting.FileSystemObject
Set SourceFolder = FSO.GetFolder(SourceFolderName)
r = Range("A65536").End(xlUp).Row + 1
For Each FileItem In SourceFolder.Files
' display file properties
Cells(r, 1).Formula = FileItem.Path '& FileItem.Name
Cells(r, 2).Formula = FileItem.Size
Cells(r, 3).Formula = FileItem.Type
Cells(r, 4).Formula = FileItem.DateCreated
Cells(r, 5).Formula = FileItem.DateLastAccessed
Cells(r, 6).Formula = FileItem.DateLastModified
Cells(r, 7).Formula = FileItem.Attributes
Cells(r, 8).Formula = FileItem.ShortPath & FileItem.ShortName
' use file methods (not proper in this example)
' FileItem.Copy "C:\FolderName\Filename.txt", True
' FileItem.Move "C:\FolderName\Filename.txt"
' FileItem.Delete True
r = r + 1 ' next row number
Next FileItem
If IncludeSubfolders Then
For Each SubFolder In SourceFolder.SubFolders
ListFilesInFolder SubFolder.Path, True
Next SubFolder
End If
Columns("A:H").AutoFit
Set FileItem = Nothing
Set SourceFolder = Nothing
Set FSO = Nothing
ActiveWorkbook.Saved = True
End Sub
Tuesday, March 8, 2011
Artikel Bagus Tentang Squidoo.com
Buka di link ini http://www.squidoo.com/workathomewithsquidoo
Cerita ibu rumah tangga yang berhasil menjalankan bisnis di squidoo.com dengan bermodal menjadi penulis artikel di squidoo.com.
Ibu tersebut memperoleh pendapatan lebih dari $1.000 per bulan……
Membuat EA secara Online
Buka aja di alamat ini http://sufx.core.t3-ism.net/ExpertAdvisorBuilder/
Layanan berbasis web untuk membuat Expert Advisor forex khusus platform Meta Trader
Wednesday, March 2, 2011
MySQL Ngga Bisa Jalan
Hmmm.... dah beberapa hari bingung dengan MySQL yang ngga bisa di start, sementara Apachenya bisa di start. Kebetulan pake XAMPP neh.
Eh ternyata, ada service yang bernama "VCL MySQL Database Server" yang menjadi faktor utama ngga jalannya MySQL dari XAMPP. Service tersebut adalah bawaan program yang ku install beberapa waktu lalu.
Setelah menonaktifkan service tersebut, alhamdulillah MySQL dari XAMPP udah berjalan.
Eh ternyata, ada service yang bernama "VCL MySQL Database Server" yang menjadi faktor utama ngga jalannya MySQL dari XAMPP. Service tersebut adalah bawaan program yang ku install beberapa waktu lalu.
Setelah menonaktifkan service tersebut, alhamdulillah MySQL dari XAMPP udah berjalan.
Subscribe to:
Posts (Atom)