Skip to content

Instantly share code, notes, and snippets.

(ns capclug.demo.cljfromjava.seven
(:gen-class
:methods [[foo [#^"[Ljava.lang.String;" ] String]]))
(defn -foo [arr] "arrgghhh")
Index: src/leiningen/pom.clj
===================================================================
--- src/leiningen/pom.clj (revision 78f94180dc88c3f18bdc7d112900478af0eddfb5)
+++ src/leiningen/pom.clj (revision )
@@ -4,7 +4,7 @@
[clojure.contrib.properties :only [as-properties]])
(:import [java.io StringWriter ByteArrayOutputStream]
[org.apache.maven.model Build Model Parent Dependency
- Exclusion Repository Scm License MailingList]
+ Exclusion Repository Scm License MailingList Resource]
(ns baz
(:import foo.com.Bar))
(def p (proxy [Bar] [] (foo ([s] (do (println s) s)) ([s1 s2] (do (println s1 ":" s2) s2)))))
(println "p is " p)
(.foo p "hi!")
(.foo p "one" "two")
@brweber2
brweber2 / gist:1246744
Created September 28, 2011 01:10
clooj 0.2.2 standalone stack trace
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
at clojure.lang.Reflector.invokeNoArgInstanceMember(Reflector.java:314)
at clooj.repl$relative_file.invoke(repl.clj:182)
at clooj.repl$send_selected_to_repl.invoke(repl.clj:203)
at clooj.core$make_menus$fn__1142.invoke(core.clj:678)
at clooj.utils$add_menu_item$reify__187.actionPerformed(utils.clj:316)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2028)
at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2351)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
@brweber2
brweber2 / ASM_output.txt
Created December 24, 2011 04:18
file stream java
/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/bin/java -Didea.launcher.port=7532 "-Didea.launcher.bin.path=/Applications/IntelliJ IDEA 11 CE.app/bin" -Dfile.encoding=UTF-8 -classpath "/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/lib/deploy.jar:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/lib/dt.jar:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/lib/javaws.jar:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/lib/jce.jar:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/lib/jconsole.jar:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/lib/management-agent.jar:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/lib/plugin.jar:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/lib/sa-jdi.jar:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/../Classes/alt-rt.jar:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/../Classes/alt-string.ja
@brweber2
brweber2 / JavaIntegerNumerics.md
Created March 31, 2012 15:00
Proposal for Integer Numerics in Java 9+

Proposal for Integer Numerics in Java 9+

Why?

Oracle recently started publicly laying out a plan for versions of Java the language from versions 9 on. One of the proposals for Java 9+ was to have a unified type system, which fundamentally means that everything would be an object (in the java.lang.Object sense). In simpler terms, this means the end of primitives. It is less clear what this means for arrays (in the java.util.Array sense), at least to me. Arrays are technically Objects, but they have special byte code instructions, similar to primitives and they have some other subtleties that separate them from Objects. They do not work particularly well with generics for example.

This proposal is put forth to address specific criticisms of removing primitive types from Java the language, in the hopes that the Java platform and language can continue to be used as a "systems" programming environment.

What?

@brweber2
brweber2 / gist:2649948
Created May 10, 2012 00:09 — forked from djKianoosh/gist:2648751
Some Clojure functions to help read IIS log files into maps
(defn comment? [s]
(.startsWith s "#"))
(defn not-comment? [s]
(not (comment? s))) ; you could also do (-> s comment? not), just showing alternatives, but what you had originally is just fine.
(defn remove-comments [file-contents]
(filter not-comment? file-contents))
(defn nil-if-hyphen [s]
From order-update@amazon.com Fri May 11 05:33:29 2012
X-Apparently-To: <SNIP-SNIP>@yahoo.com via 98.138.227.207; Fri, 11 May 2012 11:33:29 -0700
Return-Path: <fom_bonn@hilton.com>
Received-SPF: fail (domain of hilton.com does not designate 69.15.141.195 as permitted sender)
@brweber2
brweber2 / yahoo stock
Last active December 24, 2015 16:39
grab csv file with stock data from yahoo
{
"metadata": {
"name": "Scratchpad"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
Host *.foo.com
User <name>
IdentityFile ~/.ssh/foo_rsa
Host *
IdentitiesOnly yes