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
- (NSString *)convertToXml:(NSDictionary *)dictionary { | |
NSMutableString *xmlString = [[NSMutableString alloc] init]; | |
for (NSString *key in [dictionary allKeys]) { | |
id value = [dictionary objectForKey:key]; | |
[xmlString appendFormat:@"<%@>%@</%@>\n", key, value, key]; | |
} | |
return [NSString stringWithString:xmlString]; |
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 takeDamage(const int damage) { | |
assert(damage >= 0); | |
health -= damage; | |
if (health <= 0) { | |
// Do whatever a dead enemy should be doing | |
} | |
} |
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 take_damage( | |
const Enemy *enemy, | |
int damage) { | |
enemy->health -= damage; | |
if (enemy->health <= 0) { | |
// Do whatever a dead enemy should be doing | |
} | |
} |
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 take_damage( | |
const Enemy *enemy, | |
int damage) { | |
assert(enemy != NULL && "enemy must not be NULL!"); | |
assert(damage > 0 && "damage must be more than 0!"); | |
enemy->health -= damage; | |
if (enemy->health <= 0) { | |
// Do whatever a dead enemy should be doing |
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 thisIsAFunction(int foo) { | |
return 0; | |
} |
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 <cstdio> | |
int main() | |
{ | |
printf("Hello, world!\n"); | |
return 0; | |
} |
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
<?php | |
ini_set('memory_limit', '-1'); | |
$n = 1000000; | |
class A {} | |
class B {} | |
class C {} | |
class D {} |
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
f8 | |
16 04 013fb82257f676 | |
^ ^ ^ | |
version packetid imei | |
? time mask? SYS GPS COT ADC DTT | |
00 42 01 1e 83 c9 7b 00 3b 11 03 47 37 39 15 56 31 2e 31 31 26 56 31 2e 30 2e 32 13 00 3f 46 00 2f 74 22 06 0e db c0 00 00 00 00 00 48 00 db 08 03 60 84 a8 13 08 ce d3 04 03 33 11 78 06 03 02 00 02 41 00 | |
00 42 01 1e 83 c9 85 00 3b 11 03 47 37 39 15 56 31 2e 31 31 26 56 31 2e 30 2e 32 13 00 3f 46 00 2f 74 22 06 0e db c0 00 00 00 00 00 48 00 db 08 03 60 84 a8 13 08 ce d3 04 03 32 11 78 06 03 02 00 02 41 00 |
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
from collections import namedtuple | |
from datetime import date | |
import re | |
class InvalidMykadNumber(Exception): | |
def __init__(self, value): | |
self.value = value | |
def __str__(self): | |
return repr(self.value) |
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
require('@formatjs/intl-datetimeformat/polyfill-force'); | |
require('@formatjs/intl-datetimeformat/locale-data/en'); | |
require('@formatjs/intl-datetimeformat/locale-data/en-MY'); | |
require('@formatjs/intl-datetimeformat/add-all-tz'); | |
var date = new Date(Date.UTC(2020, 1, 1, 10, 10, 10, 0)); | |
var format = new Intl.DateTimeFormat('en-MY', { | |
year: 'numeric', | |
month: 'short', | |
day: '2-digit', |
OlderNewer