This file contains hidden or 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
using System; | |
using System.Collections.Generic; | |
using System.ComponentModel; | |
using System.Data; | |
using System.Drawing; | |
using System.Linq; | |
using System.Text; | |
using System.Windows.Forms; | |
using System.Speech.Recognition; | |
using System.Net; |
This file contains hidden or 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
<?xml version="1.0" encoding="utf-8" ?> | |
<!DOCTYPE grammar PUBLIC "-//W3C//DTD GRAMMAR 1.0//EN" "http://www.w3.org/TR/speech-grammar/grammar.dtd"> | |
<grammar xmlns="http://www.w3.org/2001/06/grammar" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://www.w3.org/2001/06/grammar | |
http://www.w3.org/TR/speech-grammar/grammar.xsd" | |
xml:lang="en-US" | |
version="1.0" | |
root="command" |
This file contains hidden or 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
#!/usr/bin/ruby | |
numOfTrials = 10000 | |
numTriangles = 0 | |
numOfTrials.times do | |
# generate two random breaks, in order | |
breaks = [ rand, rand ].sort | |
# load the length calculations via the breaks into an "lengths" array |
This file contains hidden or 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
jQuery.fn.selectAll = function() { | |
return this.each(function() { | |
if (document.body.createTextRange) { // MSIE | |
var r = document.body.createTextRange(); | |
r.moveToElementText(this); | |
r.select(); | |
} else if (window.getSelection) { // W3C | |
var r = document.createRange(); | |
r.selectNodeContents(this); | |
This file contains hidden or 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
#!/usr/bin/env ruby | |
# http://www.facebook.com/careers/puzzles.php?puzzle_id=7 | |
# Memory-heavy but low-computation solution | |
LOOP = [nil, nil, "Hoppity", nil, "Hophop", "Hoppity", nil, nil, "Hoppity", "Hophop", nil, "Hoppity", nil, nil, "Hop"] | |
File.open(ARGV[0], 'r') do |f| | |
f.readline.to_i.times do |i| | |
puts LOOP[i] unless LOOP[i].nil? |
This file contains hidden or 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
#!/usr/bin/env ruby | |
# usage: ./family.rb [trials] | |
# Family problem, 1000000 trials: | |
# | |
# 997496 girls, 1000000 boys | |
# 1.997496 children per family | |
# 0.997496 girls per boy | |
# | |
# Ran in 15.508096s |
This file contains hidden or 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
#!/bin/sh | |
# | |
# redis - this script starts and stops the redis-server daemon | |
# | |
# chkconfig: - 85 15 | |
# description: Redis is a persistent key-value database | |
# processname: redis-server | |
# config: /etc/redis/redis.conf | |
# config: /etc/sysconfig/redis | |
# pidfile: /var/run/redis.pid |
This file contains hidden or 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
#!/bin/sh | |
### BEGIN INIT INFO | |
# Provides: [app] | |
# Required-Start: $local_fs $remote_fs $network $syslog $nginx $mysql | |
# Required-Stop: $local_fs $remote_fs $network $syslog $nginx $mysql | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: starts the [app] app server | |
# Description: starts the [app] app server |
This file contains hidden or 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
set :application, "example_app" | |
set :domain, "example-app.com" | |
## IMPORTANT: "true" prevents the server from booting properly | |
## This line is sometimes recommended in other Capistrano configurations, | |
## but do not use it for GlassFish. | |
# default_run_options[:pty] = true | |
set :scm, :git | |
set :repository, "[email protected]:paulrosania/example_app.git" |
This file contains hidden or 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
#!/bin/sh | |
### BEGIN INIT INFO | |
# Provides: example_app | |
# Required-Start: $local_fs $remote_fs $network $syslog | |
# Required-Stop: $local_fs $remote_fs $network $syslog | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: starts the example_app app server | |
# Description: starts the example_app app server |
OlderNewer