Skip to content

Instantly share code, notes, and snippets.

View brianhsu's full-sized avatar

Brian Hsu brianhsu

View GitHub Profile
# Copyright 1999-2015 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/xfce-extra/xfce4-eyes-plugin/xfce4-eyes-plugin-4.4.4.ebuild,v 1.1 2015/03/28 20:46:39 mgorny Exp $
EAPI=5
inherit xfconf
inherit cmake-utils
DESCRIPTION="A panel plug-in which adds classic eyes to your every step"
HOMEPAGE="http://goodies.xfce.org/projects/panel-plugins/xfce4-eyes-plugin"
public class InfinteRoom {
class Customer { .... }
class Room { ... }
Map<Customer, Room> booking = new Map<Customer, Room>();
void checkIn(Customer guest) {
Room newRoom = new Room();
booking.put(guest, newRoom);
}
scala> val center = Int.MaxValue / 2
center: Int = 1073741823
scala> def homeIndex(size: Int) = (center - (center % size))
homeIndex: (size: Int)Int
scala> homeIndex(1) % 1
res53: Int = 0
scala> homeIndex(2) % 2
* Where:
Build file '/home/brianhsu/WorkRoom/sidc/remoter/build.gradle' line: 9
* What went wrong:
A problem occurred evaluating project ':remoter'.
> Could not create plugin of type 'AppPlugin'.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
@brianhsu
brianhsu / LineFunction.cpp
Last active August 29, 2015 14:11
兩直線求夾角
#include <cv.h>
#include <math.h>
#include <gsl/gsl_fit.h>
using namespace cv;
class LineFunction {
public:
LineFunction(double ax, double by, double c);
LineFunction(Point2d point1, Point2d point2);
package tw.com.zhenhai.util
object KeepRetry {
def apply(block: => Any) {
try {
block
} catch {
case e: Exception =>
e.printStackTrace()
@brianhsu
brianhsu / gist:15e4effaa1a2ddbd46d4
Created September 29, 2014 02:15
SVG Embeded+jquery
<html>
<head>
<script src="https://code.jquery.com/jquery-2.1.1.min.js"></script>
</head>
<body>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
<iframe id="song1" scrolling="no" src="" frameborder="no" height="200" width="100%"></iframe>
<script>
var soundCloudID = "try"
var playerURL = "https://w.soundcloud.com/player/?url=https%3A//soundcloud.com/kptaipei/" + soundCloudID + "&amp;color=ff5500&amp;auto_play=false&amp;hide_related=false&amp;show_comments=true&amp;show_user=true&amp;show_reposts=false";
$('#song1').attr(src, playerURL);
</script>
1 var fs = require("fs");
2 var path = require("path")
3 var pathname = process.argv[2];
4 var extension = "." + process.argv[3];
5
6 fs.readdir(pathname, function(err, list) {
7 var filtered = list.filter(function(e) { return path.extname(e) == extension })
8 filtered.forEach(function(path) {
9 console.log(path)
10 })
http://lovepeyling.pixnet.net/blog/post/46175302-%E9%B9%B9%E9%A4%85%E4%B9%BE-flourless--salty-crackers-%E7%84%A1%E9%BA%B5%E7%B2%89