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
| import processing.video.*; | |
| Capture capture; | |
| int t = 0; | |
| int mask = (1 << 8) - 1; | |
| void setup() { | |
| size(640, 480); | |
| background(0); | |
| capture = new Capture(this, 640, 480); |
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
| (*Mass*) | |
| m = {3, 4, 5}; | |
| n = Length@m; | |
| (*Coordination*) | |
| p = Array[{Subscript[px, #][t], Subscript[py, #][t]} &, n]; | |
| q = Array[{Subscript[ x, #][t], Subscript[ y, #][t]} &, n]; | |
| initialCondition = { | |
| p == {{0, 0}, { 0, 0}, {0, 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
| #include <iostream> | |
| const int s = 65; | |
| constexpr int eq(int a, int b) { return a != b ? 0 : a; } | |
| constexpr int check(int used, int x7, int x9, int x17, int x19, int x13, int x1, int x25, int x5, int x21, int x2, int x3, int x4, int x12, int x22, int x24, int x14, int x23, int x8, int x18, int x6, int x10, int x11, int x15, int x16, int x20) { | |
| return (x20 < 1 || x20 > 25) ? 0 : | |
| (((used & (1 << x20)) ? 0 : 1)); | |
| } | |
| constexpr int check(int used, int x7, int x9, int x17, int x19, int x13, int x1, int x25, int x5, int x21, int x2, int x3, int x4, int x12, int x22, int x24, int x14, int x23, int x8, int x18, int x6, int x10, int x11, int x15, int x16) { | |
| return (x16 < 1 || x16 > 25) ? 0 : | |
| (((used & (1 << x16)) ? 0 : check(used + (1 << x16), x7, x9, x17, x19, x13, x1, x25, x5, x21, x2, x3, x4, x12, x22, x24, x14, x23, x8, x18, x6, x10, x11, x15, x16, eq(s - x16 - x17 - x18 - x19, s - x5 - x10 - x15 - x25)))); |
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 <iostream> | |
| const int s = 34; | |
| constexpr int eq(int a, int b) { return a != b ? 0 : a; } | |
| constexpr int check(int used, int x1, int x4, int x13, int x16, int x2, int x3, int x5, int x6, int x7, int x8, int x9, int x10, int x11, int x12, int x14, int x15) { | |
| return (x15 < 1 || x15 > 16) ? 0 : | |
| (((used & (1 << x15)) ? 0 : 1)); | |
| } | |
| constexpr int check(int used, int x1, int x4, int x13, int x16, int x2, int x3, int x5, int x6, int x7, int x8, int x9, int x10, int x11, int x12, int x14) { | |
| return (x14 < 1 || x14 > 16) ? 0 : | |
| (((used & (1 << x14)) ? 0 : check(used + (1 << x14), x1, x4, x13, x16, x2, x3, x5, x6, x7, x8, x9, x10, x11, x12, x14, eq(s - x13 - x14 - x16, s - x3 - x7 - x11)))); |
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 <iostream> | |
| #include <fstream> | |
| #include <sstream> | |
| #include <algorithm> | |
| #include <ctime> | |
| #include <omp.h> | |
| #include <unordered_set> | |
| using namespace std; | |
| const char* outputfile = "result"; |
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
| @*The first C program. | |
| ``\.{hello, world!}''と出力するC言語のプログラムは以下のとおり。 | |
| @c | |
| @<Header files to include@>@/ | |
| @<The main program@> | |
| @ 標準入出力のためのライブラリを利用するようにコンパイラに指示する。 |
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
| @ hello, world! と出力するC言語のプログラムは以下のとおり。 | |
| @c | |
| @<Header files to include@>@/ | |
| @<The main program@> | |
| @ 標準入出力のためのライブラリを利用するようにコンパイラに指示する。 | |
| @<Header files to include@>= | |
| #include <stdio.h> |
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
| @ hello, world! と出力するC言語のプログラムは以下のとおり。 | |
| @c | |
| #include <stdio.h> | |
| main() | |
| { | |
| printf("hello, world\n"); | |
| } |
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 <stdio.h> | |
| #include <stdlib.h> | |
| #ifdef __APPLE__ | |
| #include <OpenCL/opencl.h> | |
| #else | |
| #include <CL/cl.h> | |
| #endif | |
| #define MAX_PLATFORM_IDS 8 |
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
| buffer = CUDAMemoryAllocate["Integer32", {height, width}]; | |
| Manipulate[With[{ | |
| xMin = center[[1]] - 10^scale, xMax = center[[1]] + 10^scale, | |
| yMin = center[[2]] - 10^scale, yMax = center[[2]] + 10^scale}, | |
| kernel[buffer, IntegerPart[10^maxSteps], width, height, xMin, xMax, yMin, yMax]; | |
| ArrayPlot[CUDAMemoryGet[buffer], | |
| DataRange -> {{xMin, xMax}, {yMin, yMax}}, | |
| DataReversed -> True, ColorFunction -> "Rainbow"]], | |
| {{center, {-0.5, 0}}, Locator}, |