Skip to content

Instantly share code, notes, and snippets.

View pureexe's full-sized avatar
💻
No

Pakkapon Phongthawee pureexe

💻
No
View GitHub Profile
@pureexe
pureexe / diffsin_3point.c
Created December 13, 2017 07:03
Numerical differential with 3 point
#include<stdio.h>
#include<math.h>
int main(){
double h = 1 / pow(2,16);
double df = (2*sin(1+h) + 3*sin(1) - 6*sin(1-h) + sin(1 - 2*h) )/(6*h);
printf("cos(1) = %.6f \nd/dx sin(1) = %.6f",cos(1),df);
return 0;
}
@pureexe
pureexe / diffsin_2point.c
Created December 13, 2017 06:49
Numerical differential with 2 point
#include<stdio.h>
#include<math.h>
int main(){
double h = 1 / pow(2,16);
double df = (sin(1+h) - sin(1)) / h;
printf("cos(1) = %.6f \nd/dx sin(1) = %.6f",cos(1),df);
return 0;
}
@pureexe
pureexe / gaussian_elimination.m
Last active October 19, 2017 15:05
my gaussian_elimination
function X = gaussian_elimination(A,B)
N = length(A);
R = [A B];
for i = 1:N
[val,pos] = max(abs(R(i:N,i)));
R([pos+i-1 i],:) = R([i pos+i-1],:);
R(i,:) = R(i,:) / R(i,i);
for j = i+1:N
m = R(j,i)/R(i,i);
R(j,:) = R(j,:) - (m*R(i,:));
@pureexe
pureexe / gaussian_elimination.m
Created October 19, 2017 15:05
my gaussian_elimination
function X = gaussian_elimination(A,B)
N = length(A);
R = [A B];
for i = 1:N
[val,pos] = max(abs(R(i:N,i)));
R([pos+i-1 i],:) = R([i pos+i-1],:);
R(i,:) = R(i,:) / R(i,i);
for j = i+1:N
m = R(j,i)/R(i,i);
R(j,:) = R(j,:) - (m*R(i,:));
@pureexe
pureexe / activity_main_2.xml
Created September 17, 2017 06:56 — forked from 3bugs/activity_main_2.xml
android class week2 layout file [in noo]
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="16dp">
<TextView
android:id="@+id/textView"
android:layout_width="wrap_content"
@pureexe
pureexe / activity_main.xml
Created September 17, 2017 04:32 — forked from 3bugs/activity_main.xml
Android class sample layout week2
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:padding="16dp"
tools:context="com.promlert.class17_09_2017.MainActivity">
<template>
<div>
<main>
<md-list >
<md-list-item v-for="bot in bots" :key="bot.id" :href="'#/bot/'+bot.id">
{{bot.name}}
</md-list-item>
</md-list>
<md-button class="md-fab md-fab-bottom-right" @click="add">
<md-icon>add</md-icon>
/**
* @author Pakkapon Phongthawee (07580028)
* @license GPLv3
*/
public class TestMyList {
public static void main(String[] args){
MyList<Integer> list = new MyList();
list.unshift(1).unshift(2).unshift(3);
list.shift();
list.push(1).push(2).push(3);
/**
* @author Pakkapon Phongthawee (07580028)
* @license GPLv3
*/
public class MyList<Type> {
private class Node{
public Type data;
public Node prev,next;
Node(Type d){
data = d;
[
{
"message": "Panties: แม่นางแอนแปลนิยายเหยอ",
"created_time": "2017-08-04T01:39:11+0000",
"id": "m_mid.$cAAUfK78X8bdj3Cq-4ldquV2mTLLL"
},
{
"message": "-> kipparian (AC2A600C.AD2B4F14.D3981A89.IP) เข้าห้อง",
"created_time": "2017-08-04T01:53:11+0000",
"id": "m_mid.$cAAUfK78X8bdj3DeRRFdqvJI8p0iG"