Skip to content

Instantly share code, notes, and snippets.

View MattAlp's full-sized avatar

Matt MattAlp

View GitHub Profile
@mbostock
mbostock / .block
Last active April 2, 2026 14:19
Hierarchical Edge Bundling
license: gpl-3.0
height: 960
border: no
redirect: https://observablehq.com/@d3/hierarchical-edge-bundling
@rednaxelafx
rednaxelafx / Notes.md
Created April 1, 2012 08:48
BCI of topmost interpreter Java frame shown in HotSpot crash log may be incorrect

When the topmost frame of a Java thread is an interpreted frame, the BCI printed in the crash log may be incorrect: when it shows +0, the actual BCI may be larger than that.

The BCX stored in the frame isn't always up-to-date. It only syncs up with the BCP register (ESI on x86, R13 on x64) at a few special points, such as when calling into the runtime, or other native code, or other Java methods.

If a Java thread crashed in the interpreter itself (e.g. segfault in write barrier due to card table corruption), then the info shown for the topmost interpreted Java frame might not be up-to-date. It's necessary to check the point of crash site, and the value in the BCP register.


Relevant code:

@alexeds
alexeds / move-stashes.md
Created September 5, 2012 18:00
Move your stashes from one repo to another

Move your stashes from one repo to another


This was useful for me when we created a new branch for a new major release, but were still working on our current version as well. I cloned our repo again and kept the new project on our new branch, but also wanted to get my stashes there.

Download your stashes

git stash show -p > patch

You'll have to specify your stash and name your file whatevery you want. Do this for as all your stashes, and you'll have patch files in your pwd.

@nehaljwani
nehaljwani / AVLTree.java
Created January 3, 2014 18:40
AVLTree in Java
import java.io.*;
import java.util.*;
public class AVLTree {
public class Node {
private Node left, right, parent;
private int height = 1;
private int value;
private Node (int val) {
@landonf
landonf / strongtalk.md
Last active August 3, 2024 13:30
A brief list of Strongtalk papers

In considering where Objective-C could go, it's worthwhile to start by understanding the work that's already been done.

Below are a selection of papers from Gilad Bracha's 1990s work on Strongtalk, an extension of Smalltalk (from which Objective-C's design derives) with (among other things), stronger type-safety tooling.

What's interesting (to me, anyway), is that the work done on the Self/Strongtalk VM in the early 90s was actually bought by Sun and became the modern Java VM. When Google got started on their V8 JavaScript runtime, guess who shows up again — Lars Bak, who was the technical lead for both the Strongtalk and HotSpot Java VMs.

If we're going to be talking about how to apply "modern" (1990s!) ideas to Objective-C, we'd be wise to review the considerable work done in considering those sorts of problems in a Smalltalk-derived universe, and lifting whatever good ideas we can, and discarding

@gregsh
gregsh / - IDE Scripting.md
Last active March 12, 2026 04:26
IDE Scripting

Here are my attempts to script an IntelliJ-based IDE using javax.script.* API (ex-JSR-223).

The list of available scripting languages and engines:

  1. Groovy - built-in, via Groovy jars and <app>/lib/groovy-jsr223-xxx.jar
  2. JavaScript (Nashorn) - built-in, via Java Runtime <app>/jbr/... (deprecated and will be removed soon)
  3. JavaScript (GraalJS) - https://plugins.jetbrains.com/plugin/12548-intellij-scripting-javascript
  4. JPython - https://plugins.jetbrains.com/plugin/12471-intellij-scripting-python
  5. JRuby - https://plugins.jetbrains.com/plugin/12549-intellij-scripting-ruby
  6. Clojure - https://plugins.jetbrains.com/plugin/12469-intellij-scripting-clojure
@paulochf
paulochf / ipython_notebook_large_width.py
Last active November 14, 2024 11:23
IPython/Jupyter Notebook enlarge/change cell width
from IPython.display import display, HTML
display(HTML(data="""
<style>
div#notebook-container { width: 95%; }
div#menubar-container { width: 65%; }
div#maintoolbar-container { width: 99%; }
</style>
"""))
@loderunner
loderunner / 01-mac-profiling.md
Last active July 31, 2025 17:31
Profiling an application in Mac OS X

Profiling an application in Mac OS X

Finding which process to profile

If your system is running slowly, perhaps a process is using too much CPU time and won't let other processes run smoothly. To find out which processes are taking up a lot of CPU time, you can use Apple's Activity Monitor.

The CPU pane shows how processes are affecting CPU (processor) activity:

HotSpot Internals Wiki
https://wiki.openjdk.java.net/display/HotSpot/Main
High-level introduction to HotSpot
https://www.infoq.com/articles/Introduction-to-HotSpot
Jvm-Mechanics https://github.com/dougqh/jvm-mechanics.git
Open Heart Surgery: Analyzing and Debugging the Java HotSpot VM at the OS Level (by Volker Simonis, JavaOne 2014)
https://www.youtube.com/watch?v=k7IX_diKCEo
@RichardBronosky
RichardBronosky / pep8_cheatsheet.py
Created December 27, 2015 06:25
PEP-8 cheatsheet
#! /usr/bin/env python
# -*- coding: utf-8 -*-
"""This module's docstring summary line.
This is a multi-line docstring. Paragraphs are separated with blank lines.
Lines conform to 79-column limit.
Module and packages names should be short, lower_case_with_underscores.
Notice that this in not PEP8-cheatsheet.py