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
| // Source code to Pieballs in Processing 3 | |
| // by Michael Labbe @frogtoss | |
| // | |
| // Reverse engineered after watching a similar video by @scienceporn | |
| // | |
| // Download processing at http://processing.org | |
| // Paste code in the window and run! | |
| // | |
| // Source is released into the public domain. |
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
| size_t len = strlen(path); | |
| assert(len < MAX_STRLEN); | |
| len = MIN(len, MAX_STRLEN); | |
| if (len < 1) | |
| return; | |
| strncpy(be->fs->path, path, len); | |
| be->fs->path[len-1] = 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
| // Everything before vs2008 doesn't have stdint.h | |
| #if defined(_MSC_VER) && (_MSC_VER < 1600) | |
| typedef unsigned char svis__uint8; | |
| typedef unsigned int svis__uint32; | |
| #else | |
| #include <stdint.h> | |
| typedef uint8_t svis__uint8; | |
| typedef uint32_t svis__uint32; | |
| #endif |
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
| PVector l1, l2; | |
| PVector pt; | |
| float g_scale = 50.0f; | |
| static final int SIDE_FRONT = 0; | |
| static final int SIDE_BACK = 1; | |
| static final int SIDE_COLINEAR = -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
| // worse for precision | |
| void extend_dividing_line(vec2 pt1, vec2 pt2, float len) | |
| { | |
| vec2 unit_v; | |
| vec2_sub(pt1,pt2,unit_v); | |
| vec2_normalize(unit_v, unit_v); | |
| vec2_mul(unit_v, len, unit_v); | |
| vec2_add(pt1, unit_v, pt1); | |
| vec2_sub(pt2, unit_v, pt2); |
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
| #ifdef WIN32 | |
| void perf_stricmp_w32(void) | |
| { | |
| const unsigned long REPS=10000000; /* default is 10mil */ | |
| char s1[] = "dogeatdogisSTORYOFMYLIFE"; | |
| char s2[] = "DOGEATDOGISSTORYOFMYLIFE"; | |
| unsigned long i; | |
| LARGE_INTEGER frequency; | |
| LARGE_INTEGER start; |
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 ftg_stricmp(const char *s1, const char *s2) | |
| { | |
| int result; | |
| const char *p1; | |
| const char *p2; | |
| if ( s1==s2) | |
| return 0; | |
| p1 = s1; | |
| p2 = s2; |
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
| from PIL import Image | |
| import numpy | |
| import glob | |
| for path in glob.glob("*.png"): | |
| print(path) | |
| im = Image.open(path).convert('RGBA') | |
| a = numpy.fromstring(im.tostring(), dtype=numpy.uint8) | |
| alphaLayer = a[3::4] / 255.0 | |
| a[::4] *= alphaLayer |
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
| 7 dictionary keys: | |
| Nice is type number | |
| OnDemand is type bool | |
| ProgramArguments is type dict | |
| StandardErrorPath is type string | |
| StandardOutPath is type string | |
| StartInterval is type number | |
| label is type string |
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
| From: Ryan Gordon | |
| to: SDL Development List | |
| Subject: [SDL] Alex's iOS improvements... | |
| ...have just landed in revision control. If you have an iOS project, PLEASE update your copy of SDL if at all possible and let us know if anything has totally blown up, as this is slated to ship soon in 2.0.4. | |
| A quick list of improvements and fixes Alex made are noted here: | |
| https://hg.libsdl.org/SDL/rev/cf8fab52e33b |