text stringlengths 14 410k | label int32 0 9 |
|---|---|
public void addEffectToGrid(Effect effect) {
if (effect == null)
throw new IllegalArgumentException("Effect can't be null!");
if (effects.contains(effect))
throw new IllegalArgumentException("The argument is already on the grid!");
if (!validPosition(effect.getPosition()))
throw new IllegalArgumentExcept... | 3 |
private int modifyFile(BufferedWriter out, Object fileToModify, int fileSize, int... bytesStart) throws IOException {
int dataModified = 0;
ArrayList<ByteRange> ranges = new ArrayList<ByteRange>();
for (int byteStart : bytesStart) {
// int byteStart = this.getRealisticByteModification(fileSize);
int byteE... | 2 |
@Override
public int getHeight() {
int height = 0;
if (this.fontmetrics != null) {
height = this.fontmetrics.getHeight();
}
return height;
} | 1 |
public static boolean isOwner(final CommandSender sender, final Region region) {
if (sender.hasPermission("simpleregions.override.commands")) return true;
if ((sender instanceof Player) && region.owners.inherits(sender)) return true;
return false;
} | 3 |
@Override
protected void updateComponent(long currentTime) {
Card thisTopPlayCard = Game.linkedGet().getPlayPile().peek();
ArrayList<Card> thisCurrentHand = (Game.linkedGet().getCurrentPlayer() == null) ? null : (ArrayList<Card>) Game.linkedGet().getCurrentPlayer().getCards().clone();
if ((... | 4 |
public Color getCityColor(Fraktion f) {
if (f == Fraktion.Blau) {
return blau;
} else if (f == Fraktion.Rot) {
return rot;
}
return neutralColor;
} | 2 |
public void cargarEstudianteActualizar(int cedula) {
String sql = "select * from actualizar(" + cedula + ")";
try {
conexion.consultar(sql);
while (conexion.getRes().next()) {
this.setNombre(conexion.getRes().getString(1));
this.setApellido(conexio... | 6 |
public String toString() {
StringBuilder sb = new StringBuilder();
for (Vehicle v: this.getCars()) {
sb.append(v.toString());
}
return "Road(" + this.hashCode() + "): " + sb.toString();
} | 1 |
@XmlElementDecl(namespace = "http://www.rsasecurity.com/rsalabs/pkcs/schemas/pkcs-5v2-0#", name = "PBKDF2-params")
public JAXBElement<PBKDF2ParameterType> createPBKDF2Params(PBKDF2ParameterType value) {
return new JAXBElement<PBKDF2ParameterType>(_PBKDF2Params_QNAME, PBKDF2ParameterType.class, null, value);... | 0 |
public String[] setTribeNames(String tribeOne, String tribeTwo){
// temp tribe vars.
String oldT1 = tribeNames[0];
String oldT2 = tribeNames[1];
// set the new tribes (Contestant requires this)
tribeNames[0] = Utils.strCapitalize(tribeOne.toLowerCase().trim());
tribeNames[1] = Utils.strCapitalize(tribeTwo.t... | 5 |
public int getTurnCount() {
boolean test = false;
if (test || m_test) {
System.out.println("Game :: getTurnCount() BEGIN");
}
if (test || m_test) {
System.out.println("Game :: getTurnCount() END");
}
return m_turnCount;
} | 4 |
private void acceptNewClient()
{
System.out.println("Waiting for a new client");
(new Thread()
{
@Override
public void run()
{
try
{
Client c = new Client(server.accept());
clients.add(c);
System.out.println("Client " + c + " accepted");
System.out.println(clients.size() +... | 6 |
public static void main(String[] args) throws Exception
{
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
ArrayList<String> words = new ArrayList<String>();
for (int i = 0; i < 20; i++)
{
words.add(reader.readLine());
}
Map<... | 2 |
@Override
protected Transferable createTransferable(JComponent c) {
Transferable t = null;
if (c instanceof JList) {
@SuppressWarnings("unchecked")
JList<RosterComponent> list = (JList<RosterComponent>) c;
Object value = new RosterTransferComponent(list.getSelectedValue());
... | 2 |
@Override
public boolean equals(Object o)
{
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Player player = (Player) o;
if (power != player.power) return false;
if (size != player.size) return false;
if (name != null ? !nam... | 9 |
public void Compute(HashMap<Integer, Integer> events){
m_coordinates.setX(m_coordinates.getX() + Math.round(m_velocity.X()));
m_coordinates.setY(m_coordinates.getY() + Math.round(m_velocity.Y()));
if((m_coordinates.getX() < 0 ) || (m_coordinates.getX() > Physics.MAX_X) || (m_coordinates.getY() ... | 4 |
public static String getWord() {
skipWhitespace();
StringBuffer str = new StringBuffer(50);
char ch = lookChar();
while (ch == EOF || !Character.isWhitespace(ch)) {
str.append(readChar());
ch = lookChar();
}
return str.toString();
} | 2 |
public String formatPlayTimeLeft(Player p, int min, int sec){
if(p.hasPermission(DeityNether.OVERRIDE_PERMISSION)){
return cu.format(lang.getString("nether.time.play.override").replaceAll("%header", getHeader()));
}else if(p.hasPermission(DeityNether.GENERAL_PERMISSION)){
String m = "";
String s = "";
i... | 4 |
@Override
public int compareTo(LabelGeneOverlap o) {
double difference = o.overlapArea-overlapArea;
if(difference==0){
return 0;
}
if(difference<0){
return -1;
}
return 1;
} | 2 |
private static List<String> makePluginNameList(final Map<?, ?> map,
final String key) throws InvalidDescriptionException {
final Object value = map.get(key);
if (value == null) {
return new GapList<>();
}
final GapList<String> pluginNameList = new GapList<>();
try {
for (final Object entry : (Iterabl... | 7 |
public boolean equals(Vector4f v) {
if (this.x == v.getX() && this.y == v.getY() && this.z == v.getZ() && this.w == v.getW())
return true;
return false;
} | 4 |
public void triggerEvent(final DTimer event) {
List<DTimerListener> eventListeners = this.listeners.get(event
.getEventName());
if (eventListeners == null || eventListeners.size() == 0) {
// debug no list
}
for (final DTimerListener listener : eventListeners) ... | 4 |
public void setFooArray(T[] fooArray)
{
this.fooArray = fooArray;
} | 0 |
public JComponent getGui() {
if (gui==null) {
Map<Key, Object> hintsMap = new HashMap<RenderingHints.Key,Object>();
hintsMap.put(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY);
hintsMap.put(RenderingHints.KEY_DITHERING, RenderingHints.VALUE_DITHER_ENABLE);... | 7 |
boolean isLegalCharacter(char c)
{
// CheckStyle:MagicNumber OFF
if (c == 0x9 || c == 0xA || c == 0xD)
{
return true;
}
else if (c < 0x20)
{
return false;
}
else if (c <= 0xD7FF)
{
return true;
}
else if (c < 0xE000)
{
return false;
}
else if (c <= 0xFFFD)
{
return true;
... | 7 |
public void generate(String year, String title, ArrayList<String> authors,
ArrayList<String> categories, String shortDescription,
String dpublic, String age, ArrayList<String> notes, String gamePlay,
String gameRules) {
Element xmlRoot = new Element("infos");
Element ... | 4 |
public boolean similar(Object other) {
if (!(other instanceof JSONArray)) {
return false;
}
int len = this.length();
if (len != ((JSONArray)other).length()) {
return false;
}
for (int i = 0; i < len; i += 1) {
Object valueThis = this.ge... | 8 |
private float[][][] cuboidResponse(List<IplImage> gaussianList, double omega)
{
if(gaussianList == null || gaussianList.size() == 0)
{
return null;
}
IplImage firstIamge = gaussianList.get(0);
int width = firstIamge.width();
int height = firstIamge.height();
int length = gaussianList.size();
floa... | 9 |
public V getFinalValue() {
if (isSetValue()) { return value; }
return defaultValue;
} | 1 |
public static ListNode removeDuplicatesSolutionTwo(ListNode head) {
if (head == null || head.next == null) {
return head;
}
/* PHASE #1: Count number of appearances for each element */
Map<Integer, Integer> counts = new HashMap<Integer, Integer>();
ListNode ptr = head;
while (ptr != null) {
... | 7 |
@Override
protected void onKick(String channel, String kickerNick, String kickerLogin, String kickerHostname, String recipientNick, String reason) {
if ( recipientNick.equals( getNick() ) ) {
joinChannel(channel);
sendMessage(channel, kickerNick + ": polib si elipsy");
}
... | 1 |
public static int getIntValue(String value) {
if(value != null) {
try {
return Integer.parseInt(value);
} catch(NumberFormatException exception) {}
}
throw new IllegalArgumentException("Invalid value");
} | 2 |
public Rectangle getFirstCorner() {
return firstCorner;
} | 0 |
public static Timestamp getDatahMaxPesquisa() throws SQLException, ClassNotFoundException {
ResultSet rs;
Timestamp z = null;
Connection conPol = conMgr.getConnection("PD");
if (conPol == null) {
throw new SQLException("Numero Maximo de Conexoes Atingida!");
}
... | 3 |
@SuppressWarnings("deprecation")
public static void main(String[] args)
{
//declare variables
//tracks number of incorrect answers
int failures=0;
//number of allowed failures
int numOfFailures=7;
//temp word, will come from a file or database in the end
String word="Love";
StringBuilder visible... | 7 |
private void showTip() {
String text = null;
tooltipowner = null;
String classname = getClass(mouseinside);
if ((classname == "tabbedpane") || (classname == "menubar") || (classname == ":popup")) {
if (insidepart != null) {
text = getString(insidepart, "tooltip", null);
}
}
else if (classname == "... | 9 |
@Override
public synchronized void send(String s) throws RemoteException {
ClientService chatClient = null;
for(String username : chatClients){
try {
chatClient = (ClientService) Naming.lookup(username);
chatClient.send(s);
} catch (MalformedURLException e) {
e.printStackTrace();
} catch (NotB... | 3 |
@Override
public void onKeyDown(char key, int keyCode, boolean coded)
{
if (coded)
{
// Turns with left / right arrowkey
if (keyCode == KeyEvent.VK_LEFT)
{
//System.out.println(calculateTurning());
turn(calculateTurning());
}
else if (keyCode == KeyEvent.VK_RIGHT)
turn(-calculateTurning... | 6 |
public static double evaluateAveragePrecision( HashMap<String, HashMap<Integer,Double>> relevance_judgments,
String path){
double value = 0.0;
double AP = 0.0;
int RR = 0;
int i=0;
try {
BufferedReader reader = new Bu... | 7 |
public void setAttackValue(int x, int y, int value, String player)
{
WorldChunk chunk = getChunkAt(x,y, false);
if(chunk == null)
return;
if(this.worldType == WorldType.CLIENT && !handlingChanges)
{
// if(NettyClientHandler.current != null)
// ... | 5 |
private static Map<String, String> loadSeedProducts(String seedFileName) throws Exception {
int totalRows = 0, badUPCCount = 0, badProductIdCount = 0;
Map<String, String> products = new LinkedHashMap<String, String>();
XSSFWorkbook wb = readFile(seedFileName);
for (int k = 0; k < 1; k++) {
XSSFSheet sheet... | 6 |
@Override
/**
* Returns true if managed to find a free square adjacent to target, and teleport there.
* False if none found.
*/
public boolean execute(Entity actor, Entity target, Parameters context) {
if(!(actor instanceof game.objects.Unit)){
throw new IllegalStateException("TeleportToTarget effect is o... | 6 |
public JMenu getMnChat() {
if (mnChat == null) {
mnChat = new JMenu("Chat");
mnChat.add(getMntmConectar());
mnChat.add(getMntmDesconectar());
mnChat.add(getMntmSalir());
}
return mnChat;
} | 1 |
@Override
protected void onComplete() {
if (!cancelled) {
if (soundAtEnd != null)
soundAtEnd.play();
//end.setResource(transform);
panel.remove(moving);
}
} | 2 |
@Override
public void run() {
int i = 0;
try {
listenerSocket = new ServerSocket(port);
Socket socket;
EIError.debugMsg("Listening");
gameController.showMessage("Success", "Waiting for incoming connection...");
gameController.multiplayer... | 5 |
public boolean contains(Object li) {
li = ((LocalInfo) li).getLocalInfo();
for (int i = 0; i < count; i++)
if (locals[i].getLocalInfo() == li)
return true;
return false;
} | 2 |
public int destroy(int idCrlv) throws ClassNotFoundException, ClassNotFoundException, SQLException{
int result;
con = abrirBanco(con);
PreparedStatement stm;
String sql = "delete from ipva where crlv_id_crlv = ?";
stm = con.prepareStatement(sql);
stm.setInt(1, idCrlv);
... | 1 |
public byte getPositionCode(int x, int y) {
if (rectNW.contains(x, y))
return NW;
if (rectN.contains(x, y))
return NORTH;
if (rectNE.contains(x, y))
return NE;
if (rectE.contains(x, y))
return EAST;
if (rectSE.contains(x, y))
return SE;
if (rectS.contains(x, y))
return SOUTH;
if (rectSW.... | 9 |
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (!(obj instanceof MyNode))
return false;
MyNode other = (MyNode) obj;
if (id != other.id)
return false;
return... | 4 |
private void setKey(byte[] key)
{
int[] k32e = new int[MAX_KEY_BITS/64]; // 4
int[] k32o = new int[MAX_KEY_BITS/64]; // 4
int[] sBoxKeys = new int[MAX_KEY_BITS/64]; // 4
gSubKeys = new int[TOTAL_SUBKEYS];
if (k64Cnt < 1)
{
throw new IllegalArgumentExc... | 9 |
@Override
public int hashCode() {
int hash = 0;
hash += (id != null ? id.hashCode() : 0);
return hash;
} | 1 |
private void procServerMap(Packet p) {
PacketReader pr = p.getByteBufferReader();
switch (MapPacketType.valueOf(pr.readUint8())) {
case MAP_PACKET_START:
long frameCounter = pr.readUint32();
this.expectedSaveLength = (int) pr.readUint32();
break;
case MAP_PACKET_NORMAL:
this.saveGameData = A... | 4 |
@Override
public void run() {
try {
socket = new Socket("localhost", 7000);
} catch (UnknownHostException e1) {
e1.printStackTrace();
} catch (IOException e1) {
e1.printStackTrace();
}
System.out.println(new Date() + " --> Connected to server at "
+ socket.getLocalAddress() + ":" + socket.getL... | 4 |
private Object[] getDecodedStreamBytesAndSize(int presize) {
InputStream input = getInputStreamForDecodedStreamBytes();
if (input == null)
return null;
try {
int outLength;
if (presize > 0)
outLength = presize;
else
... | 6 |
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> typeToken) {
Type type = typeToken.getType();
Class<? super T> rawType = typeToken.getRawType();
if (!Map.class.isAssignableFrom(rawType)) {
return null;
}
Class<?> rawTypeOfSrc = $Gson$Types.getRawType(type);
Type[] keyAndValueTyp... | 5 |
public static int firstIndexOfNonWhiteSpace( String string )
{
if ( isEmpty( string ) ) {
return 0;
}
int left = 0;
for ( char eachChar : string.toCharArray() ) {
if ( eachChar != ' ' && eachChar != '\t' ) {
break;
}
lef... | 4 |
public static void main(String[] args) {
// TODO Auto-generated method stub
//func = ScoreFunctionFactory.getScoreFunction("KLSum+");
Document.initialize(Document.ParseMode.POS);
String fname = "Sentiment";
String docset = ".Crawler";
if (ROOTDIR.equals("/home/graveendran/Downloads/DUC")) {
docset = ".DU... | 4 |
public void AddGlobalObj(int objectX, int objectY, int NewObjectID, int Face, int ObjectType) {
for (Player p : server.playerHandler.players)
{
if(p != null)
{
client person = (client)p;
if((person.playerName != null || person.playerName != "null")... | 5 |
public Item addItemInList(ItemDTO dto) {
Item itemList = null;
if (dto.getDtoMap().get(Constants.TYPE)
.equalsIgnoreCase(Constants.RAW_ITEM)) {
itemList = new RawItem();
} else if (dto.getDtoMap().get(Constants.TYPE)
.equalsIgnoreCase(Constants.MANUFACTURED_ITEM)) {
itemList = new ManufacturedItem(... | 5 |
@SuppressWarnings("unchecked")
public String getEventAveragesTable() {
PreparedStatement st = null;
ResultSet rs = null;
JSONArray json = new JSONArray();
try {
conn = dbconn.getConnection();
st = conn.prepareStatement("SELECT m.event_id, e.name, avg(m.auton_t... | 4 |
public FlacAudioFrame getNextAudioPacket() throws IOException {
int skipped = 0;
int b1 = 0;
int b2 = input.read();
while (b1 != -1 && b2 != -1) {
b1 = b2;
b2 = input.read();
if (FlacAudioFrame.isFrameHeaderStart(b1, b2)) {
if (skipped > 0)
... | 4 |
public void pesquisaTurma(String disc, int num) {
try {
Disciplina dis = sistemaFrontEnd.pesquisaDisciplina(disc);
try {
JOptionPane.showMessageDialog(null,
sistemaFrontEnd.pesquisaTurma(disc, num));
} catch (TurmaInexistenteException e) {
front.exibirMsg("Turma Inexistente!!");
}
} catch... | 2 |
public TitleScreen(int frameWidth, int frameHeight)
{
try
{
image = ImageIO.read(new File("logo.png"));
}
catch (IOException ex)
{
System.out.println("Can't read image.");
}
this.frameWidth = frameWidth;
... | 2 |
private void evaluateInput(String message) throws Exception {
// Parse the input message
Matcher matcher = pattern.matcher(message);
if (matcher.matches() == false) {
throw new IllegalArgumentException(
"Syntax error: " + message);
}
... | 9 |
private Map<Good, HashMap<Enums.MarketValues, Integer>> filterGoods(Map<Good, HashMap<Enums.MarketValues, Integer>> candidateValues, RandomPort port){ //}, RandomPort port){
Set<Good> keys = new HashSet<Good>();
for (Good good : candidateValues.keySet()){
if (filterIfPreAgriculture(port, goo... | 8 |
public boolean start() {
synchronized (optOutLock) {
// Did we opt out?
if (isOptOut()) {
return false;
}
// Is metrics already running?
if (task != null) {
return true;
}
// Begin hitting the s... | 7 |
public static boolean computeCell(boolean[][] world, int col, int row)
{
// liveCell is true if the cell at position (col,row) in world is live
boolean liveCell = getCell(world, col, row);
// neighbours is the number of live neighbours to cell (col,row)
int neighbours = countNeighbours(world, col... | 8 |
@Test
public void test_addition() {
int m = 2;
int n = 3;
Matrix m1 = new MatrixArrayList(m, n);
Matrix m2 = new MatrixArrayList(m, n);
Matrix m3 = new MatrixArrayList(m, n);
for (int i = 1; i <= m; i++) {
for (int j = 1; j <= n; j++)
m1.insert(i, j, (double) (2 * i + j));
}
for (int i = 1; i ... | 4 |
public static File getFile(int column)
{
switch (column) {
case 1: return File.a;
case 2: return File.b;
case 3: return File.c;
case 4: return File.d;
case 5: return File.e;
case 6: return File.f;
case 7: return File.g;
case 8: return File.h;
... | 8 |
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (!super.equals(obj))
return false;
if (!(obj instanceof BaggageCarriage))
return false;
BaggageCarriage other = (BaggageCarriage) obj;
if (shelfCount != other.shelfCount)
return false;
return true;
} | 4 |
private void lockedAndPreventingPlayerUse(JButton button, boolean trueOrFalse) {
if(!areWeUnlocked) {
setUpButtonImage(button, lockImage, 100, 50);
areWeUnlocked = true;
}
else if(areWeUnlocked) {
setUpButtonImage(button, unlockImage, 100, 50);
are... | 2 |
private static BigInteger mp(BigInteger base,BigInteger exponent,BigInteger modulus) {
BigInteger result=BigInteger.ONE; // initialize variable
// failsafe
if( base.compareTo(BigInteger.ONE) < 0 || exponent.compareTo(BigInteger.ZERO) < 0 || modulus.compareTo(BigInteger.ONE) < 1) {
return BigInteger... | 5 |
public void initProvider(String initialContextFactory, String jndiProviderUrl, Map<String, String> settings) throws Exception {
Properties env = new Properties( );
env.put(Context.INITIAL_CONTEXT_FACTORY, initialContextFactory);
env.put(Context.PROVIDER_URL, jndiProviderUrl);
initialContext = new InitialContext... | 9 |
public boolean onCommand(CommandSender cs, Command cmnd, String string, String[] args) {
if (args.length == 0) {
if (cs instanceof Player) {
args = new String[]{cs.getName()};
} else {
cs.sendMessage(ChatColor.RED + "Invalid usage: " + getHelp());
... | 6 |
private void drawConnectors(Graphics2D g) {
for (Connector c : connectors) {
Color cSave = g.getColor();
Stroke sSave = g.getStroke();
if (c.isSelected()) {
g.setColor(Color.red);
g.setStroke(new BasicStroke(2f));
}
if (c instanceof InputConnector) {
drawInput(g, (InputConnector) c);
} e... | 3 |
public void swapView(String name)
{
myLayout.show(getContentPane(), name);
if(name.equals("The Game"))
{
if(mainGame.volumeOn)
{
//sequencer.stop();
try
{
sequencer.setSequence(SORAIRO_DAYS);
}
catc... | 8 |
public static void main(String[] args) throws InterruptedException {
Callable<Integer> callable = new CallableImpl(2);
ExecutorService executor = new ScheduledThreadPoolExecutor(1);
Future<Integer> future = executor.submit(callable);
try {
System.out.println("Future value: ... | 1 |
public int[] getRowColBounds()
{
/* KSC: try to decrease processing time by using refPtgs treemap
int[] retValues = {0,0,0,0};
for (int i=0;i<sqrefs.size();i++) {
SqRef sref = (SqRef)sqrefs.get(i);
int[] locs = sref.getIntLocation();
for (int x=0;x<2... | 5 |
public boolean submitClaim(Claim c, String actionType) {
boolean flag = false;
Element claimE = (Element) document
.selectSingleNode("//" + actionType + "[@id='" + c.getId() + "']");
if (claimE != null) {
claimE.element("dialogState").setText(c.getDialogState());
// Write to xml
try {
XmlUtils.wr... | 8 |
public boolean retryRequest(IOException exception, int executionCount, HttpContext context) {
boolean retry;
Boolean b = (Boolean) context.getAttribute(ExecutionContext.HTTP_REQ_SENT);
boolean sent = (b != null && b.booleanValue());
if(executionCount > maxRetries) {
// Do n... | 7 |
public int strStr(String haystack, String needle) {
if (haystack == null || needle == null || haystack.length() < needle.length()) {
return -1;
}
if (needle.length() == 0) {
return 0;
}
int limit = Math.min(needle.length(), haystack.length() - needle.lengt... | 9 |
static private Token jj_consume_token(int kind) throws ParseException {
Token oldToken;
if ((oldToken = token).next != null) token = token.next;
else token = token.next = token_source.getNextToken();
jj_ntk = -1;
if (token.kind == kind) {
jj_gen++;
if (++jj_gc > 100) {
jj_gc = 0;... | 6 |
@Override
public synchronized void close() throws IOException {
if(!this.closed) {
LOG.info("closing a file");
if(this.keepaliveThread != null && this.keepaliveThread.isAlive()) {
this.keepaliveThread.interrupt();
}
this.keepaliveT... | 8 |
public JSONObject increment(String key) throws JSONException {
Object value = opt(key);
if (value == null) {
put(key, 1);
} else if (value instanceof Integer) {
put(key, ((Integer) value).intValue() + 1);
} else if (value instanceof Long) {
put(key, ((... | 5 |
public String toString() {
return this.getName();
} | 0 |
public void close() throws IOException {
while (numBitsInCurrentByte != 0)
write((byte)0);
output.close();
} | 1 |
public static ArrayList<Node> getNodes(SQLiteConnection db) {
ArrayList<Node> nodes = new ArrayList<>();
try{
SQLiteStatement st = db.prepare("SELECT * FROM node");
while (st.step()){
Node nod = new Node(db, st.columnInt(1),
new Point(st.c... | 8 |
protected Spielgrenze(Rectangle masse, IntHolder unit) {
super(masse, unit);
} | 0 |
private void shutdown() {
try {
isRunning = false;
FileWriter fileWriter = new FileWriter(FileCreator.getStreamListFile());
ArrayList<String> streamList = TwitchStream.getStreamList(); //ids for stream
ArrayList<String> streamName = TwitchStream.getStreamName(); ... | 8 |
public final void shutdown() {
if (isShuttingDown) {
return;
}
isShuttingDown = true;
try {
if (soundPlayer != null) {
soundPlayer.running = false;
}
if (resourceThread != null) {
resourceThread.running = tr... | 9 |
public void play() {
if (sequence == null) {
throw new IllegalStateException("MidiAsset.play: " +
"Midi sequence not loaded");
}
if (sequencer == null) {
initialiseSequencer();
}
try {
sequencer.setSequenc... | 5 |
public JsonObject deleteActivity( JsonObject json ) {
// Get and validate parameters
JsonValue activityJsonValue = json.get("activity");
if ( activityJsonValue == null ) return new JsonObject().add("error", "Parameter activity is null");
if ( !activityJsonValue.isObject() ) return new JsonObject().add("error... | 9 |
public void loadPropertiesForClass(String className){
try{
Properties props = new Properties();
String softwareProperties = System.getProperty(SOFTWARE_PROPERTIES);
props.load(new FileInputStream(softwareProperties != null ? softwareProperties : HARD_CODED_SOFTWARE_PROPERTIES... | 5 |
public boolean isRemover() {
return (remover) ? true : false;
} | 1 |
public void addToInput(String input) {
if(!this.input.contains(input))
this.input.add(input);
} | 1 |
public void run() {
while (running) {
try {
sleep(10000);
//LazyHomer.setLastSeen();
for(Iterator<MargeObserver> iter = observers.keySet().iterator(); iter.hasNext(); ) {
MargeObserver obs = (MargeObserver)iter.next();
String url = observers.get(obs);
obs.remoteSignal("localhost","GET",... | 5 |
public void addEntry(Catalog cat, Node node) {
NodeList childNodes = node.getChildNodes();
Elev key = null;
HashMap<Materie, SituatieMaterieBaza> value = new HashMap<Materie, SituatieMaterieBaza>();
for (int i = 0; i < childNodes.getLength(); i++) {
Node cNode = childNodes.item(i);
if (cNode instanceof El... | 6 |
@Get("json")
public Representation _get() {
String keyword = getAttribute("keyword");
String query = format(FIND_RSRC, keyword);
Map<?, ?> anno = $annotations.findOne(query).as(Map.class);
if (anno == null) {
setStatus(Status.CLIENT_ERROR_NOT_FOUND);
return nu... | 6 |
public List<Row> getTopLevelRows() {
ArrayList<Row> list = new ArrayList<>();
for (Row row : mRows) {
if (row.getParent() == null) {
list.add(row);
}
}
return list;
} | 2 |
public void addSymbolsFromChilds(GoTerm goTerm) {
// Add symbols
for( String symbolId : symbolIdSet )
goTerm.addSymbolId(symbolId);
// Add interesting symbols
for( String symbolId : interestingSymbolIdSet )
goTerm.addInterestingSymbolId(symbolId);
// Recurse
for( GoTerm child : childs )
child.add... | 3 |
Subsets and Splits
SQL Console for giganticode/java-cmpx-v1
The query retrieves a limited number of text entries within a specific length range, providing basic filtering but minimal analytical insight.