./xml-to-java.sh /path/to/package/directory
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
| import java.util.Date | |
| import java.util.concurrent.ConcurrentLinkedDeque | |
| import java.util.concurrent.atomic.AtomicLong | |
| import scala.util.{Failure, Success, Try} | |
| case class SimpleLimiterQueueItem(weight: Long, date: Date) |
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 | |
| policy=${HOME}/.jstatd.all.policy | |
| [ -r ${policy} ] || cat >${policy} <<'POLICY' | |
| grant codebase "file:${java.home}/../lib/tools.jar" { | |
| permission java.security.AllPermission; | |
| }; | |
| POLICY | |
| jstatd -J-Djava.security.policy=${policy} & |
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
| [ | |
| { | |
| 'repeat(5, 10)': { | |
| _id: '{{objectId()}}', | |
| index: '{{index()}}', | |
| guid: '{{guid()}}', | |
| isActive: '{{bool()}}', | |
| balance: '{{floating(1000, 4000, 2, "$0,0.00")}}', | |
| picture: 'http://placehold.it/32x32', | |
| age: '{{integer(20, 40)}}', |
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
| ### installation: | |
| # sudo apt-get install fswebcam autossh | |
| # | |
| ### test camera: | |
| # fswebcam -r 640x480 -S 25 --jpeg 85 -D 1 /tmp/web-cam-shot.jpg && opn /tmp/web-cam-shot.jpg | |
| # | |
| ### running: | |
| # PORT=10007 | |
| # autossh -M 20000 -f -N <YOUR_VPS> -R 8080:localhost:"$PORT" -C | |
| # python run-surveillance-server.py "$PORT" "/tmp/webcam.jpg" |
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
| /* | |
| Copyright 2016 <Mark Jay> | |
| */ | |
| #include <iostream> | |
| #include <vector> | |
| #include <cstdlib> // abs | |
| #include <algorithm> // std::swap | |
| #include <numeric> // std::accumulate | |
| using std::cout; |
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
| // -------------------------------------------------------------------------------- | |
| // abstract generic stuff: | |
| public abstract class AbstractEntity { | |
| ID, hibernate-version, reflective to-string/equals/hashcode | |
| } | |
| public UIWindowFactory { | |
| public <T extends AbstractEntity> AbstractUIWindow<T> getUIWindow(T entity) {...} | |
| } | |
| public abstract class AbstractUIWindow<T extends AbstractEntity> { | |
| public com.vaddin.Window generateEditWindow(T entity) { generateDefaultReflectiveEditWindow(entity); } |
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
| import javax.net.ssl.SSLSocket; | |
| import javax.net.ssl.SSLSocketFactory; | |
| import java.io.*; | |
| /** Establish a SSL connection to a host and port, writes a byte and | |
| * prints the response. See | |
| * http://confluence.atlassian.com/display/JIRA/Connecting+to+SSL+services | |
| */ | |
| public class SSLPoke { | |
| public static void main(String[] args) { |
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 python | |
| # Reflects the requests from HTTP methods GET, POST, PUT, and DELETE | |
| # Written by Nathan Hamiel (2010) | |
| from BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler | |
| from optparse import OptionParser | |
| class RequestHandler(BaseHTTPRequestHandler): | |
| def do_GET(self): |
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
| function curry() { | |
| exportfun=$1; shift | |
| fun=$1; shift | |
| params=$* | |
| cmd=$"function $exportfun() { | |
| more_params=\$*; | |
| $fun $params \$more_params; | |
| }" | |
| eval $cmd | |
| } |
NewerOlder