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
@Component | |
@Order(Ordered.HIGHEST_PRECEDENCE) | |
@SuppressWarnings({"unchecked", "rawtypes"}) | |
static final class StringToEnumConverterFactory implements ConverterFactory<String, Enum> { | |
@Override | |
public <T extends Enum> Converter<String, T> getConverter(Class<T> targetType) { | |
return new StringToEnum(getEnumType(targetType)); | |
} |
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.Arrays; | |
import java.util.stream.Collectors; | |
import java.util.stream.IntStream; | |
public class LargestNumber | |
{ | |
public static void main(String[] args) | |
{ | |
String number = IntStream.range(1, 31) | |
.mapToObj(String::valueOf) |
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
using System.IO; | |
public static class Misc | |
{ | |
/// <summary> | |
/// Calculates the checksum on a v0.90 MD superblock. | |
/// Don't ask me why I needed it. | |
/// </summary> | |
/// <param name="filename"> |
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
#!/bin/bash | |
if [ "$#" -lt 1 ] | |
then | |
echo "Usage: fix.sh <folder> [folder]...\n" | |
exit 1 | |
fi | |
for d in $@ | |
do |
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
package com.cmosis.test; | |
import java.util.Comparator; | |
public class NaturalOrderComparator implements Comparator<String> | |
{ | |
static char charAt(String s, int i) | |
{ | |
if (i >= s.length()) | |
return 0; |
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.Iterator; | |
import java.util.NoSuchElementException; | |
public class IteratorWithCurrent<E> implements Iterator<E> | |
{ | |
private final Iterator<E> it; | |
private E current; | |
public IteratorWithCurrent(Iterable<E> iterable) { | |
it = iterable.iterator(); |
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
<?php | |
class EAN13render | |
{ | |
// These are the different barcode patterns for each digit (7 bit each). | |
// '1' represents a black line, '0' represents white (no line). | |
static $Rcodes = array('1110010', '1100110', '1101100', '1000010', '1011100', | |
'1001110', '1010000', '1000100', '1001000', '1110100'); | |
// The EAN13 defines three groups of bit patterns. |
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
{ ----------------- SubRip 1.17 source ------------------- | |
Copyright (C) 2002 Brain | |
www.subrip.fr.st | |
submagic@netcourrier.com | |
See Unit01.pas for licence information. | |
} | |
unit Unit10; |
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
<?php | |
// Startup database | |
require_once 'Vacature/Autoloader.php'; | |
Vacature_Autoloader::getInstance(); | |
$mssqlconfig = Vacature_Config::get("db.mssql"); | |
$db = Zend_Db::factory($mssqlconfig); | |
if (isset($_SESSION['profiler'])) | |
$db->getProfiler()->setEnabled(true); | |
// Set encoding |
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 sealed class UnionFind<T> | |
{ | |
private sealed class Link<TLink> | |
{ | |
public TLink parent; | |
public int rank = 0; | |
public Link(TLink parent) | |
{ | |
this.parent = parent; |