Skip to content

Instantly share code, notes, and snippets.

View josep2's full-sized avatar
🎯
Focusing

Jowanza Joseph josep2

🎯
Focusing
View GitHub Profile
@mitchellh
mitchellh / RadixTrees.tla
Last active June 30, 2021 15:01
Radix tree and validation in TLA+
This module contains operations for working with radix trees. A radix tree
is a data structure for efficient storage and lookup of values that often
share prefixes, typically used with strings.
A common question when I show this to people is: how do I add to the tree?
delete? update? For these, grab the Range of the tree, use set logic to
add/remove any elements, and construct a new tree with RadixTree.
For educational purposes, I've heavily commented all the operations. I
recommend using the constant expression evaluator to try the building blocks

Quick Tips for Fast Code on the JVM

I was talking to a coworker recently about general techniques that almost always form the core of any effort to write very fast, down-to-the-metal hot path code on the JVM, and they pointed out that there really isn't a particularly good place to go for this information. It occurred to me that, really, I had more or less picked up all of it by word of mouth and experience, and there just aren't any good reference sources on the topic. So… here's my word of mouth.

This is by no means a comprehensive gist. It's also important to understand that the techniques that I outline in here are not 100% absolute either. Performance on the JVM is an incredibly complicated subject, and while there are rules that almost always hold true, the "almost" remains very salient. Also, for many or even most applications, there will be other techniques that I'm not mentioning which will have a greater impact. JMH, Java Flight Recorder, and a good profiler are your very best friend! Mea

./bin/drill-embedded                                                                                           
OpenJDK 64-Bit Server VM warning: ignoring option MaxPermSize=512M; support was removed in 8.0
Apr 19, 2017 4:53:50 PM org.glassfish.jersey.server.ApplicationHandler initialize
INFO: Initiating Jersey application, version Jersey: 2.8 2014-04-29 01:25:26...
apache drill 1.10.0 
"drill baby drill"

Now visit link http://localhost:8047 to open up Apache Drill explorer and configure S3 storage plugin refer

package org.deeplearning4j.examples.dataExamples;
import org.datavec.api.io.labels.ParentPathLabelGenerator;
import org.datavec.api.records.listener.impl.LogRecordListener;
import org.datavec.api.split.FileSplit;
import org.datavec.image.loader.NativeImageLoader;
import org.datavec.image.recordreader.ImageRecordReader;
import org.deeplearning4j.datasets.datavec.RecordReaderDataSetIterator;
import org.deeplearning4j.eval.Evaluation;
import org.deeplearning4j.nn.api.OptimizationAlgorithm;
library(idbr)
library(dplyr)
library(ggplot2)
library(tidyr)
library(countrycode)
library(gganimate)
library(tweenr)
ctrys <- countrycode(c('South Africa', 'Botswana', 'Lesotho', 'Namibia', 'Zimbabwe', 'Swaziland'),
'country.name', 'fips104')
@hrbrmstr
hrbrmstr / aplot.png
Last active March 27, 2016 03:37
Nuclear Explosions
aplot.png

Shiny app to highlight on a Leaflet map by brushing a Plotly chart. Run for yourself with (provided all of the packages are installed):

shiny::runGist('da941dac84f730adcdde')

To get this to work on another dataset, you're going to need to have a sequential ID variable that matches the pointNumber column in the data frame generated by Plotly's event_data. See the setup.R script for how this was derived.

@dwickstrom
dwickstrom / nightmare.sh
Last active December 22, 2018 01:27
NightmareJS - install Electron on Ubuntu 14.04
apt-get -y update
apt-get -y upgrade
apt-get -y --force-yes install make unzip g++ libssl-dev git xvfb x11-xkb-utils xfonts-100dpi xfonts-75dpi xfonts-scalable xfonts-cyrillic x11-apps clang libdbus-1-dev libgtk2.0-dev libnotify-dev libgnome-keyring-dev libgconf2-dev libasound2-dev libcap-dev libcups2-dev libxtst-dev libxss1 libnss3-dev gcc-multilib g++-multilib
npm -f init
npm i -S nightmare
xvfb-run nodejs index.js
@jeffThompson
jeffThompson / Apollo11GuidanceComputerVertAndNounList.txt
Created February 15, 2016 16:32
A list of "nouns" and "verbs" to control the Apollo 11 guidance computer.
APOLLO 11 GUIDANCE COMPUTER: VERB AND NOUN LIST
https://en.wikipedia.org/wiki/Apollo_Guidance_Computer#/media/File:Agc_verb-noun-list.jpg
VERB LIST
50 PLEASE PERFORM
51 PLEASE MARK
53 PLEASE MARK ALT LOG
54 REND COAS MARK
56 TERMINATE P20
58 STICKFLAG (R) V50N18 FLAG(S)
@sprintingdev
sprintingdev / scraper.js
Created May 29, 2015 00:30
jasmine-node Asynchronous callback unit testing
var request = require("require"); //request npm module
var Scraper = function() {
};
Scraper.prototype.scrape = function(url, callback) {
request(url, function responseCallback(error, response, html) {
if(error) {
callback(error);
} else {
console.log(html);