Skip to content

Instantly share code, notes, and snippets.

package com.example.android.opengl;
import android.graphics.Point;
public class Bezier {
private static final float AP = 0.5f;
private Point[] bPoints;
public Bezier(Point[] points) {
int n = points.length;
if (n < 3) {
#ifndef UTIL_STRING_UTILS_HPP
#define UTIL_STRING_UTILS_HPP
// trim from start
static inline std::string &string_ltrim(std::string &s) {
s.erase(s.begin(), std::find_if(s.begin(), s.end(), std::not1(std::ptr_fun<int, int>(std::isspace))));
return s;
}
// trim from end
@eclecticlogic
eclecticlogic / CubicBezierCurve.java
Last active May 11, 2020 00:19
Fits a Cubic Bezier curve and allows you to treat it as y = f(x)
import java.util.HashMap;
import java.util.Map;
/**
* @author kabram.
*
*/
public class CubicBezierCurve {
@proudlygeek
proudlygeek / commands-channel.go
Last active March 31, 2024 03:31
Golang Commands in Goroutines
package main
import (
"fmt"
"log"
"os/exec"
"runtime"
)
type Worker struct {
@troyscott
troyscott / check_errorlevels.bat
Created April 10, 2013 20:32
Check error level after the SSIS package completes. If the error level does not 0 stop running the batch file.
@ECHO OFF
SET DTEXEC_PATH="C:\Program Files\Microsoft SQL Server\110\DTS\Binn\dtexec.exe"
%DTEXEC_PATH% /FILE batch_success.dtsx
IF %ERRORLEVEL% NEQ 0 GOTO STOP_JOB
%DTEXEC_PATH% /FILE batch_fail.dtsx
IF %ERRORLEVEL% NEQ 0 GOTO STOP_JOB
%DTEXEC_PATH% /FILE batch_success.dtsx
IF %ERRORLEVEL% NEQ 0 GOTO STOP_JOB