Skip to content

Instantly share code, notes, and snippets.

View jbalint's full-sized avatar
🔬
ABC -> always be refa(C)toring

Jess Balint jbalint

🔬
ABC -> always be refa(C)toring
View GitHub Profile
@jbalint
jbalint / BITES_TEST.java
Created November 3, 2016 17:46
BITES connection via HTTP
/*
* Test for using a BITES connection. Set the classpath with:
* $ export CLASSPATH=`(find $STARDOG/client/http -name '*.jar' ; find $STARDOG/client/api -name '*.jar' ; echo .) | tr '\n' ':'`
*
* Run the test with:
* $ javac BITES_TEST.java && java BITES_TEST
*/
import com.complexible.stardog.docs.StardocsConnection;
import com.complexible.stardog.api.Connection;

Keybase proof

I hereby claim:

  • I am jbalint on github.
  • I am jbalint (https://keybase.io/jbalint) on keybase.
  • I have a public key whose fingerprint is EC3E 70DF 5336 3C76 AAA7 BEC0 C09B A4E5 B0A8 BB04

To claim this, I am signing this object:

59> cryspi_search:solve_subgoal({pred, "p", [{const, {int, 1}}, {var, {"ZZZ", 0}}]}, #goal_state{iter_depth=1}).
cryspi_search:solve_subgoal({pred, "p", [{const, {int, 1}}, {var, {"ZZZ", 0}}]}, #goal_state{iter_depth=1}).
Solving [{pred,"q",[{const,{int,1}},{var,{"U",1}}]},
{pred,"v",[{var,{"U",1}},{var,{"W",1}}]},
{pred,"r",[{var,{"W",1}},{var,{"ZZZ",0}}]}]
Solving [{pred,"q",[{var,{"U",1}},{var,{"Z",2}}]},
{pred,"r",[{var,{"Z",2}},{var,{"W",2}}]}]
AnswerSets=[[#{{"U",1} => {const,{int,1}},{"Z",2} => {const,{int,2}}},
#{{"U",1} => {const,{int,1}},{"Z",2} => {const,{int,8}}},
#{{"U",1} => {const,{int,1}},{"Z",2} => {const,{int,4}}},
@jbalint
jbalint / repeat.erl
Created October 15, 2015 03:20
erlang code
lookup({func, Name, Args}, Unifier) ->
{func, Name, lists:map(fun (Arg) -> lookup(Arg, Unifier) end, Args)};
lookup({list, Elements}, Unifier) ->
{list, lists:map(fun (Arg) -> lookup(Arg, Unifier) end, Elements)};
lookup({pred, Pred, Args}) ->
{pred, Pred, lists:map(fun (Arg) -> lookup(Arg, Unifier) end, Args)};
lookup(Term, _) ->
Term.
@jbalint
jbalint / asd
Created October 3, 2015 17:38
asd
diff --git a/src/rebar_plugins.erl b/src/rebar_plugins.erl
index f2d3977..4e61503 100644
--- a/src/rebar_plugins.erl
+++ b/src/rebar_plugins.erl
@@ -62,26 +62,34 @@ handle_plugins(Profile, Plugins, State, Upgrade) ->
handle_plugin(Profile, Plugin, State, Upgrade) ->
try
- {Apps, State2} = rebar_prv_install_deps:handle_deps_as_profile(Profile, State, [Plugin], Upgrade),
- {no_cycle, Sorted} = rebar_prv_install_deps:find_cycles(Apps),
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <ctype.h>
#include <assert.h>
typedef struct {
unsigned char val; /* 6-bit "spec" value or internal value */
unsigned int rest; /* additional word */
@jbalint
jbalint / pjscrape.js
Created December 8, 2011 23:43
pjscrape error handling
// run the scrape
page.open(url, function(status) {
// check for load errors
if (status != "success") {
log.error('Page did not load (status=' + status + '): ' + url);
complete(false);
}
// look for 4xx or 5xx status codes
var statusCodeStart = String(page.resource.status).charAt(0);
if (statusCodeStart == '4' || statusCodeStart == '5') {