Skip to content

Instantly share code, notes, and snippets.

View joshuamzm's full-sized avatar
🎩

Joshua Mendoza joshuamzm

🎩
  • Mexico
View GitHub Profile
@joshuamzm
joshuamzm / type_inference_prolog
Last active August 29, 2015 14:20
Inferencia de tipos en Prolog
type_of(_, true, bool).
type_of(_, false, bool).
type_of(_, X, num) :- integer(X).
type_of(_, "s1", str).
type_of(_, "s2", str).
type_of(_, "s3", str).
type_of(G, X, Y) :- nonvar(X), has_type(G, X, Y).
has_type([[X, Y]|_], X, Y).
has_type([_|T], X, Y) :- has_type(T, X, Y).
/** Convolves the float image <code>ip</code> with a kernel of width
<code>kw</code> and height <code>kh</code>. Returns false if
the user cancels the operation by pressing 'Esc'. */
public boolean convolveFloat(ImageProcessor ip, float[] kernel, int kw, int kh) {
if (!(ip instanceof FloatProcessor))
throw new IllegalArgumentException("FloatProcessor required");
if (canceled) return false;
int width = ip.getWidth();
int height = ip.getHeight();
Rectangle r = ip.getRoi();
❯ jrubyfx-generator Dummy.fxml Dummy.rb Dummy ✹ ✭
Generating JRubyFX template for Dummy.fxml into Dummy.rb... Done!
Launching 'jruby Dummy.rb' ...
Exception running Application:
#<NoMethodError: undefined method `int' for RubyWrapperBeanAdapter:Class>
/home/joshua/.rvm/gems/jruby-1.7.18/gems/jrubyfx-fxmlloader-0.4-java/lib/fxmlloader/rrba.rb:607:in `getConstantValue'
/home/joshua/.rvm/gems/jruby-1.7.18/gems/jrubyfx-fxmlloader-0.4-java/lib/fxmlloader/real_elts.rb:85:in `constructValue'
/home/joshua/.rvm/gems/jruby-1.7.18/gems/jrubyfx-fxmlloader-0.4-java/lib/fxmlloader/value_elts.rb:62:in `processStartElement'
/home/joshua/.rvm/gems/jruby-1.7.18/gems/jrubyfx-fxmlloader-0.4-java/lib/jrubyfx-fxmlloader.rb:440:in `processStartElement'
/home/joshua/.rvm/gems/jruby-1.7.18/gems/jrubyfx-fxmlloader-0.4-java/lib/jrubyfx-fxmlloader.rb:351:in `load'
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.scene.image.*?>
<?import javafx.scene.control.*?>
<?import java.lang.*?>
<?import javafx.scene.layout.*?>
<BorderPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="300.0" minWidth="500.0" prefHeight="400.0" prefWidth="600.0" xmlns="http://javafx.com/javafx/8.0.40-ea" xmlns:fx="http://javafx.com/fxml/1">
<top>
<VBox prefWidth="100.0" BorderPane.alignment="CENTER">
/usr/lib/x86_64-linux-gnu/libsqlite3.so.0.8.6
/usr/lib/x86_64-linux-gnu/apr-util-1/apr_dbd_sqlite3-1.so
/usr/lib/x86_64-linux-gnu/apr-util-1/apr_dbd_sqlite3.so
/usr/lib/x86_64-linux-gnu/libsqlite3.so
/usr/lib/x86_64-linux-gnu/qt4/plugins/sqldrivers/libqsqlite.so
/usr/lib/x86_64-linux-gnu/pkgconfig/sqlite3.pc
/usr/lib/x86_64-linux-gnu/libsqlite3.la
/usr/lib/x86_64-linux-gnu/libsqlite3.so.0
/usr/lib/x86_64-linux-gnu/qt5/plugins/sqldrivers/libqsqlite.so
/usr/lib/x86_64-linux-gnu/libsqlite3.a
$ rake db:migrate
rake aborted!
Java::JavaLang::UnsatisfiedLinkError: org.sqlite.core.NativeDB._open(Ljava/lang/String;I)V
org.sqlite.core.NativeDB._open(Native Method)
org.sqlite.core.DB.open(org/sqlite/core/DB.java:161)
org.sqlite.core.CoreConnection.open(org/sqlite/core/CoreConnection.java:145)
org.sqlite.core.CoreConnection.<init>(org/sqlite/core/CoreConnection.java:66)
org.sqlite.jdbc3.JDBC3Connection.<init>(org/sqlite/jdbc3/JDBC3Connection.java:21)
org.sqlite.jdbc4.JDBC4Connection.<init>(org/sqlite/jdbc4/JDBC4Connection.java:23)
org.sqlite.SQLiteConnection.<init>(org/sqlite/SQLiteConnection.java:45)