Skip to content

Instantly share code, notes, and snippets.

View Gnimuc's full-sized avatar
🍤

Yupei Qi Gnimuc

🍤
  • Tokyo
  • 00:43 (UTC +09:00)
  • X @Gnimuc
View GitHub Profile
A = sprand(65535, 65500, 1e-5)
v = rand(65500)
function foo(A, v)
b = zeros(size(A,1))
rows = rowvals(A)
vals = nonzeros(A)
m, n = size(A)
for i = 1:n
@inbounds @simd for j in nzrange(A, i)
using Luxor
function juliacn(radius=100; outercircleratio=0.75, innercircleratio=0.65)
points = ngon(O, radius, 3, pi/6, vertices=true)
fontsize(150)
fontface("TamilMN-Bold")
setcolor(Luxor.reds[1]...)
translate(-63.25, 51.25)
text("C", points[1], halign="center", valign="bottom")
translate(7, 0)
In file included from /Cxx.h:1:
In file included from /Users/gnimuc/.julia/dev/Cxx/src/CxxREPL/replpane.jl:68:
In file included from /Users/gnimuc/.julia/dev/Cxx/src/CxxREPL/../../deps/src/clang-6.0.0/include/clang/Parse/Parser.h:25:
In file included from /Users/gnimuc/.julia/dev/Cxx/src/CxxREPL/../../deps/src/clang-6.0.0/include/clang/Sema/Sema.h:43:
/Users/gnimuc/.julia/dev/Cxx/src/CxxREPL/../../deps/src/clang-6.0.0/include/clang/Sema/ExternalSemaSource.h:87:55: error: too few template arguments for class template 'MapVector'
virtual void ReadMismatchingDeleteExpressions(llvm::MapVector<
^
/Users/gnimuc/Codes/julia/usr/bin/../include/llvm/ADT/MapVector.h:38:7: note: template is declared here
class MapVector {
^
using Images
using Statistics
using LinearAlgebra
crop(img, l) = crop(img, size(img), l)
crop(img, (m, n), l) = img[l+1:m-l,l+1:n-l]
function extend(img, L)
M, N = size(img)
extended = zeros(M+2*L,N+2*L)

master

with this patch

-LLVM_@LLVM_VERSION_MAJOR@.@LLVM_VERSION_MINOR@ { global: *; };
+JLBB_LLVM_@LLVM_VERSION_MAJOR@.@LLVM_VERSION_MINOR@ { global: *; };

and disabling WebAssembly

# Also target Wasm because Javascript is the Platform Of The Future (TM)
# CMAKE_FLAGS="${CMAKE_FLAGS} -DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD:STRING=\"WebAssembly\""
@Gnimuc
Gnimuc / phong.frag
Created December 31, 2018 11:11
face_normal
#version 410
in vec3 geo_position_eye, normal_eye;
uniform mat4 view_mat;
// fixed point light properties
vec3 light_position_world = vec3(0.0, 0.0, 5.0);
vec3 Ls = vec3(1.0, 1.0, 1.0); // white specular colour
vec3 Ld = vec3(0.7, 0.7, 0.7); // dull white diffuse light colour
julia> :(struct Foo
struct Bar
struct Baz
x
end
struct Goo
y
end
baz::Baz
goo::Goo
@Gnimuc
Gnimuc / Nuklear_and_CImGui.jl
Created February 28, 2019 02:14
Nuklear works along side with CImGui
using Nuklear
using Nuklear.LibNuklear
using Nuklear.GLFWBackend
using CImGui
using CImGui.CSyntax
using CImGui.GLFWBackend
using CImGui.OpenGLBackend
using CImGui.GLFWBackend.GLFW
using CImGui.OpenGLBackend.ModernGL
@Gnimuc
Gnimuc / imgui_node_graph_test.cpp
Created March 1, 2019 07:53 — forked from ocornut/imgui_node_graph_test.cpp
Node graph editor basic demo for ImGui
// Creating a node graph editor for ImGui
// Quick demo, not production code! This is more of a demo of how to use ImGui to create custom stuff.
// Better version by @daniel_collin here https://gist.github.com/emoon/b8ff4b4ce4f1b43e79f2
// See https://github.com/ocornut/imgui/issues/306
// v0.03: fixed grid offset issue, inverted sign of 'scrolling'
// Animated gif: https://cloud.githubusercontent.com/assets/8225057/9472357/c0263c04-4b4c-11e5-9fdf-2cd4f33f6582.gif
#include <math.h> // fmodf
// NB: You can use math functions/operators on ImVec2 if you #define IMGUI_DEFINE_MATH_OPERATORS and #include "imgui_internal.h"
using CImGui
using CImGui.LibCImGui
using CImGui.GLFWBackend
using CImGui.OpenGLBackend
using GLFW, ModernGL
using CSyntax
using Printf
@static if Sys.isapple()
# OpenGL 3.2 + GLSL 150