First of all, make sure you have Oracle's Java installed. (installing Java is outside the scope of this tutorial).
-
First of all, start by downloading the java3d linux binaries on http://java3d.java.net/binary-builds.html
-
Secondly, unzip it:
{ | |
"uid": "1525548425", | |
"predictions": [ | |
{ | |
"trait": "Relationship_Married", | |
"value": 0.1472537849883816 | |
}, | |
{ | |
"trait": "Concentration_Journalism", | |
"value": 0.10400347649614775 |
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
# | |
# This program is free software; you can redistribute it and/or modify | |
# it under the terms of the GNU General Public License as published by | |
# the Free Software Foundation; either version 2 of the License, or | |
# (at your option) any later version. | |
# | |
# This program is distributed in the hope that it will be useful, | |
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
import math | |
pi = math.pi | |
cos = math.cos | |
def f(x): | |
return cos(pi*(x+1)/8.0) + (0.148*(x)) -0.9062 | |
def mod(x): | |
if x > 0: |
from gi.repository import Gtk | |
def log_key_events(widget, event): | |
print(event.get_keyval()[1]) | |
w = Gtk.Window() | |
w.connect('key-press-event', log_key_events) | |
w.show() |
const GdkPixbuf = imports.gi.GdkPixbuf; | |
const Gtk = imports.gi.Gtk; | |
const Lang = imports.lang; | |
Gtk.init(null, 0); | |
let test_window = new Gtk.Window({ | |
default_width: 128, | |
default_height: 128 |
const ByteArray = imports.byteArray; | |
const Gio = imports.gi.Gio; | |
const Lang = imports.lang; | |
const Mainloop = imports.mainloop; | |
let byteArray = ByteArray.fromString('lala');; | |
let file = Gio.file_new_for_path("output.json"); | |
file.replace_contents_async(byteArray, null, false, Gio.FileCreateFlags.REPLACE_DESTINATION, null, | |
Lang.bind(this, function() { | |
log("bye!"); |
const Gtk = imports.gi.Gtk; | |
const Lang = imports.lang; | |
Gtk.init(null, 0); | |
print("Gtk Version: " + Gtk.MAJOR_VERSION +"."+Gtk.MINOR_VERSION+"."+Gtk.MICRO_VERSION); | |
let test_window = new Gtk.Window({ | |
default_width: 800, | |
default_height: 600 |
First of all, make sure you have Oracle's Java installed. (installing Java is outside the scope of this tutorial).
First of all, start by downloading the java3d linux binaries on http://java3d.java.net/binary-builds.html
Secondly, unzip it:
// Updated in August 2022 | |
imports.gi.versions.Gtk = '3.0'; | |
const { Gtk, GObject, WebKit2: WebKit } = imports.gi; | |
Gtk.init(null); | |
const WebBrowser = GObject.registerClass( | |
class WebBrowser extends Gtk.Application { |