Skip to content

Instantly share code, notes, and snippets.

View witoong623's full-sized avatar
🙂

witoong623 witoong623

🙂
  • Samut Prakan, Thailand
View GitHub Profile
public class Student {
private String Search;
public void setSearch(String keyword) {
keyword = Search;
}
public String getSearch() {
return Search;
}
@witoong623
witoong623 / Client_class.java
Last active August 29, 2015 14:15
Just demonstration how to pass array to another object's array.
public class Client_class {
private Server_class serv;
private int[] pac = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
public static void main(String[] args) {
Client_class Main = new Client_class();
Main.serv = new Server_class(Main.pac, Main.pac);
}
}
@witoong623
witoong623 / ComicInfo.xml
Created February 24, 2015 11:31
A xml file with tag that can be used by KCC
<?xml version="1.0"?>
<ComicInfo xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<Series>Kakegurui</Series>
<Volume>1</Volume>
<Number>1</Number>
<Writer>Tooru Naomura(Art) Homura Kawamoto(Story)</Writer>
</ComicInfo>
@witoong623
witoong623 / testParseXml1.cs
Created April 6, 2015 16:40
the code that use for load xml file with specific encoding
using System;
using System.Text;
using System.IO;
using System.Xml;
namespace testParseXml1
{
class Program
{
static void Main(string[] args)
@witoong623
witoong623 / Program.java
Created May 5, 2015 01:12
Demonstrate simple ask-question
public class Program implements ActionListener
// Store instance of Question clas in array
private Question[] question = new Question[30];
// Maintain question index to indicate current question
private int CurrentQuestion;
........
public Program()
{
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace AffineCiphers
{
class Program
{
<!ELEMENT students (student+)>
<!ELEMENT student (firstname,middlename?,lastname,email)>
<!ELEMENT firstname (#PCDATA)>
<!ELEMENT middlename (#PCDATA)>
<!ELEMENT lastname (#PCDATA)>
<!ELEMENT email (#PCDATA)>
<!ATTLIST student id CDATA #REQUIRED>
@witoong623
witoong623 / xslt.xsl
Created December 2, 2016 15:18
lab_w5 homework
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<html>
<head>
<style>
table,th, td {
border: 1px solid black;
}
// เช็คว่า มี permission READ_CONTACTS รึเปล่า
if (ContextCompat.checkSelfPermission(thisActivity,Manifest.permission.READ_CONTACTS) != PackageManager.PERMISSION_GRANTED) {
// เข้ามาในนี้ได้ แปลว่า ไม่มี
// Should we show an explanation?
if (ActivityCompat.shouldShowRequestPermissionRationale(thisActivity,
Manifest.permission.READ_CONTACTS)) {
// โชว์คำอธิบายแบบไม่บล็อค ตัวอย่างที่ไม่บล็อคก็เช่น toast ซึ่งข้อความันขึ้นมาบนจอก็จริง แต่โค้ดไม่ได้ค้าง
// this thread waiting for the user's response! After the user
using System;
using System.IO;
using System.Windows.Forms;
using testClientBinaryWebservice01.service1;
namespace testClientBinaryWebservice01
{
public partial class Form1 : Form
{
public Form1()