Instantly share code, notes, and snippets.

• Sort options

Taro YABUKItaroyabuki

View VennDiagram.m
 VennDiagram[n_, ineqs_: {}] := Module[{i, r = .6, R = 1, v, x, y, f}, v = Table[Circle[r {Cos[#], Sin[#]} &[2 Pi (i - 1)/n], R], {i, n}]; { If[ineqs == {}, {}, f = And @@ (v /. Circle[{xx_, yy_}, rr_] :> (x - xx)^2 + (y - yy)^2 < rr^2)[[ineqs]]; RegionPlot[ImplicitRegion[f, {x, y}], Axes -> False, DisplayFunction -> Identity][[1]] ], v
View 100weightchars.md

� � � � � � � � �

View four-coloring.m
 map = Import["http://mathforum.org/wagon/fall97/images/5colormap.gif"]; matrix = MorphologicalComponents[map]; vars = Flatten[Map[{p[#], q[#]} &, Rest[Union[Flatten[matrix]]]]]; f[r_] := Map[If[Length[Union[#]] > 2, Sort[Select[#, Positive]], Nothing] &, Partition[r, 4, 1]]; neighbours = Union[Flatten[Map[f, Join[matrix, Transpose[matrix]]], 1]];
View MyCos.java
 /* org.apfloat apfloat 1.8.2 */ import org.apfloat.*;
View cuda-cos-vs-fcos.cu
 //On Ubuntu, you need to install CUDA and: //sudo apt-get install libboost-dev //On Windows, I don't know the way to build this code. #include #include #include #include #include
View cuda-cos.cu
 //On Ubuntu, you need to install CUDA and: //sudo apt-get install libboost-dev //On Windows, I don't know the way to build this code. #include #include #include #include #include