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
NSDateFormatter *f = [NSDateFormatter new]; | |
f.dateFormat = @"M/d/yyyy"; | |
NSLog(@"Date: %@", [f dateFromString:@"8/29/2014"]); | |
//Logs: | |
// Date: 2014-08-29 07:00:00 +0000 |
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
Starting program: /usr/bin/php | |
[Thread debugging using libthread_db enabled] | |
Using host libthread_db library "/lib/arm-linux-gnueabihf/libthread_db.so.1". | |
Program received signal SIGILL, Illegal instruction. | |
0xb6e0b5e0 in ?? () from /usr/lib/arm-linux-gnueabihf/libcrypto.so.1.0.0 | |
(gdb) bt | |
#0 0xb6e0b5e0 in ?? () from /usr/lib/arm-linux-gnueabihf/libcrypto.so.1.0.0 | |
Cannot access memory at address 0x0 | |
#1 0xb6e07fc4 in OPENSSL_cpuid_setup () from /usr/lib/arm-linux-gnueabihf/libcrypto.so.1.0.0 |
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
//A for loop is a loop dictated by 3 expressions | |
for( | |
//This is executed once at the beginning of the loop | |
var i=0; | |
//The loop continues as long as this evaluates to TRUE | |
i<5; | |
//This is executed at the end of every iteration | |
++i | |
) | |
{ |
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
<html> | |
<br> | |
<body> | |
<?php | |
$supers=array | |
( | |
"Earth"=>array('The Hulk', 'Captain America', 'Black Widow', 'Hawkeye'), |
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
Procedural galaxy generator | |
1. Randomly create systems using algorithm that approximates the shape of a galaxy | |
⁃ If point is too close to the solar system, don’t add it | |
⁃ Choose a system type to add | |
⁃ Star type? Black hole? | |
⁃ Check for nearby systems | |
⁃ If system is very close to another system | |
⁃ Add up to a couple planets, some debris, and another star at the center |
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
//Draw Lead Angle | |
glUseProgram(ook->solid_color->program); | |
glBindVertexArray(lead_angle_vao); | |
float lead_verts[]= | |
{ | |
ook->player->target->pos.x,ook->player->target->pos.y, | |
0,0 | |
}; |
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
int main(int argc, const char * argv[]) | |
{ | |
printf("Start\n"); | |
for(int i=0;i<123335423;++i) | |
{ | |
int s=(int)(float)i; | |
if(s!=i) | |
printf("%i\n",s); | |
} |
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
OOKVec3 matrix_unproject(GLuint fbo,OOKVec3 camera,int x,int y,Z_DEPTH z) | |
{ | |
int viewport[4]; | |
float winZ; | |
switch(z) | |
{ | |
case Z_NEAR: | |
winZ=0.0f; | |
break; |
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
//Energy = radiation energy released from impact, MJ | |
//Shield = shield absorbtion capacity, MJ | |
//Hull = amount of stress the hull can receive before collapsing, MJ | |
shield -= energy | |
if(shield < 0) | |
{ | |
energy = -shield; | |
shield = 0; | |
} |
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
{ | |
beforeSend: function (xhr, s) { | |
if (Object.prototype.toString.call(s.data).slice(8, -1) != 'FormData') { | |
s.data = csrfMagicName + '=' + csrfMagicToken + '&' + s.data; | |
} else { | |
s.data.append(csrfMagicName, csrfMagicToken); | |
} | |
} | |
} |