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: https://gist.github.com/qtxie/12c087db8a2c0c2d9fe0104af2f4236e | |
// compare Cell struct | |
// struct Cell { | |
// int header; | |
// int pading; | |
// int value; | |
// int pading2; | |
// Cell(int x) : value(x) {} | |
// bool operator<(const Cell& r) const | |
// { |
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 <random> | |
#include <ctime> | |
#include <vector> | |
#include <iostream> | |
#include <chrono> | |
#include <utility> | |
#include <array> | |
#include <type_traits> | |
#include <functional> | |
#include <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
// Source Code: https://gist.github.com/qtxie/12c087db8a2c0c2d9fe0104af2f4236e | |
// compare Cell struct | |
// struct Cell { | |
// int header; | |
// int pading; | |
// int value; | |
// int pading2; | |
// Cell(int x) : value(x) {} | |
// bool operator<(const Cell& r) const | |
// { |
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
1. 安装32位库 | |
sudo dpkg --add-architecture i386 | |
sudo apt-get update | |
sudo apt-get install build-essential gcc-multilib rpm libstdc++6:i386 libgtk-3-0:i386 libcurl3:i386 libgcc1:i386 zlib1g:i386 libncurses5:i386 | |
2. 安装git | |
sudo apt-get install git | |
3. 下载Rebol for Linux | |
https://1drv.ms/u/s!Am3tb4OZU9Jqpyxm6GtGsPY3ToI- |
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
转换的代码应该是平台无关的。Draw里只需要很少的改动。 | |
runtime/datatypes/image.reds 里增加一个函数: | |
``` | |
any-resize: func [ | |
;-- 4 points resize (also support 3 points) | |
src [red-image!] | |
dst [red-image!] | |
crop1 [red-pair!] | |
start [red-pair!] ;-- first point |
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
Red/System [] | |
int64!: alias struct! [ | |
low [integer!] | |
high [integer!] | |
] | |
sub64: func [ ;-- result: a - b | |
a [int64! value] | |
b [int64! value] |
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 <windows.h> /* WinAPI */ | |
/* Windows sleep in 100ns units */ | |
BOOLEAN nanosleep(LONGLONG ns){ | |
/* Declarations */ | |
HANDLE timer; /* Timer handle */ | |
LARGE_INTEGER li; /* Time defintion */ | |
/* Create timer */ | |
if(!(timer = CreateWaitableTimer(NULL, TRUE, NULL))) | |
return FALSE; |
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
Red [Needs: View] | |
start?: no | |
total1: 0 total2: 0 total3: 0 | |
n1: n2: n3: 0 | |
NUM: 10 | |
view [ | |
b1: base 500x500 on-drawing [ | |
unless start? [exit] | |
cmds: reduce ['pen red] |
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
REBOL [] | |
Red [] | |
do { | |
src: [ | |
#switch OS [ | |
Windows [#define LIBREDRT-file "libRedRT.dll"] | |
macOS [#define LIBREDRT-file "libRedRT.dylib"] | |
#default [#define LIBREDRT-file "libRedRT.so"] | |
] |
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
Red [ | |
Title: "Simple HTTP server" | |
Notes: { | |
The compiler is not able to compile it. | |
} | |
] | |
httpd: context [ | |
debug: :print |