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
| #base any 10->higher i suppose | |
| def basec(x, b): | |
| r = [] | |
| while(x != 0): | |
| r.append(x % b) | |
| x = x // b | |
| return r[::-1] |
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
| //renders a cube on a purple background | |
| #include <GL/glut.h> | |
| #include <GL/GL.h> | |
| #include <GL/GLU.h> | |
| void display_gl(){ | |
| glClearColor(1.0f, 0.0f, 1.0f, 1.0f); //purple | |
| glClear(GL_COLOR_BUFFER_BIT); | |
| glLoadIdentity(); |
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
| #include <malloc.h> | |
| typedef struct{ | |
| int i; | |
| short s[2]; | |
| } PACKET; | |
| int main(void){ | |
| PACKET *mp, m = {4, 1, 0}; | |
| char *fp, *tp; |
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
| char *joinlist(char **list, char *obj, int count) | |
| { | |
| char *str = NULL; | |
| size_t total = 0; | |
| size_t length = 0; | |
| int i; | |
| for(i = 0; i < count; i++){ | |
| total += strlen(list[i]); | |
| } | |
| total += count - 1; |
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
| #define MODULE_NAME "streams" | |
| #define MAKING_STREAMS | |
| #include "src/mod/module.h" | |
| #include "streams.h" | |
| #undef global | |
| static Function *global = NULL; |
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
| #!/usr/bin/python | |
| from bs4 import BeautifulSoup | |
| import sys, urllib, textwrap | |
| class URLOpener(urllib.FancyURLopener): | |
| def __init__(self, *args): | |
| self.version = "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20100101 Firefox/17.0" | |
| urllib.FancyURLopener.__init__(self, *args) |
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
| d2replayparser.exe 92802440.dem | |
| Match-id: 92802440 | |
| Mode: 1 | |
| Winner: 2 | |
| Duration: 3006.666748 | |
| SKERDI (npc_dota_hero_rattletrap) 0/0 0 i1 i2 i3 i4 i5 i6 | |
| Sexy.777 (npc_dota_hero_lion) 0/0 0 i1 i2 i3 i4 i5 i6 | |
| Sexy.S4suke (npc_dota_hero_morphling) 0/0 0 i1 i2 i3 i4 i5 i6 | |
| ViCTORAKOS (npc_dota_hero_crystal_maiden) 0/0 0 i1 i2 i3 i4 i5 i6 | |
| Sexy.Sossi|Yko (npc_dota_hero_lycan) 0/0 0 i1 i2 i3 i4 i5 i6 |
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
| #include <map> | |
| int main(void) | |
| { | |
| std::map<int, std::string> test; | |
| test.insert(std::pair<int, std::string>(23, "string here")); | |
| return 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
| struct c{ | |
| int id; | |
| std::string name; | |
| }; | |
| std::vector<c> clist; | |
| std::vector<c>::iterator i; | |
| i = std::find(c.begin(), c.end(), 2 /* any integer value */) | |
| if(i != c.end()) |
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
| #include <map> | |
| #include <iostream> | |
| #include <vector> | |
| #include <algorithm> | |
| struct person{ | |
| int id; | |
| std::string name; | |
| }; |