This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class DatabaseHelper extends OrmLiteSqliteOpenHelper | |
{ | |
private static DatabaseHelper instance; | |
public static synchronized DatabaseHelper getHelper(Context context) | |
{ | |
if (instance == null) | |
instance = new DatabaseHelper(context); | |
return instance; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Cheat sheet for UML diagramming: From http://broken.build/assets/images/posts/cheat_sheet4.png |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Collection; | |
import java.util.List; | |
import java.util.Scanner; | |
public final class Scratch { | |
public static final String CORRECT_CLASS_NAME = List.class.getCanonicalName(); | |
public static final String INCORRECT_CLASS_NAME = Scanner.class.getCanonicalName(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class MatlabTimeHelper { | |
public static final int UNIX_EPOCH_START_MATLAB_DAYS = 719529; | |
public static long matlabToMillis(double matlab) { | |
return (long) (matlab - UNIX_EPOCH_START_MATLAB_DAYS) * 24 * 3600 * 1000; | |
} | |
public static double millisToMatlab(long millis) { | |
return millis / (24.0 * 3600 * 1000) + UNIX_EPOCH_START_MATLAB_DAYS; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env node | |
/** | |
* This is a wrapper to the `antora generate` command line tool that adds some | |
* functionality not otherwise present in antora. | |
* | |
* Before getting into that, one restriction is that the playbook.yml file MUST | |
* be the first argument to this command, otherwise this script will not work | |
* correctly. Other than that small restriction, all other uses of | |
* `antora generate` are supported here. | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from dataclasses import is_dataclass | |
from typing import TypeVar, Type, Callable, List, Dict, Any | |
_T = TypeVar("_T") | |
_Self = TypeVar("_Self") | |
_VarArgs = List[Any] | |
_KWArgs = Dict[str, Any] | |
def _kwarg_only_init_wrapper( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import asyncio | |
import datetime as dt | |
import logging | |
import os | |
import pyracing | |
import sys | |
from pyracing.client import Client | |
from pyracing.response_objects.chart_data import IRating | |
from pyracing.constants import ChartType | |
from pyracing.constants import Category |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Task to get current version of the project. | |
task version(type: VersionTask) | |
class VersionTask extends DefaultTask { | |
@TaskAction | |
def version() { | |
println project.version | |
} | |
} |
OlderNewer