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
*~ | |
.Rhistory | |
Rplot*.* |
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(igraph) | |
require(RColorBrewer) | |
require(rgl) | |
G <- make_lattice(length=10, dim=2) | |
r <- c() | |
for (i in 4:6) r <- c(r, (4:6) + 10 * i) | |
G <- delete_vertices(G, r) | |
n <- length(V(G)) | |
u0 <- rep(0, n) | |
u0[1] <- 1 |
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
var scene = new THREE.Scene(); | |
var camera = new THREE.PerspectiveCamera(45, window.innerWidth / window.innerHeight, 0.1, 1000); | |
camera.position.z = 300; | |
var renderer = new THREE.WebGLRenderer(); | |
renderer.setSize(window.innerWidth, window.innerHeight); | |
renderer.setClearColor( 0xffffff, 1 ); | |
document.body.appendChild(renderer.domElement); | |
var material = new THREE.MeshBasicMaterial({ | |
color: "white", |
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
# our sample size | |
n <- 10 | |
# generate all subsets of size 2 | |
co <- combn(n, 2) | |
# confirm that the false friend is biased by generating a lot of samples | |
f <- rep(0, 50000) | |
g <- rep(0, 50000) |
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
using System; | |
using System.Collections.Generic; | |
using System.Collections.ObjectModel; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
using MathNet.Numerics; | |
using System.Numerics; |
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
Mesh M = new Mesh(); | |
int axis_divisions = 100; | |
int height_divisions = 200; | |
M.Vertices.Capacity = axis_divisions * height_divisions; | |
M.Faces.Capacity = 2 * (axis_divisions * (height_divisions - 1)); | |
for (int th = 0; th < axis_divisions; th++) | |
{ | |
double x = Math.Cos(2.0 * Math.PI * th / (double) axis_divisions); |
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 <stdio.h> | |
#include <stdlib.h> | |
#include <mmg/mmg2d/libmmg2d.h> | |
#include <math.h> | |
int main() { | |
MMG5_pMesh mesh2 = NULL; | |
MMG5_pSol met2 = NULL; | |
int ier = 0; | |
MMG2D_Init_mesh(MMG5_ARG_start, MMG5_ARG_ppMesh, &mesh2, MMG5_ARG_ppMet, &met2, MMG5_ARG_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
CC = gcc | |
CPP = g++ | |
INCL = -I$(HOME)/mmg/buildLinuxDebug/include/ | |
CFLAGS += -g -Wall -Wextra -pedantic -fPIC `pkg-config --cflags cairo` -DWITHCAIRO -D_DEBUG -DEXTRADEBUG | |
CPPFLAGS += -g -Wall -Wextra -pedantic -fPIC `pkg-config --cflags cairo` -DWITHCAIRO -D_DEBUG -DEXTRADEBUG --std=c++17 | |
LDFLAGS += -L$(HOME)/mmg/buildLinuxDebug/lib/ -Wl,-rpath=$(HOME)/mmg/buildLinuxDebug/lib -lmmg -lcairo -lm | |
main.o: main.c | |
$(CC) $(CFLAGS) $(INCL) -c -o $@ $< |
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
BOOL CMeshbExporterPlugIn::savemeshtomeshormeshb(const ON_Mesh& m, const wchar_t* filename) { | |
{ | |
if (m.VertexCount() == 0) { | |
RhinoApp().Print("This mesh seems to be empty."); | |
return FALSE; | |
} | |
ON_Mesh* mdp = m.Duplicate(); | |
if (!mdp) { |
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
#define _CRT_SECURE_NO_WARNINGS | |
#define STB_IMAGE_IMPLEMENTATION | |
#include "../stb/stb_image.h" | |
#define STB_IMAGE_WRITE_IMPLEMENTATION | |
#include "../stb/stb_image_write.h" | |
int main(int argc, char** argv) | |
{ | |
char* filename[6]; |