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 <stdlib.h> | |
#include <sys/time.h> | |
#include <sys/types.h> | |
#include <unistd.h> | |
int main(void) | |
{ | |
fd_set bar; | |
struct timeval foo; |
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 load_obj(const char* filename, Mesh* mesh) { | |
ifstream in(filename, ios::in); | |
if (!in) { cerr << "Cannot open " << filename << endl; exit(1); } | |
vector<int> nb_seen; | |
string line; | |
while (getline(in, line)) { | |
if (line.substr(0,2) == "v ") { | |
istringstream s(line.substr(2)); | |
glm::vec4 v; s >> v.x; s >> v.y; s >> v.z; v.w = 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 <iostream> | |
#include <jnx_headers/jnxlib.hpp> | |
#include <queue> | |
#include <sstream> | |
#include <vector> | |
using namespace std; | |
using namespace jnx; | |
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 kill_spawn() | |
{ | |
pid_t parent = getpid(); | |
cout << "Current process ID is : " << parent << endl; | |
system("ps -ax | grep launch_pad > /tmp/process.tmp"); | |
ifstream fs("/tmp/process.tmp"); | |
string line; | |
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 kill_spawn() | |
{ | |
pid_t parent = getpid(); | |
//Isn't this an ugly way of doing ATOI, but hey thats the way it goes | |
stringstream parent_string; | |
parent_string << parent; | |
cout << "Current process ID is : " << parent << endl; |
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 kill_spawn() | |
{ | |
pid_t parent = getpid(); | |
//Isn't this an ugly way of doing ATOI, but hey thats the way it goes | |
stringstream parent_string; | |
parent_string << parent; | |
cout << "Current process ID is : " << parent << endl; |
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
string jnx::jnx_network::get_http_page(string host) | |
{ | |
int sockid; | |
int bufsize; | |
char buffer[MAXHTMLBUF]; | |
struct sockaddr_in socketaddr; | |
struct hostent *hostaddr; | |
struct servent *servaddr; | |
struct protoent *protocol; |
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 <stdlib.h> | |
typedef struct node | |
{ | |
struct node *next_node; | |
char *text; | |
}node; | |
int main(int argc, char **argv) |
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> | |
print_number(int *x) | |
{ | |
++x; | |
printf("Number %d\n",x); | |
} | |
int main(int argc, char **argv) | |
{ |
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
char *getline(void) | |
{ | |
char* accumulator = malloc(100); | |
char readBuf[100]; | |
int accumulatorSize = 100; | |
*accumulator = '\0'; | |
while (!feof(stdin)) | |
{ | |
fgets(readBuf, 99, stdin); |