Skip to content

Instantly share code, notes, and snippets.

@ophers
ophers / setup.py
Created January 22, 2020 12:51
Produce a Python Wheel without sources with CLI option --exclude-source-files
import os
from distutils import log
from setuptools import setup, find_packages
from setuptools.command.build_py import build_py as _build_py
from wheel.bdist_wheel import bdist_wheel as _bdist_wheel
from wheel.pep425tags import get_impl_ver
class build_py(_build_py):
def initialize_options(self):
@ophers
ophers / computeLevenshtein.java
Last active August 29, 2015 14:27
[Java Lambda MOOC] Lesson 3 solution
static int[][] computeLevenshtein(List<String> wordList, boolean parallel, int method) {
final int LIST_SIZE = wordList.size();
int[][] distances = new int[LIST_SIZE][LIST_SIZE];
// For use with method 3
class IntTrio {
int row, col, val;
public IntTrio(int row, int col, int val) {
this.row = row;
this.col = col;
@ophers
ophers / base64fix.patch
Last active August 29, 2015 14:18
Patch for Jersey httpsclientservergrizzly example
--- src\main\java\org\glassfish\jersey\examples\httpsclientservergrizzly\RootResource.java 2015-03-11 12:39:44.000000000 +0300
+++ src\org\glassfish\jersey\examples\httpsclientservergrizzly\RootResource.java 2015-04-08 14:39:35.489000000 +0300
@@ -40,7 +40,8 @@
package org.glassfish.jersey.examples.httpsclientservergrizzly;
-import org.glassfish.jersey.internal.util.Base64;
+import java.nio.charset.Charset;
+import javax.xml.bind.DatatypeConverter;