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
'response'=>[ | |
'format' => yii\web\Response::FORMAT_JSON, | |
'class' => 'yii\web\Response', | |
'on beforeSend' => function ($event) { | |
$response = $event->sender; | |
//var_dump($response); | |
if ($response->data !== null) { | |
$response->data = [ | |
'success' => $response->getIsSuccessful(), |
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
FDPGroup *group = self.datasource[indexPath.row]; | |
UIAlertController* alert = [UIAlertController alertControllerWithTitle:LocalizedString(@"Rename Group") | |
message:LocalizedString(@"Input Group Name") | |
preferredStyle:UIAlertControllerStyleAlert]; | |
UIAlertAction* cancelAction = [UIAlertAction actionWithTitle:LocalizedString(@"Cancel") | |
style:UIAlertActionStyleCancel | |
handler:^(UIAlertAction * action) { | |
[[self.tableView cellForRowAtIndexPath:indexPath] setSelected:false]; |
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
import xmlrpclib | |
url = 'http://localhost:8069' | |
db = 'kojostudio' | |
username = 'admin' | |
password = 'admin' | |
common = xmlrpclib.ServerProxy('{}/xmlrpc/2/common'.format(url)) | |
vVersion = common.version() | |
print(vVersion) |
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]); |
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
-(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
_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
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
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
#รัน Library Script | |
execfile('wsadminlib.py') | |
enableDebugMessages() #สำหรับเปิด Log | |
#============================== | |
#เริ่มด้วยการสร้าง JDBCProvider | |
#============================== | |
_parent = getServerId(_nodeName,'server1') #กำหนดว่าเราจะสร้าง JdbcProvider ใน Scope 'Server' | |
_name ='DB2 Using IBM JCC Driver (XA)' |