Skip to content

Instantly share code, notes, and snippets.

View Vatyx's full-sized avatar
💭
🎉

Sahil Dhanju Vatyx

💭
🎉
View GitHub Profile
var horizontalLines = (function() {
var playing = false;
var callback = _.identity;
var distance = min_dimension * 0.5;
var line = two.makeLine(-width, center.y - center.y * .25, 0, center.y - center.y * .25);
var line2 = two.makeLine(width, center.y + center.y * .25, 2*width, center.y + center.y * .25);
def find_it (numbers):
biggest, smaller = None, None
for x in numbers:
if x >= biggest:
biggest, smaller = x, biggest
elif biggest > x > smaller:
smaller = x
return smaller
print smaller
public void run() {
try {
String response = HttpRequest.post("http://ec2-52-38-4-62.us-west-2.compute.amazonaws.com/")
.contentType("application/json")
.accept("application/json")
.send("{\"hello\":\"" + concatStringsWSep(allTweets, " ") + "\"}")
.body();
final JSONObject what = new JSONObject(response);
url_done = what.getString("img");
runOnUiThread(new Runnable() {
public void run() {
try {
String response = HttpRequest.post("http://ec2-52-38-4-62.us-west-2.compute.amazonaws.com/")
.contentType("application/json")
.accept("application/json")
.send("{\"hello\":\"" + concatStringsWSep(allTweets, " ") + "\"}")
.body();
final JSONObject what = new JSONObject(response);
url_done = what.getString("img");
runOnUiThread(new Runnable() {
void flapOptimization()
{
vector<unsigned int> vertexCount(g.halfmesh.totalVerts);
vector<HE_Face*> faceTracker(g.halfmesh.totalVerts);
map<unsigned int, HE_Face*> flaps;
for(unsigned int i = 0; i < g.halfmesh.totalFaces; i++)
{
for(unsigned int j = 0; j < 3; j++)
vec3 Raytracer::getLighting(vec3 point, vec3 norm, vec3 origin, Lighting* lighting)
{
vec3 intensity(0, 0, 0);
auto ka = lighting->ka;
auto intensityAmbient = lighting->ia;
intensity = ka * intensityAmbient;
if (depth < 6)
{
auto V = -r.dir;
auto R = 2 * dot(V, norm) * norm - V;
R.make_unit_vector();
auto ray = Ray(point + 0.001 * norm, R);
if (surface->gamma_e != 0) {
auto recurredLight = trace(ray, ++depth);
light = light + inter.first->gamma_e * recurredLight;
> [*New to Dota 2? Start here.*](http://goo.gl/IwmCv#heading#intro)
[Read Before Posting: Subreddit FAQ](http://goo.gl/COUhZ#trade#button)
[Subreddit Rules](http://www.reddit.com/r/DotA2/wiki/rules#rules#button)
[Message the Moderators](https://goo.gl/VTTJy7#mods#button)
>>[](#separator)
#[derive(Copy, Clone, Debug)]
pub struct Vector2<T> {
pub x: T,
pub y: T,
}
impl<T: Copy + Num + Signed> Vector2<T> {
pub fn new(x: T, y: T) -> Vector2<T> where T: Float {
assert!(!x.is_nan() && !y.is_nan());
public static string GetCurrentPathOfProjectWindow()
{
Type projectWindowUtilType = typeof(ProjectWindowUtil);
MethodInfo getActiveFolderPath = projectWindowUtilType.GetMethod("GetActiveFolderPath", BindingFlags.Static | BindingFlags.NonPublic);
object obj = getActiveFolderPath.Invoke(null, new object[0]);
return obj.ToString();
}