Skip to content

Instantly share code, notes, and snippets.

View dcbriccetti's full-sized avatar

Dave Briccetti dcbriccetti

View GitHub Profile
dbl:~/devel/esme $ git svn clone http://svn.apache.org/repos/asf/incubator/esme
Can't load '/System/Library/Perl/Extras/5.8.8/darwin-thread-multi-2level/auto/SVN/_Core/_Core.bundle' for module SVN::_Core: dlopen(/System/Library/Perl/Extras/5.8.8/darwin-thread-multi-2level/auto/SVN/_Core/_Core.bundle, 1): Library not loaded: /usr/lib/libsvn_client-1.0.dylib
Referenced from: /System/Library/Perl/Extras/5.8.8/darwin-thread-multi-2level/auto/SVN/_Core/_Core.bundle
Reason: image not found at /System/Library/Perl/5.8.8/darwin-thread-multi-2level/DynaLoader.pm line 230.
at /System/Library/Perl/Extras/5.8.8/darwin-thread-multi-2level/SVN/Base.pm line 59
BEGIN failed--compilation aborted at /System/Library/Perl/Extras/5.8.8/darwin-thread-multi-2level/SVN/Core.pm line 5.
Compilation failed in require at /usr/local/git/libexec/git-core/git-svn line 30.
$ git --version;svn --version
git version 1.6.4.4
package org.talkingpuffin.state
import net.lag.configgy.Configgy
object ConvertPrefs {
def convert {
val confName = "/Users/daveb/tpuf.conf"
val f = new java.io.File(confName)
if (! f.exists) f.createNewFile
import xml._
XML.loadString("""<?xml version="1.0" encoding="UTF-8" ?>
<kml xmlns="http://earth.google.com/kml/2.0"><Response>
<name>32.867930,-117.131160</name>
<Status>
<code>200</code>
<request>geocode</request>
</Status>
<Placemark id="p1">
<address>Miramar, CA, USA</address>
13:52:42,995 [AWT-EventQueue-0] INFO StatusTableModel Following - Tweets Arrived: 1
13:52:46,395 [pool-16-thread-1] DEBUG Http - dcbriccetti GET http://api.twitter.com/1/friends/ids.xml?cursor=-1
13:52:46,409 [pool-17-thread-1] DEBUG Http - dcbriccetti GET http://api.twitter.com/1/statuses/friends.xml?cursor=-1
13:52:46,419 [pool-16-thread-2] DEBUG Http - dcbriccetti GET http://api.twitter.com/1/followers/ids.xml?cursor=-1
13:52:46,412 [pool-17-thread-2] DEBUG Http - dcbriccetti GET http://api.twitter.com/1/statuses/followers.xml?cursor=-1
13:52:51,853 [pool-17-thread-2] DEBUG Http - dcbriccetti GET http://api.twitter.com/1/statuses/followers.xml?cursor=1309828382000114566
13:52:55,338 [pool-17-thread-1] DEBUG Http - dcbriccetti GET http://api.twitter.com/1/statuses/friends.xml?cursor=1303052132811746611
13:52:55,399 [pool-17-thread-1] DEBUG TwitterException - Code: 502, Title: Twitter / Over capacity
13:52:55,407 [pool-17-thread-1] WARN Http - org.talkingpuffin.twitter.TwitterBadGateway
13:52:57,4
package sandbox
import actors.Actor
import org.apache.log4j.Logger
object getter extends Actor {
val logger = Logger.getLogger("Actor")
def act() {
while (true) {
package org.talkingpuffin.util
import java.util.concurrent.{ExecutorCompletionService, Callable, Executors}
object Parallelizer {
/**
* Runs, in the number of threads requested, the function f, giving it each A of args, returning a List[T]
*/
def run[T,A](numThreads: Int, args: List[A], f: (A) => T): List[T] = {
val pool = Executors.newFixedThreadPool(numThreads)
// Code for instrumenting Twitter API calls with JMX.
package org.talkingpuffin.twitter
import management.ManagementFactory
import javax.management.ObjectName
import org.apache.log4j.Logger
trait HttpRunnerMBean {
/** A request is a single HTTP request, counted only once even if retries are necessary. */
@dcbriccetti
dcbriccetti / helloVM.scala
Created January 24, 2011 20:55
Any review comments for this “Hello VM” code for use with VI Java (VMware)?
package com.vmware.vim25.mo.samples
import java.net.URL
import org.apache.log4j.Logger
import com.vmware.vim25.mo._
object HelloVM {
val log = Logger.getLogger(getClass)
def sayHello(url: String, user: String, pwd: String) {
val trailingPunctRe = "^(.*?)[,.\"]?$".r
def stripTrailingPunctuation(text: String) = text match {
case trailingPunctRe(result) => result
}
object AuthenticatedSession extends Loggable {
def logIn(credentialsOption: Option[Credentials]): Twitter = {
val (tw, credentials) = credentialsOption match {
case Some(cr) =>
(createTwitter(Some(cr)), cr)
case None =>
val requestToken = tw.getOAuthRequestToken
DesktopUtil.browse(requestToken.getAuthorizationURL)
(createTwitter(None), Dialog.showInput(null, "Enter the PIN from the Twitter authorization page in your browser",
"Enter PIN", Dialog.Message.Question, null, List[String](), "") match {