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
case class JPlayer(id: Int, x: Int, y: Int) | |
val players: ImmutableBag[Entity] = world.getManager(classOf[GroupManager]).getEntities("PLAYERS"); | |
val numEntities = players.size | |
var entityJString : String = "[" | |
var aPlayers: ArrayBuffer[JPlayer] = ArrayBuffer() | |
for( i <- 0 until numEntities) { |
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
type_list = list() | |
for type in location_type._asdict().values(): | |
type_list.append(type.capitalize()) | |
render_template('bla.html', location_types=type_list) |
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
Screen 0: minimum 320 x 200, current 1680 x 1050, maximum 16384 x 16384 | |
HDMI-0 connected 1680x1050+0+0 (normal left inverted right x axis y axis) 480mm x 270mm | |
1680x1050 60.0*+ | |
1920x1080i 50.0 60.1 | |
1280x1024 75.0 60.0 | |
1440x900 75.0 59.9 | |
1280x960 60.0 | |
1152x864 75.0 | |
1280x720 50.0 60.0 | |
1024x768 75.1 70.1 60.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
faces == the "fs" | |
for(unsigned int i = 0; i < faces.size(); i += 3){ | |
int index = faces[i]; | |
vec4 vertex = vertices[index - 1]; | |
vec4 a = vertex; | |
out_vertices.push_back(vertex); | |
index = faces[i + 1]; | |
vertex = vertices[index - 1]; | |
vec4 b = vertex; |
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
// Circle | |
vec3 circle_vert[CIRCLE_SIZE]; | |
for(int i = 0; i < CIRCLE_SIZE; i++) { | |
circle_vert[i] = vec3( radius * cos(i * twoPi / 360) + .5, radius * sin(i * twoPi / 360) + .7, 0); | |
} | |
vec4 circle_col[CIRCLE_SIZE]; | |
for(int i = 0; i < CIRCLE_SIZE; i++) { | |
circle_col[i] = vec4(i / 360.0, 0.0, 0.0, 1.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 <X11/Xlib.h> | |
#include <X11/Xatom.h> | |
#include <X11/Xutil.h> | |
#include <X11/extensions/Xrandr.h> | |
#include <stdbool.h> | |
#include <string.h> | |
int main(){ | |
Display *dp = XOpenDisplay(NULL); // Connection to X Server | |
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
make -C /lib/modules/3.2.0-38-generic/build M=/home/tyh25/cs370/sources/cs370/tar/module modules | |
make[1]: Entering directory `/usr/src/linux-headers-3.2.0-38-generic' | |
CC [M] /home/tyh25/cs370/sources/cs370/tar/module/tarfs.o | |
/home/tyh25/cs370/sources/cs370/tar/module/tarfs.c: In function ‘add_tarfs_instance’: | |
/home/tyh25/cs370/sources/cs370/tar/module/tarfs.c:83:2: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement] | |
/home/tyh25/cs370/sources/cs370/tar/module/tarfs.c: In function ‘tarfs_read_file’: | |
/home/tyh25/cs370/sources/cs370/tar/module/tarfs.c:173:2: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement] | |
/home/tyh25/cs370/sources/cs370/tar/module/tarfs.c:189:2: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement] | |
/home/tyh25/cs370/sources/cs370/tar/module/tarfs.c:192:15: warning: initialization from incompatible pointer type [enabled by default] | |
/home/tyh25/cs370/sources/cs370/tar/module/tarfs.c: In function |
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 <stdio.h> | |
#include <unistd.h> | |
int main(int argc, char *argv[]) { | |
int status; | |
int parent_pid = getpid(); | |
int child_pid = fork(); | |
if(!child_pid) { // If Child | |
printf("child\n"); | |
char * send_buffer; |
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
//Custom message struct | |
struct mymsg | |
{ | |
//Data for this message | |
char * msg_data; | |
//Length of the data | |
int data_length; | |
//Sending pid | |
pid_t origin_pid; |
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 y; | |
y = 4; |
NewerOlder