Skip to content

Instantly share code, notes, and snippets.

@wisaruthk
wisaruthk / mysample.c
Last active August 29, 2015 14:00
GLPK Example
/* mysample.c */
/* gcc -I../src -o mysample mysample.c ../src/*.o */
#include <stdio.h>
#include <stdlib.h>
#include <glpk.h>
/*
minimize
z = 14.7x1 + 10.7x2 + 7.2x4
@wisaruthk
wisaruthk / PathExample.m
Last active August 29, 2015 13:57
Path Example, Documents, Bundle
#pragma mark - Defind Functions
- (void)copyBundleToDocuments{
BOOL success;
NSFileManager *fileManager = [NSFileManager defaultManager];
NSError *error;
//Document path
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *docDir = [paths objectAtIndex:0];
NSString *docDBPath = [docDir stringByAppendingPathComponent:@"database.sqlite"];
@wisaruthk
wisaruthk / MyFilelog.java
Last active January 2, 2016 11:48
Openjpa customize @SequenceGenerator for @id
package my.database;
import java.sql.Timestamp;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.SequenceGenerator;