Skip to content

Instantly share code, notes, and snippets.

View k4m4r82's full-sized avatar
🏠
Working from home

Kamarudin k4m4r82

🏠
Working from home
View GitHub Profile
Private Function GetOpenConnection() As SqlConnection
Dim conn As SqlConnection = Nothing
Try
' . = localhost
' sqlexpress2008 = instance sql server
' retail = nama database
Dim strConn = "Data Source=.\sqlexpress2008;Initial Catalog=Retail;Integrated Security=True"
conn = New SqlConnection(strConn)
<?php
header('Content-Type: text/plain');
$wsdl = 'http://localhost/ServiceKoperasi/ServiceBarang.svc?wsdl';
$client = new SoapClient($wsdl);
$result = $client->GetAll();
foreach ($result->GetAllResult->Barang as $barang) {
import java.text.DecimalFormat;
import java.text.ParseException;
import android.text.Editable;
import android.text.TextWatcher;
import android.widget.EditText;
public class NumberTextWatcher implements TextWatcher {
private DecimalFormat df;
// get edittext
EditText txtHargaVoucher = (EditText)findViewById(R.id.txtHargaVoucher);
// add text change listenr
txtHargaVoucher.addTextChangedListener(new NumberTextWatcher(txtHargaVoucher));
private void bacaFileJson(String fileName) {
try {
InputStream inputStream = this.context.getAssets().open(fileName);
InputStreamReader streamReader = new InputStreamReader(inputStream);
BufferedReader reader = new BufferedReader(streamReader);
while (reader.ready()) {
String json = reader.readLine();
@k4m4r82
k4m4r82 / DemoThousandSeparator.cs
Created December 4, 2014 05:46
Demo Thousand Separator
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
txtThousandSeparator.TextAlign = HorizontalAlignment.Right;
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.web>
<compilation debug="true" targetFramework="4.0" />
<customErrors mode="Off"/>
</system.web>
<system.webServer>
// sumber : https://social.msdn.microsoft.com/Forums/en-US/923ccb2e-857e-429d-90ae-00f73e32eba4/getting-usb-flash-drive-serial-number-in-c?forum=wdk
// tambahkan namespace System.Management
public class USBSerialNumber
{
string _serialNumber;
string _driveLetter;
public string getSerialNumberFromDriveLetter(string driveLetter)
{
this._driveLetter = driveLetter.ToUpper();
@k4m4r82
k4m4r82 / DynamicInput.cs
Created May 7, 2015 03:08
Contoh Dynamic Input
namespace DemoDynamicInput
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
Button[] btn = new Button[3];
Private Sub ParseYmsg(Data As String)
On Error Resume Next
Dim PckTyp As Long, YChal() As String
PckTyp = (256 * Asc(Mid$(Data, 11, 1)) + Asc(Mid$(Data, 12, 1)))
Select Case PckTyp
Case Is = 6
Dim arrmsg() As String