Skip to content

Instantly share code, notes, and snippets.

View witoong623's full-sized avatar
🙂

witoong623 witoong623

🙂
  • Samut Prakan, Thailand
View GitHub Profile
import math
class D2Vector:
def __init__(self, X, Y):
self.X = X
self.Y = Y
def __add__(self, other):
X = self.X + other.X
Y = self.Y + other.Y
import csv
csvfiles = {
'ACRU': 'ACRU.csv',
'ANLI': 'ANLI.csv',
'BBUA': 'BBUA.csv'
}
data = {}
for key, filename in csvfiles.items():
<script>
let b = [{
code: '999'
, problem: [{
a: '1',
b: '2',
z: [{
z1: '7z',
z2: '8z'
}, {
@witoong623
witoong623 / index.html
Last active June 12, 2017 04:27
A demonstration of setInterval, used for changing title
<html>
<head>
<title></title>
</head>
<body>
<script
src="https://code.jquery.com/jquery-3.2.1.min.js"
integrity="sha256-hwg4gsxgFZhOsEEamdOYGBf13FyQuiTwlAQgxVSNgt4="
crossorigin="anonymous"></script>
<script>

Mobile Application version checking and Notification sender

Global API

public class GenericResponseMessage
{
    // indicates result of HTTP API call, 200 = success, 400 = parameter invalid, 500 = internal server error
    public int status { get; set; }
    // indicates error messages, otherwise null
    public string[] message { get; set; }
}
using System;
using System.IO;
using System.Windows.Forms;
using testClientBinaryWebservice01.service1;
namespace testClientBinaryWebservice01
{
public partial class Form1 : Form
{
public Form1()
// เช็คว่า มี 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
@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;
}
<!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>
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace AffineCiphers
{
class Program
{