This file contains hidden or 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.lang.annotation.Retention; | |
import java.lang.annotation.RetentionPolicy; | |
/** | |
* Created by Red8 on 20/03/2018. | |
*/ | |
@Retention(RetentionPolicy.RUNTIME) | |
public @interface Inject { | |
Class clazz(); | |
} |
This file contains hidden or 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.io.IOException; | |
import java.io.InputStream; | |
public class BufferedInputStream extends InputStream { | |
private InputStream inputStream; | |
private byte[] buffer = new byte[5]; | |
private int start; | |
private int count; | |
public BufferedInputStream(InputStream inputStream) { |
This file contains hidden or 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.io.*; | |
import java.time.LocalDateTime; | |
import java.time.format.DateTimeFormatter; | |
import java.util.ArrayList; | |
public class LogAnalyzer { | |
public ArrayList<LogToken> getSuitableLogTokensFromFile(String path, LocalDateTime timeFrom, LocalDateTime timeTo) throws IOException { | |
ArrayList<LogToken> logTokens = new ArrayList<>(); | |
BufferedReader bufferedReader = new BufferedReader(new FileReader(path)); |
This file contains hidden or 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.ArrayList; | |
import java.util.Iterator; | |
import java.util.List; | |
public class HashMap<K, V> implements Map<K, V> { | |
@SuppressWarnings("unchecked") | |
private List<Entry<K, V>>[] buckets = new List[5]; | |
private int size; | |
public HashMap() { |
This file contains hidden or 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.NoSuchElementException; | |
public class ArrayQueue extends Queue { | |
private Object[] array = new Object[5]; | |
private int pointStart; | |
private void addCapacity() { | |
Object[] newArray = new Object[(int) (1.5 * array.length)]; | |
System.arraycopy(array, 0, newArray, 0, size); | |
array = newArray; |
This file contains hidden or 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 DecToBinary { | |
String getBinary(int number, int outputLength){ | |
if (number==0){ | |
return "0"; | |
} | |
String strNumber = ""; | |
while (!((number/2==0)&&(number%2==1))){ | |
strNumber = (number % 2) + strNumber; | |
number = number / 2; | |
} |
This file contains hidden or 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
uses Registry; | |
procedure getCOM_ports(); | |
var | |
reg: TRegistry; | |
st: Tstrings; | |
begin | |
reg := TRegistry.Create(KEY_READ); | |
try | |
reg.RootKey := HKEY_LOCAL_MACHINE; |
This file contains hidden or 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
/* | |
The name + type results of these queries will be used by the Code Assistant | |
if the "Describe Context" option is enabled. After typing 3 or more characters | |
the Code Assistant will show a list of matching names. | |
Separate multiple queries with semi-colons and use the :schema bind variable | |
to restrict names to the currently connected user. | |
In case of an error the query results will be omitted. No error message will | |
be displayed. | |
Place this file in the PL/SQL Developer installation directory for all users, | |
or in the "%APPDATA%\PLSQL Developer" directory for a specific user. |
This file contains hidden or 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
#include <Servo.h> | |
Servo myservo; | |
int enableA = 1; | |
int pinA1 = 3; | |
int pinA2 = 2; | |
int servposnum = 0; | |
int servpos = 0; | |
int enableB = 6; |
This file contains hidden or 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
int enableA = 1; | |
int pinA1 = 3; | |
int pinA2 = 2; | |
int enableB = 6; | |
int pinB1 = 5; | |
int pinB2 = 4; | |
char state = '0'; |