text stringlengths 14 410k | label int32 0 9 |
|---|---|
public void setName(String name) {
this.name = name;
} | 0 |
public void loadProperties(String xmlDataFile, String xmlSchemaFile)
throws InvalidXMLFileFormatException
{
String dataPath = getProperty(DATA_PATH_PROPERTY);
// ADD THE DATA PATH
xmlDataFile = dataPath + xmlDataFile;
xmlSchemaFile = dataPath + xmlSchemaFile;
... | 5 |
void sort(int[] a) throws Exception {
for (int i = a.length; --i>=0; )
for (int j = 0; j<i; j++) {
if (stopRequested) {
return;
}
if (a[j] > a[j+1]) {
int T = a[j];
a[j] = a[j+1];
a[j+1] = T;
}
pause(i,j);
}
} | 9 |
public int getSelectionMode() {
return this.selectionMode;
} | 0 |
public boolean hasEntryPoint(Cell cell, int entryPointId){
String result = "";
char c = get(cell);
if(entryPointId == 1) {
return StringUtils.isOneOf(c, entryPoints1);
} else if(entryPointId == 2) {
return StringUtils.isOneOf(c, entryPoints2);
} else if(entryPointId == 3) {
return StringUtils.isO... | 8 |
public static void main(String[] args)
{
List v = (List)factory(new Vector());
System.out.println(v.getClass().getName());
v.add("new");
System.out.println("----------------------------");
v.add("old");
System.out.println(v);
v.remove(0);
System.out.println(v);
} | 0 |
public ArrayList<Patch> getNeighbors(){
ArrayList<Patch> neighbors = new ArrayList();
if (!topEdge()){
neighbors.add(getN());
if (!leftEdge()){
neighbors.add(getNW());
}
if (!rightEdge()){
neighbors.add(getNE());
}
}
if (!bottomEdge()){
neighbors.add(getS());
if (!leftEdge()){... | 8 |
private boolean checkNorthEdge(EdgeLocation normEdgeLocation, ArrayList<Road> roads, int playerIndex) {
HexLocation thisHexLoc = normEdgeLocation.getHexLoc();
HexLocation NEHexLoc = normEdgeLocation.getHexLoc().getNeighborLoc(EdgeDirection.NorthEast);
HexLocation NWHexLoc = normEdgeLocation.getHexLoc().getNeighbo... | 9 |
public int uniquePathsWithObstacles(int[][] obstacleGrid) {
if (obstacleGrid==null){
return 0;
}
int m = obstacleGrid.length;
int n = obstacleGrid[0].length;
int [][]result = new int[m][n];
result [0][0] = (obstacleGrid[0][0]==0?1:0);
for (int i = 1; i... | 9 |
public Object getValue(String aggregate) {
if ("min".equals(aggregate)) {
return getMin();
}
if ("max".equals(aggregate)) {
return getMax();
}
if ("avg".equals(aggregate)) {
return getAverage();
}
if ("count".equals(aggregate)) {
return getCount();
}
if ("sum".equals(aggregate)) {
retur... | 7 |
public static QuizResult getQuizResult(int QuizId, int UserId)
{
try
{
QuizResult qr = new QuizResult();
String statement = String.format("select qq.questionid ,coalesce(qr.ANSWERID, 0) AnswerID, q.questiontext, coalesce(qr.answertext, 'NONE') ANSWERTEXT, coalesce(qr.iscorre... | 2 |
static public String convertResponseToString(Object response, Object command) {
if (!(response instanceof String)) {
throw new RuntimeException("Expected String but received ("
+ response.getClass() + ") " + response + "\n in response to command " + command);
}
return (String) response;
} | 1 |
public static void checkException(ExceptionGenerator exceptionGenerator, Class expectedException) {
try {
exceptionGenerator.generateException();
//no exception was caught
System.out.println("no exception; expected " + expectedException.getSimpleName());
} catch (Exce... | 2 |
public void init(int mode, byte[] key, byte[] iv) throws Exception{
String pad="NoPadding";
//if(padding) pad="PKCS5Padding";
byte[] tmp;
if(iv.length>ivsize){
tmp=new byte[ivsize];
System.arraycopy(iv, 0, tmp, 0, tmp.length);
iv=tmp;
}
if(key.length>bsize){
tmp=new... | 4 |
@Override
public void run() {
while(true) {
synchronized (timers) {
for(Timer timer : timers){
if((timer.isWorking())&&(timer.update())){
timer.stop();
}
}
}
try {
sleep(1000);
} catch (InterruptedException e) {}
}
} | 5 |
public void insertElement(IndexPair pair) throws IOException {
// If there is no block yet, allocate one and insert the element.
if (firstBlock == null) {
firstBlock = createNewBlock();
firstBlock.insertElement(pair);
} else {
SignatureStoringBlock block = getBlockFor(pair.getBitSignature(... | 5 |
public static void main(String[] args) throws InterruptedException {
EasyPost.apiKey = "cueqNZUb3ldeWTNX7MU3Mel8UXtaAMUi";
try {
Map<String, Object> fromAddressMap = new HashMap<String, Object>();
fromAddressMap.put("name", "Simpler Postage Inc");
fromAddressMap.put(... | 6 |
public synchronized void setSkin(String skinName) {
//LogUtil.logInfo("setSkin(" + skinName + ")");
if (skinName == null || skinName.length() == 0) {
// Blank values of "skinName" reset skin to default.
resetSkin();
return;
}
if (isInteger(modelName)) ... | 8 |
private void paintPlaceable(Placeable obj, Graphics2D g2) {
if (obj == null) {
System.out.println("obj in paintPlaceable is null");
} else {
int yPos = obj.getPosition().getY();
int xPos = obj.getPosition().getX();
int ySide = obj.getDimension().height;
... | 3 |
private static void handleMoveType3(PGNMove move, String strippedMove, byte color, byte[][] board)
throws PGNParseException {
byte piece = WHITE_PAWN;
int fromhPos = getChessATOI(strippedMove.charAt(1));
int tohPos = getChessATOI(strippedMove.charAt(2));
int tovPos = strippedMove.charAt(3) - '... | 9 |
public Composite(final Delegate<?> ... delegates) {
super(
new InvocationHandler() {
@Override public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
for (Delegate<?> delegate : delegates) {
try {
Method handler = delegate.getClassTarget().getMethod(method.getName... | 4 |
public static int main(Iterator<String> argi) {
RepoConfig repoConfig = new RepoConfig();
while( argi.hasNext() ) {
String arg = argi.next();
if( repoConfig.parseCommandLineArg(arg, argi) ) {
} else {
System.err.println("Unrecognized argument: "+arg);
return 1;
}
}
repoConfig.fix();
... | 5 |
private void renderIntersections(Graphics2D g2)
{
Iterator<Intersection> it = model.intersectionsIterator();
while (it.hasNext())
{
Intersection intersection = it.next();
// ONLY RENDER IT THIS WAY IF IT'S NOT THE START OR DESTINATION
// AND IT IS IN THE ... | 6 |
public static void refreshDefaultTrayToolTip()
{
if( !SystemTray.isSupported() ) return;
AsyncFunction task = new AsyncFunction() {
@Override
public Object doInBackground() {
try {
IConfig servlet = (IConfig) ConfigManager.getConfigManager().getActiveContainer();
IConfig database = (IConfig)... | 6 |
public void geefLijntje(boolean goed) {
if (gekozenAntwoord.isGoed())
imagePanel.setBorder(new EtchedBorder(EtchedBorder.RAISED, Color.GREEN, Color.GREEN));
else imagePanel.setBorder(new EtchedBorder(EtchedBorder.RAISED, Color.RED, Color.RED));
} | 1 |
public double[][] rankedAttributes ()
throws Exception {
int i, j;
if (m_attributeList == null || m_attributeMerit == null) {
throw new Exception("Search must be performed before a ranked "
+ "attribute list can be obtained");
}
int[] ranked = Utils.sort(m_attribu... | 7 |
public double getPesoLlaveEntera(int capa, int neurona, int llave){
double peso = 0;
switch (llave) {
case 0:
peso = this.getPeso(capa, neurona, THRESHOLD);
break;
case 1:
peso = this.getPeso(capa, neurona, EMBARAZOS);
break;
case 2:
peso = this.getPeso(capa, neurona, CONCENTRACION_G... | 9 |
@Override
public void performEvent(ActionEvent e)
{
if ("Normal".equals(e.getActionCommand()))
{
Save.DIFFICULTY = 1;
}
if ("Hard".equals(e.getActionCommand()))
{
Save.DIFFICULTY = 2;
}
if ("Easy".equals(e.getActionCommand()))
{
Save.DIFFICULTY = 0;
}
if ("On".equals(e.getActionCommand... | 5 |
private void addDice(String sides) {
List<String> letters = new ArrayList<String>(sides.length());
for ( int i = 0; i < sides.length(); i++){
letters.add(String.valueOf(sides.charAt(i)));
}
dice.add(new Dice<String>(letters));
} | 1 |
protected Command getCommand() {
CompoundCommand command = new CompoundCommand();
command.setDebugLabel("Drag Object Tracker");//$NON-NLS-1$
Iterator iter = getOperationSet().iterator();
Request request = getTargetRequest();
if (isCloneActive())
request.setType(REQ_CLONE);
else if (isMove())
reques... | 8 |
public ISocketServerConnection getSocketServerConnection() {
return socketServerConnection;
} | 0 |
@Override
public void valueChanged(ListSelectionEvent e) {
if (e.getSource() == lstStock) {
if (lstStock.getSelectedValue() != null
&& lstStock.getSelectedValue() instanceof Stock) btnCreate
.setEnabled(true);
}
else if (e.getSource() == lstProduct) {
Object sel = lstProduct.getSelectedVa... | 9 |
public CheckResultMessage checkDayofMonth() {
return checkReport1.checkDayofMonth();
} | 0 |
public int GetNextStopBusStop()
{
//set a random bus stop to get off at
SetStopBusStop((GetSelectedBusStop()+1)+rndStop.nextInt(busStop.length-GetSelectedBusStop()));
//SetStopBusStop(rndStop.nextInt(busStop.length+1)+GetSelectedBusStop());
//System.out.println("Stop: "+(GetStopBusSt... | 0 |
@Override
public void windowClosing(WindowEvent e)
{
System.exit(0);
} | 0 |
public void calculateScaleRange() {
if( !automaticScale && userScaleRange != 0.0 ) {
scaleRange = userScaleRange;
} else {
RootedTree tree = treePane.getTree();
if (tree != null) {
final double treeHeight = tree.getHeight(tree.getRootNode());
... | 7 |
private final void method2454(int i, int i_39_, int i_40_, int i_41_,
AnimatableToolkit class64, int i_42_,
Class101 class101, AbstractToolkit var_ha, int i_43_) {
do {
try {
if (i != 6253)
((Player) this).aString10544 = null;
anInt10563++;
int i_44_ = i_43_ * i_43_ + i_39_ * i_39_;
if (... | 9 |
public static void run()
{
System.out.println("\n\n--|Cards|----------------------------------------------------------------------");
System.out.println();
String value[] = { "Ace", "2", "3", "4", "5", "6", "7", "8", "9", "10", "Jack", "Queen", "King" };
String suit[] = { "diamonds", "clubs", "hearts"... | 4 |
@Override
public String toString() {
String wasQueuedTxt = "";
if (wasQueued() == true) {
int queueOverstay;
if (getParkingTime() == 0) {
queueOverstay = getDepartureTime() - getArrivalTime() - Constants.MAXIMUM_QUEUE_TIME;
wasQueuedTxt = "\nExit from Queue: " + getDepartureTime() +
"\nQ... | 4 |
@Override
public void executeMsg(Environmental affecting, CMMsg msg)
{
super.executeMsg(affecting,msg);
if((affecting instanceof MOB)&&(!CMLib.flags().isAliveAwakeMobileUnbound((MOB)affecting,true)))
return;
if(disabled)
return;
if(((!(affecting instanceof MOB))||(!msg.amISource((MOB)affecting)))
&&(... | 9 |
@AfterClass
public static void tearDownClass() {
} | 0 |
public CheckResultMessage checkDayofMonth5() {
int r1 = get(2, 5);
int c1 = get(3, 5);
date();
if (checkVersion(file).equals("2003")) {
try {
in = new FileInputStream(file);
hWorkbook = new HSSFWorkbook(in);
if (!(getValueString(r1 + maxDay, c1 - 1, 4).equals(maxDay
+ "日"))) {
return e... | 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 RenderableObject generateShape(Scanner inFile) {
Point loc = null;
RenderableShape rs = new RenderableShape(loc);
String current = inFile.next();
while (inFile.hasNext()
&& !(isCloseTag(current) && parseTag(current) == LegalTag.Object)) {
if (isOpenTag(current)) {
switch (parseTag(current)) {... | 6 |
public void setPlacePool(ParkingPlacePool placePool) throws ParkingException {
if (placePool == null) {
throw new ParkingException("Parking place pool is null");
}
this.placePool = placePool;
} | 1 |
@Override
public Query rewrite(IndexReader reader) throws IOException {
int numDisjunctions = disjuncts.size();
if (numDisjunctions == 1) {
Query singleton = disjuncts.get(0);
Query result = singleton.rewrite(reader);
if (getBoost() != 1.0f) {
if (result == singleton) result = (Query... | 7 |
private void refreshFootprint(int slot) {
footprints[slot] = (byte) (random.nextInt(1 << (bitsPerSlot) - 1) + 1);
} | 0 |
public void enable() throws IOException {
// This has to be synchronized or it can collide with the check in the task.
synchronized (optOutLock) {
// Check if the server owner has already set opt-out, if not, set it.
if (isOptOut()) {
configuration.set("opt-out", ... | 2 |
public double[][] fast_idct(double[][] input)
{
double output[][] = new double[8][8];
double temp[][] = new double[8][8];
double temp1;
int i, j, k;
for (i = 0; i < 8; i++)
{
for (j = 0; j < 8; j++)
{
temp[i][j] = 0.0;
for (k = 0; k < 8; k... | 8 |
@EventHandler
public void onPlayerMove(PlayerMoveEvent event) {
if (event.isCancelled())
return;
Player player = event.getPlayer();
if (this.parentarena.getArenaState() != ArenaState.STAT_READY)
return;
if (!this.parentarena.getplayers().contains(player))
return;
event.setCancelled(true);
} | 3 |
private LinkedList<SmallPacket> processData(Byte destination, Byte hops,
byte[] data, boolean ack, boolean routing, boolean keepalive) {
// data = eh.getPacket(data, destination);
LinkedList<SmallPacket> result = new LinkedList<SmallPacket>();
lock.lock();
SmallPacket dp;
boolean moar = false;
int ma... | 6 |
private VariableType simple_expression() {
TokenType[] op = new TokenType[]{
TokenType.SPLUS, TokenType.SMINUS, TokenType.SOR};
VariableType ltype, rtype = VariableType.VOID;
if(whenToken(new TokenType[]{TokenType.SPLUS, TokenType.SMINUS}) ){
int linum = getLineNumber();
ltype = term();
if(ltype !... | 9 |
public PanelGrille(int largeur, int hauteur) {
this.setBackground(Color.black);
cellules = new JCellule[largeur][hauteur];
this.setLayout(new GridLayout(largeur, hauteur));
for (int i = 0; i < largeur; i++) {
for (int j = 0; j < hauteur; j++) {
cellules[i][... | 2 |
@Override
public int pulse() {
if (npc != null) {
if (npc.isInteracting() && players.getLocalPlayer().isInteracting()) {
if (widgets.canContinue()) {
widgets.clickContinue();
sleep(1700, 2000);
}
} else {
... | 5 |
public EditorController getNewLevel(int columns, int rows) {
EditorController controller = new EditorController();
Board currentLevel = new Board(columns, rows);
controller.setModel(currentLevel);
LevelEditorView editorView = new LevelEditorView(columns, rows);
controller.setView(editorView);
// initiali... | 2 |
@Override
public void removeExtension(String ext) {
extensions.remove(ext);
} | 0 |
private File getFile(String source){
if(source.indexOf(getOsFileSeparator()) == -1){
System.out.println("디렉토리 구분자가 잘못되었습니다."); //리소스 경로 잠못된것인지 체크
}
File file = new File(source);
if(file.isDirectory() && !file.exists()){
System.out.println("지정한 경로가 존재하지 않습니다."); //리소스 경로에 리소스가 있는지 체크
}
return fi... | 3 |
public String longestPrefixOf(String s) {
if (s == null || s.length() == 0) return null;
int length = 0;
Node<Value> x = root;
int i = 0;
while (x != null && i < s.length()) {
char c = s.charAt(i);
if (c < x.c) x = x.left;
else if (c > x.c... | 7 |
private boolean shoudCheckNewVersion() {
Logger.getLogger(MainInterface.class.getName()).entering(MainInterface.class.getName(), "shoudCheckNewVersion");
Logger.getLogger(MainInterface.class.getName()).log(Level.INFO, "Checking if the software should check for a new version");
String autoCheckUp... | 5 |
public Output draw() {
if (_drawOutput != null) {
return _drawOutput;
}
return drawRandom();
} | 1 |
@SuppressWarnings({ "unchecked", "rawtypes" })
public void dispatchTask(final String supportedService, final Task t) {
List<ProductLine<?>> lines = getProductLinesBySupportedService(supportedService);
if (lines == null) {
lines = new ArrayList<ProductLine<?>>();
for (ProductLineFactory factory : factoryList)... | 7 |
public void flattenSelection()
{
if (selection.width == 0 || selection.height == 0)
return;
for (int x = selection.x; x < selection.width + selection.x; x++)
{
for (int y = selection.y; y < selection.height + selection.y; y++)
{
try
... | 5 |
public void tick() {
for(int i = 0; i < buttons.length; i++) {
oldButtons[i] = buttons[i];
}
} | 1 |
public void removeRow(int position) {
// Si la matière est renseignée, on la supprime de la liste des matières de l'enseignant.
if(!table.getModel().getValueAt(position, 0).equals("")) {
selectedTeacher.removeFieldAt(position);
}
// Puis on supprime la ligne dans le tableau
int indic... | 3 |
public void compFinalResult() {
do {
iStage++;
compAllocation();
if (compDistribution()) {
/* deadline can not be satisfied */
if (!bDeadline) {
System.out.println("THE DEADLINE CAN NOT BE SATISFIED!");
return;
} else {
System.out.println("\nNEW ROUND WITHOUT CHECKING:");
dEv... | 7 |
public static boolean hasNull(Object... objs) {
boolean result = false;
for (Object obj : objs) {
if (obj == null) {
result = true;
break;
}
}
return result;
} | 2 |
public SolarSystem(
int numberOfPlanets,
int height,
int width,
Force gravity,
boolean centrifugal_flag,
double averageEnergy,
boolean sun_flag,
double sun_size){
int i,j;
Color colour;
total_mass = 0;
centre_of_mass_x = 0;
centre_of_mass_y = 0;
originalEnergy = 0;
potentialEnerg... | 9 |
public void loadBookmark() throws Exception
{ ArrayList<Float> myList = new ArrayList<Float>();
FileReader fileReader = new FileReader(new File("BookMark.txt"));
BufferedReader reader = new BufferedReader(fileReader);
String s;
/* float lowVal,highVal,lowValInDataSet,highValInDataSet;
int num... | 6 |
public static Class<?> formulaClass(Class<?extends Deduction> rule) {
try {
return (Class<?>) rule.getMethod("formulaClass", null).invoke(null,null);
} catch (Exception e) {
e.printStackTrace();
return null;
}
} | 4 |
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
final CommandFailure other = (CommandFailure) obj;
if (feedbackPropertyReference == n... | 9 |
public static String encrypt(final String text) {
String encryptedText = null;
TripleDesCipher cipher = new TripleDesCipher();
cipher.setKey("GWT_DES_KEY_16_BYTES".getBytes());
try {
encryptedText = cipher.encrypt(String.valueOf(text));
} catch (DataLengthException e1) {
e1.printStackTrace();
/... | 3 |
private void processLabors(int year, List<Man> mankind, List<Woman> womankind) {
List<Man> fathers = calculateFathers(mankind);
List<Human> children = new ArrayList<Human>();
for (Iterator<Woman> it = womankind.iterator(); it.hasNext(); ) {
Woman woman = it.next();
if (wo... | 8 |
public void sortArray() {
this.arrayAccess = 0;
this.comparisions = 0;
int arrLength = this.array.length;
/**
* This denotes the index of the minimum element. It is assumed that the
* first element during the iteration is the minimum and then the array
* is s... | 4 |
protected Double coerceToDouble(Object value) {
if (value == null || "".equals(value)) {
return Double.valueOf(0);
}
if (value instanceof Double) {
return (Double)value;
}
if (value instanceof Number) {
return Double.valueOf(((Number)value).doubleValue());
}
if (value instanceof String) {
try ... | 7 |
public XmlRuleSpider(final String filePath){
this.cobweb = new MemoryBasedCobweb();
parseXml(filePath);
} | 0 |
public void changePlayerMarker(String username, int markerID){
try {
cs = con.prepareCall("{call changePlayerMarker(?,?)}");
cs.setString(1, username);
cs.setInt(2, markerID);
cs.executeUpdate();
} catch (SQLException e) {
e.printStackTrace();
}
} | 1 |
public void procBtnRech() {
int compsSize = getCompsSize();
if (optEmploi.isSelected()) {
if (compsSize > 0) {
if (!jckbprox.isSelected()) {
activerRechercher(true);
setErrorMsg(" ");
} else {
final String text = txtSale... | 8 |
public static void addClass(Course course, int type){ //adding class information - name, index, intake size for each course class created
String classType = type==1?"lecture":type==2?"tutorial":"laboratory";
System.out.println("How many classes for " + course.getName() + " - " + classType + " ?");
int classAmt;//... | 7 |
@Override
public List<Integer> update(Criteria beans, Criteria criteria, GenericUpdateQuery updateGeneric, Connection conn) throws DaoQueryException {
List paramList1 = new ArrayList<>();
List paramList2 = new ArrayList<>();
StringBuilder sb = new StringBuilder(UPDATE_QUERY);
String ... | 1 |
@Override
public String getColorRepresentation(char roomChar, int line)
{
switch (line)
{
case 0:
if (links.containsKey(Integer.valueOf(Directions.NORTH)))
return " ^ ";
return " ";
case 1:
{
if (links.containsKey(Integer.valueOf(Directions.EAST)))
{
if (links.containsKey(Integer.valu... | 8 |
private void lisaaButtonActionPerformed(ActionEvent evt) {
if (!kurssiField.getText().isEmpty()) {
if (kurssiField.getText().length() > 50) {
JOptionPane.showMessageDialog(this, "Kurssin nimi voi olla enintään 50 merkkiä pitkä.", "Virhe", JOptionPane.ERROR_MESSAGE);
} else {
... | 4 |
@Test
public void testPermutate1() {
int[] testExpansionTabel = new int[]{
1, 2, 3, 4, 5, 6,
7, 8, 9, 10, 11, 12,
13, 14, 15, 16, 17, 18,
19, 20, 21, 22, 23, 24,
25, 26, 27, 28, 29, 30,
31, 32, 1, 2, 3, 4,
... | 1 |
public synchronized void join(RMIClientInterface n) throws RemoteException {
threadList.add(n);
for (Iterator i = threadList.iterator(); i.hasNext();) {
RMIClientInterface client = (RMIClientInterface) i.next();
client.joinMessage(n.getName());
}
if (topic != null) {
System.out.println(topic);
n.to... | 8 |
public static RecipeBook matcherNOBT(RecipeBook k, Recipe lijst) {
RecipeBook a = new RecipeBook();
LNode boek = k.first();
while (boek != null) {
boolean res = true;
RNode pijl = boek.getElement().first();
while (pijl != null && res==true) {
res = lijst.bevatGeq(pijl.getElement());
pijl = pijl... | 4 |
public int lookup(String key) {
int index = 0;
int base = 1; // base at index 0 should be 1
int keyLength = key.length();
for(int i = 0; i < keyLength; i++) {
int previous = index;
index = index + base + key.charAt(i);
if(index > baseBuffer.limit()) { // Too long
return -1;
}
base = baseBu... | 6 |
private static ObjectType parseArray(String sig, Cursor c) throws BadBytecode {
int dim = 1;
while (sig.charAt(++c.position) == '[')
dim++;
return new ArrayType(dim, parseType(sig, c));
} | 1 |
public BiNode addChild(BiNode child){
if(this.value_type.compareTo(child.value_type) < 0){
child.father = this.father;
return child.addChild(this);
}else{
if(children[0] == null){
children[0] = child;
child.father = this;
}e... | 4 |
public static String get(String s) throws IOException {
URL url = new URL("http://oberien.net/download/Oberien/" + s);
InputStream is = url.openStream();
int i;
StringBuffer sb = new StringBuffer();
while ((i = is.read()) != -1) {
char c = (char) i;
sb.append(c);
}
is.close();
return sb.toString()... | 1 |
public void setFovX(float fovX) {
Radar.fovX = fovX;
} | 0 |
public void updateAsScheduled(int numUpdates) {
if (destroyed()) {
I.say(this+" IS DESTROYED! SHOULD NOT BE ON SCHEDULE!") ;
this.setAsDestroyed() ;
}
structure.updateStructure(numUpdates) ;
if (! structure.needsSalvage()) {
if (base != null && numUpdates % 10 == 0) updatePaving(true) ... | 5 |
public ContentObject getObject(ContentType type, String id) {
if (type instanceof RegionType)
return getRegion(id);
else if (type instanceof LowLevelTextType) { //Text lines, word, glyph
for (int i=0; i<regions.size(); i++) {
Region reg = regions.getAt(i);
if (reg instanceof LowLevelTextContainer) {
... | 5 |
@Override
public void mouseDragged(MouseEvent evt) {
int mouseX = evt.getX();
int mouseY = evt.getY();
int row = FindTileRow(mouseY);
int col = FindTileCol(mouseX);
Point p = new Point(row, col);
if (p != lastTilePressed) {
if (row != -1 && col != -1) {
lastTilePressed = p;
... | 3 |
public static void populateEmployeeInfo(ManageEmployeePage emp,String username){
Employee employee=new Employee();
employee.setUsername(username);
employee=(Employee)DatabaseProcess.getRow(employee);
Gui.setCurrentEmployee(employee);
emp.getDobText().setText(employee.getDob().toString());
emp.getAddressText... | 1 |
public static int integerParseInt(String data) throws Exception{
int result =0; //返回值
int initType = 1; //用来标示正和负
int i=0; //遍历字符的首
if(null==data)
throw new Exception("字符串转化异常");
if('-'==data.charAt(0)){
initType=-1;
i++;
}else if(0<=data.charAt(... | 8 |
public void start() {
if (graphics == null) {
throw new SystemMissingException("The game's graphics system has not yet been initialized");
}
if (scenemanager == null) {
throw new SystemMissingException("The game's scene management system has not yet been initialized");
... | 4 |
Module addSubModule(Module module) {
if (null == module) {
return this;
}
if (null == this.subModules) {
this.subModules = new HashSet<>();
}
this.subModules.add(module);
return this;
} | 2 |
public boolean saveChunks(boolean par1, IProgressUpdate par2IProgressUpdate)
{
int i = 0;
for (Iterator iterator = field_73245_g.iterator(); iterator.hasNext();)
{
Chunk chunk = (Chunk)iterator.next();
if (par1)
{
func_73243_a(chunk);
... | 7 |
public int newLocal(final Type type) {
Object t;
switch (type.getSort()) {
case Type.BOOLEAN:
case Type.CHAR:
case Type.BYTE:
case Type.SHORT:
case Type.INT:
t = Opcodes.INTEGER;
break;
case Type.FLOAT:
t = Opcodes.FLOAT;
break;
case Type.LONG:
t = Opcodes.LONG;
break;
case Type.DO... | 9 |
public int[] get_circles_years()
{
if(circles.isEmpty())
return null;
int years[]=new int[circles.size()];
int next_year_index=0;
boolean is_exist=false;
for(int i=0; i<circles.size(); i++)
... | 6 |
@Override
public void executeTask() {
try {
fs = new ServerSocket(ClientGUITask.port);
} catch (Exception e) {
System.out.println("problem with initial file sender setup");
}
try {
do {
while (!ClientGUITask.clientSend)
;
try {
if (ClientGUITask.port != fs.getLocalPort()) {
fs.... | 6 |
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.