text stringlengths 14 410k | label int32 0 9 |
|---|---|
private int getDoorPos(){
//TODO: EITHER check if floors are on both sides of the door. OR let doors be placed in places with one exit, easter egg saying "You've walked into a brick wall". - Tamfoolery
if(getTile(tileX + 1, tileY).equals(Tile.wallTile) && getTile(tileX - 1, tileY).equals(Tile.wallTile)) return 3;
... | 4 |
public void setSetting(String group, String name, String value) {
String compiledName = group + "." + name;
this.settings.put(compiledName, value);
try {
Element propertiesElem = getOrCreateCollection("properties");
Node setting = Utilities.selectSingleNode(propertiesElem, "./c:property[@c:name='" + comp... | 5 |
@Override
public int compare(Integer o1, Integer o2) {
// TODO Auto-generated method stub
// Sort topic word index according to the probability of each word
// in topic k
if (sortProb[o1] > sortProb[o2])
return -1;
else if (sortProb[o1] < sortProb[o2])
return 1;
else
return 0;
} | 2 |
public BipMatch() {
try {
io = new Kattio(System.in, System.out);
long start, end; // Tid tagnings variabler
if (DEBUG) {
System.err.println("\nreadBipartiteGraph");
}
readBipartiteGraph();
if (DEBUG_TIME) {
System.out.println("Start timing");
start = System.currentTimeMillis();
}
... | 9 |
private static void testInvalidNode(ListNode p) {
System.out.println("p.isValidNode() should be false: " + p.isValidNode());
try {
p.item();
System.out.println("p.item() should throw an exception, but didn't.");
} catch (InvalidNodeException lbe) {
System.out.println("p.item() should throw... | 7 |
public void setPurchaseDate(String purchaseDate)
{
if (purchaseDate == null || purchaseDate.length() != 8 || !purchaseDate.matches("\\d{8}"))
throw new IllegalArgumentException("The purchase date field in the " + frameType.getId() + " frame contains an invalid value, " + purchaseDate + ". It must hav... | 9 |
public void createUser(UserBean user){
try {
String queryString = "INSERT INTO user values('?', '?', '?', '?', ?, ?, NULL);";
PreparedStatement statement = this.db.createStatement(queryString);
statement.setString(1, user.getName());
statement.setString(2, user.ge... | 1 |
public final void displayStatus()
{
System.out.println("Name: " +playerName);
System.out.println("Health: " +health +"/100");
System.out.println("Sanity: " +sanity +"/100");
System.out.println("Hunger: " +hunger +"/100");
System.out.println("Fatigue: " +fatigue +"/100");
... | 2 |
public static boolean verify(byte[] data, String publicKey, String sign)
throws Exception {
// 解密由base64编码的公钥
byte[] keyBytes = SecurityCoder.base64Decoder(publicKey);
// 构造X509EncodedKeySpec对象
X509EncodedKeySpec keySpec = new X509EncodedKeySpec(keyBytes);
// ALGORITHM 指定的加密算法
KeyFactory keyFactory = K... | 0 |
private void portComboBox_itemStateChanged(ItemEvent event) {
String selected = (String) event.getItem();
if (event.getStateChange() == ItemEvent.SELECTED) {
if (! selected.equals("-")) {
openSerialPort((CommPortIdentifier) tableOfPorts.get(selected));
}
... | 2 |
@Override
public void ordena(int[] vector, DatosEstadisticos de) {
long tiempo = System.currentTimeMillis();
for (int i = 0; i < vector.length - 1; i++) {
for (int j = i; j < vector.length; j++) {
if (vector[j] < vector[i]) {
int aux = vector[... | 8 |
public boolean proceed(Player p, Location target)
{
if (!region.contains(toWEVector(target.toVector())))
return true;
if (players.contains(p.getName()))
return false;
for (String group : groups)
if (InvisibleWallsPermission.isInGroup(p, group))
return false;
return true;
} | 4 |
void closestColor(int red, int green, int blue, Search search) {
if (nchild != 0) {
for (int id = 0; id < 8; id++) {
if (child[id] != null) {
child[id].closestColor(red, green, blue, search);
}
... | 5 |
public boolean canCollectCoin(EntityPlayer player){
return posX == (int)((player.getxPos() + 16) / 32) && posY == (int)((player.getyPos() + 16) / 32);
} | 1 |
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
UrlPair other = (UrlPair) obj;
if (longUrl == null) {
if (other.longUrl != null)
return false;
} else if (!longUrl.equals(other.longUrl)... | 9 |
public void destroy(Long id) throws NonexistentEntityException {
EntityManager em = null;
try {
em = getEntityManager();
em.getTransaction().begin();
Professor professor;
try {
professor = em.getReference(Professor.class, id);
... | 2 |
private static boolean tryFindSentence(final Map<Integer, Set<String>> words, final int[] indexes, int startIndOfCurrWord, int currWordNumberInOrder, final int phoneLength) {
Set<String> wordsByIndex = words.get(startIndOfCurrWord);
if (startIndOfCurrWord >= phoneLength || wordsByIndex == null || wordsB... | 7 |
public Configuration[] getValidConfigurations() {
// A state is valid for return if it is normal.
ArrayList list = new ArrayList();
Iterator it = configurationToButtonMap.values().iterator();
while (it.hasNext()) {
ConfigurationButton button = (ConfigurationButton) it.next();
if (button.state == Configura... | 3 |
public void mainloop()
{
Initialisierung();
//Rand erstellen
Lines.clear();
Lines.add(new int[]{0, 0, blaenge, 0});
Lines.add(new int[]{blaenge, 0, blaenge, bbreite});
Lines.add(new int[]{blaenge, bbreite, 0, bbreite});
Lines.add(new int[]{0, bbreite, 0, 0});
//Standardtor setzen
Goals.clear();
G... | 7 |
private static String maskPassword(String proxyString) {
String retVal = proxyString;
if (proxyString != null && !"".equals(proxyString.trim())) {
boolean hasSchemeDefined = proxyString.contains("http:") || proxyString.contains("https:");
boolean hasProtocolDefined = proxyString.... | 8 |
public Object put(Object key, Object value) {
for (Iterator i = backing.iterator(); i.hasNext();) {
Map.Entry entry = (Map.Entry) i.next();
if (key.equals(entry.getKey()))
return entry.setValue(value);
}
backing.add(new SimpleEntry(key, value));
return null;
} | 2 |
public void ReceivePacket() throws IOException, ServiceException {
boolean serviceLock=true;
Logger.getInstance().log("HID","getting device name from user");
String targetDevice = getTarget("device name");
Logger.getInstance().log("HID","getting device name " + targetDevice);
i... | 6 |
private void saveImageFromXML(Match documentRoot) {
if (documentRoot.attr("image") != null) {
File filePath = new File(documentRoot.attr("image"));
// Verifica daca path-ul este absolut.
if (filePath.isAbsolute()) {
this.imagePath = filePath.getAbsolutePath();
} else {
this.imagePath = (new File(... | 5 |
@Override
public void actionESC() {
if (_DEBUG) System.out.println("Press ESC from Level");
Fenetre.setState(StateFen.MenuPause);
} | 1 |
@Override
public void tick(ServerKontext kontext)
{
// dirty fix
if(!_satt && _raum != null && !istEinSpielerImRaum(kontext, _raum))
{
bewegeKatze(kontext);
}
} | 3 |
public synchronized void processCas(CAS aCAS) throws ResourceProcessException {
JCas jcas;
try {
jcas = aCAS.getJCas();
} catch (CASException e) {
throw new ResourceProcessException(e);
}
String output = null;
String lineID = null;
int so;
int eo;
int start, end;
int ... | 7 |
public Entity(Level level, int x, int y) {
this.x = x;
this.y = y;
this.level = level;
level.entities.add(this);
hWidth = 16;
hHeight = 16;
} | 0 |
public int getCount(ArrayList<FilterBean> hmFilter) throws Exception {
int pages;
try {
oMysql.conexion(enumTipoConexion);
pages = oMysql.getCount("backlog", hmFilter);
oMysql.desconexion();
return pages;
} catch (Exception e) {
throw n... | 1 |
public Serializable decode(File file, Map parameters) {
throw new ParseException("This codec is not implemented yet.");
} | 0 |
public String getImageName() {
String path = "";
String extension = ".png";
switch (getId()) {
case 1:
return path + "c_contact" + extension;
case 2:
return path + "c_creativity" + extension;
case 3:
return path... | 7 |
@Override
public boolean isCellEditable(int row, int column) {
Project prj = this.getProjectAt(row);
switch (column) {
case ProjectTableModel.COLUMN_CHECK:
case ProjectTableModel.COLUMN_TITLE:
case ProjectTableModel.COLUMN_COLOR:
case ProjectTableModel.COLUMN_CREATED:
return true;
case ProjectTable... | 7 |
public void setFunNitCxc(Integer funNitCxc) {
this.funNitCxc = funNitCxc;
} | 0 |
public static double jauTf2a(char s, int ihour, int imin, double sec ) throws JSOFAIllegalParameter
{
double rad;
/* Compute the interval. */
rad = ( s == '-' ? -1.0 : 1.0 ) *
( 60.0 * ( 60.0 * ( (double) abs(ihour) ) +
( (double) abs(imin) ) ) +
... | 7 |
@Override
public int compare(AAccount o1, AAccount o2) {
String val1, val2;
try {
try {
val1 = o1.getClass().getMethod(methodName, null).invoke(o1).toString();
val2 = o1.getClass().getMethod(methodName, null).invoke(o2).toString();
return (... | 5 |
@Override
public Script create(ResourceDefinition definition)
throws ResourceException {
String compileAttr = definition.getAttribute("compile");
boolean compile = (compileAttr != null && compileAttr.equals("false")) ? false : true;
String file = definition.getValue();
if (file.isEmpty()) {
throw new ... | 4 |
private static final void post(char levelCode, Context context, String msg, Throwable throwable) {
StringBuilder buffer = new StringBuilder();
buffer.append(levelCode);
buffer.append(SEPARATOR);
buffer.append(FORMAT.format(new Date()));
buffer.append(SEPARATOR);
if (context != null) {
buffer.append(conte... | 7 |
@Override
public String getHome() {
return "/";
} | 0 |
public int [] usingHashing(int [] arrA, int [] arrB){
//Insert all the elements of arrA in hash Table,
//Element as key and its count as its value
//Navigate through arrB, check element's presence in Hash table
//if it is present then takes its value (count) and insert into arrA.
//Once arrB is completed, tak... | 7 |
public int getMinimum(int[] numbers, int goal){
int m=0, tmp=goal;
while(tmp>0){
m++;
tmp = tmp>>1;
}
int[] count = new int[m];
for(int i=0; i<numbers.length; i++){
if((goal|numbers[i])==goal){
for(int j=0; j<m; j++){
... | 7 |
private void Merge(ObservableArray tab, int left, int center, int right) {
Double[] temp = new Double[(right - left) + 1];
int leftIndex = left;
int rightIndex = center + 1;
int i = 0;
while (leftIndex <= center && rightIndex <= right) {
if (tab.Less(leftIndex, righ... | 6 |
public void printVisit( Tree.Node<String> node, int depth ) {
for ( int i = 0; i < depth; ++i ) {
System.out.print("-");
}
System.out.println( node.getData() );
List<Tree.Node<String>> children = node.getChildren();
for( int i = 0; i < children.size(); ++i ) {... | 2 |
public static void loadItemDefinitions() {
try {
int parsedIndex = 0;
setDefinitions(new ItemDefinition[7956]);
DataInputStream inputStream = new DataInputStream(new FileInputStream("./data/item_definition/ItemDefinitions.dat"));
while (inputStream.available() > 0) {
ItemDefinition itemDefinition = ne... | 8 |
public void setPreference(Preference pref) {
this.pref = pref;
} | 0 |
private void initComponents() {
// JFormDesigner - Component initialization - DO NOT MODIFY //GEN-BEGIN:initComponents
// Generated using JFormDesigner Evaluation license - Bob Joe
dListModel = new DefaultListModel<String>();
channelUserList = new JList<String>(dListModel);
menu... | 0 |
public BesieForm (ArrayList<Excel> allEx)
{
allex = allEx;
setColoredExes();
} | 0 |
private void fillCompositeInfo(IFileInfo[] srcStat, IFileInfo[] destStat)
{
this.srcComp.setLayout(new GridLayout(2, false));
this.destComp.setLayout(new GridLayout(2, false));
if(srcStat.length >= destStat.length)
{
for(int i = 0; i < srcStat.length; ++i)
{
IFileInfo srcFileInfo = srcStat[i];
Te... | 6 |
public boolean start() {
synchronized (optOutLock) {
// Did we opt out?
if (isOptOut()) {
return false;
}
// Is metrics already running?
if (task != null) {
return true;
}
// Begin hitting the s... | 7 |
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
jLabelTitre = new javax.swing.JLabel();
jSeparatorTitre = new javax.swing.JSeparator();
jButtonValider = new javax.swing.JButton();
... | 0 |
private void generateElements(PrintStream out) {
for (Element element : repository.elements()) {
if (element instanceof ClassElement) {
generateNodeDefForClass(out);
generateClassElement(out, (ClassElement) element);
}
else if (element instance... | 4 |
public AttendanceReadList getAttendanceReadList(
int aiMaxSize, String asLastId, String asRoom, Boolean abExcludeTapNGo) {
String lsParam = "";
if (aiMaxSize > 0) {
lsParam += "&max_size=" + Integer.toString(aiMaxSize);
}
if (UtilityMethods.isValidString(asLastId)... | 5 |
@Test(timeout = 1000)
public void testConcurrentStreamPiping() throws Exception {
final int charCount = 30;
final char[] vals = "123456789".toCharArray();
final int n = vals.length;
InputStream[] istreams = new InputStream[n];
// Generate n istreams with charCount equal elem... | 8 |
public static Class<? extends Property> getPropByType(String name){
return Types.get(name);
} | 1 |
void process_downloaded_changeset_wayrelation_attributes( Node passed_l2_item,
String passed_l1_item_type, String passed_changeset_number,
int passed_arg_debug, String passed_arg_out_file, PrintStream passed_myPrintStream )
{
if ( passed_l2_item.hasAttributes() )
{
NamedNodeMap node_attributes = passed_... | 9 |
@Override
public PlayerLeftGameMessage LeaveGame(int playerID) {
Player player = _state.GetPlayer(playerID);
ServerGame game = _state.TryGetGameByPlayerId(playerID);
if (game == null)
return MessageCreator.CreatePlayerLeftGameMessage(Arrays.asList(playerID),null,player,null);
... | 7 |
public String toString()
{
return pattern;
} | 0 |
private void addToCouleurNonVoulue(TreeMap<String,TreeMap< Integer, TreeSet<Integer>>> tree, String agent, Integer noeud, Integer badColor)
{
TreeMap< Integer, TreeSet<Integer>> tempTree = tree.get(agent);
try{
TreeSet<Integer> listBadColor = tempTree.get(noeud);
listBadColor.add(badColor);
}
catch(Excep... | 1 |
private void setupQualifiers(EntityRegistry registry) {
// for (Field f : qualifierRegistry.getDeclaredFields()) {
// FieldId fann = f.getAnnotation(FieldId.class);
// if (fann == null) {
// continue;
// }
// Object key;
// try {
// ... | 5 |
public void delete(int index) {
if (index >= size() || index < 0)
throw new IndexOutOfBoundsException();
if (group != null)
group.removeElementAt(index);
list.remove(index);
_showNotify();
} | 3 |
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int T = sc.nextInt();
for (int t = 0; t < T; t++) {
int n = sc.nextInt();
int m = sc.nextInt();
int[] arr = new int[(int) Math.pow(2, n)];
for (int i = 0; i < m; i++) {
... | 9 |
public static boolean confirm() {
WidgetChild button = getChild(CONFIRM_BUTTON);
final Item it = getItem(getCurrentIndex());
final int count, amount;
return it != null && canConfirm() && visible(button) && (count = it.getStackSize()) != 0
&& (amount = getAmount()) != 0 && button.click(true) && new TimedCond... | 6 |
static final RasterToolkit method1969(byte[] is, int i) {
anInt8546++;
if (i != -5901)
anInt8550 = 83;
if (is == null)
throw new RuntimeException("");
for (;;) {
try {
Image image = Toolkit.getDefaultToolkit().createImage(is);
MediaTracker mediatracker
= new MediaTracker(NpcDefinition.aClie... | 7 |
private static char ConvertToLetter(int num)
{
char letter = 'A';
switch(num)
{
case 1:
letter = 'B';
break;
case 2:
letter = 'C';
break;
case 3:
letter = 'D';
break;
case 4:
letter = 'E';
break;
case 5:
letter = 'F';
break;
case 6:
letter = 'G';
... | 9 |
private void initialize() throws ParseException {
controleInstitucional = new ControleInstitucional();
controleAtividade = new ControleAtividade();
recursosSelecionados = new HashMap<>();
frame = new JFrame();
frame.setBounds(100, 100, 450, 300);
frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
... | 5 |
@Override
public void draw(int x, int y) {
TexInfo currentTexInfo = texinfo;
Color4F color = currentTexInfo.getColor4F();
glColor4f(1f, 1f, 1f, 1f);
glColor4f(color.getRed(), color.getGreen(), color.getBlue(), color.getAlpha());
Boot.getTexHandler().bindTexture("entities");
float xloc = 0;
... | 4 |
public void insertString(int offset, String str, AttributeSet set) throws BadLocationException{
if(str == null){
return;
}else if((getLength() + str.length())<= limit){
super.insertString(offset, str, set);
}
} | 2 |
public double getMaximumDifference_as_double(){
double diff = 0.0D;
if(this.type==0 || this.type==1){
double max = this.getMaximum_as_double();
double min = this.getMinimum_as_double();
diff = max - min;
}
else{
throw new IllegalArgumentExc... | 2 |
public static boolean save() {
if (HoleList.size() == 0) { // If queue is empty OR economy is disabled.
HoleFile.delete();
Golfcraft.Log(Level.INFO, "No holes to save.");
return true;
}
Golfcraft.Log(Level.INFO, "Saving " + HoleList.size() + " holes...");
try {
if (!HoleFile.exists()) {
if (... | 5 |
public void union(int p,int q){
int pid = id[p];
int qid = id[q];
for(int i = 0;i<id.length;i++)
if(id[i] == pid)id[i]=qid;
} | 2 |
public void handleProjectileHitEvent(ProjectileHitEvent e) {
if(e.getEntity() instanceof Snowball) {
Snowball s = (Snowball)e.getEntity();
if(area.isInArea(s.getLocation())) {
s.getWorld().
dropItemNaturally(s.getLocation(), new ItemStack(Material.... | 2 |
public Node getNodeForState(State state) {
/** Search through all nodes for state. */
for (int k = 0; k < myNodes.length; k++) {
Node node = myNodes[k];
if (node.getState() == state)
return node;
}
return null;
} | 2 |
public void setValue(Object target, Class<?> type, long fieldOffset,
Object value) {
if (type == int.class)
unsafe.putInt(target, fieldOffset, (Integer) value);
else if (type == short.class)
unsafe.putShort(target, fieldOffset, (Short) value);
else if (type == long.class)
unsafe.putLong(target, fieldO... | 9 |
public void testJGRP_1876() throws Exception {
e=createChannel("E", true);
f=createChannel("F", true);
g=createChannel("G", true);
h=createChannel("H", true);
Util.waitUntilAllChannelsHaveSameView(10000, 500, a, b, c, d, e, f, g, h);
enableInfoSender(false, a,b,c,d,e,f,g,... | 8 |
@POST
@Path("participate/{participant}/{idEvent}")
@Consumes(MediaType.TEXT_PLAIN)
public void participate(@PathParam("participant") String participant,@PathParam("idEvent") int idEvent){
System.out.println("Add a participant to an event");
JpaTest.eventService.addParticipant(idEvent, participant);
} | 0 |
@Override
public boolean equals(Object object)
{
if(object == null)
{
return false;
}
if(object == this)
{
return true;
}
if(!(object instanceof Node))
{
return false;
}
Node aNode = (Node)object;
if(aNode.getHostname().equals(this.hostname) && aNode.getIpAddress().equals(this.ipAddress... | 5 |
public short alphaBeta(AiNodeMaster node, int depth, int Max, short alpha, short beta){
if (depth == 0) {
return node.getNodeValue();
}
if (MaxNode(Max, node.getBoard())) {
for (int i = 0; i < node.childNode.size(); i++) {
alpha = max(alpha, alphaBeta(node.childNode.get(i), depth-1, Max, alpha, beta));... | 6 |
@Override
public void run() {
int count = 10;
while (count > 0) {
synchronized (prev) {
synchronized (self) {
System.out.print(name);
// if(name.equals("C")) System.out.println();
count--;
try {
Thread.sleep(5);
} catch (InterruptedException e) {
e.printStackTrace();
... | 4 |
public void printResult(String fileName) {
FileWriter fw = null;
BufferedWriter bw = null;
try {
fw = new FileWriter(fileName);
bw = new BufferedWriter(fw);
// 写入文件
for (int i = 0; i < InstanceNumber; i++) {
bw.write(String.valueOf(data[i][FieldCount]).substring(0, 1));
bw.newLine();
}
/... | 7 |
public static void noConcurrentTest() {
final int BUFFER_SIZE = 10;
final int NUM_PRODUCERS = 5;
final int NUM_CONSUMERS = 3;
Buffer buffer = new RingBuffer(BUFFER_SIZE);
for (int i = 0; i < NUM_PRODUCERS; ++i) {
new Thread(new Producer(buffer)).start();
}
... | 2 |
public void forward(int velocity) {
controls.forward(velocity);
} | 0 |
public ArrayList<ArrayList<Integer>> zigzagLevelOrder(TreeNode root) {
// Start typing your Java solution below
// DO NOT write main() function
ArrayList<ArrayList<Integer>> res = new ArrayList<ArrayList<Integer>>();
if (root == null)
return res;
ArrayList<TreeNode> cur, next;
cur = new ArrayList<TreeN... | 9 |
public static <V> ArrayList<V> shortestUnweightedPath(Graph<V> graph, V source, V end){
// the parent of a node is the node that discovers it
HashMap<V, V> parent = new HashMap<V, V>();
// the source has no parent
parent.put(source, null);
// this list will contain the path to the node from the source node... | 7 |
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 Collection<DepartamentoDTO> buscarTodos()
{
Connection con = null;
PreparedStatement pstm = null;
ResultSet rs = null;
try {
con = UConnection.getConnection();
String sql = "SELECT d.* FROM ubdepartamento d";
pstm = con.prepareS... | 5 |
@Override
public void keyPressed(KeyEvent e) {
myTank.keyPressed(e);
} | 0 |
public K getKey(){
return mKey;
} | 0 |
@Override
public void loadPlayers() throws PersistenceException {
PlayerContainer pCon = PlayerContainer.instance();
CsvReader csvReader = null;
try {
csvReader = new CsvReader(FILENAME, DELIMITER);
csvReader.skipLine();
csvReader.skipLine();
csvReader.readHeaders();
csvReader.readRecord(); // ski... | 4 |
private Type returnTypeFromDesc(String desc) throws BadBytecode {
CtClass clazz = null;
try {
clazz = Descriptor.getReturnType(desc, classPool);
} catch (NotFoundException e) {
throw new BadBytecode("Could not find class in descriptor [pos = " + lastPos + "]: " + e.getMes... | 2 |
private static int stringSize(int num, int radix) {
int exp;
if (radix < 4)
{
exp = 1;
}
else if (radix < 8)
{
exp = 2;
}
else if (radix < 16)
{
exp = 3;
}
else if (radix < 32)
{
exp = 4;
}
else
{
exp =... | 5 |
@Override
public void executeCommand(CommandSender sender, Command cmd, String[] args){
CommandHelper helper = new CommandHelper(sender, cmd);
Player player = (Player) sender;
Location loc = player.getLocation();
//Usage: /ghostsquadron setspawn lobby
if(args.length == 2){
if(args[0].equalsIgnoreCase("... | 9 |
public void draw(Graphics g, int brickSize, int anagramOn, HashSet<Integer> bricksClicked, HashSet<Point> bricksWordle, boolean gameOver) {
g.translate(position.x * brickSize, position.y * brickSize);
for(int i = 0; i < this.getNumberOfBricks(); ++i) {
boolean clicked... | 6 |
public void actionPerformed(ActionEvent e) {
String[] ex=e.getActionCommand().split("/");
if(ex[0].equals("showOthers")){
otherBlocksMenu.show((Component)e.getSource(), 0, 0);
}
else if(ex[0].equals("add")){
if(codeBased.isSelected())
((Flowchart)a... | 7 |
public boolean hasPathSum(TreeNode root, int sum) {
if (root == null) return false;
if (root.left == null && root.right == null) return (root.val == sum);
if (root.left != null && hasPathSum(root.left, sum - root.val)) return true;
if (root.right != null && hasPathSum(root.right, sum -root.val))... | 7 |
protected void endStatistics(String html) {
//calculate compression time
if(generateStatistics) {
statistics.setTime((new Date()).getTime() - statistics.getTime());
statistics.getCompressedMetrics().setFilesize(html.length());
//calculate number of empty chars
Matcher matcher = emptyPattern.matcher(... | 2 |
private void findSolidObjects(GameDescription game){
ArrayList<SpriteData> avatars = game.getAvatar();
ArrayList<SpriteData> staticSprites = game.getStatic();
for(SpriteData sprite:avatars){
for(SpriteData solid:staticSprites){
boolean isSolid = true;
ArrayList<InteractionData> interactions = game.g... | 9 |
public DemoFrame() {
setTitle("Swing Preview");
// use name to target the frame
getContentPane().setName("Frame");
JPanel panel1 = new JPanel();
JPanel panel2 = new JPanel();
final DefaultTableModel model = new DefaultTableModel(new String[]{"Key", "Value"},0);
... | 8 |
public void loadAll()
{
JFileChooser chooser = new JFileChooser();
chooser.setSelectedFile(preferredFile);
int result = chooser.showOpenDialog(null);//this);
if (result == JFileChooser.APPROVE_OPTION)
{
preferredFile = choo... | 8 |
private boolean r_un_accent() {
int v_3;
// (, line 215
// atleast, line 216
{
int v_1 = 1;
// atleast, line 216
replab0: while(true)
{
... | 8 |
public String correct(String x)
{
String ret = "";
char[] prs = x.toCharArray();
int cnt = 0;
boolean flag;
queueNode n;
while(cnt<prs.length)
{
n = iHead;
flag = false;
while(n!=null&&!flag)
{
if(n.getData() == prs[cnt])
flag = true;
n = n.getNext();
}
if(!flag)
re... | 5 |
private void setupKeys() {
// for (Field f : keyRegistry.getDeclaredFields()) {
// FieldId ann = f.getAnnotation(FieldId.class);
// if (ann != null) {
// Object okey;
// try {
// okey = f.get(TKey.class);
// } catch (IllegalAcc... | 9 |
public void run() {
// TODO: add in thread logic here
while (!getRequestQueue().isEmpty()){
ArrayList<Integer> curRequest = popRequest();
fromFloor = curRequest.get(0);
destFloor = curRequest.get(1);
while (!this.onElevator){
if (destFloor ... | 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.