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
// | |
// RangeStreamer.h | |
// iOS Player | |
// | |
// Created by Ryan Layne on 4/2/15. | |
// | |
#import <Foundation/Foundation.h> | |
#import <AVFoundation/AVFoundation.h> |
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
# Parse input | |
n = gets.strip.to_i | |
a = Array.new(n) | |
(0...n).each { |a_i| | |
a_t = gets.strip | |
a[a_i] = a_t.split(' ').map(&:to_i) | |
arr = a[a_i] | |
} | |
# Initialize variables |
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
Hey guys! | |
I am a little stuck on Title Case checkpoint on Ruby Arrays. | |
“We will need to use conditional logic --if and else statements -- to make this work. Read the test specification carefully so you understand the conditional logic to be implemented. | |
Some helpful methods to use are: | |
String#downcase | |
String#capitalize |
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
b=$(basename "$1") | |
echo -n "http://example.com/uploads/$b" | pbcopy | |
for i | |
do | |
b=$(basename "$1") | |
mv "$i" "/path/to/Uploads/$b" | |
done |
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 os | |
from threading import Thread | |
from time import sleep | |
import asyncio | |
FIFO_PATH = "/path/to/crash-log" | |
class FifoReader(Thread): | |
def __init__(self, path, crash): | |
super().__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
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 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 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 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 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; | |
} |
NewerOlder