Follow step in muktware.
When you want to install GNOME you could follow the official website.
*for sound you could use alsa-utils
*for wireless you should use wireless_tools
frgunawan's note
Programming Associate
Thursday, July 11, 2013
Thursday, June 20, 2013
Export to Excel
Private Sub cmdExport_Click()
Dim rs As ADODB.Recordset
On Error GoTo halt
Me.MousePointer = 11
Dim Answer As VbMsgBoxResult
Priod = txtPriod.Text
KdSem = txtKdSem.Text
'Set Recordset(rdoCon) [Proses Query]
Set rs = Nothing
query = "[stored Procedure]'" _
& Priod & "','" _
& KdSem & "','" _
& IIf(cmbLokasi.Text = "All", 0, Left(cmbLokasi.Text, 1)) & "','" _
& IIf(cmbGugusBinaan.Text = "All", 0, Left(cmbGugusBinaan.Text, 2)) & "','" _
& IIf(cmbMatkul.Text = "All", 0, Left(cmbMatkul.Text, 5)) & "',1"
Set rs = Puskom.gadocon.Execute(query)
'Jika tidak ada data, tampilkan pesan, dan disable btnSave & chkAll
If rs.EOF Then
If showErrIfNull = True Then
Answer = MsgBox("Data Tidak Ada", vbExclamation, "Informasi")
End If
End If
Dim oExcelApp As Object
Dim oExcelWkb As Object
Dim oExcelWks As Object
Dim i As Integer
Dim cnt As Integer
Dim iRow As Integer
Me.MousePointer = 11
Set oExcelApp = CreateObject("Excel.Application")
Set oExcelWkb = oExcelApp.Workbooks.Add
Set oExcelWks = oExcelWkb.worksheets(1)
'what to be writed
' createExcelData oExcelWks, rs
oExcelWks.Cells(1, 1).Value = "No"
oExcelWks.Cells(1, 2).Value = "Lokasi"
oExcelWks.Cells(1, 3).Value = "Gugus"
oExcelWks.Cells(1, 4).Value = "Matakuliah"
oExcelWks.Cells(1, 5).Value = "Kelas"
oExcelWks.Cells(1, 6).Value = "Jml Mhs"
For i = 1 To 6
oExcelWks.Columns(i).autofit
oExcelWks.Cells(1, i).Font.Bold = True
'BuatKotak oExcelApp, i, 1
Next i
cnt = 2
iRow = 1
If Not rs.EOF Then rs.MoveFirst
Do While Not rs.EOF
oExcelWks.Cells(cnt, 1).Value = iRow
oExcelWks.Cells(cnt, 2).Value = rs!Lokasi
oExcelWks.Cells(cnt, 3).Value = rs!gugus
oExcelWks.Cells(cnt, 4).Value = rs!Matkul
oExcelWks.Cells(cnt, 5).Value = rs!kelas
oExcelWks.Cells(cnt, 6).Value = rs!jmmhs
rs.MoveNext
cnt = cnt + 1
iRow = iRow + 1
Loop
For i = 1 To 5
oExcelWks.Columns(i).autofit
'BuatKotak oExcelApp, i, 2, i, cnt - 1
Next i
'end of what tobe writed
oExcelWkb.SaveAs "C:\Documents and Settings\All Users\Desktop\InformasiKelasSmartProgram.xls", FileFormat:=56
oExcelApp.quit
Set oExcelApp = Nothing
Set oExcelWkb = Nothing
Set oExcelWks = Nothing
Me.MousePointer = 0
MsgBox "File Excel Created Sucessfuly", , Me.Caption
Exit Sub
halt:
Set rs = Nothing
Me.MousePointer = 0
MsgBox err.Description, vbCritical, "Error"
End Sub
Tuesday, May 28, 2013
Checkbox in UltraGrid (Check Cell)
Cells[Check] data type is bool. You didn't need any code to make checkbox in Ultragrid. Just use datasource with datatype bool, and it will become Checkbox.
Code for check the checkbox when clicked:
private void DG_ClickCell(object sender, ClickCellEventArgs e)
{
Infragistics.Win.UltraWinGrid.UltraGrid grid = (UltraGrid)sender;
Infragistics.Win.UIElement element = grid.DisplayLayout.UIElement.LastElementEntered;
if (element is Infragistics.Win.UIElement)
{
UltraGridCell cell =
element.GetContext(typeof(UltraGridCell)) as UltraGridCell;
if (cell != null)
{
//cell.Value = !((bool)cell.Value);
//e.Cell.Row.Cells["Check"].Value = cell.Value;
e.Cell.Row.Cells["Check"].Value = !((bool)e.Cell.Row.Cells["Check"].Value);
}
}
}
Code for make a "check all" in header:
Copy and paste this code in UltraGrid InitializeLayout
ugPostingDegree.DisplayLayout.Bands[0].Columns["Check"].Hidden = false;
ugPostingDegree.DisplayLayout.Bands[0].Columns["Check"].Header.CheckBoxVisibility = Infragistics.Win.UltraWinGrid.HeaderCheckBoxVisibility.Always;
ugPostingDegree.DisplayLayout.Bands[0].Columns["Check"].Header.CheckBoxSynchronization = Infragistics.Win.UltraWinGrid.HeaderCheckBoxSynchronization.Band;
ugPostingDegree.DisplayLayout.Bands[0].Columns["Check"].Header.VisiblePosition = 7;
ugPostingDegree.DisplayLayout.Bands[0].Columns["Check"].Width = 50;
ugPostingDegree.DisplayLayout.Bands[0].Columns["Check"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.ActivateOnly;
Code for check the checkbox when clicked:
private void DG_ClickCell(object sender, ClickCellEventArgs e)
{
Infragistics.Win.UltraWinGrid.UltraGrid grid = (UltraGrid)sender;
Infragistics.Win.UIElement element = grid.DisplayLayout.UIElement.LastElementEntered;
if (element is Infragistics.Win.UIElement)
{
UltraGridCell cell =
element.GetContext(typeof(UltraGridCell)) as UltraGridCell;
if (cell != null)
{
//cell.Value = !((bool)cell.Value);
//e.Cell.Row.Cells["Check"].Value = cell.Value;
e.Cell.Row.Cells["Check"].Value = !((bool)e.Cell.Row.Cells["Check"].Value);
}
}
}
Code for make a "check all" in header:
Copy and paste this code in UltraGrid InitializeLayout
ugPostingDegree.DisplayLayout.Bands[0].Columns["Check"].Hidden = false;
ugPostingDegree.DisplayLayout.Bands[0].Columns["Check"].Header.CheckBoxVisibility = Infragistics.Win.UltraWinGrid.HeaderCheckBoxVisibility.Always;
ugPostingDegree.DisplayLayout.Bands[0].Columns["Check"].Header.CheckBoxSynchronization = Infragistics.Win.UltraWinGrid.HeaderCheckBoxSynchronization.Band;
ugPostingDegree.DisplayLayout.Bands[0].Columns["Check"].Header.VisiblePosition = 7;
ugPostingDegree.DisplayLayout.Bands[0].Columns["Check"].Width = 50;
ugPostingDegree.DisplayLayout.Bands[0].Columns["Check"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.ActivateOnly;
Sunday, May 26, 2013
SQL Management Studio can't Remember Password
Solution (3 step)
1. Run: %Appdata%\Microsoft\Microsoft SQL Server\100\Tools\Shell
2. Delete: SqlStudio.bin
3. re-Run SQL Management Studio
Now your SQL Management Studio will remember the password if you check "Remember password" option.
1. Run: %Appdata%\Microsoft\Microsoft SQL Server\100\Tools\Shell
2. Delete: SqlStudio.bin
3. re-Run SQL Management Studio
Now your SQL Management Studio will remember the password if you check "Remember password" option.
Monday, April 29, 2013
Generate Table's Script by Query SQL
--CREATED BY: frgunawan
CREATE PROC [dbo].table_helptext
@TableName varchar(50)
AS
SET NOCOUNT ON
DECLARE @result varchar(8000)
IF EXISTS(SELECT * FROM sysobjects WHERE name=@TableName)
BEGIN
SET @result = 'CREATE TABLE [dbo].[' + @TableName + ']' + char(10) + '(' + char(10)
SELECT @result = @result + sc.Name + ' ' +
st.Name + CASE WHEN st.Name in ('varchar','varchar','char','nchar') then '(' +
CASE WHEN cast(sc.Length as varchar)=-1 THEN 'MAX' ELSE cast(sc.Length as varchar) END + ') '
ELSE ' ' END +
CASE WHEN sc.IsNullable = 1 then 'NULL' ELSE 'NOT NULL' END +
CASE WHEN scm.text is not null then ' DEFAULT '+ scm.text ELSE ' ' END +
',' + char(10)
FROM sysobjects so
LEFT JOIN syscolumns sc on sc.id = so.id
LEFT JOIN systypes st on st.xusertype = sc.xusertype
LEFT JOIN syscomments scm on sc.cdefault = scm.id
WHERE so.name = @TableName
ORDER BY
sc.ColID
--cek ada Primary Key atau tidak
IF EXISTS (SELECT * FROM INFORMATION_SCHEMA.CONSTRAINT_COLUMN_USAGE
WHERE CONSTRAINT_NAME = (SELECT name FROM sysobjects WHERE parent_obj=object_id(@TableName) and xtype='PK'))
BEGIN
SET @result = @result + 'Primary Key('
SELECT @result = @result + COLUMN_NAME + ','
FROM INFORMATION_SCHEMA.CONSTRAINT_COLUMN_USAGE
WHERE CONSTRAINT_NAME = (SELECT name FROM sysobjects WHERE parent_obj=object_id(@TableName) and xtype='PK')
SET @result = SUBSTRING(@result,1,len(@result) - 1)+ ')'
END
ELSE
BEGIN
SET @result = SUBSTRING(@result,1,len(@result) - 2)
END
SELECT @result + char(10) + ')'
END
ELSE
BEGIN
SET @result = 'Invalid object name ' + @TableName + '.'
SELECT @result
END
Thursday, October 4, 2012
KeyPress for DataGridView
private void DataGridViewName_EditingControlShowing(object sender, DataGridViewEditingControlShowingEventArgs e)
{
DataGridViewName.EditingControl.KeyPress += new KeyPressEventHandler(DataGridViewName_KeyPress);
}
private void DataGridViewName_KeyPress(object sender, KeyPressEventArgs e)
{
const char Delete = (char)8; e.Handled = !Char.IsDigit(e.KeyChar) && e.KeyChar != Delete;
}
{
DataGridViewName.EditingControl.KeyPress += new KeyPressEventHandler(DataGridViewName_KeyPress);
}
private void DataGridViewName_KeyPress(object sender, KeyPressEventArgs e)
{
const char Delete = (char)8; e.Handled = !Char.IsDigit(e.KeyChar) && e.KeyChar != Delete;
}
Monday, July 2, 2012
How to install Slackware
I make this thread as my note, If you want to learn more about slackware you can visit Slackerbox.com (for Indonesian). I learn a lot from there.
Installing slackware:
1. Download linux ISO image from official website.
2. Burn it to DVD or CD.
3. Boot it.
4. login as root. Just type "root" then Enter.
5. type "cfdisk" then Enter.
6. Create 2 partition with Type: Linux, and Linux Swap. You must select Write before quit to create the partition.
*Note: you need 10GB for Linux partition and at least 10MB for Linux Swap partition.
7. Quit from cfdisk. Then type cfdisk again to check if Linux and Linux Swap has been successfully created. If it's success, you can Quit.
8. Now we can begin the setup. Type "setup" then press Enter.
9. First we need to create partition swap. Select AddSwap Partition, slackware will automatically recognize Linux Swap partition you just need to press Enter.
10. After success created Swap, select INSTALL.
11. You can select or deselect package you want to install by press Space. There are * mark on the left of package selection. After select the package press Enter. I recommend you to select all package.
12. Select "FULL Installing everything (4.5+ GB of software)"
13. From here you just need to select the default configuration by press Enter all the time. But if there is option you understand, you can make a choice. If you not sure because it's the first time, you can just select automatic/simple/default choice(just press ENTER).
14. Create password for root. This is very important, because root like "God" in slackware system. root can select any user and even select root itself.
15. Slackware successfully installed. Now restart your computer and run Linux.
16. Login as root for the first time, because you don't have other user account yet.
17. type: "startx" and press Enter.
Now you can explore Slackware in GUI before try another thing.
Installing slackware:
1. Download linux ISO image from official website.
2. Burn it to DVD or CD.
3. Boot it.
4. login as root. Just type "root" then Enter.
5. type "cfdisk" then Enter.
6. Create 2 partition with Type: Linux, and Linux Swap. You must select Write before quit to create the partition.
*Note: you need 10GB for Linux partition and at least 10MB for Linux Swap partition.
7. Quit from cfdisk. Then type cfdisk again to check if Linux and Linux Swap has been successfully created. If it's success, you can Quit.
8. Now we can begin the setup. Type "setup" then press Enter.
9. First we need to create partition swap. Select AddSwap Partition, slackware will automatically recognize Linux Swap partition you just need to press Enter.
10. After success created Swap, select INSTALL.
11. You can select or deselect package you want to install by press Space. There are * mark on the left of package selection. After select the package press Enter. I recommend you to select all package.
12. Select "FULL Installing everything (4.5+ GB of software)"
13. From here you just need to select the default configuration by press Enter all the time. But if there is option you understand, you can make a choice. If you not sure because it's the first time, you can just select automatic/simple/default choice(just press ENTER).
14. Create password for root. This is very important, because root like "God" in slackware system. root can select any user and even select root itself.
15. Slackware successfully installed. Now restart your computer and run Linux.
16. Login as root for the first time, because you don't have other user account yet.
17. type: "startx" and press Enter.
Now you can explore Slackware in GUI before try another thing.
Subscribe to:
Posts (Atom)