text stringlengths 14 410k | label int32 0 9 |
|---|---|
public boolean addEdge(Tile tile1, Tile tile2, String direction1, String direction2, Item key, boolean crossable)
{
Edge e;
Direction dir1 = Direction.valueOf(direction1.toUpperCase());
Direction dir2;
if(dir1 != null)
{
if(direction2.isEmpty()) dir2 = dir1.getOppositeDirection();
else dir2 = Direction... | 3 |
private void calculateElements(double t)
throws JPLEphemerisException {
ephemeris.calculatePositionAndVelocity(t, JPLEphemeris.NEPTUNE,
position, velocity);
position.rotate(OBLIQUITY, Vector.X_AXIS);
velocity.rotate(OBLIQUITY, Vector.X_AXIS);
position.multiplyBy(AU);
velocity.multiplyBy(AU*K);
... | 4 |
@Override
public boolean equals(Object other) {
if (other == null)
return false;
if (other == this)
return true;
if (!(other instanceof Feature))
return false;
Feature otherF = (Feature) other;
boolean result = false;
// Mu... | 9 |
protected void train(double limiar)
{
double[] err = new double[w.length];
double t = 9999;
/*while (t > limiar)
{*/
for(int k = 0; k < 100000; k++)
{
t = 0;
for(int i = 0; i < w.length; i ++)
{
err[i] = erro(i);
w[i] = w[i] - (ETA*erro(i));
err[i] = err[i] - erro(i);
}
fo... | 3 |
@Override
public void copyTo(MapLayer other) {
for (int y = bounds.y; y < bounds.y + bounds.height; y++) {
for (int x = bounds.x; x < bounds.x + bounds.width; x++) {
((TileLayer) other).setTileAt(x, y, getTileAt(x, y));
}
}
} | 2 |
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
RecordSelectorNode other = (RecordSelectorNode) obj;
if (selector == null) {
... | 9 |
private int setQuarter(int quarter, String description)
{
if (quarter == 5)
{
this.overtime = true;
if (description.contains("1st"))
{
return 1;
}
else if (description.contains("2nd"))
{
return 2;
}
else if (description.contains("3rd"))
{
return 3;
}
else if (descriptio... | 7 |
public void authenticate() throws ParseException, IOException {
String string;
Boolean exit = false;
JSONObject json;
// If not authenticated already, commence
if (!authenticated) {
try {
// Keep reading outpu... | 9 |
public static void main(String[] args) {
System.out.println("main start");
new Thread(new Runnable() {
@Override
public void run() {
for (int i=0; i<100; i++) {
System.out.println("thread:" + i);
//这里本意是要程序停止的
if (i == 10) {
System.exit(0);
}
try {
Thread.sleep(200);
... | 5 |
public static String[] convertSingleConsoleCommand(String command)
throws InvalidCommandException {
logger.trace("Converting single console command for ProcessBuilder: " + command);
List<String> preparedResult = new ArrayList<String>();
String tmp = null;
for (String curren... | 7 |
public String getDirectory() {
return (isAValidDirectory()) ? args[0] : Constants.DEFAULT_SERVER_DIRECTORY;
} | 1 |
@Override
public void build(JSONObject json, FieldsMetadata metadata, IContext context) {
// iterate on all the simple text
Iterator<?> iter = json.entrySet().iterator();
while (iter.hasNext()) {
Map.Entry<?,?> entry = (Map.Entry<?,?>)iter.next();
// add the text to the report's context
context.put(entr... | 6 |
public void takeTurn(int roll) {
//calculate targets
Board.calcTargets(currentPlayer.getLocation().y, currentPlayer.getLocation().x, roll);
//take human turn
if(currentPlayer == human) {
this.setTurnDone(false);
Board.setHumanTurn(true);
Board.repaint();
}
//take computer turn
else {
setTur... | 6 |
public static void main(String[] args){
//dirty log init
org.apache.log4j.BasicConfigurator.configure();
Model model = ModelFactory.createDefaultModel();
File f = new File("rdf-model.xml");
FileReader fr;
try {
fr = new FileReader(f);
model.read(fr, "http://imi.org/");
} catch (FileNotFoundExcept... | 3 |
private void CalculateAttackSuccessButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_CalculateAttackSuccessButtonActionPerformed
PreparedStatement ps_update = null;
Connection conn = null;
try {
if ((conn = JavaDBAccess.setConn()) != null) {
System.out.println("Co... | 4 |
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://download.oracle.c... | 8 |
public void setKodPocztowy(String kodPocztowy) {
this.kodPocztowy = kodPocztowy;
} | 0 |
private void saveInfo(String name)
{
FileWriter baseSave = null;
String eol = System.getProperty("line.separator");
try
{
baseSave = new FileWriter(name+".rcf");
//Build the file header
baseSave.write("Base Controller Info;" + eol);
//The Base Controller Name
baseSave.write(">name:"+strName+";... | 9 |
protected void handleMousePressed(MouseEvent e) {
synchronized (simulator) {
if (simulator.isRunning()) {
simulator.stop();
} else {
simulator.start();
}
}
} | 1 |
public static void printTree(MyTreeNode<Integer> root){
if(root == null) return;
Stack<MyTreeNode<Integer>> stack = new Stack<>();
MyTreeNode<Integer> temp = root;
stack.add(temp);
MyTreeNode<Integer> head = null;
while (!stack.isEmpty()) {
temp = stack.peek();
if (temp.getRight() == head || tem... | 8 |
@EventHandler
public void Mondo(PlayerChangedWorldEvent event)
{
for(String s:Main.jl.dati())
{
System.out.println(s);
}
String name = event.getPlayer().getName();
if(!Main.jl.leggi(name))
{
if(event.getPlayer().getWorld() == Main.server.getWorld(Main.conf.mondo))
{
Location lc = Main.sp.c... | 3 |
public double lru()
{
if(printAll)
System.out.println("~~~~~ Least Recently Used ~~~~~");
int hits = 0;
Page evictedPage;
int prevPageRef = -1;
int nextPage;
for(int i=0;i<PAGE_REFERENCES;i++)
{
evictedPage = null;
nextPage = nextReference(prevPageRef);
prevPageRef = nextPage;
fo... | 8 |
private void searchGoodWord(List<String> words) {
if(words != null && !words.isEmpty()) {
List<Keyword> keywordList = dictionary.getKeywordList();
int priority = -1;
float distance = 1;
int elementId = -1;
int elementIdRegardingDistance = 0;
for(int i = 0; i < words.size(); i++) {
String[] p... | 9 |
public Question getNextQuestion() {
if (nextQuestion == QueStatus.Q1_GAS_TYPE) return new Q1_GasType(gasSAXManager);
else if (nextQuestion == QueStatus.Q2_ASK_BRAND) return new Q2_AskBrand(gasSAXManager);
else if (nextQuestion == QueStatus.Q3_CHOOSE_BRANDS) return new Q3_ChooseBrands(gasSAXManager);
... | 4 |
@Override
public String toString() {
return "fleming.entity.Entradas[ idEntrada=" + idEntrada + " ]";
} | 0 |
private boolean jj_3R_16()
{
if (jj_3R_18()) return true;
Token xsp;
while (true) {
xsp = jj_scanpos;
if (jj_3R_19()) { jj_scanpos = xsp; break; }
}
return false;
} | 3 |
public void defaultFlipping(CharacterAction action) {
switch (action) {
case DEFAULT:
break;
case IDLE:
break;
case ATTACK:
break;
case MOVELEFT:
currentAction.setFlip(true);
break;
... | 8 |
@Override
public void paint(Graphics g) {
super.paint(g);
Dimension koko = getSize();
int huippu = (int) koko.getHeight() - log.getRuudunKorkeus() * nelionKorkeus();
for (int i = 0; i < log.getRuudunKorkeus(); ++i) {
for (int j = 0; j < log.getRuudunLeveys(); ++j) {
... | 5 |
public void setVinculo(Vinculo vinculo){
this.vinculo = vinculo;
if(vinculo != null){
this.lblMatriculaValor.setText(vinculo.getMatricula());
if(vinculo.getLinhaDePesquisa() != null){
this.lblLinhaDePesquisaValor.setText(vinculo.getLinhaDePesq... | 5 |
private void thresholdEdges() {
for (int i = 0; i < picsize; i++) {
data[i] = data[i] > 0 ? -1 : 0xff000000;
}
} | 2 |
public int getListOffset(RSyntaxTextArea textArea, TabExpander e,
float x0, float x) {
// If the coordinate in question is before this line's start, quit.
if (x0 >= x)
return offset;
float currX = x0; // x-coordinate of current char.
float nextX = x0; // x-coordinate of next char.
float stableX =... | 8 |
public void Insert(TreeNode root,TreeNode node){
if(root == null){
root = node;
} else{
insertRec(root,node);
}
} | 1 |
public void mostrarDatosPantalla(String id, int nivel){
System.out.print("----");
System.out.print(id);
System.out.println("----");
System.out.print("ExisteID: ");
System.out.println(existeID(id, nivel));
System.out.print("Nivel: ");
System.out.println(nivel);
System.out.print("Clase: ");
System.out.p... | 7 |
public void move(int xa, int ya) {
// this allows "sliding" on solid tile edges
if(xa !=0 && ya != 0){
move(xa, 0);
move(0, ya);
return;
}
// movement handling
if (ya < 0) dir = Direction.UP;
if (ya > 0) dir = Direction.DOWN;
if (xa < 0) dir = Direction.LEFT;
if (xa > 0) dir = Direction.RIGHT;
... | 7 |
public boolean isItemSent(Auction auction){ return auction.isItemSent(); } | 0 |
public Object nextContent() throws JSONException {
char c;
StringBuilder sb;
do {
c = next();
} while (Character.isWhitespace(c));
if (c == 0) {
return null;
}
if (c == '<') {
return XML.LT;
}
sb = new St... | 7 |
public static Vector<Caddie> testCheckValideCaddie(Vector<Caddie> caddies, int formCaddie) throws ParseException, BDException{
Vector<Caddie> toDelete = new Vector<Caddie>();
// Vérification
for(int i = 0 ; i< caddies.size() ; i++){
Caddie caddie = caddies.get(i);
Date dNow = new Date( );
SimpleDateForm... | 5 |
public boolean hasDupDumb(String str) {
for (int i = 0; i < str.length() - 1; i++) {
for (int j = i + 1; j < str.length(); j++) {
if (str.charAt(i) == str.charAt(j))
return true;
}
}
return false;
} | 3 |
public void addBuilding(Building newBuilding, Point2D location) throws InvalidLocationException {
if (!isInVillage(location) || !isInVillage(new Point2D.Double(location.getX()+newBuilding.getWidth()-1, location.getY()+newBuilding.getHeight()-1)))
throw new InvalidLocationException();
for (int i = (int) locati... | 7 |
@EventHandler
public void onPlayerDeath(final PlayerDeathEvent event)
{
final Player player = event.getEntity();
/*final removeEquipment removeEquipment = new removeEquipment();*/
StringBuilder flagPath = new StringBuilder(player.getName());
flagPath.append(".flag");
final FileConfiguration pFile = pCop... | 3 |
public List<String> getStrings(String xpath)
{
List<String> list = new ArrayList<>();
try
{
XPathExpression expr = xPath.compile(xpath);
Object result = expr.evaluate(document, XPathConstants.NODESET);
if (result != null)
{
... | 3 |
@Override
public String toString() {
String s = "{ ";
int aux = 0;
for (int i = 0; i < listas.length; i++) {
for (int j = 0; j < listas[i].size(); j++) {
s += listas[i].get(j).toString() + ", ";
if (++aux == 5) {
s += "\n";
... | 3 |
@Override
public boolean doChanged(ObservableValue<? extends String> observable,
String oldValue, String newValue)
{
int i = 0;
try
{
i = Integer.parseInt(newValue);
}
catch(NumberFormatException nfe)
{
label.setText("Must be an integer");
return false;
}
if(!acceptNegative && i < 0)
... | 8 |
public void handleInput(Input input) {
if (input.isKeyPressed(Input.KEY_S)) {
if (currentWaveHasBeenCleared() || !wavesHaveBegun()) {
if (!isFinalWave()) {
startNextWave();
}
}
}
} | 4 |
public static int calcSoftTwo(Session aSession, Lecture aLecture) {
int penalty = 0;
Instructor anInstructor = aLecture.getInstructor();
if(anInstructor != null){
List<Lecture> coursesTaughtByInstructor = anInstructor.getInstructedLectures();
for(int i = 0; i < coursesTaughtByInstructor.size(); i++){
Se... | 9 |
public static void justifyText(String[] words, int maxLength) {
int[] justifyCost = new int[words.length+1];
int[] justificationPoints = new int[words.length +1];
List<String> result = new ArrayList<>();
justifyCost[words.length] = 0;
for(int i = words.length-1; i >= 0; i--) {
... | 6 |
private static void sortResults(Map results) {
// TODO Auto-generated method stub
TreeSet sortedResults = new TreeSet(
new Comparator(){
@Override
public int compare(Object o1, Object o2) {
// TODO Auto-generated method stub
User user1 = (User)o1;
User user2 = (User)o2;
/*如果com... | 4 |
public void teleport(Player player, int playerNumber) {
if (playerNumber == 1) {
if (getSpawnLocation1() == null) {
player.sendMessage("Location not set yet.");
return;
}
player.teleport(getSpawnLocation1());
} else if (playerNumber == ... | 4 |
public boolean interact(Level level, int xt, int yt, Player player, Item item, int attackDir) {
if (item instanceof ToolItem) {
ToolItem tool = (ToolItem) item;
if (tool.type == ToolType.shovel) {
if (player.payStamina(4 - tool.level)) {
level.setTile(xt, yt, Tile.dirt, 0);
Sound.monsterHurt.play(... | 7 |
public void paintComponent(Graphics g)
{
super.paintComponent(g);
if(count<7 && count>0)
{
g.setColor(Color.YELLOW);
g.fillRect(1,200,200,20);
g.fillRect(250,200,200,20);
g.fillRect(500,200,200,20);
g.fillRect(750,200,200,20);
g.fillRect(1,450,200,20);
g.fillRect(250,450,200,20);
g.fillR... | 6 |
public static void main(String[] args) {
Set<Integer> linkedHashSet = new LinkedHashSet<Integer>();
linkedHashSet.add(1);
linkedHashSet.add(2);
linkedHashSet.add(0);
linkedHashSet.add(4);
linkedHashSet.add(8);
linkedHashSet.add(6);
System.out.println("lin... | 0 |
public static Polygon interpolate(Polygon p, int points) {
if (points < 1) return p;
Polygon ret = new Polygon();
ret.setClosed(p.closed());
for (int i = 0; i < p.getPointCount(); i++) {
float[]
point = p.getPoint(i),
pointNext = i < p.getPointCount()-1 ? p.getPoint(i+1) : (p.closed() ? p.getPo... | 9 |
private void installListeners() {
button.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
String folderPath = MainWindow.this.getTextField().getText();
File file = new File(folderPath);
... | 8 |
private void cancelBuild(){
if (placeHolder != null){ //cancels the building of a tower
removeObject(placeHolder);
placeHolder = null;
place = false;
removeObject (r);
r = null;
}
else if (selectedTower != null){ /... | 3 |
@Override
public Receiver createReceiver(byte code, KadServer server)
{
switch (code)
{
case ConnectMessage.CODE:
return new ConnectReceiver(server, this.localNode);
case ContentLookupMessage.CODE:
return new ContentLookupReceiver(server, t... | 4 |
@Override
public int compareTo(Vertex o) {
return this.distance - o.getDistance();
} | 0 |
public void endGame() {
blackFood = 0;
redFood = 0;
for (int[] i : world.getAnthillCells()) {
if (world.getCell(i).anthill.equalsIgnoreCase("black")) {
blackFood += world.getCell(i).getFood();
} else if (world.getCell(i).anthill.equalsIgnoreCase("red")) {
... | 3 |
@Override
public Object getPage(int pageNum, int width, int height) throws NoSuchPageException {
if (pageNum < 1 || pageNum > pdffile.getNumPages())
throw new NoSuchPageException();
PDFPage page = pdffile.getPage(pageNum);
int sourceWidth = (int) page.getBBox().getWidth();
int sourceHei... | 5 |
private void skipPastAnyPrefixJunk(InputStream in) {
if (!in.markSupported())
return;
try {
final int scanLength = 2048;
final String scanFor = "%PDF-1.";
int scanForIndex = 0;
boolean scanForWhiteSpace = false;
in.mark(scanLength);... | 9 |
public boolean canSummon(Familiar familiar) {
return familiar != null
&& points() >= familiar.requiredPoints()
&& (!summoned() || timeLeft() <= 150)
&& !ctx.backpack.select().id(familiar.pouchId()).isEmpty();
} | 4 |
protected boolean getFlipY (Node contNode) throws ParseException {
logger.entering(getClass().getName(), "getFlipY", contNode);
boolean flipY = false;
String strValue = getProcessingInstructionValue(contNode, "flip-y");
if (strValue != null) flipY = strValue.equalsIgnoreCase("true");
... | 1 |
private void parsePidstatMetrics(String wholeMetricsText, List<JvmModel> list) {
JvmModel cjm = list.get(list.size() - 1);
String[] lines = wholeMetricsText.split("\\n");
int RSS = 0;
for (String line : lines) {
if (line.length() == 0 || line.charAt(0) == '#')
continue;
String parameters[] = lin... | 4 |
public static String doubleToString(double d) {
if (Double.isInfinite(d) || Double.isNaN(d)) {
return "null";
}
// Shave off trailing zeros and decimal point, if possible.
String string = Double.toString(d);
if (string.indexOf('.') > 0 && string.indexOf('e') < 0 &&
... | 7 |
public void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
{
response.setContentType("text/html");
PrintWriter out=response.getWriter();
Connection conn;
Statement stmt;
ResultSet rs;
HttpSession hs=request.getSession(true);
hs.setAttribute("... | 3 |
static final void method1428(byte byte0, int i) {
if (byte0 != -41) {
return;
}
if (!Class99.aBoolean1680) {
i = -1;
}
if (~i == ~Class105.anInt1733) {
return;
}
if (i != -1) {
Class116 class116 = Class142_Sub8_Sub31... | 7 |
public void run(){
while(keepRunning){
synchronized(syncObject){
if(wait){
try {
syncObject.wait();
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}
}
} | 3 |
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 fe... | 6 |
public static void loadAllFusions() {
int c;
File[] files = PluginVars.dirCards.listFiles();
List<File> fusion_configs = new ArrayList<File>();
List<String> set_names = new ArrayList<String>();
for(File f : files) {
if(!f.getName().substring(0,4).equalsIgnoreCase("fus_")) continue;
fusion_configs.add(f)... | 5 |
public void keyPressed(KeyEvent e) {
int key = e.getKeyCode();
if (key == KeyEvent.VK_SPACE && !getMidair()) {
setDY(-4 * Board.getInstance().getGravity());
setMidair(true);
}
if (key == KeyEvent.VK_LEFT) {
setDX(-2);
}
if (key == KeyEvent.VK_RIGHT) {
setDX(2)... | 5 |
public void init() throws IOException {
ServerSocketChannel channel = ServerSocketChannel.open(); //Creates an unbound ServerSocketChannel
System.out.println("Server Launched!");
//Bind the channel to an address. The channel starts listening to incoming connections
channel.bind(new InetSocketAddress(host, po... | 9 |
public static int minimumTotal(List<List<Integer>> triangle) {
if (null == triangle) {
return 0;
} else if (1 == triangle.size()) {
return triangle.get(0).get(0);
}
int[] minlen = new int[triangle.size()];
for (int level = triangle.size() - 1; level >= 0; level--) {
for (int i... | 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 |
public Manacher(String s) {
this.s = s.toCharArray();
t = preprocess();
p = new int[t.length];
int center = 0, right = 0;
for (int i = 1; i < t.length - 1; i++) {
int mirror = 2 * center - i;
if (right > i)
p[i] = Math.min(right - i, p[mirror]);
// attempt to expand palindrome centere... | 4 |
public static double getDet(double[][] A){
if(A.length != A[0].length)
return Double.NaN;
double det = 0;
int cofact = 0;
if(A.length == 1)
return A[0][0];
for(int i = 0; i<A.length; i++){
double[][] T = new double[A.length-1][A.length-1];
for(int j = 1; j<A.length; j++){
for(int k = 0; k<A.le... | 8 |
public JSONWriter key(String s) throws JSONException {
if (s == null) {
throw new JSONException("Null key.");
}
if (this.mode == 'k') {
try {
if (this.comma) {
this.writer.write(',');
}
stack[top - 1].put... | 4 |
public static void check_intersect(double Hy, double Hxl, double Hxr, double Vx, double Vyt, double Vyb) {
if (Hy < Vyt && Hy > Vyb && Vx > Hxl && Vx < Hxr) {
//if the y-value of the horizontal component is within the range of the y-values of the vertical
//component and the x-values of the vertical componen... | 4 |
public Image contrast(Image im, int width, int height, int contrast)
{
int pix[] = JIPTUtilities.getPixelArray(im);
int new_pix[] = new int[width*height];
int mean_luminance = 0;
mean_luminance = getMeanLuminance(pix);
for(int i = 0; i < pix.length; i++)
{
... | 5 |
protected Dimension doLayout(Container target) {
// Pass 1 - get preferred sizes
minw = minh = 0;
curComps = target.getComponents();
for (int i = 0; i<curComps.length; i++) {
Component tc = curComps[i];
Dimension d = tc.getPreferredSize();
minw = Math.max(minw, d.width);
minh = Math.max(minh, d.hei... | 8 |
private void initialize(String fileName) throws IOException {
BufferedReader br = new BufferedReader(new FileReader(fileName));
String nextLine;
while ((nextLine = br.readLine()) != null) {
if (nextLine.trim().equals("DESTINATIONS")) {
while (!(nextLine = br.readLine().trim())
.equals("END_D... | 8 |
@WebMethod(operationName = "ReadCountry")
public ArrayList<Country> ReadCountry(@WebParam(name = "cnt_id") String cnt_id) {
Country cnt = new Country();
ArrayList<Country> cnts = new ArrayList<Country>();
ArrayList<QueryCriteria> qc = new ArrayList<QueryCriteria>();
... | 3 |
private void generateChests() {
int chestWidth = 34;
int chestHeight = 23;
int[] chestLevels = {2, 2, 3, 3, 4, 5};
for (int level = 0; level < chestLevels.length; level++) {
for (int count = 0; count < chestLevels[level]; count++) {
boolean chestPlaced = fals... | 4 |
public int read() throws IOException {
//init();
isInited = true;
return internalIn.read();
} | 0 |
protected void cellResized(Object cell)
{
mxGraph graph = getGraph();
mxGraphView view = graph.getView();
mxIGraphModel model = graph.getModel();
mxCellState state = view.getState(cell);
mxCellState pstate = view.getState(model.getParent(cell));
if (state != null && pstate != null)
{
Object[] cells ... | 8 |
@Override public void iterate(){
matcount += 1;
if(matcount >= mat){matcount = 0;
calculate(); }
if(ages){ if(active){ if(age == 0){age = 1;} else{age += 1;}}else{ age = 0;}
if(fades){ if( age >= fade){ purgeState(); age = 0;}}
if( age > 1023){ age = 1023; }state = agify(age);}
else{if(acti... | 8 |
public boolean commandProcessing(String userInput)
/* processes user commands */
{
boolean successfulMove = false;
if(userInput.startsWith("clear"))
{
clear();
}
else if(userInput.startsWith("go"))
{
successfulMove = go(userInput);
}
... | 9 |
public MFEVersionCommand(CommandParameter par) {
if(par == null)
throw new NullPointerException("MFEVersionCommand has a null CommandParameter");
this.par= par;
} | 1 |
public static void menu()
{
while(true)
{
print("**********************\n");
print("* SPN Demo *\n");
print("**********************\n");
print("* 1 - Create *\n");
print("* 2 - List *\n");
print("* 3 ... | 8 |
public void checkConsistent() {
super.checkConsistent();
StructuredBlock sb = outer;
while (sb != continuesBlock) {
if (sb == null)
throw new RuntimeException("Inconsistency");
sb = sb.outer;
}
} | 2 |
public Being bear() {
dynamicStats.get(StatType.D_EATEN).addToValue(-30.0);
int newClassID = WorldPhysics.nextID();
return new CellCreature(new Point3(pos), constStats.mutateClone(), childDynamicStats.clone(), newClassID);
} | 0 |
public Nan()
{
super("Nan", 29780, 600, 9001, 500, as);
as.setSkill(0, "Logic", 10000, 50, "Nan uses the power of logic to smite his enemy.");
as.setSkill(1, "Righteous Fury", 25000, 100, "Nan unleashes righteous fury.");
as.setSkill(2, "Lance Of Longinus", 90001, 150, "Nan sends the holy Lance of Longinus at ... | 0 |
public void removeSecondaryEdge(ComparableNode source, ComparableNode target) throws MaltChainedException {
if (source == null || target == null || source.getBelongsToGraph() != this || target.getBelongsToGraph() != this) {
throw new SyntaxGraphException("Head or dependent node is missing.");
} else if (!target.... | 7 |
public void saveTracks(String folderToSave) {
File folder = new File(folderToSave);
boolean success = folder.mkdirs();
System.out.println("created folder: " + folder.getAbsolutePath() + " " + (success ? "created" : ""));
MyDownloadExecutor executor = new MyDownloadExecutor(nThreads);
... | 6 |
public static void start() {
running = true;
Runnable runnable = new Runnable() {@Override public void run() {
long lastMillis = System.currentTimeMillis();
long deltaLastMillis = System.currentTimeMillis();
while (running) {
long newMillis = System.currentTimeMillis();
long sleep = 15 - (newMill... | 6 |
public int tLineCount(){
int tCount = 0;
if(statement.toString()!=null)
tCount = statement.tLineCount();
if(statements.toString()!=null){
tCount += statements.tLineCount();
}
return tCount;
} | 2 |
public void setIntelligence(double intelligence) {
this.intelligence = intelligence;
} | 0 |
public List<List<Gate>> getGates() {
List<List<Gate>> layersOfGates = new ArrayList<List<Gate>>();
boolean firstLine = true;
try {
BufferedReader fbr = new BufferedReader(new InputStreamReader(
new FileInputStream(circuitFile), Charset.defaultCharset()));
String line;
//hack to skip first line
L... | 5 |
public void clicked(String sender) {
if (sender == "hud") {
for (int i = 0; i < HUD.qSlots.length; i++) {
HUD.qSlots[i].selected = false;
}
selected = true;
Player.selectedWeapon = this.weapon;
}
if (sender == "pane") {
for (int i = 0; i < SpellSelectGUI.spells.size(); i++) {
SpellSelectGUI... | 6 |
public Option getOption(String ID) {
for (Option o: options) {
if (o.getID().equals(ID)) {
return o;
}
}
return null;
} | 2 |
private boolean setupSQL() {
if (config.getSQLValue().equalsIgnoreCase("MySQL")) {
dataop = new MySQLOptions(config.getHostname(), config.getPort(), config.getDatabase(), config.getUsername(), config.getPassword());
}
else if (config.getSQLValue().equalsIgnoreCase("SQLite")) {
dataop = new SQLiteOptions(new... | 5 |
@SuppressWarnings("static-access")
public boolean doIt(int width, int height,
int frameRate, List<String> inFiles,
MediaLocator outML,
String type) {
this.fRate = frameRate;
ImageDataSource ids = new ImageDataSource(width, height,
... | 8 |
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.