View rotated_array_search.dart
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
import 'dart:math'; | |
import 'package:cli/cli.dart' as cli; | |
abstract class AbstactBinarySearch { | |
final List<int> nums; | |
final int target; | |
int start = 0; | |
int end; |
View vuforia_add_target.rb
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 'digest' | |
require 'openssl' | |
require 'base64' | |
require 'net/http' | |
require 'json' | |
require 'time' | |
VWS_ENDPOINT = 'vws.vuforia.com' | |
TARGETS_PATH = '/targets' |
View App.js
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
/** | |
* Sample React Native App | |
* https://github.com/facebook/react-native | |
* | |
* @format | |
* @flow | |
*/ | |
import React, { Component } from 'react'; | |
import { Platform, StyleSheet, Text, View, Button } from 'react-native'; |
View method-to-function.js
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 _ = new Proxy({}, {get: (object, prop) => x => Reflect.get(x, prop)}) | |
// Now you can use `_.method` instead of `x => x.method` | |
var a = {someMethod: x => x + 1} | |
_.someMethod(a)(1) // => 2 | |
a.prototype.prototypeMethod = (a, b) => a + b | |
_.prototypeMethod(a)(1, 2) // => 3 |
View AnkoAdapter.kt
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
class AnkoViewHolder<out V : AnkoComponent<ViewGroup>>(val parent: ViewGroup, val createUI: () -> V) { | |
class ViewHolder<out V : AnkoComponent<ViewGroup>>(val view: View, val ui: V) : RecyclerView.ViewHolder(view) | |
val ankoContext by lazy { AnkoContext.createReusable(parent.context, parent) } | |
val viewHolder by lazy { | |
val ui = createUI() | |
val view = ui.createView(ankoContext) | |
view.setupTapEffectForBG(true) // default for every item in application | |
// TODO some items may be disabled... | |
ViewHolder(view, ui) |
View optional_arguments_application.swift
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
infix operator .? : NilCoalescingPrecedence | |
func .?<ARG, RES> (fn: (ARG) -> RES, arg: ARG?) -> RES? { | |
if let arg = arg { | |
return fn(arg) | |
} | |
return nil | |
} | |
func .?<ARG0, ARG1, RES> (fn: (ARG0, ARG1) -> RES, arg: (ARG0?, ARG1?)) -> RES? { |
View type_operators.swift
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
enum Either<A,B> { | |
case left(A) | |
case right(B) | |
} | |
func |<A,B>(left: A.Type, right: B.Type) -> Either<A, B>.Type { | |
return Either<A, B>.self | |
} |
View mda_counter.py
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
# -*- coding: utf-8 -*- | |
import json | |
from subprocess import * | |
from collections import Counter | |
import matplotlib | |
import matplotlib.pyplot as plt | |
import matplotlib.dates as mdates | |
from scipy.interpolate import splev, splrep, InterpolatedUnivariateSpline | |
import datetime | |
import time |
View astar_readmodel.cpp
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
/* | |
Copyright 2005-2016 Intel Corporation. All Rights Reserved. | |
This file is part of Threading Building Blocks. Threading Building Blocks is free software; | |
you can redistribute it and/or modify it under the terms of the GNU General Public License | |
version 2 as published by the Free Software Foundation. Threading Building Blocks is | |
distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the | |
implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | |
See the GNU General Public License for more details. You should have received a copy of | |
the GNU General Public License along with Threading Building Blocks; if not, write to the |
View disable_set_rect.swift
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
//... | |
// change instance property setter to custom at runtime | |
let type = self.view.superview!.superview!.superview!.dynamicType | |
if String.fromCString(class_getName(type)) != "runtimeUIView" { | |
let newtype = objc_allocateClassPair(type, "runtimeUIView", 0) | |
let imp = class_getMethodImplementation(ViewController.self, #selector(ViewController.fakeFrameSetter(_:))) | |
let types = method_getTypeEncoding(class_getInstanceMethod(ViewController.self, #selector(ViewController.fakeFrameSetter(_:)))) | |
class_addMethod(newtype, Selector("setFrame:"), imp, types) | |
object_setClass(self.view.superview!.superview!.superview!, newtype) | |
} |
NewerOlder