text stringlengths 14 410k | label int32 0 9 |
|---|---|
public static void TH() throws IOException{
int timeblock = 5;
BufferedReader r = new BufferedReader (new InputStreamReader(System.in));
while (timeblock > 0){
System.out.println("What would you like to do right now?");
if (timeblock > 3)
{
System.out.println("1. Go to class (not likely)");
... | 7 |
public static CypherType arrayToType(double[] array)
{
CypherType type = null;
if (array[0] == 1 && array[1] == 0 && array[2] == 0)
type = CypherType.PLAIN_TEXT;
else if (array[0] == 0 && array[1] == 1 && array[2] == 0)
type = CypherType.MONO_ALPHABETIC;
else if (array[0] == 0 && array[1] == 0 && array... | 9 |
public static List<Player> getOnlinePlayers() {
List<Player> onlinePlayers = new ArrayList<Player>();
try {
Method onlinePlayersMethod = Bukkit.class.getMethod("getOnlinePlayers");
if (onlinePlayersMethod.getReturnType().equals(Collection.class)) {
Collection<Play... | 5 |
@Override
public int getIndex(String name) {
for (int i=0;i<=attsList.size();i++)
if (name.equalsIgnoreCase(attsList.get(i).getName())) return i;
return -1;
} | 2 |
@Override
public <T extends AggregateRoot<?>> T loadOneBy(final Class<T> aggregateRoot, final Specification<T> specification) {
@SuppressWarnings("unchecked")
final DomainRepositoryDriver<T, ?> driver = (DomainRepositoryDriver<T, ?>) drivers.get(aggregateRoot);
if (driver =... | 4 |
public ArrayList<Integer> postorderTraversal(TreeNode root) {
// Start typing your Java solution below
// DO NOT write main() function
ArrayList<Integer> res = new ArrayList<Integer>();
if (root == null)
return res;
Stack<TreeNode> path = new Stack<TreeNode>();
TreeNode prev = null, cur;
path.push(roo... | 9 |
public Dimension getCurrentAvailableSpace() {
return new Dimension(getParent().getWidth(), getParent().getHeight());
} | 0 |
@Override
protected void leave() {
// Find north most door
final GameObject door = ctx.objects.select().select(ObjectDefinition.name(ctx, "Door")).within(15).sort(new Comparator<GameObject>() {
@Override
public int compare(GameObject o1, GameObject o2) {
return Integer.valueOf(o2.tile().y()).compareTo(o1... | 4 |
public static void printDocument(Document doc) {
OutputFormat format = OutputFormat.createPrettyPrint();
try {
XMLWriter writer = new XMLWriter(System.out, format);
writer.write(doc);
} catch (Exception e) {
System.err.println("Error while trying to print: " + e.getMessage());
e.printStackTrace();
}... | 1 |
public void saveHistogram(String path) {
try {
if(path == null)
path = "histogram.csv";
File file = new File("histogram.csv");
file.createNewFile();
FileWriter fileW = new FileWriter(file);
BufferedWriter buffW = new BufferedWriter(fileW);
buffW.write("Grayscale");
for(int i = 0; i < histogra... | 4 |
public static void CheckServerMessages(String message){
newestreply = OtherStuff.LatestServerReply();
if(newestreply.startsWith("YouGotkickednr")){
OtherStuff.CloseAllWindows();
JOptionPane.showMessageDialog(null, "Kicked by Server");
System.exit(0);
}
else if(message.startsWith("YouGotkicked")){
... | 9 |
public AppTest(String testName) {
super(testName);
} | 0 |
protected boolean processOtherEvent(Sim_event ev)
{
boolean result = true;
switch ( ev.get_tag() )
{
//-----------REPLICA MANAGER REQUESTS--------
case DataGridTags.CTLG_ADD_MASTER:
processAddMaster(ev);
break;
case DataGri... | 8 |
public int getLowestY()
{
int y = a[1];
if(b[1] < y)
{
y = b[1];
}
if(c[1] < y)
{
y = c[1];
}
if(d[1] < y)
{
y = d[1];
}
return(y);
} | 3 |
public void run() {
if (ItemCount > 0) {
for (int i = 0; i < ItemCount; i++) {
try {
stack.push(temp.get(i));
} catch (InterruptedException ex) {
Logger.getLogger(TestingThread.class.getName()).log(Level.SEVERE, null, ex);
... | 5 |
public void feedFood(int index)
{
FoodObject food = Food.getFood(index);
if (!canAfford(food.getPrice()))
return;
hunger += food.getAmount();
// money -= food.getMoney();
// "Purchased" + food.getName();
// TODO Add Food on the screen.
// TODO adding hunger is placeholder
} | 1 |
public int getInt(String key, int def) {
if(fconfig.contains(key)) {
return fconfig.getInt(key);
}
else {
fconfig.set(key, def);
try { fconfig.save(path); } catch (IOException e) { e.printStackTrace(); }
return def;
}
} | 2 |
private boolean searchUpForNextSubsetNode( Node node, K key, Object[] ret ) {
if( node.mRight != null && mComp.compareMinToMax( node.mKey, key ) < 0 &&
mComp.compareMinToMax( key, node.mRight.mMaxStop.mKey ) < 0 )
{
// Request downard search on right subtree.
ret[0] ... | 7 |
@Override
public void onDisable()
{
saveConfig();
if (thread != null && thread.isRunning())
{
//Disable thread
thread.setRunning(false);
}
else
{
}
} | 2 |
public static void main(String[] args) throws IOException {
AuthenticationServer server = null;
try {
Options options = new Options();
options.addOption("sp", true, "security package");
options.addOption("p", true, "server port");
options.addOption("h", f... | 5 |
private int findDirectionOfSquare(int x, int y, int[][] path) { // grid system
int sq2 = path[x][y] + 1;
try {
if (y > 0) if (sq2 == path[x][y - 1]) return NORTH;
if (x < getColumns() - 1) if (sq2 == path[x + 1][y]) return EAST;
if (y < getRows() - 1) if (sq2 == path[x][y + 1]) return SOUTH;
if (x > 0) ... | 9 |
public void multiSpellEffectNPC(int npcId, int damage) {
switch(c.MAGIC_SPELLS[c.oldSpellId][0]) {
case 12919: // blood spells
case 12929:
int heal = (int)(damage / 4);
if(c.constitution + heal >= c.maxConstitution)
c.constitution = c.maxConstitution;
else
c.constitution += heal;
... | 6 |
public synchronized void stop() {
if (thread == null) {
return;
}
running = false;
if (server != null) {
try {
server.close();
} catch (Exception e) { }
}
thread = null;
} | 3 |
@Override
public boolean supportsEditability() {return true;} | 0 |
public static boolean howHardCanItBe(){
for (final String word : words) {
if( wordValidator.wordContainsLettersInOrder(letGen, word) ) {
return true;
}
}
return false;
} | 2 |
public void processRequest(HttpServletRequest req, HttpServletResponse res)
throws ServletException, IOException {
FrontCommand command;
try {
command = getCommand(req);
command.init(getServletContext(), req, res);
command.process();
} catch (Exce... | 1 |
private static char ConvertToChar(int num)
{
char letter = '0';
switch(num)
{
case 1:
letter = '1';
break;
case 2:
letter = '2';
break;
case 3:
letter = '3';
break;
case 4:
letter = '4';
break;
case 5:
letter = '5';
break;
case 6:
letter = '6';
... | 9 |
public boolean changeUserName(String oldName, String newName){
if (users.get(newName.toLowerCase())!=null) return false;
UserAccount account = users.remove(oldName.toLowerCase());
account.setName(newName);
users.put(newName.toLowerCase(), account);
return true;
} | 1 |
public void upload(UploadedFile uploadedFile, String fileName) throws IOException, NotCreatedDirException {
InputStream inputStream = null;
OutputStream outputStream = null;
try {
// save file on disk
inputStream = uploadedFile.getInputStream();
File newFile = new File(path + "poms/" + fileName + ".xml"... | 4 |
public void keyTyped(KeyEvent e) {
if(open) {
switch(e.getKeyCode()) {
case KeyEvent.VK_ESCAPE:
case KeyEvent.VK_ENTER:
break;
case KeyEvent.VK_BACK_SPACE:
if(typing.length() > 0)
typing = typing.substring(0, typing.length()-1);
break;
default:
if(typing.length() < MAX_INPUT_LENGTH... | 6 |
public void deleteComponent(Component com) {
if(com == null) {
return;
}
((ContactItem)com).deleteContactItem();
Component cm = hd;
while(cm != null) {
if(cm == com) {
if(com == hd) {
hd = hd.n... | 7 |
private void processResp(OMMItemEvent event)
{
OMMMsg msg = event.getMsg();
Token token = (Token)event.getClosure();
// we need to set dictionary in case we reencode FieldList
Handle handle = (Handle)_reqMap.get(token);
// this can happen, when the dictionary stream is clos... | 9 |
private int[] getAround(int[][] temp, int x, int y) {
int[] around = new int[9];
int i = 0;
for(int xLoop = x-1; xLoop <= x+1; xLoop++) {
for(int yLoop = y-1; yLoop <= y+1; yLoop++) {
around[i] = validPosition(temp, xLoop, yLoop) ? temp[xLoop][yLoop] : USED;
i++;
}
}
return around;
} | 3 |
@Test
public void testSecondUp()
{
Model model = new Model();
Time realTime, expectedTime;
realTime = new Time(0,1,53);
expectedTime = new Time(0,2,3);
model.setTime(realTime);
for (int i=0;i<10;i++)
{
model.secondUp();
... | 1 |
public String toString() {
StringBuilderOutputSource sb = new StringBuilderOutputSource(new StringBuilder());
for (int i = 0; i < path.length; i+=2) {
Object key = path[i];
if (key == null) {
sb.append("[null]");
} else if (key instanceof Number) {
sb.append('[');
sb.append(key.toString... | 9 |
private void putRequest(HttpExchange he) throws IOException {
try {
InputStreamReader isr = new InputStreamReader(he.getRequestBody(), "UTF-8");
BufferedReader br = new BufferedReader(isr);
String jsonInput = br.readLine();
long roleId = parseRoleId(jsonInput);
... | 5 |
public void setModel(PlotModel model) {
surfacePanel.setModel(model.getModel());
setLayout(new BorderLayout());
task = model.getModel().plot();
surfacePanel.setBackground(Color.white);
surfacePanel.setConfigurationVisible(true);
add(surfacePanel, BorderLayout.CENTER);
... | 2 |
@Override
public void run() {
try {
serversocket = new ServerSocket(port);
} catch (IOException e1) {
JOptionPane.showMessageDialog(null, "Failed to run serversocket.", "Error", JOptionPane.ERROR_MESSAGE);
return;
}
while (breakflag == false) {
try {
client = serversocket.accept();
Bu... | 5 |
public String getSno() {
return this.sno;
} | 0 |
public Humain rencontre(Humain h) {
Humain b;
loterie = new Random();
if (h instanceof Homme)
return null;
if (h.age > 15 && h.age < 50 && age > 15) {
if (poids > 150 || h.poids > 150) {
return null;
} else {
int f = loterie.nextInt(100);
if (f > ((Femme) h).getFertilite())
return null... | 8 |
public static Iterable<Direction> solve(State state)
{
State boxToGoal;
int px = state.player.x;
int py = state.player.y;
ArrayList<Position> possiblePlayerPositions = possibleStartPositions(state);
for (Position player : possiblePlayerPositions)
{
boxToG... | 5 |
public boolean isFinished() {
boolean retBoo = false;
for (int i = 0; i < 6; i++) {
if (board.get(i) > 0)
break;
else if (i == 5)
retBoo = true;
}
for (int x = 7; x < 13; x++) {
if (board.get(x) > 0)
break;
else if (x == 12)
retBoo = true;
}
return retBoo;
} | 6 |
@Override public void paintComponent(Graphics g2) {
Graphics2D g = (Graphics2D) g2; // Create Graphics Object
super.paintComponent(g); // Paint Background
// Get the size of the x path vectors
int size_of_xpath = xPath.size();
// Create array of integers
int[] xPoints = new i... | 9 |
public boolean isProgressive()
{
return progressive;
} | 0 |
private String startSetToString() {
StringBuffer FString = new StringBuffer();
boolean didPrint;
if (m_starting == null) {
return getStartSet();
}
for (int i = 0; i < m_starting.length; i++) {
didPrint = false;
if ((m_hasClass == false) ||
(m_hasClass == tru... | 7 |
public String getToolTip() {
return "Transition Creator";
} | 0 |
public List<TestResultData> process() {
List<TestResultData> testResults = new ArrayList<TestResultData>();
try {
TestNgResultParser resultParser = new TestNgResultParser(resultFile);
Map<String, String> testResultMap = resultParser.getTestResultMap();
Iterator<Entry... | 4 |
private void drawDebug() {
debugRenderer.begin(ShapeType.Line);
for (MapLayer ml : world.getMap().getLayers()) {
for (Tile t : ml.getTiles()) {
debugRenderer.setColor(Color.WHITE);
float startX = t.getPosition().x * ppuX, startY = t
.getPosition().y * ppuY;
debugRenderer.rect(startX, startY, pp... | 8 |
@Test
public void enqueuesAtTheEnd()
{
for (int i = 0; i < 3; i++) queue.dequeue();
queue.enqueue("nice shoes");
assertTrue(queue.dequeue().equals("tommytoes") &&
queue.dequeue().equals("nice shoes") &&
queue.dequeue() == null);
} | 3 |
public void fire(char tankDirection,int bulletx,int bullety){
x=bulletx;
y=bullety;
if(tankDirection=='u'){setXSpeed(0);setYSpeed(-16);}
if(tankDirection=='d'){setXSpeed(0);setYSpeed(16);}
if(tankDirection=='r'){setXSpeed(16);setYSpeed(0);}
if(tankDirection=='l'){setXSpeed(-16);setYSpeed(0);}
isF... | 4 |
@Override
public void mouseExited(MouseEvent event) {
//When hovering off the board, only display data for the selected tile.
if (event.getSource() instanceof Tile) {
Tile selectedTile = match.getSelectedTile();
match.getPanel().setTile(null, selectedTile, null, match.getTileOwner(selectedTile), true);
}
... | 1 |
private Object instantiate(Class<?> clazz) {
try {
Object instance = clazz.newInstance();
for (ExtendedField field : DaoUtils.getAllFieldsWithSuperclasses(clazz)) {
if (field.hasEntityMapping() && field.isCascadingLoad()) {
switch (field.getEntityM... | 7 |
public Connector read(int bytes, Consumer<byte[]> consumer) {
updateActionIfNotNull();
byte[] data = new byte[bytes];
if (in != null) {
try {
int r = -1;
synchronized (in) {
r = in.read(data);
}
if (r != -1) {
if (r < bytes) {
byte[] n = new byte[r];
System.arraycopy(data,... | 4 |
@Test
public void combine() {
SimpleMatrix A = new SimpleMatrix(6,4);
SimpleMatrix B = SimpleMatrix.random(3,4, 0, 1, rand);
SimpleMatrix C = A.combine(2,2,B);
assertEquals(6,C.numRows());
assertEquals(6,C.numCols());
for( int i = 0; i < 6; i++ ) {
for(... | 8 |
public boolean expandAtdl4jWidgetParentStrategyPanel( Atdl4jWidget<?> aWidget )
{
boolean tempAdjustedFlag = false;
if ( ( aWidget.getParent() != null ) && ( aWidget.getParent() instanceof Composite ) )
{
Composite tempParent = (Composite) aWidget.getParent();
while ( tempParent != null )
{
// ... | 9 |
@Override
public AnnotationVisitor visitInsnAnnotation(final int typeRef,
final TypePath typePath, final String desc, final boolean visible) {
checkStartCode();
checkEndCode();
int sort = typeRef >>> 24;
if (sort != TypeReference.INSTANCEOF && sort != TypeReference.NEW
... | 9 |
@Override
public void putAll(Map<? extends K, ? extends V> m) {
for (Entry<? extends K,? extends V> p : m.entrySet())
this.put(p.getKey(),p.getValue());
} | 5 |
public boolean realizarTransacoesPossiveis() {
for (int indiceCompra = 0; indiceCompra < compras.getTamanhoLista(); indiceCompra++) {
for (int indiceVenda = 0; indiceVenda < vendas.getTamanhoLista(); indiceVenda++) {
Interesse compra = compras.getInteresse(indiceCompra);
... | 8 |
public static OpCode parseOpCode(String op, boolean throwError) throws AssemblyException {
OpCode code = OpCode.parseOpCode(op);
if (code == null && throwError)
throw new AssemblyException(op + " is not a valid op code!");
return code;
} | 2 |
public void run() {
try {
correct = check();
} catch (ModelingException e) {
e.printStackTrace();
}
if(correct) {
try {
simulate();
} catch (IOException e) {
e.printStackTrace();
}
}
} | 3 |
private void setLogger(ILogger logger) {
if (logger == null) {
throw new IllegalArgumentException("aLogger is null");
}
this.logger = logger;
} | 1 |
private void copyValue(Value val) {
descriptor_ = new ValueDescriptor(val.getDescriptor());
Object obj = val.getData();
switch (getType()) {
case FLOAT:
data_ = new Float((Float) obj);
break;
case DOUBLE:
data_ = new Double((Double) obj);
break;
case INTEGER:
data_ = new Integer((Integer) obj... | 9 |
public static Object getProperty(Object obj, String propertyName)
{
if (obj == null)
return null;
try
{
BeanInfo info = Introspector.getBeanInfo(obj.getClass());
PropertyDescriptor[] descriptors = info.getPropertyDescriptors();
for (int i = 0; ... | 6 |
private static void writeProperties(Properties props, XMLWriter w) throws
IOException
{
if (!props.isEmpty()) {
final SortedSet<Object> propertyKeys = new TreeSet<Object>();
propertyKeys.addAll(props.keySet());
w.startElement("properties");
for (Ob... | 3 |
private void getAllActors(){
Document doc = getXmlFile();
NodeList nList = doc.getElementsByTagName("Actor");
if(debugConsole){
System.out.println("Actors in XML-File");
System.out.println("-------------------");
System.out.println("");
System.out.println("Number : "+nList.getLength());
}
Sys... | 7 |
private static String createRealUser(String string) {
Connection conn = ConnectionFactory.getConnection();
PreparedStatement pst = null;
ResultSet rs = null;
User user = JsonUtils.getUserByJson(string);
String sql = null;
int i = 0;// 判断是否创建了用户信息
// 判断是否输入了info
String infoString = ",u_info";
Str... | 7 |
public String decode(String codeWord) {
if (codeWord != null) {
decode = new StringBuilder();
StringBuilder sum = new StringBuilder();
String c;
char l;
int count = 0;
for (int i = 0; i < codeWord.length()-1; i++) {
switch (... | 7 |
private Expression primary() {
Expression e = null;
// variable or function call
if (currentToken.type() == Token.Type.Identifier) {
Variable v = new Variable(currentToken.value());
match(Token.Type.Identifier);
// function call
if(currentToken.type() == Token.Type.LeftParen)
e = callStatem... | 5 |
public static void main(String args[]) {
/* Set the Nimbus look and feel */
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
/* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
* For details see http://down... | 6 |
private void setLookAndFeel(final String laf) {
try {
final int lafNum = Integer.parseInt(laf);
switch(lafNum){
default:
case -2: //Nimbus
boolean isLAFFound = false;
for (javax.swing.UIManager.LookAndFeelInfo info : ja... | 9 |
private void jButtonGuardarNovaEntradaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonGuardarNovaEntradaActionPerformed
// BOTAO GUARDAR -> JANELA ENTRADAS
//FAZER AS VALIDAÇÕES, SE OS CAMPOS ESTAO TODOS PREENCHIDOS
String nomeFuncionarioResponsavelEntrada = jC... | 8 |
public static boolean userExist(String email){
SQLiteJDBC db = new SQLiteJDBC();
String sql = String.format("SELECT user_id FROM users WHERE email='%s'", email);
ResultSet resultSet = db.query(sql);
try {
if(resultSet.next())
return true;
... | 2 |
private void buttonSendInfoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonSendInfoActionPerformed
//Создаем нового клиента по заполненным полям
Client client = new Client();
try {
client.setFio(textFieldFio.getText());
client.setAddress(textField... | 2 |
private void setMenu() {
boolean isNumeric;
boolean hasColumns;
boolean hasRows;
boolean attSelected;
ArffSortedTableModel model;
boolean isNull;
model = (ArffSortedTableModel) m_TableArff.getModel();
isNull = (model.getInstances() == null);
hasColumns = !i... | 7 |
public static LinkedListNode unionLL(LinkedListNode head1,
LinkedListNode head2)
{
if (head1 == null || head2 == null)
{
return null;
}
LinkedListNode result = null;
LinkedListNode temp = head1;
LinkedListNode temp2 = head2;
... | 6 |
public Transition(Integer n, Character c, Integer lc, Integer rc){
node = n;
character = c;
leftChildren = lc;
rightChildren = rc;
} | 0 |
protected Proxy getNextProxy() {
if (this.proxies.isEmpty()) {
System.out.println(">>> GET NEW PROXIES: ");
try {
if (useLocalProxyFile) { // Local Proxy List
if (proxyFile == null)
return null;
File in = new File(proxyFile);
if (!in.isFile())
throw new IllegalArgumentExc... | 9 |
public mst(Graph G) {
graphSize = G.getSize();
mst1 = new Graph(graphSize); //size of graph initialized to number of Vertices
parent = new int[graphSize]; //stores the parent values corresponding to every vertice. Used to decide whic edges lie in the graph
key = new int[graphSize]; //stores t... | 7 |
public void descend(){
eraseCenter();
for(int col = 0; col < board.getWidth(); col++){
int[] values = new int[board.getLength()];
for(int i = 0; i < values.length; i++){
values[i] = -2;
}
for(int row = board.getLength()-1; row >= 0;row--){
if(board.getValue(row, col) != -2){
if(board.isVa... | 7 |
@Override
public void hyperlinkUpdate(HyperlinkEvent event) {
if (event.getEventType() == HyperlinkEvent.EventType.ACTIVATED) {
try {
String url = event.getDescription();
if (url != null) {
if (url.indexOf("jfchat;jsessionid=") != -1) {
if (url.indexOf("say=") !... | 6 |
public static SwingAppenderUI getInstance() {
if (instance == null) {
synchronized(SwingAppenderUI.class) {
if(instance == null) {
instance = new SwingAppenderUI();
}
}
}
return instance;
} | 2 |
public static void main(String[] args) {
// TODO code application logic here
ArchivoDeTexto nuevo = new ArchivoDeTexto();
int[] lista = new int[2000];
lista = nuevo.lectura();
String menu = "1. Mostrar arreglo inicial\n2. Ordenar por BubbleSort\n3. Ordena... | 7 |
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Period other = (Period) obj;
if (cost != other.cost)
return false;
if (date_hour == null) {
if (other.date_hour != null)
return false... | 9 |
@Override
public void mouseDragged(MouseEvent e) {
float y = e.getY();
if(scrolling) {
scrollPerc = (y - startScrolling)/this.height + startScrollingPerc;
scroll = (int) (scrollPerc * totalHeight);
if(scrollPerc < 0)
scrollPerc = scroll = 0;
else
if(scroll > totalHeight - this.height) {
... | 3 |
public void draw(Graphics2D g){
switch(size){
case 0:
g.setColor(new Color(0xFF4545));
break;
case 1:
g.setColor(new Color(0xaa5555));
break;
case 2:
g.setColor(Color.red);
break;
default:
g.setColor(Color.yellow);
break;
}
int[] px = {x , x + width, x + width };
int[] py = {y ... | 3 |
private static Class findUnderlyingClass(Type t)
{
if (t instanceof Class) {
return (Class) t;
}
else if (t instanceof ParameterizedType) {
ParameterizedType paramType = (ParameterizedType) t;
return findUnderlyingClass(paramType.getRawType());
}
... | 4 |
public static boolean estDate(String source){
if(source.length() != 10){
return false ;
}
else {
try {
int jour = Integer.parseInt(source.substring(0,2)) ;
int mois = Integer.parseInt(source.substring(3,5)) - 1 ;
int annee = Integer.parseInt(source.substring(6)) ;
if(jour >= 1 && mois >= 0 &... | 5 |
@Override
public List<SpaceObject> getSpaceObjectsWithin(final SpaceObject ofObj, long minDistance, long maxDistance)
{
final List<SpaceObject> within=new ArrayList<SpaceObject>(1);
if(ofObj==null)
return within;
synchronized(space)
{
space.query(within, new BoundedObject.BoundedCube(ofObj.coordinates()... | 8 |
public void setEncryptionMethod(EncryptionMethodType value) {
this.encryptionMethod = value;
} | 0 |
public void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException, UnknownHostException {
tempRxList = new ArrayList<Medicine>();
Date EditDate = new Date();
ArrayList<String> tempPrescriptionID;
// Prepare Morphia Framework
Mongo mongo = new Mongo("localhost... | 4 |
@Override
public TypeInfo TypeCheck(CompilationContext cont) throws Exception {
TypeInfo eval_leftTypeInfo = leftExpr.TypeCheck(cont);
TypeInfo eval_rightTypeInfo = rightExpr.TypeCheck(cont);
if (eval_leftTypeInfo != eval_rightTypeInfo) {
throw new Exception("Wrong Type in expre... | 7 |
@Override
public void actionPerformed(ActionEvent e) {
if(e.getSource()==btnSauvegarder){
JFileChooser fileChooser = new JFileChooser();
fileChooser.setDialogTitle("Specify a file to save");
int userSelection = fileChooser.showSaveDialog(this);
if (userSelection == JFileChooser.APPROVE_OPTIO... | 8 |
public String getUserId() {
return userId;
} | 0 |
public void start() {
activeScreen = new CreateScreen(this);;
while (true) {
Draw();
if (gotchi != null) {
gotchi.Update();
}
try {
Thread.sleep(200);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
} | 3 |
@Override
public Hashtable<String, LinkedList<Triple<String, String, String>>> relations_extraction() throws IOException{
// Start by building dictionaries
build_dicos();
// st is the next sentence tree to be built
Tuple<Sentence_tree,String> st = build_next_sentence_tree();
if(st == null){
st = bui... | 6 |
private Map<Integer, Integer> buildLoopIndex(List<Token> tokens) {
Map<Integer, Integer> loopIndex = new HashMap<>();
Stack<Integer> startIndices = new Stack<>();
for (int i = 0; i < tokens.size(); i++) {
switch (tokens.get(i).getType()) {
case LOOP_START:
... | 5 |
@Test
public void testServerSetQueueTimeoutErrorIndividualInvalidEx() {
LOGGER.log(Level.INFO, "----- STARTING TEST testServerSetQueueTimeoutErrorIndividualInvalidEx -----");
boolean exception_other = false;
String client_hash = "";
try {
server2.setUseMessageQueues(true)... | 5 |
public void visitExpr(final Expr expr) {
if (checkValueNumbers) {
Assert.isTrue(expr.valueNumber() != -1, expr
+ ".valueNumber() = -1");
}
visitNode(expr);
} | 1 |
public void processInput(Deque<KeyEvent> events) {
int eventNumber = events.size();
for (int i = 0; i < eventNumber; i++) {
KeyEvent event = events.pollFirst();
Point direction = keyMapping.get(event.getKeyCode());
if (direction != null) {
schlange.setDirection(direction);
}
}
} | 2 |
private boolean r_verb_suffix() {
int among_var;
int v_1;
int v_2;
int v_3;
// setlimit, line 174
v_1 = limit - cursor;
// tomark, line 174
if (cursor < I_pV)
{
return false;
}
... | 9 |
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.