Skip to content

Instantly share code, notes, and snippets.

View TheB1ackSheep's full-sized avatar

Falook Glico TheB1ackSheep

  • Bangkok, Thailand
View GitHub Profile
public class FloatingPointRep {
public static void main(String[] args) throws Exception {
Scanner sc = new Scanner(System.in);
System.out.print("Enter you float (eg. 135.00, -50.65): ");
float _f1 = sc.nextFloat();
String _f1Bin = Integer.toBinaryString(((Float) _f1).hashCode());
System.out.printf("The value of _f1 is %f\n", _f1);
System.out.printf("The bin representation of _f1 is %s\n\n", padding(_f1Bin));
//System.in.read();
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
namespace ConsoleApplication
{
class Program
{
import RPi.GPIO as gpio
pin_st = 7
pin_nd = 11
gpio.setmode(gpio.BOARD)
gpio.setup(pin_st, gpio.OUT)
gpio.setup(pin_nd, gpio.OUT)
while 1:
#include "opencv2/imgproc/imgproc.hpp"
#include "opencv2/highgui/highgui.hpp"
#include <stdio.h>
#include <iostream>
using namespace cv;
using namespace std;
int main(void){
VideoCapture cap(0);
import java.math.BigDecimal;
import java.math.BigInteger;
/**
* author (JS) Earthchie http://www.earthchie.com/
* modify (Java) Falook http://www.falook.in.th/
* license WTFPL v.2 - http://www.wtfpl.net/
*
* Copyright (c) 2014, Earthchie (earthchie@gmail.com)
*/
@TheB1ackSheep
TheB1ackSheep / Content.java
Created September 28, 2014 00:03
Youtube Fecther
import java.util.ArrayList;
import java.util.List;
/**
*
* @author FALOOK
*/
public class Content {
private String id;
@TheB1ackSheep
TheB1ackSheep / hardcfg.tcl
Last active August 29, 2015 14:08
Config file for Comware 5 Simulator
SetSelfSlot 1
SetMainSlot 1
SetBrdType 0 24 -slot 0
SetWinSockOffset 0
#Mac Address ของ Switch ให้ใส่เลข 2 ชุดลงไป
SetMac 03 00
SetMemorySize 196
#ชื่อของ Switch จะแสดงบน title bar ของ Simulator
@TheB1ackSheep
TheB1ackSheep / LAB05.sql
Last active August 29, 2015 14:08
Information Management LAB 1/2557
/* 1. List full details of all properties. */
SELECT *
FROM PROPERTYFORRENT;
/* 2. List full details of all properties that are only house type. */
SELECT *
FROM PROPERTYFORRENT
WHERE UPPER(TYPE) = 'HOUSE';
/* 3. List the client number, first name, last name and telephone number of all clients whose preferred property type are Flat. */
SELECT CLIENTNO, FNAME, LNAME, TELNO
FROM CLIENT
@TheB1ackSheep
TheB1ackSheep / 03mountsd
Last active August 29, 2015 14:09
มี 2 ไฟล์น่ะครับ ไฟล์ 03mountsd ไว้ใช้ mount sd card ไปไว้ที่ /sd-ext แต่ต้องแก้ device path ให้ถูกด้วยน่ะครับ ส่วนไฟล์ 40int2ext จะเอาไว้ mount /data มาที่ /sd-ext วิธีทำก็ให้ก็อป 03mountsd ไปไว้ที่ /system/etc/init.d ก่อน เปลี่ยน permission เป็น 755 แล้วรีบูทเครื่อง หลังจากนั้นก็อปโฟลเดอร์ /data/app, /data/app-lib, /data/app-private, /data/app…
#!/system/bin/sh
#mount sd card, partion formatted as ext2, to /sd-ext if already wipe and format
mount -o rw /dev/block/mmcblk1p1 /sd-ext
BB="logwrapper busybox";
# Areeb - make mount point
if [ ! -d /sd-ext ];
then
$BB mount -o rw,remount /
package model;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
/**
* Created by FALOOK on 12/21/2014.
*/
public class ResponseMessage {