text stringlengths 14 410k | label int32 0 9 |
|---|---|
public static void main(String [] args) {
//Start time
long startTime = System.currentTimeMillis();
for( int c = 334; c < 1000; c++) {
for( int a = 1; a < c; a++) {
int b = 1000 - c - a;
if( isPythagTriple(a,b,c)) {
System.out.println(a + " , " + b + " , " + c);
System.out.println( a * b * c... | 3 |
public void changerDeVue(String nomVue){
System.out.println("GuiCR::changerDeVue()");
if(nomVue.equals("Liste visiteurs")){
this.vues.show(this.conteneur,nomVue) ;
this.vueVisualiserVisiteurs.actualiser() ;
}
else if(nomVue.equals("Liste praticiens h�sitants")){
this.vues.show(this.conteneur,nomVue) ;
... | 9 |
protected void doGet(HttpServletRequest request,
HttpServletResponse response) throws ServletException, IOException {
response.setCharacterEncoding("UTF-8");
// Setup output stream
PrintWriter out = response.getWriter();
// out.println("System is closed.");
boolean isAuthorized = false;
String requestU... | 8 |
public static void main(String[] args) {
try {
Socket s = null;
for(int i = 0; i < Robot.robots.size(); i++) {
try {
SocketAddress local = new InetSocketAddress(InetAddress.getLocalHost(), CBCGUI.PORT + 1 + i);
SocketAddress server ... | 6 |
private int GeneraNumero(int[][] matriz, int fila, int columna)
{
int resp = 0;
boolean flag = false;
//Genera lista para validar los numeros utilizados en el ciclo
ReiniciarSecuencia();
do
{
boolean validaFila = true;
... | 9 |
@Override
protected void onNotify(BTServerStateListener listener, int event, Object o) {
if ((SERVER_STARTED & event)>0){
listener.serverStarted();
}
if ((SERVER_ACCEPT & event)>0){
listener.serverAccept();
}
if ((SERVER_STOPPED & event)>0){
listener.serverStopped();
}
if ((SERVER_LIST... | 6 |
public static ACTIONS fromString(String strKey) {
if (strKey.equalsIgnoreCase("ACTION_UP")) return ACTION_UP;
else if (strKey.equalsIgnoreCase("ACTION_LEFT")) return ACTION_LEFT;
else if (strKey.equalsIgnoreCase("ACTION_DOWN")) return ACTION_DOWN;
else if (strKey.equalsIg... | 6 |
public void addNotes(String note)
{
String eol = System.getProperty("line.seperator");
if(this.contactNotes==null || this.contactNotes.equals(""))
{
this.contactNotes = note;
}else{
this.contactNotes = this.contactNotes + eol + note;
}
} | 2 |
public Object [][] getDatos(){
Object[][] data = new String[getCantidadElementos()][colum_names.length];
//realizamos la consulta sql y llenamos los datos en "Object"
try{
if (colum_names.length>=0){
r_con.Connection();
String c... | 5 |
public void poistaRivi(int rivi) {
if (rivi >= 0) {
elokuvalista.poista(rivi);
this.fireTableDataChanged();
}
} | 1 |
public static double dynamicallyEstimateInferenceCost(NamedDescription self) {
{ MemoizationTable memoTable000 = null;
Cons memoizedEntry000 = null;
Stella_Object memoizedValue000 = null;
if (Stella.$MEMOIZATION_ENABLEDp$) {
memoTable000 = ((MemoizationTable)(Logic.SGT_LOGIC_F_DYNAMICALLY... | 6 |
public static ListNode alterList(ListNode head) {
if (head == null || head.next == null)
return head;
//find the midpoint of the list
ListNode p = head, q = head.next;
while (q != null && q.next != null) {
p = p.next;
q = q.next.next;
}
q = p.next;
p.next = null;
//reverse the half of ... | 6 |
@Override
public void buildModel(Dataset dataset)
{
estimators = new DecisionTreeC45[estimatorCount];
estimatorWeight = new double[estimatorCount];
for(int i = 0; i < estimatorCount; i++)
{
estimators[i] = new DecisionTreeC45();
estimators[i].maxHeight = splitCount;
estimators[i].needPrune = false;
... | 7 |
final void removeImageFetcher(Canvas canvas) {
do {
try {
anInt7674++;
if (canvas == aCanvas7626)
throw new RuntimeException();
if (!aHashtable7577.containsKey(canvas))
break;
Long var_long = (Long) aHashtable7577.get(canvas);
anOpenGL7664.releaseSurface(canvas, var_long.longValue());
aHas... | 5 |
public static ArrayList<QuizTakenRecord> getQuizHistoryByUserID(int userID) {
ArrayList<QuizTakenRecord> records = new ArrayList<QuizTakenRecord>();
String statement = new String("SELECT * FROM " + DBTable + " WHERE userid = ?");
PreparedStatement stmt;
try {
stmt = DBConnection.con.prepareStatement(statemen... | 2 |
public static void main(String[] args) throws IOException {
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
String line = "";
StringBuilder out = new StringBuilder();
while ((line = in.readLine()) != null && line.length() != 0) {
int k = Integer.parseInt(line.trim());
Manacher m ... | 8 |
public static void initializeTranslates() {
// Initialize the scaling translates
Transform.scalingTranslates = new ArrayList<Double> ();
int startTranslate = (int) Math.floor((Math.pow(2,Settings.startLevel)*Settings.getMinimumRange())-Wavelet.getSupport()[1]);
int stopTranslate = (int) Math.ceil((Math.pow(2... | 4 |
private void delCchButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_delCchButtonActionPerformed
if(tablaCoches.getSelectedRow() >= 0){
askWind a = new askWind(new javax.swing.JFrame(),true,"Seguro que desea eliminar este vehiculo?");
a.setLocationRelativeTo(null);... | 3 |
@Override
public Integer getValue() {
return this.value;
} | 0 |
public CFPumpingLemmaChooser()
{
myList = new ArrayList();
//old languages
myList.add(new AnBnCn());
myList.add(new WW());
myList.add(new AnBjAnBj());
myList.add(new NaNbNc());
myList.add(new NagNbeNc());
myList.add(new AiBjCk());
myLi... | 0 |
private XTreeTry makeTryPosStarted(){
expect(XKeyword.TRY);
XTreeScope resources;
if(tokenOk(XTokenKind.KEYWORD, XKeyword.LBRAKET)){
startPosition();
tokenizer.next();
List<XTreeStatement> list = new ArrayList<XTreeStatement>();
list.add(makeExpr());
while(tokenOk(XTokenKind.KEYWORD, XKeyword.SEMIC... | 6 |
public char skipTo(char to) throws JSONException {
char c;
try {
int startIndex = this.index;
reader.mark(Integer.MAX_VALUE);
do {
c = next();
if (c == 0) {
reader.reset();
this.index = startIndex... | 3 |
private static void StackWithArrayMenu(StackWithArray<Integer> StackWithArray){
System.out.println("What do you want to do ?");
System.out.println("1) pop");
System.out.println("2) top");
System.out.println("3) push");
System.out.println("4) print");
System.out.println("Enter your option");
try{
choose... | 8 |
* @param var2 The second list
* @return result The difference of var1 and var2
*/
static LinkedList<Integer> subtract(LinkedList<Integer>var1, LinkedList<Integer>var2){
LinkedList<Integer> result = new LinkedList<Integer>();
// If var1 has fewer digits than var2, var1 must be smaller than var2, so return 0
... | 9 |
public void update() {
int current = currentQueue;
currentQueue = (currentQueue + 1) % 2;
eventQueues.get(currentQueue).clear();
ArrayDeque<IGameEvent> toEmpty = eventQueues.get(current);
while(!toEmpty.isEmpty()) {
IGameEvent event = toEmpty.pollFir... | 1 |
private static void test_itostrb(TestCase t) {
// Print the name of the function to the log
pw.printf("\nTesting %s:\n", t.name);
// Run each test for this test case
int score = 0;
for (int i = 0; i < t.tests.length; i += 2) {
String exp = (String) t.tests[i];
int arg1 = (Integer) t.tests[i + 1];
S... | 2 |
public String getImageFile()
{
return filename;
} | 0 |
@Override
public boolean equals(Object obj) {
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final Search_Result other = (Search_Result) obj;
if (!Objects.deepEquals(this.imageIds, other.imageIds)) {
... | 6 |
public void loadKompetenser() {
PanelHelper.cleanPanel(kompetensHolderPanel);
Dimension d = kompetensHolderPanel.getPreferredSize();
d.setSize(400, 10);
kompetensHolderPanel.setPreferredSize(d);
ArrayList<HashMap<String, String>> a1 = null;
try {
String query ... | 3 |
public void transformCode(BytecodeInfo bytecode) {
this.bc = bytecode;
calcLocalInfo();
if ((GlobalOptions.debuggingFlags & GlobalOptions.DEBUG_LOCALS) != 0) {
GlobalOptions.err.println("Before Local Optimization: ");
dumpLocals();
}
stripLocals();
distributeLocals();
if ((GlobalOptions.debuggingFl... | 2 |
public int insert(Funcao f) {
Connection conn = null;
PreparedStatement pstm = null;
int retorno = -1;
try {
conn = ConnectionFactory.getConnection();
pstm = conn.prepareStatement(INSERT, Statement.RETURN_GENERATED_KEYS);
pstm.setString(1, f.getNome(... | 3 |
@Override
public void execute(String command) throws CommandExecutionException {
System.out.println("Execution: " + command);
Validate.notEmpty(command, "Command line must be not empty.");
Process process = null;
Throwable throwable = null;
try {
process = Runt... | 5 |
@Override
public void atacar(){
if(!this.matriz[this.objectivo.x][this.objectivo.y].getOcupado()){
this.objectivo.x=0;
this.objectivo.y=0;
}else{
ImageIcon iconLogo = new ImageIcon(IMG.getImage(this.mainImg));
this.refLabel.setIcon(iconLogo);
... | 2 |
@SuppressWarnings("unchecked")
private void Help(StateInfo<T> u){
if(u==null)
return;
switch(u.state){
case StateInfo.IFlag:
if(u.info instanceof IInfo)
HelpInsert((IInfo<T>) u.info);
break;
case StateInfo.MARKED:
if(u.info instanceof DInfo)
HelpMarked((DInfo<T>)u.info);
break;
case ... | 7 |
public String getName() { return this.name; } | 0 |
public int compare(Object o1, Object o2)
{
int prob_diff=((data)o2).get_probability()-((data)o1).get_probability();
if(prob_diff<0)return -1;
if(prob_diff>0)return 1;
return 0;
} | 2 |
private void skip0(CSVParser csv, int lines) {
try {
csv.skipLines(lines);
} catch (IOException ex) {
throw new RuntimeException(ex);
}
} | 1 |
public void testRefTime() {
ReferenceGroupSet ref = new ReferenceGroupSet();
for( int i = 0; i < 100000; i++ ) {
switch( mRand.nextInt( 4 ) ) {
case 0:
{
int c = mRand.nextInt( 10 );
int v = mRand.nextInt( 100 );
ref.a... | 9 |
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 |
@Test
public void testLongWalkManager() throws IOException {
int nvertices = 33333;
LongWalkManager wmgr = new LongWalkManager(nvertices, 40000);
int tot = 0;
for(int j=877; j < 3898; j++) {
wmgr.addWalkBatch(j, (j % 100) + 10);
tot += (j % 100) + 10;
... | 9 |
@Override
public void processCommand(String command, Scanner sc) {
switch (command) {
case "-help": {
getHelp();
break;
}
case "-expatt": {
processExpAtt(sc);
break;
}
case "-expst": {
processExpSt(sc);
break;
}
case "-cc": {
createCourse(sc);
break;
}
case "-cs": {
creat... | 7 |
@Override
public void windowDeactivated(WindowEvent arg0) {
// TODO Auto-generated method stub
} | 0 |
private void initConnection() {
try {
if (url.toURI().toString().contains("https")) {
connection = (HttpsURLConnection) url.openConnection();
} else {
connection = (HttpURLConnection) url.openConnection();
}
} catch (IOException | URISyntaxException e1) {
// TODO Auto-generated catch block
e... | 9 |
public void mouseClicked(MouseEvent me)
{
try
{
if (me.getSource() == jb_connexion)
{
login = jtf_login.getText();
password = String.valueOf(jpf_password.getPassword());
System.out.println("Email : "+login);
System.out.println("MotDePasse : "+password);
User u = null;
... | 6 |
public static void main(String[] args) throws Exception {
URL yahoo = new URL("http://www.yahoo.com/");
BufferedReader in = new BufferedReader(
new InputStreamReader(
yahoo.openStream()));
String inputLine;
while ((inputLine = in.readLine()) != null)
System.out.println(inputLine);
in.close(... | 1 |
private void initBorders() {
for(int i = 0; i < height; i++) {
grid[0][i] = new Fence(0, i, this);
grid[width-1][i] = new Fence(width-1, i, this);
}
//Offset by 1 because corner
for(int i = 1; i < width; i++) {
grid[i][0] = new Fence(i, 0, this);
grid[i][height-1] = new Fence(i, height-1, this);
}... | 2 |
public Piece selectPieceJouable(int tour)
{
Position pos = null;
Piece pieceSelected = null;
boolean stop = false;
do
{
pos = this.getCaseCliquee();
if(pos != null)
if(this.E.getTableau()[pos.getI()][pos.getJ()] != null)
if(((tour%2 != 0) && (this.E.getTableau()[pos.getI()][pos.getJ()].getCou... | 7 |
public boolean doTransformations() {
return ((initBlock == null && type == POSSFOR) || (initInstr == null && type == FOR))
&& CreateForInitializer.transform(this, flowBlock.lastModified);
} | 4 |
private void initGUI() {
try {
{
jPanelText = new JPanel();
getContentPane().add(jPanelText, BorderLayout.EAST);
jPanelText.setPreferredSize(new java.awt.Dimension(343, 362));
}
{
jPanelLabel = new JPanel();
getContentPane().add(jPanelLabel, BorderLayout.WEST);
jPanelLabel.setPreferre... | 1 |
public static MaplePacket updateParty(int forChannel, MapleParty party, PartyOperation op, MaplePartyCharacter target) {
MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();
mplew.writeShort(SendPacketOpcode.PARTY_OPERATION);
switch (op) {
case DISBAND:
... | 8 |
public <T extends Apple & Comparable<Apple>> Collection<? super T> getNewFilteredCollection(
Collection<? extends T> collection, T element) {
Collection<Apple> filtereCollection = new ArrayList<>();
for (T t : collection) {
if (t.compareTo(element) > 0) {
filtereCollection.add(t);
}
}
return filter... | 4 |
public boolean saveFilesToDisk(String path) {
for (MultipartFile mpf : files) {
try {
errorMsg += "\nFile saved to: " + path;
File dest = new File(path, mpf.getOriginalFilename());
if (!dest.exists()) {
dest.mkdirs();
... | 4 |
public static <T> Constructor<T> getConstructorIfAvailable(Class<T> clazz,
Class<?>... paramTypes) {
Assert.notNull(clazz, "Class must not be null");
try {
return clazz.getConstructor(paramTypes);
} catch (NoSuchMethodException ex) {
return null;
}
} | 2 |
public Integer getIdEntrada() {
return idEntrada;
} | 0 |
public void setCount(int newHeadCount) {
if (newHeadCount >= headCount)
return;
headCount = newHeadCount;
if ((GlobalOptions.debuggingFlags & GlobalOptions.DEBUG_CONSTRS) != 0) {
GlobalOptions.err.println("setCount: " + this + "," + newHeadCount);
new Throwable().printStackTrace(GlobalOptions.err);
}
... | 5 |
public SplashScreen() {
Camera.get().addScreenEffect(new TintEffect(new Vector4f(0f, 0f, 0f, 0f), 1f, true, Tween.IN));
if(loadRandom) {
loadRandomSplashes();
} else {
loadSplashes();
}
} | 1 |
public void handleWaves(int delta) {
if (!wavesHaveBegun) {
handleWaitForFirstWave(delta);
return;
}
Wave currentWave = waves.get(waveIndex);
currentWave.update(delta);
if (currentWave.hasNextSpawn()) {
spawnEnemy(currentWave.nextSpawn());
}
if (currentWave.isFinished() && !isFinalWave()) {
... | 7 |
public LatLong(double latitude, double longitude) {
if (latitude > 90 || latitude < -90) {
throw new IllegalArgumentException("Latitude:" + latitude +", is outside of acceptable values (-90<x<90)");
} else if (longitude < -180 || longitude > 180) {
throw new IllegalArgumentException("Longitude :" + longitude ... | 4 |
@Override
public LogicalArea findArea(Area area)
{
if (getAreas().contains(area))
return this; //in our area nodes
else //in the subtree
{
for (int i = 0; i < getChildCount(); i++)
{
final LogicalArea ret = getChildArea(i).findArea(area... | 3 |
@Override
public Exam get(String examId) {
Exam.Builder examBuilder = new Exam.Builder();
try (Connection con = getConnection();
CallableStatement callableStatement = con.prepareCall(querySelectExamById)) {
callableStatement.setNString(1, examId);
try (ResultSe... | 5 |
public String checkNumber(int number) {
if (number == 1) {
return "Ace";
} else if (number == 11) {
return "Jack";
} else if (number == 12) {
return "Queen";
} else if (number == 13) {
return "King";
}
return null;
} | 4 |
@Override
public boolean equals(Object o)
{
if (o == null)
return false;
if (o == this)
return true;
if (!(o instanceof Arbeitsplan))
return false;
Arbeitsplan a = (Arbeitsplan) o;
if(a.getId() != this.getId())
return false... | 6 |
private void doSettings(int setting)
{
switch (setting)
{
case 0:
File SettingsDirectory = new File("Settings/");
if (!SettingsDirectory.exists())
{
SettingsDirectory.mkdir();
}
break;
//-------------------------------------------------------------... | 7 |
private void formScreen(String action,
Connection database,
HttpSession session,
HttpServletRequest request,
PrintWriter webPageOutput)
{
int orderNumber=0;
String orderName="";
... | 7 |
private void growRegionSeeds(){
int remainingSpaces = countSpaces();
while (remainingSpaces > 0){
Region r = regions.get((int) (Math.random() * regions.size()));
Tile t = r.getTiles().get((int) (Math.random() *r.getTiles().size()) );
Tile nt = null;
int x = t.getX();
int y = t.getY();
/*
* ... | 9 |
@Override
protected Void doInBackground() throws Exception {
final int BUFFER_SIZE = 10000;
Client client = new Client(BUFFER_SIZE, BUFFER_SIZE);
client.getKryo().register(PacketLogin.class);
client.getKryo().register(PacketLoginResponse.class);
client.getKryo().register(Pac... | 2 |
@Override
public void update(GameState state)
{
pos.add(vel, state.seconds);
if (pos.x < 0 || pos.x > AsteroidsGame.WIDTH || pos.y < 0 || pos.y > AsteroidsGame.HEIGHT)
{
expire();
}
// TODO Coll Detection
for (int j = 0; j < AsteroidsGame.enemies.size(); j++)
{
if (getBoundary().intersects(... | 6 |
public void setNilai(String nilai) {
this.nilai = nilai;
} | 0 |
private Music loadMusic(String path) throws SlickException {
if (path == null || path.length() == 0)
throw new SlickException("Sound resource has invalid path");
Music music = null;
try {
music = new Music(path);
} catch (SlickException e) {
throw new SlickException("Could not load sound", e);
}
... | 3 |
@Override
public long getIdleTimeout() {
return idleTimeout;
} | 0 |
public static int fieldNum(String name) {
int fieldNum = 0;
if (name.equals("LOF.GENE")) return fieldNum;
fieldNum++;
if (name.equals("LOF.GENEID")) return fieldNum;
fieldNum++;
if (name.equals("LOF.NUMTR")) return fieldNum;
fieldNum++;
if (name.equals("LOF.PERC")) return fieldNum;
fieldNum++;
... | 4 |
public String generateXML() {
// Fisierul XML se va genera intr-un folder separat de cel cu executabilele
String thisXMLPath = getXMLFolder() + "\\" + getName() + id + ".xml";
// Se ia fiecare parametru si se trece in tag-uri
File file = new File(thisXMLPath);
try {
file.createNewFile();
} catch (IOEx... | 8 |
@Override
public void assignValue(Designator d, BasicBlock cur, BasicBlock join, Environment env, Value newVal)
throws Exception {
if(global) {
used = true;
Adda ad = new Adda(getGBP(), getAddr(d));
cur.addInstruction(ad);
Store st = new Store(d.getVar... | 3 |
private void borrarFichero(File dir, int i) {
File[] files = dir.listFiles();
if (files != null) {
for (File f : files) {
if (f.isDirectory()) {
borrarFichero(f, i);
} else {
f.delete();
}
}
... | 3 |
static void init(){
SimpleDateFormat sdf =new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS");
sdf.setTimeZone(TimeZone.getTimeZone("GMT"));
try {
startDay= sdf.parse("1900-01-01 00:00:00.000");
endDay= sdf.parse("2001-12-04 00:00:00.000");
} catch (ParseException e)... | 1 |
public static void main(String[] args) {
try {
List<String> warnings = new ArrayList<String>();
boolean overwrite = true;
File configFile = new File(ClassLoader.getSystemResource(runXMLAUTHORITY).getFile());
ConfigurationParser cp = new ConfigurationParser(warnings);
Configuration config = cp.parseConf... | 6 |
public static String getPopulation(String date, String state, String gender)
{
DB db = _mongo.getDB(DATABASE_NAME);
DBCollection coll = db.getCollection(COLLECTION_POPULATION);
BasicDBObject query = new BasicDBObject();
query.put("year", "" + getYear(date));
DBCursor cur = coll.find(que... | 2 |
@SuppressWarnings("serial")
public MvcView(MvcModel model, JFrame Frame) {
// add a property change listener to the model to listen and
// respond to changes in the model's state
model.addPropertyChangeListener(new PropertyChangeListener() {
public void propertyChange(PropertyChangeEvent evt) {
// if the ... | 7 |
@After
public void tearDown() {
} | 0 |
private int minBest(int i, int j, int k){
double di = fitness.get(i);
double dj = fitness.get(j);
double dk = fitness.get(k);
if(di <= dj && di <= dk){
return i;
}else if(dj <= di && dj <= dk){
return j;
}else{
return k;
}
} | 4 |
public void beginTurn() {
if (!autoGame) {
autoGame = true;
for (int i = 0; i < numPlayers; i++) {
if (!players[i].isAI() && players[i].isLiving())
autoGame = false;
}
}
playerPnlHash.get(activePlayer).setActive(true);
int troopCount = Math.max(map.getTerritoryCount(activePlayer) / 3, 3)... | 7 |
public int getSequence() {
return this._sequence;
} | 0 |
@Override
public boolean processBuffer()
{
// Stream buffers can only be queued for streaming sources:
if( errorCheck( channelType != SoundSystemConfig.TYPE_STREAMING,
"Buffers are only processed for streaming sources." ) )
return false;
// Ma... | 5 |
protected void recoverStatements() {
class MethodVisitor extends ASTVisitor {
public ASTVisitor typeVisitor;
TypeDeclaration enclosingType; // used only for initializer
TypeDeclaration[] types = new TypeDeclaration[0];
int typePtr = -1;
public boolean visit(ConstructorDeclaration constructorDeclaration, Cl... | 9 |
@Override
public void update(long deltaMs) {
if(spawned) {
checkBossStatus();
}
else {
spawnBoss();
}
} | 1 |
public KladrComboBoxModel(String code, Integer type){
Kladr kladr = new Kladr();
LinkedHashMap<String, String> subjects = null;
if(code == null){
subjects = kladr.getSubjects();
}else if(type == KladrComboBoxModel.REGION){
subjects = kladr.getRegions(code);
... | 6 |
public int run() {
Utils.setConsoleTitle(log.localize("interactive.cmd.title"));
log.println("interactive.header", se.getFactory().getEngineName(), se.getFactory().getEngineVersion());
se.put(XScriptLang.ENGINE_ATTR_INTERACTIVE, true);
se.put(XScriptLang.ENGINE_ATTR_SOURCE_FILE, ".interactive");
@SuppressWarn... | 6 |
public static Stella_Object accessSavedInferenceLevelProofAdjunctSlotValue(SavedInferenceLevelProofAdjunct self, Symbol slotname, Stella_Object value, boolean setvalueP) {
if (slotname == Logic.SYM_LOGIC_SAVED_INFERENCE_LEVEL) {
if (setvalueP) {
self.savedInferenceLevel = ((InferenceLevel)(value));
... | 6 |
public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args){
if(cmd.getName().equalsIgnoreCase("settag")){
if (sender instanceof Player){
if (args.length==1){
if(((Player) sender).getItemInHand().getTypeId() == plugin.getConfig().getInt("radioitemid")){
if(args[0].equals(... | 9 |
@Raw
public Weapon getNextWeapon() throws IllegalStateException {
if (currentWeaponIndex == -1 && weaponList.size() == 0)
throw new IllegalStateException("Next Weapon isn't available since the list doesn't contain any weapons.");
if (currentWeaponIndex == weaponList.size() - 1)
return weaponList.get(0);
el... | 3 |
public static boolean fileprocess(String downloadpath, String filepath, String []paras, String sn){
int errorcode=0;// print error code in the final output file;
int errornum = 13;
String result="";
File downloadfile = new File(downloadpath+"\\humid_test.txt");
File outputfile = new File(filepath);
do... | 8 |
private String readIACSETerminatedString(int maxlength) throws IOException {
int where = 0;
char[] cbuf = new char[maxlength];
char b = ' ';
boolean cont = true;
do {
int i;
i = rawread();
switch (i) {
... | 8 |
protected static Object getter(Object obj, String type, String attr) {
Class<?> c = obj.getClass();
Method method = null;
if (type.equals("boolean")) {
try {
method = c.getMethod("is" + attr);
} catch (Exception e) {
LOG.error("没有这个方法is" + attr + "或者因为安全问题无法访问", e);
}
} else {
try {
meth... | 5 |
public void setDest(String dest){
this.dest = dest;
} | 0 |
public boolean additionalStrictCheck() {
for (GridElement ge : g) {
if (ge instanceof Cell) {
Cell cell = (Cell) ge;
if (cell.getDigit() != -1) {
if (cell.countYesEdges() != cell.getDigit()) {
iV = cell.getY();
... | 7 |
public static double getSumValue(HashMap<String, Double> map) {
Double count = 0.0D;
List list = new LinkedList(map.entrySet());
for (Iterator it = list.iterator(); it.hasNext();) {
Map.Entry entry = (Map.Entry) it.next();
count += map.get(entry.getKey());
}
return count;
} | 1 |
public static void main(String[] args)
{
//Set Used Queues values to False
for(int k = 0;k<=5;k++)
{
usedQueues[k] = false;
usedStatusArea[k] = false;
usedConnectionThread[k] = false;
usedUploadQueues[k] = false;
usedUploadStatusArea[k] = false;
usedUploadConnectionThread[k] = false;
}
... | 2 |
@Override
public void map(LongWritable id, Text line,
OutputCollector<IntWritable, Text> out, Reporter reporter)
throws IOException {
// Get Name and Text of document
contents = line.toString().split("\\|",2);
words = contents[1].split("\\s+");
// Process for document names and contents that are ... | 9 |
public static void newStartMenu(Game game, Screen parent, PokeInstance pokemon) {
try {
pokemonStatusMenuClass.getConstructors()[0].newInstance(game, parent, pokemon);
} catch (InstantiationException e) {
e.printStackTrace();
} catch (IllegalAccessException e) {
e.printStackTrace();
} catch (IllegalArg... | 5 |
public void start()
throws Exception
{
_unavailable=0;
super.start();
if (!javax.servlet.Servlet.class
.isAssignableFrom(_class))
{
Exception ex = new IllegalStateException("Servlet "+_class+
" is no... | 7 |
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.