This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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"]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#รัน Library Script | |
execfile('wsadminlib.py') | |
enableDebugMessages() #สำหรับเปิด Log | |
#============================== | |
#เริ่มด้วยการสร้าง JDBCProvider | |
#============================== | |
_parent = getServerId(_nodeName,'server1') #กำหนดว่าเราจะสร้าง JdbcProvider ใน Scope 'Server' | |
_name ='DB2 Using IBM JCC Driver (XA)' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package my; | |
import java.lang.reflect.Field; | |
import my.annotation.MyColumn; | |
public class Main { | |
public static void main(String[] args) { | |
MyObject o = new MyObject("Jonathan", "Jo", "GREEN"); | |
//อีกเทคนิคหนึ่งที่ใช้ร่วมกับ Annotation คือ reflect เพื่อเรียกดูข้อมูลของ Class |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NSMutableArray *items = [self initialItems]; | |
[items sortUsingComparator:^NSComparisonResult(id obj1, id obj2) { | |
Item *i1 = obj1; | |
Item *i2 = obj2; | |
if (i1.code > i2.code) { | |
return (NSComparisonResult)NSOrderedDescending; | |
} | |
if (i1.code < i2.code) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
_textInputHelper = [[FDPTextInputHelper alloc] init]; | |
[self.batchSizeTextField addTarget:_textInputHelper action:@selector(textFieldIntegerDidChange:) forControlEvents:UIControlEventEditingChanged]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-(void)sortMyGroupArray:(NSMutableArray *)items{ | |
NSSortDescriptor *sd = [[NSSortDescriptor alloc] initWithKey:@"groupName" ascending:YES]; | |
[items sortUsingDescriptors:@[sd]]; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CGRect mybounds = CGRectMake(0, 0, 24, 24); | |
UIGraphicsBeginImageContext( mybounds.size ); | |
CGContextRef context = UIGraphicsGetCurrentContext(); | |
CGContextSetFillColorWithColor(context, [[UIColor redColor] CGColor]); | |
CGContextFillRect(context, mybounds); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CGRect mybounds = CGRectMake(0, 0, 20, 20); | |
UIGraphicsBeginImageContext( mybounds.size ); | |
CGContextRef context = UIGraphicsGetCurrentContext(); | |
CIColor *itemColor = [CIColor colorWithString:item.color]; | |
CGContextSetFillColorWithColor(context, [[UIColor colorWithCIColor:itemColor] CGColor]); |
OlderNewer