Skip to content

Instantly share code, notes, and snippets.

View Jacke's full-sized avatar
πŸ‘€
Mastermind

Stan Sobolev Jacke

πŸ‘€
Mastermind
View GitHub Profile
@Jacke
Jacke / JOIN FOREIGN.md
Created January 2, 2022 16:43 — forked from joelonsql/JOIN FOREIGN.md
SQL language proposal: JOIN FOREIGN

SQL language proposal: JOIN FOREIGN

The idea is to improve the SQL language, specifically the join syntax, for the special but common case when joining on foreign key columns.

The problem

Example below taken from PostgreSQL documentation [1]

In SQL-89, we didn't have any JOIN syntax yet, so queries were written in this way:

JNI Example (Mac OS)

JNI (Java Native Interface) allows implementing methods in C/C++, and use them in Java.

1. Create JNIExample.java file

class JNIExample {

  // Native method, no body.
@Jacke
Jacke / HelloJNI.java
Created July 18, 2021 13:31 — forked from santa4nt/HelloJNI.java
Sample JNI/C++ HelloWorld
public class HelloJNI {
static {
System.loadLibrary("hello"); // loads libhello.so
}
private native void sayHello(String name);
public static void main(String[] args) {
new HelloJNI().sayHello("Dave");
}
@Jacke
Jacke / upper_type_bound.scala
Created July 13, 2021 23:25
upper_type_bound ART
abstract class Animal {
def name: String
}
abstract class Pet extends Animal {}
class Cat extends Pet {
override def name: String = "Cat"
}
@Jacke
Jacke / graph.scala
Created July 13, 2021 21:46
Graph Abstract with Subclasses
class Graph {
class Node {
var connectedNodes: List[Graph#Node] = Nil
def connectTo(node: Graph#Node): Unit = {
if (!connectedNodes.exists(node.equals)) {
connectedNodes = node :: connectedNodes
}
}
}
var nodes: List[Node] = Nil
@Jacke
Jacke / README.md
Created July 13, 2021 16:40 — forked from acamino/README.md
Shortcuts to Improve Your Bash & Zsh Productivity

Shortcut β€” Action

  • CTRL + A β€” Move to the beginning of the line
  • CTRL + E β€” Move to the end of the line
  • CTRL + [left arrow] β€” Move one word backward (on some systems this is ALT + B)
  • CTRL + [right arrow] β€” Move one word forward (on some systems this is ALT + F)
  • CTRL + U β€” (bash) Clear the characters on the line before the current cursor position
  • CTRL + U β€”(zsh) If you're using the zsh, this will clear the entire line
  • CTRL + K β€” Clear the characters on the line after the current cursor position
  • ESC + [backspace] β€” Delete the word in front of the cursor
import io.Source
import scala.util.control.Breaks._
/**
* Scala TicTacToe game without any side effects
*
* Written in response to following post (which also contains task description):
* http://blog.tmorris.net/scala-exercise-with-types-and-abstraction/
*/
object TicTacToe {
@Jacke
Jacke / index.md
Created June 12, 2021 16:15 — forked from dacr/index.md
Programming knowledge base examples overview / published by https://github.com/dacr/code-examples-manager #cafacafe-cafecafe/cf07135554d29ae9497b6ecda36b9d37bbb70507

Code examples knowledge base

akka

  • akka-actors-hello-world.sc : Simple akka hello world example
  • akka-http-client-json-stream.sc : Fully asynchronous http client call with json streamed response using akka-http will work in all cases, even with chunked responses !
  • akka-http-client-json-with-proxy.sc : Fully asynchronous http client call with json response using akka-http will work in all cases, even with chunked responses, this example add automatic http proxy support.
  • akka-http-client-json.sc : Fully asynchronous http client call with json response using akka-http will work in all cases, even with chunked responses !
  • [akka-http-client-s
@Jacke
Jacke / relational.js
Created May 14, 2021 20:17 — forked from aos/relational.js
Relational Database Normalization
/* Relational (SQL) Database Normalization
Normalization:
- Every non-key attribute must provide a fact about the key, the whole key, and nothing but the key. (3NF)
- Reduction and elimination of redundant data
- Example: A post in a blog, each post will have an author e-mail but if you needed to update the e-mail address of 'Andrew', you should only have to do it once (and not for each post).
Examples of un-normalized databases:
(https://en.wikipedia.org/wiki/Database_normalization)