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
diff --git a/src/crystal/system/random.cr b/src/crystal/system/random.cr | |
index e03cc6ca6..745d0300d 100644 | |
--- a/src/crystal/system/random.cr | |
+++ b/src/crystal/system/random.cr | |
@@ -11,7 +11,7 @@ module Crystal::System::Random | |
end | |
{% if flag?(:linux) %} | |
- require "./unix/getrandom" | |
+ require "./unix/urandom" |
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
diff --git a/src/socket/addrinfo.cr b/src/socket/addrinfo.cr | |
index 25e046cda..0ac8867ae 100644 | |
--- a/src/socket/addrinfo.cr | |
+++ b/src/socket/addrinfo.cr | |
@@ -82,12 +82,12 @@ class Socket | |
class Error < Socket::Error | |
getter error_code : Int32 | |
- def self.new(error_code) | |
- new error_code, "getaddrinfo: #{String.new(LibC.gai_strerror(error_code))}" |
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
crystal make Makefile:68: *** Could not locate llvm-config, make sure it is installed and in your PATH, or set LLVM_CONFIG. Stop. | |
this meant "llvm isn't linked in after it's installed" "it's "keg only" or whatever homebrew calls it" so you have to link it or manually use it, this: | |
$ find /usr -name llvm-config | |
/usr/local/Cellar/llvm@8/8.0.1/bin/llvm-config | |
$ PATH=/usr/local/Cellar/llvm@8/8.0.1_1/bin/:$PATH make |
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
require 'webrick' | |
server = WEBrick::HTTPServer.new :Port => 8000 | |
server.mount_proc '/' do |req, res| | |
if req.path != "/" | |
address = "taobao.com" | |
else | |
address = "facebook.com" | |
end |
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
require "socket" | |
lib C | |
# In C: double cos(double x) | |
fun sleep(value : UInt32) : UInt32 | |
end | |
spawn { | |
loop { | |
TCPSocket.new("facebook.com",80,0.1,0.1).close | |
STDOUT.print "." |
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
$ ls -lh a | |
-rw-rw-r-- 1 x x 10G Oct 31 16:52 a | |
$ time grep abc < a | |
real 0m20.633s | |
user 0m9.745s | |
sys 0m10.837s | |
$ time grep abc a |
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
How to get the build version by having maven create a file with the "build.timestamp" etc. in it: | |
You can set it yourself by filtering a "resource" properties file that declares it, then read it as a resource, a la: | |
String retrieveVersionFromResource() throws IOException { | |
try (InputStream br = getClass().getResourceAsStream("/auto-version.txt")) { // maven pom.xml specifies to setup auto-version.txt with some values for us | |
Properties props = new Properties(); | |
props.load(br); | |
return "build_version=" + props.get("project_version") + " " + props.get("build_date"); | |
} |
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
26 ??,??,_Unwind_Backtrace,unwind,initialize,new,raise,unbuffered_close,close,process,process,handle_client,->,run,->,?? | |
12 ??,__GI___dl_iterate_phdr,_Unwind_Find_FDE,??,_Unwind_Backtrace,unwind,initialize,new,raise,unbuffered_close,close,process,process,handle_client,->,run,->,?? | |
10 ??,??,_Unwind_RaiseException,__crystal_raise,raise,unbuffered_close,close,process,process,handle_client,->,run,->,?? | |
10 __kernel_vsyscall,recv,unbuffered_read,fill_buffer,read,->,BIO_read,??,??,??,SSL_shutdown,unbuffered_close,close,process,process,handle_client,->,run,->,?? | |
7 ??,??,??,_Unwind_RaiseException,__crystal_raise,raise,unbuffered_close,close,process,process,handle_client,->,run,->,?? | |
5 includes?,->,_Unwind_Backtrace,unwind,initialize,new,raise,unbuffered_close,close,process,process,handle_client,->,run,->,?? | |
5 ??,__GI___dl_iterate_phdr,_Unwind_Find_FDE,??,??,_Unwind_RaiseException,__crystal_raise,raise,unbuffered_close,close,process,process,handle_client,->,run,->,?? | |
4 ??,_Un |
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
diff --git a/cross_compile_ffmpeg.sh b/cross_compile_ffmpeg.sh | |
index dda8ccd..29736f1 100755 | |
--- a/cross_compile_ffmpeg.sh | |
+++ b/cross_compile_ffmpeg.sh | |
@@ -380,11 +380,18 @@ do_configure() { | |
if [ -f bootstrap ]; then | |
./bootstrap # some need this to create ./configure :| | |
fi | |
- if [[ ! -f $configure_name && -f bootstrap.sh ]]; then # fftw wants to only run this if no configure :| | |
- ./bootstrap.sh |
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 <libvmaf.h> | |
#include <stdint.h> | |
long check_compute_vmaf(void) { return (long) compute_vmaf; } | |
int main(void) { int ret = 0; | |
ret |= ((intptr_t)check_compute_vmaf) & 0xFFFF; | |
return ret; } |