This file contains 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
var state = 0; | |
function hoge(a) { | |
if(state === 0) { | |
setTimeout(function(){console.log(a);},1000); | |
} else { | |
setTimeout(function(){console.log(a);},500); | |
} | |
state++; | |
} |
This file contains 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
{ | |
"env": { | |
"gccArmPath": "/usr/local/gcc-arm-none-eabi-6-2017-q2-update", | |
"nrf5SdkPath": "~/Documents/Nordic/nRF5_SDK_15.2.0_9412b96" | |
}, | |
"configurations": [{ | |
"name": "Mac", | |
"includePath": [ | |
"${gccArmPath}/arm-none-eabi/include", | |
"${gccArmPath}/arm-none-eabi/include/bits", |
This file contains 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
#include <MailCore/MailCore.h> | |
... | |
-(void) sendEmail:(NSString *) message | |
{ | |
MCOSMTPSession *smtpSession = [[MCOSMTPSession alloc] init]; | |
smtpSession.hostname = @"smtp.gmail.com"; // SMTPサーバのアドレス | |
smtpSession.port = 465; | |
smtpSession.username = @"moemoe"; // SMTPサーバのユーザ名 |
This file contains 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)peripheral:(CBPeripheral *)peripheral didUpdateValueForCharacteristic:(CBCharacteristic *)characteristic error:(NSError *)error | |
{ | |
NSString* str = [[NSString alloc] initWithData:characteristic.value encoding:NSUTF8StringEncoding]; | |
... | |
} |
This file contains 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)peripheral:(CBPeripheral *)peripheral didUpdateValueForCharacteristic:(CBCharacteristic *)characteristic error:(NSError *)error | |
{ | |
uint8_t *byte = (uint8_t *)[characteristic.value bytes]; | |
... | |
} |
This file contains 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 <UIKit/UIKit.h> | |
#import "SKPSMTPMessage.h" | |
#import "NSData+Base64Additions.h" | |
@interface ViewController : UIViewController<SKPSMTPMessageDelegate> | |
@end |
This file contains 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
NSMutableData* data = [NSMutableData dataWithLength:sizeof(uint8_t) * 100]; | |
uint8_t* array = [data mutableBytes]; |
This file contains 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
/* Copyright (c) 2012 Nordic Semiconductor. All Rights Reserved. | |
* | |
* The information contained herein is property of Nordic Semiconductor ASA. | |
* Terms and conditions of usage are described in detail in NORDIC | |
* SEMICONDUCTOR STANDARD SOFTWARE LICENSE AGREEMENT. | |
* | |
* Licensees are granted free, non-transferable use of the information. NO | |
* WARRANTY of ANY KIND is provided. This heading must NOT be removed from | |
* the file. | |
* |
This file contains 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
int main(void) | |
{ | |
// Initialize | |
leds_init(); | |
timers_init(); | |
buttons_init(); | |
APP_GPIOTE_INIT(1); | |
uart_init(); | |
ble_stack_init(); | |
scheduler_init(); |
This file contains 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
static void pstorage_test_store_and_load(void) | |
{ | |
pstorage_handle_t handle; | |
pstorage_handle_t block_handle; | |
pstorage_module_param_t param; | |
uint8_t source_data[16] = {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F}; | |
uint8_t source_data_2[16] = {0x00, 0x10, 0x20, 0x30, 0x40, 0x50, 0x60, 0x70, 0x80, 0x90, 0xA0, 0xB0, 0xC0, 0xD0, 0xE0, 0xF0}; | |
uint8_t dest_data[16] = {0}; | |
uint32_t err_code; |
NewerOlder