text stringlengths 14 410k | label int32 0 9 |
|---|---|
public void drawState(Graphics g, State state) {
if (selected.contains(state)) {
getStateDrawer().drawState(g, getAutomaton(), state,
state.getPoint(), SELECTED_COLOR);
if (doesDrawStateLabels())
getStateDrawer().drawStateLabel(g, state, state.getPoint(),
StateDrawer.STATE_COLOR);
} else
sup... | 2 |
private void func_48430_a(File par1File, File par2File, WorldChunkManager par3WorldChunkManager, int par4, int par5, IProgressUpdate par6IProgressUpdate)
{
try
{
String var7 = par2File.getName();
RegionFile var8 = new RegionFile(par2File);
RegionFile var9 = new Re... | 7 |
public static void pprintDescriptionsAsRule(Description head, Description tail, Proposition rule, org.powerloom.PrintableStringWriter stream) {
{ Vector headvariables = null;
Vector tailvariables = null;
boolean forwardruleP = ((BooleanWrapper)(KeyValueList.dynamicSlotValue(rule.dynamicSlots, Ontosaurus... | 9 |
public static void recoverTree(TreeNode root) {
List<TreeNode> nodes = new ArrayList<TreeNode>();
traversal(root, nodes);
for (TreeNode tn : nodes) {System.out.print(tn.val + " ");}
int i = 0;
int index1 = -1;
int index2 = -1;
for (i = 0; i < nodes.size() - 1; i++... | 8 |
public static String convertToUnix(String text) {
// Convert \r\n -> \n
text = Replace.replace(text,"\r\n","\n");
// Convert \r -> \n
text = Replace.replace(text,"\r","\n");
return text;
} | 0 |
public void paintContent(Graphics2D g) {
int w = getWidth();
int h = getHeight();
g.setColor(Color.LIGHT_GRAY);
g.fillRect(0, 0, w, h);
g.setColor(Color.BLACK);
int xFactor = 5;
int yFactor = 3;
g.setColor(Color.BLACK);
backWall = new Rectangl... | 8 |
public static boolean isEmpty(Automaton a) {
if (a.getNumStates() == 0) {
// Common case: no states
return true;
}
if (a.isAccept(0) == false && a.getNumTransitions(0) == 0) {
// Common case: just one initial state
return true;
}
if (a.isAccept(0) == true) {
// Apparent... | 8 |
public XMLReaderSAX getSAXReader() {
if (saxReader == null) {
saxReader = new XMLReaderSAX();
}
return saxReader;
} | 1 |
public void ordinaryChar(int ch) {
if (ch >= 0 && ch < ctype.length)
ctype[ch] = 0;
} | 2 |
public List<Position> getPositionsAround(Position position) {
if (position == null)
throw new IllegalArgumentException("Position can't be null!");
Set<Position> positions = new HashSet<Position>();
if (validPosition(position))
positions.add(position);
for (Movement move : Movement.values()) {
Positio... | 4 |
public static String getCurrentTime() {
Calendar c = Calendar.getInstance();
String result = "";
int temp;
result += c.get( Calendar.YEAR ) + "_";
if( ( temp = c.get( Calendar.MONTH ) + 1 ) < 10 ) {
result += "0";
}
result += temp + "_";
if( ( temp = c.get( Calendar.DAY_OF_MONTH ) ) < 10 ) {
... | 5 |
@SuppressWarnings("deprecation")
@Override
public void run() {
for (int i = 0; i <= 1; i++) {
if (!data.isEmpty()) {
int index = r.nextInt(data.size());
RegenData rd;
synchronized (lock) {
rd = data.remove(index);
}
Block b = rd.getW().getBlockAt(rd.getX(), rd.getY(), rd.getZ());
in... | 3 |
public static int Boruvka(Graph input) {
input.setState(States.ARR_ADJ);
Log.print(Log.system, "Boruvka algorithm:");
// init:
int N = input.getVertexCount();
int M = input.getEdgeCount();
int[][] arr_inc = new int[N][M];
int[][] arr_adj = new int[N][N];
@SuppressWarnings("unchecked")
ArrayList<ListN... | 8 |
public void setIsLocalRunMode(Boolean localRunMode) {
if (this.isLocalRunMode != localRunMode) {
this.isLocalRunMode = localRunMode;
NotifyRunModeChanged(localRunMode);
}
} | 1 |
private void preTraversal(TreeNode node,StringBuilder sb){
if(sb.length()>0) sb.append(",");
if(node==null) sb.append("NULL");
else{
sb.append(node.val);
preTraversal(node.left, sb);
preTraversal(node.right, sb);
}
} | 2 |
/* */ public synchronized void update(long elapsedTime) {
/* 29 */ if (this.frames.size() > 1) {
/* 30 */ this.animTime += elapsedTime;
/* 31 */ if (this.animTime >= this.totalDuration) {
/* 32 */ this.animTime %= this.totalDuration;
/* 33 */ this.currentFrame = 0;
/* */ }
... | 3 |
public boolean isEmpty() {
return mChildren[0] == null && mChildren[1] == null;
} | 1 |
public void deathAni()
{
switch (aniNum)
{
case 0:
sprt = imgD1.getImage();
if(Game.tickCount2 == game.DELAY){
aniNum = 1;
}
break;
case 1:
sprt = imgD2.getImage();
if(Game.tickCount2 == game.DELAY){
aniNum = 2;
}
break;
case 2:
sprt = imgD5.getImage();
if... | 7 |
public static void setFieldValue(Object object,
String fieldName,
String value){
try {
Field field = object.getClass().getDeclaredField(fieldName);
field.setAccessible(true);
if(field.getType().equals... | 4 |
@Override
public IEvent emit(IEvent event) {
Iterator<Map<Class<? extends IEvent>, List<IEventListener>>> itr = this.mapListeners.values().iterator();
while (itr.hasNext()) {
Map<Class<? extends IEvent>, List<IEventListener>> mapListener = itr.next();
List<IEventListener> listeners = mapListener.get(event.ge... | 5 |
public Window(Game game) {
// Game instance
this.game = game;
// Game and board
this.setTitle("Chess");
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
this.setLayout(new BorderLayout());
this.setResizable(true);
this.setIconImage(this.iconImage.getImage());
this.pack();
// Create menu... | 0 |
private void initMouse() {
try {
if (!jTextField1.getText().equals("")) {
listVarInt.put("nbSourisG", Integer.parseInt(jTextField1.getText()));
} else {
listVarInt.put("nbSourisG", 0);
}
if (!jTextField2.getText().equals("")) {
... | 3 |
public boolean equals(Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof LabelValue)) {
return false;
}
LabelValue bean = (LabelValue) obj;
int nil = (this.getValue() == null) ? 1 : 0;
nil += (bean.getValue() == null) ? ... | 6 |
void radf2(final int ido, final int l1, final double in[], final int in_off, final double out[], final int out_off, final int offset) {
int i, ic, idx0, idx1, idx2, idx3, idx4;
double t1i, t1r, w1r, w1i;
int iw1;
iw1 = offset;
idx0 = l1 * ido;
idx1 = 2 * ido;
for ... | 7 |
public static void demarrer(){
String choixJeu;
resterDansLeCasino = true;
System.out.println("\n\nBienvenue dans le Casino !");
while (resterDansLeCasino)
{
if (joueur.age < 21)
{
System.out.println ("Vous êtes trop jeune... | 8 |
private void buildPostOrderTraversal(GeneralTreeNode<T> cur) {
Iterator<GeneralTreeNode<T>> it = cur.getChildren();
while (it.hasNext()) {
this.buildPostOrderTraversal(it.next());
}
OutputQueue.add(cur);
} | 1 |
public DisconnectOnServerEvent(Object server, ISocketServerConnection clientConnection) {
super(server);
this.clientConnection = clientConnection;
} | 0 |
public void setDay(int d) {
if (d < 1) {
d = 1;
}
Calendar tmpCalendar = (Calendar) calendar.clone();
tmpCalendar.set(Calendar.DAY_OF_MONTH, 1);
tmpCalendar.add(Calendar.MONTH, 1);
tmpCalendar.add(Calendar.DATE, -1);
int maxDaysInMonth = tmpCalendar.... | 6 |
public static int readVersion(Handshakedata handshakedata) {
String vers = handshakedata.getFieldValue("Sec-WebSocket-Version");
if (vers.length() > 0) {
int v;
try {
v = new Integer(vers.trim());
return v;
} catch (NumberFormatException e) {
return -1;
}
}
return -1;
} | 2 |
private void read24Bit(byte[] bdata) {
// Padding bytes at the end of each scanline
int padding = 0;
// width * bitsPerPixel should be divisible by 32
int bitsPerScanline = width * 24;
if ( bitsPerScanline%32 != 0) {
padding = (bitsPerScanline/32 + 1)*32 - bitsPerScanline;
padding = (int)Math.ceil(paddi... | 9 |
public void method1() {
adaptee.method2();
} | 0 |
public static void main(String[] args)
{
enumCompareTo(opConstant.SHOOT);
} | 0 |
@Override
public void setName(String name) {
this.name = name;
} | 0 |
public static int escapeXmlChar(Writer out, char ch, int buffIndex, char[] buff, int buffLength) throws IOException {
int nextIndex;
if (ch < 0xA0) {
// If "?" or over, no escaping is needed (this covers
// most of the Latin alphabet)
if (ch >= 0x3f) {
... | 8 |
public ServerData( String name, String shortName, boolean force, String channel, int localDistance, boolean connectionMessages ) {
this.serverName = name;
this.shortName = shortName;
this.forceChannel = force;
if ( channel.equalsIgnoreCase( "server" ) ) {
this.forcedChannel =... | 3 |
public void changeLoc(int newLocX, int newLocY) {
if (PRIVS != PRIVS.BANNED || (BATTLE == null && !BLN_SLEEP && Game.canMoveTo(newLocX,newLocY,this))) {
if (isMob()) {
if (!(Math.abs(originalX-newLocX) < Game.VIEW_RANGE && Math.abs(originalY-newLocY) < Game.VIEW_RANGE)) {
return;
}
}
changeLocB... | 7 |
@Override
public void configure(AbstractCommand command, String[] args) {
TimeBanBanCommand banCommand = (TimeBanBanCommand) command;
List<String> players = CommandLineParser.getListOfString(args[0]);
String reason = stdBanReason;
Calendar until = UntilStringParser.parse(stdBanDurat... | 5 |
public void testProperty() {
MonthDay test = new MonthDay(6, 6);
assertEquals(test.monthOfYear(), test.property(DateTimeFieldType.monthOfYear()));
assertEquals(test.dayOfMonth(), test.property(DateTimeFieldType.dayOfMonth()));
try {
test.property(DateTimeFieldType.millisOfDay... | 2 |
private static boolean isLychrel(int n){
BigInteger temp = new BigInteger(Integer.toString(n));
for(int i=0;i<50;i++){
String reverse = new StringBuilder(temp.toString()).reverse().toString();
temp = temp.add(new BigInteger(reverse));
if (isPalindrome(temp.toString())) return false;
}
return true;
} | 2 |
public boolean processMsg(CConnection cc) {
OutStream os = cc.getOutStream();
StringBuffer username = new StringBuffer();
// JW: Launcher passes in username as property of Options object,
// so there's no need to pop up a dialog asking for a username
// if it is already recorded within the Options... | 3 |
private void monitorTouchInput()
{
boolean isPressed = touch.isPressed();
while (!Thread.interrupted())
{
if (touch.isPressed() && !isPressed)
{
isPressed = true;
for (TouchListener l : listeners)
{
l.contactInitiated();
}
}
else if (!touch.isPressed() && isPressed)
{
isPr... | 7 |
private boolean hasWildCard(RedisBigTableKey key)
{
boolean hasWildCard = Utils.hasWildCard(key.getRow());
hasWildCard = hasWildCard && Utils.hasWildCard(key.getColumnFamily());
hasWildCard = hasWildCard && Utils.hasWildCard(key.getColumnQualifier());
return hasWildCard;
} | 2 |
private boolean matchSpaces(String sentence, int matches) {
int c = 0;
for (int i = 0; i < sentence.length(); i++) {
if (sentence.charAt(i) == ' ')
c++;
if (c == matches)
return true;
}
return false;
} | 3 |
private void loadStats() throws IOException {
String line;
boolean fileFound = true;
int nameScoreDate = 0; ///< Names = 0, Scores = 1, Dates = 2
int j; ///< Line in leaderboard
try {
bfr = new BufferedReader(new FileReader(statsFile));
} catch (FileNotFoundE... | 5 |
@Override
public int compareTo(RushPlayer o) {
int killsA = kills;
int killsB = o.getKills();
if(killsA == killsB) {
int deathsA = deaths;
int deathsB = o.getDeaths();
if(deathsA == deathsB)
return 0;
else if(deathsA > deathsB)
return -1;
else
return 1;
}
else if(killsA > killsB)
... | 4 |
public String getClientIP()
{
return clientIP;
} | 0 |
public static void equalizeChannel(Image original, Image image,
ChannelType color) {
int[] ocurrences = getColorOccurrences(original, color);
int totalPixels = image.getWidth() * image.getHeight();
double[] levels = new double[totalPixels];
double s_min = 0;
double s_max = Image.MAX_VAL;
for (int i = 0; ... | 5 |
public int sum(TreeNode root, int top)
{
if (root == null) return top;
if (root.left == null && root.right == null)
{
return top * 10 + root.val;
}
int sum = 0;
if (root.left != null) sum += sum(root.left, top * 10 + root.val);
if (root.right != null) sum += sum(root.right, top * 10 + root.... | 5 |
public static void main(String[] args) {
int port = defaultPort;
String host = defaultHost;
// Auf Eingabeparameter ueberpruefen und gegebenenfalls setzten.
if (args.length > 0) {
for (int i = 0; i < args.length; i++) {
// Pruefen, ob ein Parameter den Port angibt.
if ((args[i] = ... | 9 |
public TwoWarriorsVsTwoHobgoblins() {
model = new CPModel();
// Tableau de variable représentant les dommages reçus par le premier
// guerrier
for (int i = 0; i < NB_OF_ROUNDS; i++) {
warrior1DamageReceived[i] = makeIntVar(
"warrior 1 damage received for round" + (i + 1),
HOBGOBLIN_DMG);
model.... | 9 |
@Override
public String toString() {
return "ARGS " + new Integer(numberOfArguments).toString();
} | 0 |
public static void removeConnection(InetSocketAddress sockaddr) {
if(!isInit) { init(); }
for(int i = 0; i < clientRecent.size(); i++) {
if(clientRecent.get(i).equals(sockaddr)) {
clientRecent.remove(i);
}
}
} | 3 |
private void runGame(Player p1, Player p2, Sign s1, Sign s2)
{
if (s1 == s2)
{
draw(p1, p2, s1);
return;
}
if ((s1 == Sign.ROCK && s2 == Sign.SCISSORS)
|| (s1 == Sign.SCISSORS && s2 == Sign.PAPER)
|| (s1 == Sign.PAPER && s2 == Sign.ROCK))
finishGame(p1, p2, s1, s2);
else
finishGame(p2, p1... | 7 |
public static void removeCopy(int copyId){
try {
if(conn == null || conn.isClosed()){
conn = DatabaseConnection.getConnection();
}
} catch (SQLException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
try{
conn.setAutoCommit(false);
PreparedState... | 4 |
public synchronized void stop() {
running = false;
} | 0 |
public Requests() {
} | 0 |
private int parseInt(String value) throws InvalidFormatException {
try {
return Integer.parseInt(value);
} catch (NumberFormatException e) {
throw new InvalidFormatException();
}
} | 1 |
@Override
public IEmailKontakt first() throws NoEmailKontaktFoundException {
EmailKontaktList emailContacts = readContacts();
if (emailContacts.getContactList().size() == 0) {
throw new NoEmailKontaktFoundException("Kein Kontakt gefunden!");
} else
return emailContacts.getContactList().get(0);
} | 1 |
public boolean check(String userName, String password) {
for (Account account : accountList) {
if (account.getUserName().equals(userName)
&& account.getPassword().equals(password)) {
return true;
}
}
return false;
} | 3 |
public BefehlsPanel()
{
setLayout(null);
setSize(682, 512);
_labelFuerLebensenergie = new JLabel();
_labelFuerLebensenergie.setLocation(ABSTAND_NORMAL, 0);
_labelFuerLebensenergie.setSize(50, BefehlsPanel.this.getHeight() - 50);
_beinstellenButton = new JButton(BEINSTELLEN);
_beinstellenButton.setSize(... | 5 |
public void run() {
while (true) {
try {
Socket socket = mServerSocket.accept(); // Wait for a new peer
Log.i("PeerAccepter", "New Peer connected ->");
MessageInputStream mis = new MessageInputStream(socket.getInputStream());
Handshake handshake = mis.readHandShake();
Hash infoHash = ... | 5 |
@Column(name = "percent")
@Id
public double getPercent() {
return percent;
} | 0 |
protected static byte[] decodeData(String password, BufferedImage origin, BufferedImage otp) throws NoSuchAlgorithmException, NoSuchPaddingException, InvalidKeyException, IllegalBlockSizeException, BadPaddingException, UnsupportedEncodingException {
byte[] otpA = null;
if (otp != null) {
otp... | 4 |
public static RuleSet GenerateRuleSets(TransactionSet transSet, TransactionSet finalLargeItemSet,double minConfidenceLevel) {
Timer timer = new Timer();
timer.startTimer();
RuleSet allRuleSets = new RuleSet(new ArrayList<Rule>());
for (Transaction itemset : finalLargeItemSet.getTransactionSet()) {
Arr... | 6 |
public final void setNoOfLeds(final int NO_OF_LEDS) {
int amount = NO_OF_LEDS < 5 ? 5 : NO_OF_LEDS;
if (amount > noOfLeds.get()) {
for (int i = 0 ; i < (amount - noOfLeds.get()) ; i++) {
ledColors.get().add(Color.RED);
}
}
if (null == noOfLeds) {
... | 4 |
public String toString()
{
StringBuffer sb = new StringBuffer();
sb.append( versions+": " );
if ( parent != null )
{
sb.append("["+parent.id+":");
sb.append( new String(parent.data) );
sb.append( "]" );
}
else if ( children != null )
{
sb.append("{"+id+":");
sb.append( new String(data) );
... | 5 |
public static byte[] decrypt(byte[] data, byte[] key) {
if(data.length == 0) {
return data;
}
int[] s = Util.bytesToInts(data);
int[] g = Util.bytesToInts(Arrays.copyOfRange(key, 0, 16));
int d = s.length;
int j = s[d - 1], l = s[0];
int o = 0x9E377... | 5 |
public GUI() {
setBackground(Color.DARK_GRAY);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setBounds(10, 10, 745, 485);
contentPane = new JPanel();
contentPane.setForeground(Color.DARK_GRAY);
contentPane.setBackground(Color.DARK_GRAY);
contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
setContentPa... | 8 |
private int compareMastRecWithTransRec(AcctsRecMastRec m,
AcctsRecTransRec t, Comparator<String> comp) {
int result;
if (t == null) {
result = -1;
} else if (m == null) {
result = 1;
} else {
result = comp.compare(m.getKey(), t.getMastKey());
}
return result;
} | 2 |
@Override
@SuppressWarnings({ "nls", "boxing" })
protected void initialize(Class<?> type, Object oldInstance,
Object newInstance, Encoder enc) {
super.initialize(type, oldInstance, newInstance, enc);
if (type != oldInstance.getClass()) {
return;
}
Choice choice = (Choice) oldInstance;
int count = ... | 8 |
@Override
public Area areaLocation(CMObject E)
{
if(E==null)
return null;
if(E instanceof Area)
return (Area)E;
else
if(E instanceof Room)
return ((Room)E).getArea();
else
if(E instanceof MOB)
return areaLocation(((MOB)E).location());
else
if(E instanceof Item)
return areaLocation(((Ite... | 8 |
@Test(expected = RuntimeException.class)
public void twoInchesPlusEightOuncesShouldThrowException(){
ArithmeticQuantity two_in = new ArithmeticQuantity(2, Distance.INCHES);
ArithmeticQuantity eight_oz = new ArithmeticQuantity(8, Volume.OUNCE);
two_in.add(eight_oz);
} | 0 |
public void simplify()
{
top:for(Element elem1 : array)
{
for(Element elem2 : array)
{
if(elem1 != elem2 && elem1.getClass().getName().equals("PowerSupply") == false && elem2.getClass().getName().equals("PowerSupply") == false)
{
if(elem1.getConnections("first").indexOf(elem2) !=... | 9 |
Sequence (String url_1, String url_2, String url_3) {
if (url_1 == null || url_2 == null || url_3 == null
|| url_1.isEmpty() || url_2.isEmpty() || url_3.isEmpty()) {
throw new IllegalArgumentException("Neither of the construction urls allowed to be null or empty");
... | 6 |
private boolean addDeklinationSubstTable( String wikiText, int fromIndex, String baseWord ) {
Properties props = BookUtils.parseRule( wikiText, "Deutsch Substantiv bersicht", fromIndex );
if( props != null ) {
if( props.remove( "Bild" ) != null || props.remove( "Bild 1" ) != null ) {
... | 8 |
public Instantiation findOwner(final int i) {
if (!subroutine.ownsInstruction(i)) {
return null;
}
if (!dualCitizens.get(i)) {
return this;
}
Instantiation own = this;
for (Instantiation p = previous; p != null; p = p.previous) {
if (p.subroutine.ownsInstruction(i)) {
own = p;
}
... | 4 |
public t(int nu) throws ParameterException {
if (nu < 1) {
throw new ParameterException("t parameter nu >= 1");
} else {
this.nu = nu;
chiSq = new ChiSquared(nu);
norm = new Normal(0, 1);
}
} | 1 |
protected void loadNBT(NBTTagCompound data) {
NBTTagList list = data.getTagList("pairings", 10);
for (byte entry = 0; entry < list.tagCount(); entry++) {
NBTTagCompound tag = list.getCompoundTagAt(entry);
int[] c = tag.getIntArray("coords");
pairings.add(new WorldCoor... | 2 |
@Override
public void update(GameContainer container, int delta) throws SlickException {
i = container.getInput();
if (i.isKeyDown(Input.KEY_UP)) {
gc.key_up(delta);
} else if (i.isKeyDown(Input.KEY_DOWN)) {
gc.key_down(delta);
}
if (i.isKeyDown(Input.KEY_RIGHT)) {
gc.key_righ... | 4 |
public Key min()
{
if (minIndex != -1)
return pq[minIndex];
return null;
} | 1 |
public void setPayment(boolean payment) {
this.payment = payment;
} | 0 |
private static String loadPattern(String fileName) {
BufferedReader in;
StringBuilder b;
if (fileName == null) {
return null;
} // if
try {
in = new BufferedReader(new InputStreamReader(new FileInputStream(fileName), Charset.forName(chars... | 6 |
@Override
public final void registerId(final Path parent, final String filename) {
final Path p = parent == null ? Path.getPath(filename) : parent.resolve(filename);
final int pathId = Deserializer_0.this.pathIdNextOut.incrementAndGet();
final byte[] idBytesPrev = writeIntRE(parent == null ? 0 : Deserialize... | 3 |
public final void callAttachments(Interface sender, String message) {
ArrayList<Interface> receiver = new ArrayList<Interface>();
// Find all receiver in attachments list
Iterator<Attachment> itAttach = this.attachments.iterator();
while(itAttach.hasNext()) {
Interface dest = itAttach.next().getReceiver(... | 3 |
@Override
public List<Race> raceQualifies(int theme)
{
final Vector<Race> qualRaces = new Vector<Race>();
final HashSet<String> doneRaces=new HashSet<String>();
for(final Enumeration<Race> r=CMClass.races();r.hasMoreElements();)
{
Race R=r.nextElement();
if(doneRaces.contains(R.ID()))
continue;
R... | 7 |
public void handleDoMPIMaster(MutationManager mutMan, int size) throws MPIException, InterruptedException {
//KER: If it isn't an mpiRun start extra threads so that we can simulate
//an mpiRun
if(!mpiRun)
MPItoThread.startThreads(this,Thread.currentThread());
CommucObj cObjArray[] = new CommucObj[size]... | 9 |
private static boolean isHexNumber(String value) {
int index = (value.startsWith("-") ? 1 : 0);
return (value.startsWith("0x", index) || value.startsWith("0X", index) || value
.startsWith("#", index));
} | 3 |
public static void main(String args[])
{
// null check
Utility.printObject(null);
DataBase db = new DataBase();
// null fields
Utility.printObject(db);
Name n = new Name();
Utility.printObject(n);
n.firstName = "Aviva";
n.lastName = "Herman";
// prints a real object
Utility.pri... | 1 |
protected static Ptg calcPRICEMAT( Ptg[] operands )
{
if( operands.length < 4 )
{ // not supported by function
return new PtgErr( PtgErr.ERROR_NULL );
}
debugOperands( operands, "calcPRICEMAT" );
try
{
GregorianCalendar sDate = (GregorianCalendar) DateConverter.getCalendarFromNumber( operands[0].get... | 8 |
public boolean ParseChatCommand(Session mSession, String Command)
{
String CommandName = SplitCommand(Command, true)[0];
if (!ChatCommands.containsKey((CommandName).toLowerCase()))
{
mSession.SendAlert(CommandName + " isn't a valid chat command!", null);
return false;
}
if (mSession.GrabHabbo().R... | 2 |
public void rotate(Direction dir)
{
if (dir == Direction.EAST)
{
Log.i("Rotating model right");
for (Level l : levels)
{
for (Piece p : l.pieces)
{
int oldY = p.y;
p.y = p.x;
p.x = getHeight()*2 - oldY- 1; // height pre swap
p.type = Pi... | 6 |
public static void printInfo() {
Logger.logInfo("FTBLaunch starting up (version " + Constants.version + " Build: " + Constants.buildNumber + ")");
Logger.logInfo("Java version: " + System.getProperty("java.version"));
Logger.logInfo("Java vendor: " + System.getProperty("java.vendor"));
L... | 8 |
private boolean ReadConfigFile()
{
//read status
boolean status = false;
//holds each line read
String data = null;
//hold the name of the section of the config file
String section = null;
try
{
//open the file input stream
... | 6 |
private static void setExtendedParentPointers (final int[] array) {
final int length = array.length;
array[0] += array[1];
for (int headNode = 0, tailNode = 1, topNode = 2; tailNode < (length - 1); tailNode++) {
int temp;
if ((topNode >= length) || (array[headNode] < array[topNode])) {
temp = array[h... | 6 |
@Override
public Class<?> getColumnClass(int columnIndex) {
switch(columnIndex){
case 0:
return String.class;
case 1:
return Ingredient.class;
case 2:
// return String.class;
return Double.class;
case 3:
return Component.class;
// return Double.class;
// return String.class;
def... | 5 |
private void bindAmountScrolled() {
int var1 = this.getContentHeight() - (this.bottom - this.top - 4);
if(var1 < 0) {
var1 /= 2;
}
if(this.amountScrolled < 0.0F) {
this.amountScrolled = 0.0F;
}
if(this.amountScrolled > (float)var1) {
this.amountScrolled =... | 3 |
public static boolean buildInstance(String account, String name) {
//Clear progress (partially redundant)
GlobalDialogs.setProgressCaption("Initializing...");
GlobalDialogs.setProgressValue(0);
//Mark instance as incomplete
Logger.info("Instances.buildInstance",... | 8 |
public void removeView(AbstractView view) {
registeredViews.remove(view);
view.removePropertyChangeListener(this);
} | 0 |
@Override
public int compareTo(Object e) {
if(this.weight > ((Edge)e).weight)
return 1;
if(this.weight < ((Edge)e).weight)
return -1;
if(this.weight == ((Edge)e).weight)
return 0;
return 0;
} | 3 |
public SchemaEditorToolBar(final BasicGraphEditor editor, int orientation)
{
super(orientation);
setBorder(BorderFactory.createCompoundBorder(BorderFactory
.createEmptyBorder(3, 3, 3, 3), getBorder()));
setFloatable(false);
add(editor.bind("New", new NewAction(),
"/com/mxgraph/examples/swing/images/ne... | 5 |
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.