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 / tempalert.c
Created January 27, 2013 06:51
เตื่อนเมื่ออุณหภูมิสูงกว่า 30c พลอย + แนง
/***
เทอร์โมมิเตอร์ต่อ PA1
ลำโพงต่อ PD1
***/
#include<analog.h>
#include<sound.h>
int main(){
while(1)
{
if(analog(1)>465)
@pureexe
pureexe / FireAlert.c
Created January 27, 2013 07:23
แจ้งไฟไหม้ของผักบุ้ง Add led กระพิบ
/***
ลำโพงต่อ PD0
ไฟต่อ PD1
เทอร์โมต่อ PA4
***/
#include<sleep.h>
#include<sound.h>
#include<analog.h>
#include<in_out.h>
@pureexe
pureexe / tree_class.cpp
Created March 20, 2013 01:58
คลาสของต้นไม้ (แจ่ม)
/*
LANG:C++
COMPILER:WCB
*/
#include<cstdio>
using namespace std;
class TreeNode
{
public:
int key;
@pureexe
pureexe / Binary_decode.cpp
Created May 20, 2013 15:22
แปลงตัวอักษรเปนเลขฐาน2
#include<stdio.h>
#include<string.h>
#include<math.h>
#include<stdlib.h>
int main()
{
char word[200];
gets(word);
char buff[20];
int i,x;
@pureexe
pureexe / gist:5957941
Created July 9, 2013 14:48
Logcat for roottool problem
I/ActivityManager( 538): START u0 {act=android.intent.action.MAIN cat=[android.
intent.category.LAUNCHER] flg=0x10200000 cmp=com.pureexe.testroottool/.MainActiv
ity} from pid 893
D/alsa_ucm( 185): Set mixer controls for HiFi Lowlatency enable 1
D/ALSAModule( 185): Device value returned is hw:0,14
D/ALSAModule( 185): setHardwareParams: reqBuffSize 1024 channels 2 sampleRate 4
8000
D/ALSAModule( 185): setHardwareParams: buffer_size 2048, period_size 1024, peri
od_cnt 2
D/dalvikvm( 6826): Late-enabling CheckJNI
#include<iostream>
using namespace std;
int main()
{
int i,x,isMember,upper,n,sum=0;
cin >>isMember>>upper>>n;
for(i=0;i<n;i++)
{
cin >>x;
sum+=x;
#include<iostream>
#include<vector>
using namespace std;
class box
{
public:
int a,w;
box(int c,int v)
{
#include<iostream>
using namespace std;
int blink(int n)
{
static bool b;
static int a=0;
if((n%2==0&&b==false))
{
a=0;
}
#include<iostream>
#include<algorithm>
using namespace std;
int tab[20][20],c[20],M,u=0,n;
int gen(int r,int v)
{
if(r>=n)
{
if(v>u&&v<=M)
@pureexe
pureexe / SU40_P7_r2.cpp
Created August 21, 2013 12:36
rewrite SU40_P7
#include<iostream>
using namespace std;
int row,money,tab[21][21],big=-1;
int gen(int n,int value)
{
int i;
if(value>money)
{
return 0;