text stringlengths 14 410k | label int32 0 9 |
|---|---|
protected Object invokeReadFromXML(Element node) throws Exception {
Method method;
Class[] methodClasses;
Object[] methodArgs;
boolean array;
boolean useDefault;
useDefault = false;
method = null;
m_CurrentNode = node;
... | 9 |
@Test
public void testConnectComponents(){
gameEngine.connectComponentTo(valve1, valve1, true);
InfoPacket info = null;
Iterator<InfoPacket> it = gameEngine.getAllComponentInfo().iterator();
while(it.hasNext()){
info = it.next();
Iterator<Pair<?>> pIt = info.namedValues.iterator();
while(pIt.hasNex... | 5 |
private String getLevelNodeValue(final Document doc) {
Node node = this.getFirstLevelNodeByTag(doc, LEVEL_TAG);
if (node == null) {
return DEFAULT_LEVEL;
}
String value = this.getNodeValue(node);
if (value.isEmpty()) {
value = DEFAULT_LEVEL;
}
return value;
} | 2 |
public static void main(String[] args) throws IOException {
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
StringBuilder out = new StringBuilder();
int nCases = Integer.parseInt(in.readLine().trim());
for (int t = 0; t < nCases; t++) {
int r = Integer.parseInt(in.readLine().trim())... | 6 |
public static Type fromInt(int x)
{
switch ( x % 3 )
{
case 0:
return simple;
case 1:
return conjugation;
case 2:
return number;
}
return null;
} | 3 |
@Override
public void analyse() throws AnalyseException {
if (this.sentence != null && this.sentence.length() != 0) {
this.analyseImpl();
if (this.errorMsg == null || this.errorMsg.size() == 0) {
this.isComplete = true;
}
} else {
AnalyseException exception = new AnalyseException(
"Error your ... | 4 |
public void write(DataOutput out) throws IOException {
try{
// minhash is not maxed out, M is redundant so don't write it
if (s < k) {
// Use -p to signify no M
out.writeByte(-p);
out.writeInt(k);
out.writeInt(s);
for(int i=0; i < s; i++){
out.writeLong(... | 5 |
public void findNearestFreeSpot()
{
if (getEntities() == null) return;
Deque<Double> xQueue = new ArrayDeque<>();
Deque<Double> yQueue = new ArrayDeque<>();
List<Double> usedX = new ArrayList<>();
List<Double> usedY = new ArrayList<>();
enqueueCoor... | 3 |
public static void rectangle(double x, double y, double halfWidth, double halfHeight) {
if (halfWidth < 0) throw new RuntimeException("half width can't be negative");
if (halfHeight < 0) throw new RuntimeException("half height can't be negative");
double xs = scaleX(x);
double ys = scal... | 4 |
private static int RodCutTopDownHelper(int n, int[] p, int[] s) {
if ( s[n] != Integer.MIN_VALUE ) return s[n];
// divide the problem into subproblem
int max = Integer.MIN_VALUE;
for ( int i=1; i <= n ; ++i ) {
// conquer each subproblem and combine them together
max = Math.max(max, p[i-1]+RodCutT... | 2 |
private Integer loadPropertyInt(Properties properties, String key) {
String value = properties.getProperty(key);
if (value == null) {
return null;
}
if(!value.matches("[0-9]+")){
throw new DBException(properties+"-value from properties file must be an integer value (0-9) but is '"+value+"'");
}
try {... | 3 |
public List<StudentObj> getStudentByMark(String classname, int objId, int topicId, float mark) {
List<StudentObj> items = new LinkedList<StudentObj>();
String sql = "select Student.classname, Student.rollNo, fullname, email, mark from Student inner join Result on Student.rollNo = Result.rollNo inner joi... | 6 |
@Override
public void addBinaryField(FieldInfo field, Iterable<BytesRef> values) throws IOException {
// write the byte[] data
meta.writeVInt(field.number);
meta.writeByte(Lucene54DocValuesFormat.BINARY);
int minLength = Integer.MAX_VALUE;
int maxLength = Integer.MIN_VALUE;
final long startFP ... | 9 |
@Override
public void closeHandler() {
try {
con.close();
} catch (SQLException e) {
// TODO 自動生成された catch ブロック
e.printStackTrace();
}
} | 1 |
@Override
public String getOne(String strTabla, String strCampo, int id) throws Exception {
Statement oStatement;
ResultSet oResultSet;
try {
oStatement = (Statement) oConexionMySQL.createStatement();
String strSQL = "SELECT " + strCampo + " FROM " + strTabla + " WHER... | 2 |
@Test()
public void preAuthCompletionDifferentOrderNumber()
throws BeanstreamApiException {
CardPaymentRequest paymentRequest = getCreditCardPaymentRequest(
getRandomOrderId("GAS"), "120.00");
PaymentResponse response = beanstream.payments()
.preAuth(paymentRequest);
if (response.isApproved()) {
P... | 2 |
private void handleDeleteCommands(ClientHandler handler, String command)
throws SocketTimeoutException, IOException, CacheException {
/*
delete <key> [noreply]\r\n
*/
String cmdData[] = command.split(" ");
String cmd = cmdData[0];
String key = cmdData[1];
if(QuickCached.DEBUG==false) {
logger.l... | 5 |
@Override
public int entryCount(String word) {
return storage.get(word) == null ? 0 : storage.get(word);
} | 1 |
public RefinedAbstractionA(Implementor implementor) {
super(implementor);
} | 0 |
public RealmStatus getRealmStatus(String... realms) throws CharacterNotFoundException {
URI uri = null;
try {
uri = new URI("https", String.format(URL_BASE, region), REALM_API_URL, null);
} catch (URISyntaxException e) {
e.printStackTrace();
}
if(uri == n... | 7 |
public final String getStrings(int from)
{
if (!this.hasPositional(from))
{
return null;
}
StringBuilder sb = new StringBuilder(this.getString(from));
while (this.hasPositional(++from))
{
sb.append(" ").append(this.getString(from));
}
... | 2 |
public boolean validate()
{
if(this.city.getText() != "" &&
this.email.getText() != "" &&
this.fname.getText() != "" &&
this.lname.getText() != "" &&
this.phone.getText() != "" &&
this.state.getItem(state.getSelectionIndex()) != "" &&
this.address1.getText() != "" &&
this.address2.getText... | 9 |
private void deleteMails(){
for (Integer n : deletedMails) {
// Hole den Namen der Datei
String fileName = mails.get(n);
// Namens String in File Objekt, das auf die Datei im Mail
// Ordner
// referenziert, umwandeln
File mailFile = Paths.get(
Proxy.MAIL_STORAGE_PATH + "/" + fileName).toFile();... | 2 |
@Override
public void handleOutOfBounds(EntityGrid grid) {
float tx = -1;
float ty = -1;
float gWidth = grid.getSize().x;
float gHeight = grid.getSize().y;
float pAdjustedWidth = sprite.getLocalBounds().width * .9f;
float pAdjustedHeight = sprite.getLocalBounds().he... | 6 |
@Test
public void transferInstrSTORE_testInvalidRegisterRef() { //Checks STORE instruction not created with invalid register ref.
try {
instr = new TransferInstr(Opcode.STORE, 50, 17);
}
catch (IllegalStateException e) {
System.out.println(e.getMessage());
}
assertNull(instr);
} | 1 |
public void searchFor(String text) {
if (worker != null) {
if (currentquery.equals(text.trim())) {
System.out.println("I'm too lazy to do another search");
return;
} else {
worker.halt();
}
}
currentquery = text.trim();
int n = results.size();
if (n != 0) {
results.clear();
this.fir... | 4 |
protected void initialize() {
System.out.println("Tilting");
Robot.tilter.moveUp();
} | 0 |
public void setDescription(String description) {
this.description = description;
} | 0 |
public synchronized void trust(Certificate cert) {
clear();
try {
trusted.setCertificateEntry("cert-" + tserial++, cert);
} catch(KeyStoreException e) {
/* The keystore should have been initialized and should
* not have the generated alias, so this should not
* happen. */
throw(new Runtime... | 1 |
public ArrayList<SubscriptionPlan> removeExpiredSubs() {
ArrayList<SubscriptionPlan> result = new ArrayList<SubscriptionPlan>();
ArrayList<Integer> subremove = new ArrayList<Integer>();
ArrayList<Integer> orderremove = new ArrayList<Integer>();
PreparedStatement sqlRead = null;
R... | 6 |
public synchronized void windowClosed(WindowEvent evt)
{
quit=true;
this.notifyAll(); // stop all threads
try { reader.join(1000);pin.close(); } catch (Exception e){}
try { reader2.join(1000);pin2.close(); } catch (Exception e){}
... | 2 |
private void posicionarBarandales(Node barandal)
{
barandal.setLocalTranslation(-697, 0, 797);
//rootNode.attachChild(barandal);
for (int i=1,x=0; i<=9; i++,x+=150)
{
// Del frente
Node tmp = barandal.clone(false);
tmp.move(x, 0, 0);
... | 4 |
protected void testOptimalEncoding( Number v, byte optimalEncoding ) {
try {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
StandardValueOps.writeNumberCompact(v, baos);
byte[] encoded = baos.toByteArray();
if( optimalEncoding == StandardValueOps.NE_INT6 ) {
assertEquals(1, encoded.length);... | 8 |
public void checkTrips() {
enablePreviewButtons (MainWindow.tripDB.checkDay (targetDay.getTime(), checkResultText));
int e = MainWindow.tripDB.getCheckErrors();
int w = MainWindow.tripDB.getCheckWarnings();
if (e > 0) {
errorsField.setFont(errorsField.getFont().deriveFont(Font.BOLD));
errorsField.setFo... | 2 |
private static BufferedImage renderNumber(Number number) {
BufferedImage integer = render(number.getInteger() == null ? "0" : number.getInteger());
BufferedImage decimal = number.getDecimal() == null ? null : render("." + number.getDecimal());
BufferedImage multiplication = null;
if(number.getScientificNotat... | 5 |
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((ativo == null) ? 0 : ativo.hashCode());
result = prime * result + ((autores == null) ? 0 : autores.hashCode());
result = prime * result + ((id == null) ? 0 : id.hashCode());
result = prime * result + ((isbn ... | 5 |
private String readWord() {
String s = null;
holdPos = pos;
while ( pos < line.length()
&& isWord( String.valueOf( line.charAt( pos ) ) ) ) {
if ( isBadChar( line.charAt( pos ) ) ) {
if ( isSpace( String.valueOf( line.charAt( pos - 1 ) ) )
... | 6 |
public KeyDataType createKeyDataType() {
return new KeyDataType();
} | 0 |
@Override
public boolean onCommand(CommandSender sender, org.bukkit.command.Command cmd, String label, String[] args) {
for (CommandGroup command : commands) {
if (command.getName().equalsIgnoreCase(cmd.getName())) {
String subCommand = args.length > 0 ? args[0] : "";
... | 6 |
private String compute(String[] input) {
try {
Integer operand1 = Integer.parseInt(input[1]);
Integer operand2 = Integer.parseInt(input[3]);
if (!node.getOperators().contains(input[2]))
return "Error: Operation not supported!";
String result = "";
switch (input[2]) {
case "+":
result = St... | 7 |
private void handleTime(int year, int month) {
int newMonth = month;
int newYear = year;
if (newMonth == 0) {
newMonth = 12;
newYear -= 1;
} else if (newMonth == 13) {
newMonth = 1;
newYear += 1;
}
RoosterProgramma.getInstan... | 2 |
@Override
public void init(GameContainer container) throws SlickException
{
grassmap = new TiledMap("data/40X40Map.tmx");
player1 = new Player(Username,35f,35f*3);
Tinput = new TextField(container, container.getDefaultFont(), (int)chatx,(int)(chaty+chat.getHeight() + 5),(int)(c... | 4 |
@Override
public int hashCode() {
int hashFirst = first != null ? first.hashCode() : 0;
int hashSecond = second != null ? second.hashCode() : 0;
return (hashFirst + hashSecond) * hashSecond + hashFirst;
} | 2 |
public boolean canCommit(ReservationStation resStation) {
// where index is the index of the required ROB
int index = Integer.parseInt(resStation.getDest());
return (ROB.getHead() == index && ROB.isReady(index));
} | 1 |
protected void emoteHere(Room room, MOB emoter, String emote)
{
if(room==null)
return;
final Room oldLoc=emoter.location();
if(emoter.location()!=room)
emoter.setLocation(room);
final CMMsg msg=CMClass.getMsg(emoter,null,CMMsg.MSG_EMOTE,emote);
if(room.okMessage(emoter,msg))
{
for(int i=0;i<room.n... | 8 |
public static Stella_Object accessTokenizerTokenSlotValue(TokenizerToken self, Symbol slotname, Stella_Object value, boolean setvalueP) {
if (slotname == Stella.SYM_STELLA_TYPE) {
if (setvalueP) {
self.type = ((Keyword)(value));
}
else {
value = self.type;
}
}
else if... | 6 |
public void interpolate(int[] /* fc_point */f0_base[], int p0, int pn,
PointPlotter plotter, double res) {
double k1, k2;
// Set up points for first curve segment.
int p1 = p0;
++p1;
int p2 = p1;
++p2;
int p3 = p2;
++p3;
// Draw each curve segment.
for (; p2 != pn; ++p0, ++p1, ++p2, ++p3) {
... | 7 |
public static HashMap<String, String> getBoundKeys(String url)
{
HashMap<String, String> map = new HashMap<String, String>();
try
{
Scanner scan = new Scanner(new URL(url).openStream());
while (scan.hasNext())
{
String line = scan.next();
String pubkey = line.split("=", 2)[1];
String signer ... | 2 |
@Override
public void process(SimEvent event) {
NodeReachedEvent _event = (NodeReachedEvent) event;
this.setPosition(_event.getPosition()); //Sets the actual position to the one provided by the event.
System.out.println(getName() + "@" + getEngine().getCurrentTime() + ": reached node (" + getPosition().getX() + ... | 3 |
public boolean ValidateTickers(List<String> tickers){
if(tickers.isEmpty()){
return false;
}
boolean areValid = true;
for(String s : tickers){
if(!ValidateTicker(s)){
areValid = false;
}
}
return are... | 3 |
public MethodAnalyzer getMethodAnalyzer() {
ClassAnalyzer ana = getClassAnalyzer();
if (ana == null)
return null;
return ana.getMethod(methodName, methodType);
} | 1 |
public void makeCollisionConnection(String firstLayer, String secondLayer, CollisionReport reportTo) {
if (firstLayer != null || secondLayer != null || reportTo != null) {
LayerConnection lc = new LayerConnection( findLayerByName(firstLayer), findLayerByName(secondLayer), reportTo);
coll... | 3 |
@Override
public int getFreeSpace() {
int freeSpace = 0;
for (int i = 1; i <= aisleCount; i++) {
try {
Aisle aisle = (Aisle) manager.get("A" + i);
List<Rack> racks = aisle.getRacks();
for (int j = 0; j < racks.size(); j++) {
... | 4 |
private static Hashtable getMatch(Term term, Term pattern) {
//System.out.println("\n------ match -------");
//System.out.println(term);
//System.out.println(pattern);
Hashtable result = new Hashtable();
if (pattern.isVariable()) {
result.put(pattern.getVariable(), term);
} else if (term.getTopOperation(... | 8 |
public LSystemDisplay(LSystemEnvironment environment) {
super(environment, "Render System", null);
putValue(ACCELERATOR_KEY, KeyStroke.getKeyStroke(KeyEvent.VK_D,
MAIN_MENU_MASK));
} | 0 |
public Usuario buscaPorEmailESenha(String email, String senha) {
if (!USUARIOS.containsKey(email))
return null;
Usuario usuario = USUARIOS.get(email);
if (usuario.getSenha().equals(senha))
return usuario;
return null;
} | 2 |
public void testConstructor() {
assertEquals(1, DateTimeZone.class.getDeclaredConstructors().length);
assertTrue(Modifier.isProtected(DateTimeZone.class.getDeclaredConstructors()[0].getModifiers()));
try {
new DateTimeZone(null) {
public String getNameKey(long instant... | 1 |
private Node resolveStatement(int offset)
{
while(args.size() > offset+1)
{
int index = -1;
Object e;
int maxPrio = -1;
for(int i = offset; i < args.size(); i++)
{
e = args.get(i);
if (e instanceof OperationNode)
{
int curPrio = ((OperationNode) e).getPriority();
if (curPrio > ... | 5 |
public ShadingPattern getShading(String name) {
// look for pattern name in the shading dictionary, used by 'sh' tokens
if (shading != null) {
Object shadingDictionary = library.getObject(shading, name);
if (shadingDictionary != null && shadingDictionary instanceof Hashtable) {
... | 3 |
private void btn_aceptarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btn_aceptarActionPerformed
if (lab_modo.getText().equals("Alta")){
if (camposCompletos()){
ocultar_Msj();
insertar();
menuDisponible(true);
... | 9 |
private static void drawOcean(Graphics graphics, Ocean ocean) {
if (ocean != null) {
int width = ocean.width();
int height = ocean.height();
for (int y = 0; y < height; y++) {
for (int x = 0; x < width; x++) {
int contents = ocean.cellContents(x, y);
if (contents == Oc... | 5 |
private String calc(String input) {
String output = "";
int length = input.length();
Integer[] tempArray = new Integer[length];
for(int i = 0; i < length; i++){
tempArray[i] = i;
}
Collections.shuffle(Arrays.asList(tempArray));
for(int x = 0; x < length; x++){
output += input.charAt(tempArr... | 2 |
protected Floor decodeFloor(VorbisStream vorbis, BitInputStream source) throws VorbisFormatException, IOException {
//System.out.println("decodeFloor");
if(!source.getBit()) {
//System.out.println("null");
return null;
}
Floor1 clone=(Floor1)clone();
clone.yList=new int[x... | 5 |
public void deleteReplication(IInsertDeleteReplicationRequest req) throws RemoteException{
String key = req.getKey().trim();
int serverId = getServer(key);
String value = (String)req.getValue();
// drop the package, if the request is visited all servers
if(req.getProbe().contains(this.myId)){
h... | 8 |
@Override
public void draw() {
texture.bind();
//Center
for (int x = 0; x < Main.xLen; x += 1) {
for (int y = 0; y < Main.yLen; y += 1) {
drawTexture(0, 0, 32, 32, Main.padding + x * Main.tileSize, Main.padding + y * Main.tileSize, Main.tileSize, Main.tileSize);
}
}
//Edges
for (int x = 0; x <... | 7 |
public void ShuffleDeck(DeckType type) {
logger.debug("Shuffling Deck " + type);
switch(type){
default:
case Corpse: cardHolder.corpseDeck.shuffle(); processDrawCorpseCard(); break;
case Crypt: cardHolder.cryptDeck.shuffle(); processDrawCryptCard(); break;
... | 9 |
private void txtcedulaKeyTyped(java.awt.event.KeyEvent evt) {
char caracter = evt.getKeyChar();//Validacion del campo cedula
if (caracter >= '0' && caracter <= '9' || caracter == 8 || caracter == KeyEvent.VK_BACK_SPACE || caracter == KeyEvent.VK_CAPS_LOCK || caracter ... | 7 |
@Override
protected ExpressionElement protectedNext() {
switch (this.nextState) {
case LEFT_BRACKET:
this.nextState = State.LEFT_OPERAND;
return new OpenBracketExpression();
case LEFT_OPERAND:
this.nextState = State.OPERATOR;
Operand firstOperand = operator.getFirstOperand();
this.innerI... | 5 |
private boolean isOver(int x, int y) {
return x >= 0 && y >= 0 && x < getWidth() && y < getHeight();
} | 3 |
Scriptable compile(Context cx, Scriptable scope, Object[] args)
{
if (args.length > 0 && args[0] instanceof NativeRegExp) {
if (args.length > 1 && args[1] != Undefined.instance) {
// report error
throw ScriptRuntime.typeError0("msg.bad.regexp.compile");
... | 7 |
private void fixNegativeRed(Node negRed)
{
Node n1, n2, n3, n4, t1, t2, t3, child;
Node parent = negRed.parent;
if (parent.left == negRed)
{
n1 = negRed.left;
n2 = negRed;
n3 = negRed.right;
n4 = pare... | 5 |
public boolean createPartition(int partId, int numPE,
PartitionPredicate predicate) {
if(partId >= partitions.length || partId < 0) {
throw new IndexOutOfBoundsException("It is not possible to " +
"add a partition with index: " + partId + ".");
}
else if(numPE < 0) {
throw new IllegalArgum... | 4 |
@Override
public void run() {
//shadow mode
Coordinate p;
p = gui.getPlayerCoordinate(player);
while (true) {
// Check if Paused
synchronized (Game.lockPause) {
if(Game.isPaused() || Game.isHasWinner())
try {
Game.lockPause.wait();
} catch (InterruptedException e) {
e.printStac... | 9 |
public static void testDenominators() {
DB db = DBMaker.newFileDB(new File(serializationFolder + "denominators" + "_mapdb.bin" ))
.readOnly()
.make();
Map<Tuple_WithEqualityConstraints, int[]> myMap_counts_first_tuple_directed = db.getHashMap("counts_first_tuple_directed");
Map<Tuple_WithEqualityConstrai... | 8 |
@Override
public String getMessage() {
// server 1 and server 2
if (this.server != null && this.server2 != null) {
return String.format("%s %s %s", this.getCommandName(), this.server, this.server2);
}
// server 1 but not server 2
if (this.server != null && this.server2 == null) {
return String.form... | 6 |
public static void addSystemTestScroe(String state ,HashMap<String, Float> systemTestScores, float systemTestPoints) {
if(lastSystemTestPoints == null)
lastSystemTestPoints = new HashMap<String, Float>();
if(lastSystemTestPoints.containsKey(state))
last... | 4 |
public static void main(String[] args) {
IDBFactoryPlugin plugin=new NonSQLPlugin();
System.out.println("plugin made-pre start");
plugin.start();
System.out.println("connection made-pre clear");
plugin.clearAllTables();
System.out.println("made db-pre save");
//Test Users
List<String> names=new ArrayLis... | 3 |
private String getTranslation(String address) throws Exception {
String content = loadPage(address);
if(content.indexOf("nebylo nic nalezeno") != NOT_FOUND || content.indexOf("li jste hledat?") != NOT_FOUND)
return NO_TRANSLATION;
String[] translations = getAllPossibleTranslations(... | 6 |
@Override
protected void keyTyped(char var1, int var2) {
if(var2 == 1) {
this.func_22115_j();
} else if(var2 == 28) {
String var3 = this.message.trim();
if(var3.length() > 0) {
this.mc.thePlayer.sendChatMessage(this.message.trim());
}
this.message... | 3 |
protected TechComponent findComponentByName(List<? extends TechComponent> list, String prefix, String name)
{
if(list.size()==0)
return null;
name=name.toUpperCase();
if(name.startsWith(prefix))
{
final String numStr=name.substring(6);
if(!CMath.isInteger(numStr))
return null;
final int num=CMa... | 7 |
public String getSuffix()
{
return _suffix;
} | 0 |
@Override
public Matrix run(Matrix coef, Matrix free) {
int n = coef.getHeight();
double[][] alpha = new double[n][n];
double[][] beta = new double[n][1];
for (int i = 0; i < n; i++) {
for (int j = 0; j < n; j++) {
alpha[i][j] = (i == j ? 0. : -coef.get(i, j) / coef.get(i, i));
}
beta[i][0] = free... | 5 |
public void run ()
{
while (true)
{
if ( !plugin.isEnabled())
break;
try
{
if (this.updateCheck() && download)
{
this.downloadLatestVersion();
}
Thread.slee... | 5 |
private static Monster[] renameDouble(Monster[] group) {
for (int i = 0; i < group.length; i++) {
for (int j = i + 1; j < group.length; j++) {
if (group[i].getName().equals(group[j].getName())) {
int doubleCount = 1;
for(int k = 0; k < j; k++){
if(group[k].getName().contains(group[i].getName... | 5 |
private SootMethod initializeSoot() {
Options.v().set_no_bodies_for_excluded(true);
Options.v().set_allow_phantom_refs(true);
Options.v().set_output_format(Options.output_format_none);
Options.v().set_whole_program(true);
Options.v().set_soot_classpath(apkFileLocation + File.pathSeparator
+ Scene.v().getA... | 4 |
public int[] twoSum(int[] numbers, int target) {
// IMPORTANT: Please reset any member data you declared, as
// the same Solution instance will be reused for each test case.
// Arrays.sort(numbers);
int[] res = new int[2];
for (int i = 0; i < numbers.length; ++i) {
int subTarget = target - numbers[i];
i... | 3 |
public CypherType predictNew(String text)
{
//to determine the type. get the sig and scrawl predictions,
// then get the highest value of their vector additions.
double [] sigPredict = sigPredict(text);
double [] scrawlPredict = scrawlPredict(text);
int highestIndex;
double highestValue;
highest... | 7 |
@Override
@SuppressWarnings("unchecked")
public String toJSONString() {
BetterJSONObject o = new BetterJSONObject();
o.put("meta", this.meta);
if (this.network != null) {
o.put("network", this.network);
}
if (this.performance != null) {
o.put("performance", this.performance);
}
return o.toJSON... | 2 |
private synchronized Bestandteil getBestandTeilvonFile(File f) {
try{
Scanner fileScanner = new Scanner(f);
if(!fileScanner.hasNext()){ //Sollte kein bestandteil vorhanden sein wird null zurueckgegeben
fileScanner.close(); //filescanner vor dem return wieder freigeben
return null;
}
Stri... | 6 |
public String getFilter() {
if (this.isValid()) {
final StringBuilder sb = new StringBuilder("filters");
for (final String field : this.path) {
sb.append("[").append(field).append("]");
}
return sb.toString();
}
return null;
} | 2 |
@Override
public boolean removeLockByTransaction(String transaction) {
Set<String> thisResources = this.resourcesOfT.get(transaction);
// This transaction locks no resources
if (thisResources == null || thisResources.isEmpty())
return false;
boolean thereturn = false;
... | 4 |
public boolean ruleFires(ArrayList<Conditional> facts)
{
//if counter is not set correctly, return false
if(counter != -1 && counter < counterLimit)
return false;
for(Conditional item: Conditions)
{
if(!facts.contains(item))
{
... | 4 |
public Boolean concluir(Emprestimo emprestimo) {
Boolean sucesso = false;
Connection connection = conexao.getConnection();
try {
String valorDoComandoUm = comandos.get("concluir" + 1);
String valorDoComandoDois = comandos.get("concluir" + 2);
StringBuilder que... | 6 |
public String toString(){
String resultado = "{ ";
if(getInicio() == null){
return "Lista personas esta vacia";
}else{
NodoPersonas q = this.inicio;
while(q != null){
resultado += q.getInfo().toString() + ",\n\n";
q = q.getLiga();
}
return resultado.substring(0,resultado.length() -1 ) ... | 2 |
public QuitParseException(String msg)
{
super(msg);
} | 0 |
public List getMaps(GameAction gameCode) {
ArrayList list = new ArrayList();
for (int i=0; i<keyActions.length; i++) {
if (keyActions[i] == gameCode) {
list.add(getKeyName(i));
}
}
for (int i=0; i<mouseActions.length; i++) {
if (mouse... | 4 |
public void writeEnvironment(StringBuilder code, Environment env) {
for (Environment.EnvironmentEntry ent : env) {
if (ent.loc.type != Location.LocationType.HeapLocation)
continue;
if (ent.val.type instanceof ArrayType) {
ArrayType t = (ArrayType) ent.val.type;
int min = Math.min(t.min, 0);
int... | 7 |
public void paint(Graphics2D g2, boolean draw, boolean fill ){
if (calcularvarr) {
calcularvar();
calcularvarr = false;
}
if (draw && !fill) {
g2.draw(path);
}else if(fill && !draw){
g2.fill(path);
}else if(draw && fi... | 7 |
private Component getParseButton() {
JButton jbParse = new JButton("Parse");
jbParse.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent ae) {
String text = inputText.getText();
String regex = jtfParseExpression.getSelected... | 1 |
public void findHiddenPrice() {
try {
Class.forName("com.mysql.jdbc.Driver");
} catch (ClassNotFoundException e) {
System.out.println("Where is your MySQL JDBC Driver?");
e.printStackTrace();
}
PreparedStatement ps = null;
Connection con = nul... | 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.