text stringlengths 14 410k | label int32 0 9 |
|---|---|
public void doGet(HttpServletRequest request, HttpServletResponse response) {
try {
PrintStream out = new PrintStream(response.getOutputStream());
out.println("<capabilities>");
out.println("<peers path=\"community/\"/>");
// always give publish -- if clients don't have perms, they will see an error ... | 5 |
@SuppressWarnings("unchecked")
@Override
public <Native, Hosted extends JOSObject<Native, Hosted>> JOSObject<Native, Hosted> _get(String name, Class<Native> NativeType, Class<Hosted> ReturnType) {
JOSObject<? , ?> raw = this.get(name, JOSObject.class);
if(raw == null) return null;
try{
return (JOSObject<Nati... | 4 |
public LinkedHashMap<String, Object> getData() {
LinkedHashMap<String, Object> data = Maps.newLinkedHashMap();
if (type == Type.BOOLEAN) {
enumeration.clear();
enumeration.add("true");
enumeration.add("false");
enumDescriptions.clear();
enumDescriptions.add("True");
enumDescriptions.add("False");... | 7 |
private Boolean uploadFileIntern(File file, String graphURI){
if(!file.exists()){
try{
throw new FileNotFoundException();
}
catch(FileNotFoundException e){
LogHandler.writeStackTrace(log, e, Level.SEVERE);
return false;
}
}
String absFile = file.getAbsolutePath();
String contentType = RD... | 9 |
@Override
public void deleteIllness(IllnessDTO illness) throws SQLException {
Session session = null;
try {
session = HibernateUtil.getSessionFactory().openSession();
session.beginTransaction();
session.delete(illness);
session.getTransaction().commit(... | 3 |
public boolean interact(Widget w, Coord c) {
for (Widget wdg = w.lchild; wdg != null; wdg = wdg.prev) {
if (wdg == this)
continue;
Coord cc = w.xlate(wdg.c, true);
if (c.isect(cc, (wdg.hsz == null) ? wdg.sz : wdg.hsz)) {
if (interact(wdg, c.add(cc.inv())))
return (true);
}
}
if (w instanc... | 7 |
public void run() {
// XXX: Is this not the same as screen?
while (true) {
try {
while (! request_queue.isEmpty()) {
// XXX: request_queue is a queue of HTTPMessages, not
// HttpRequests.
HttpRequest next = (HttpRequ... | 9 |
private boolean readTrue( StringBuffer b )
throws IOException,
JSONSyntaxException {
if( !readExpected('r',b) || !readExpected('u',b) || !readExpected('e',b) )
throwJSONException( "Unexpected token: " + this.describeCurrentToken() + "; expected true." );
this.fireTrueRead( b.toString() );
return tr... | 3 |
private void clean_pipes()
{
if (pipe != null) {
// Get rid of half-processed messages in the out pipe. Flush any
// unflushed messages upstream.
pipe.rollback ();
pipe.flush ();
// Remove any half-read message from the in pipe.
w... | 3 |
private void createPageRangeFields(PrintRequestAttributeSet set) {
PrintService service = getService();
if (service.isAttributeCategorySupported(PageRanges.class)) {
ButtonGroup group = new ButtonGroup();
int start = 1;
int end = 9999;
PageRanges pageRanges = (PageRanges) set.get(PageRanges.class);
i... | 4 |
private ResGridlet cancel(int gridletId, int userId)
{
ResGridlet rgl = null;
// Check whether the Gridlet is in execution list or not
int found = gridletInExecList_.indexOf(gridletId, userId);
// if a Gridlet is in execution list
if (found >= 0)
{
// up... | 3 |
public double classify(svm_problem _prob){
int[] countClass = new int[_prob.l];
double[] result = null;
for (SVMHelper aSVM : ensembler){
result = aSVM.predict(_prob);
for (int i = 0; i < result.length; i++){
if (result[i] == 1){
co... | 7 |
public void end() {
if(z==null)
return;
if(compress){ z.deflateEnd(); }
else{ z.inflateEnd(); }
z.free();
z=null;
} | 2 |
public void tick()
{
if (this.getWorldInfo().isHardcoreModeEnabled() && this.difficultySetting < 3)
{
this.difficultySetting = 3;
}
this.worldProvider.worldChunkMgr.cleanupCache();
this.updateWeather();
long var2;
if (this.isAllPlayersFullyAsleep... | 9 |
public static boolean forwardToPrevious(final HttpServletRequest request, final HttpServletResponse response)
throws ServletException, IOException
{
final String referrer = request.getHeader(REFERRER);
if (null == referrer)
{
return false;
}
final String contextPath = request.getContextPath();
if (re... | 4 |
public static void main(String[] args) {
ApplicationContext applicationContext = new FileSystemXmlApplicationContext("classpath:client.xml");
WebCrafterService service = (WebCrafterService) applicationContext.getBean("rmiProxy");
try {
ItemTemplate wood = service.getItemTemplate("Wo... | 5 |
void search() {
Logger.getLogger(Search.class.getName()).entering(Search.class.getName(), "search");
String text = searchField.getText();
tableRowSorter.setRowFilter(RowFilter.regexFilter("(?i)" + text));
Pattern pattern = Pattern.compile("(?i)" + text);
... | 3 |
public static void initializeStreets(Gameboard board)
{
try
{
for (final StreetColor color : StreetColor.values())
{
final List<PlaceProperty> places = new ArrayList<PlaceProperty>();
for (final Place place : board.places)
{
if (place instanceof PlaceProperty && ((PlaceProperty) place).getC... | 7 |
private static boolean isServerChannel( Channel c ) {
if ( c.isDefault() && BungeeSuite.proxy.getServers().containsKey( c.getName() ) ) {
return true;
}
return false;
} | 2 |
protected boolean extractNatives() {
setStatus("Extracting natives...");
File nativesJar = new File(binDir, getFilename(jarURLs[jarURLs.length - 1]));
File nativesDir = new File(binDir, "natives");
if(!nativesDir.isDirectory()) {
nativesDir.mkdirs();
}
FileInputStream input = null;
ZipInputStream zipIn... | 6 |
public static Double nernst(Double freeEnergy, Double moles, Double cellPotential)
{
//G = -nFE
boolean[] nulls = new boolean[4];
nulls[0] = (freeEnergy == null);
nulls[1] = (moles == null);
nulls[2] = (cellPotential == null);
int nullCount = 0;
for(int k = 0; k < nulls.length; k++)
{
if(nulls... | 6 |
@Override
public ParserResult specialCheckAndGetParserResult(ParserResult result,
SyntaxAnalyser analyser) throws GrammarCheckException {
boolean theOtherInfoIsEmpty = result.getAggregateFunctionName() == null
&& result.getConditions().size() == 0
&& result.getDimensionLevelInfo().size() == 0
&& resul... | 5 |
private static int rankHands(Cards[] hands, Cards board, int numhands, int[] wins, int[] ties, int total) {
List<HandRank> ranks = new ArrayList<HandRank>(numhands);
HandRank highest = null;
for (Cards hand : hands) {
HandRank rank = holdem(hand, board);
if (highest == nu... | 6 |
public void skipCurrentTurn() {
remainingActions = (remainingActions > 0) ? 0 : remainingActions;
} | 1 |
public boolean isSet(_Fields field) {
if (field == null) {
throw new IllegalArgumentException();
}
switch (field) {
case ID:
return isSetId();
case NAME:
return isSetName();
case PRICE:
return isSetPrice();
}
throw new IllegalStateException();
} | 4 |
public TwitterModel getTwitterModel() {
return twitterModel;
} | 0 |
public void buttonClick(ActionEvent e) {
String bv = e.getActionCommand().toString();
switch (bv) {
case "New":
NewMapDialog mapDialog = new NewMapDialog();
int mapDialogResult = JOptionPane.showConfirmDialog(null, mapDialog, "Select", JOptionPane.OK_CANCEL_OPTION);
if (mapDialogResult == JOpti... | 8 |
public static void main(String[] _args) {
Random rand = new Random(0);
final int HOLDERSIZE = 1000;
TestObj[] holder = new TestObj[HOLDERSIZE];
TestObj testobj = new TestObj(0x12345678);
if (!OkraUtil.okraLibExists()) {
System.out.println("...unable to create context, using fake references");
for (... | 5 |
public void keyReleased(KeyEvent e) {
int key = e.getKeyCode();
switch(key) {
case KeyEvent.VK_W:
p.setMoveUp(false);
break;
case KeyEvent.VK_S:
p.setMoveDown(false);
break;
case KeyEvent.VK_A:
p.setMoveLeft(false);
break;
case KeyEvent.VK_D:
p.setMoveRight(false);... | 4 |
@Override
public boolean isDefault() {
return defaultGroup;
} | 0 |
@Override
public void onDisable() {
FileOutputStream fos = null;
ObjectOutputStream oos = null;
try {
File data = new File(this.getDataFolder(), "arenadata.bin");
data.mkdirs();
data.createNewFile();
fos = new FileOutputStream(data);
... | 5 |
public Fornecedor getFornecedor(String razao) throws ExceptionGerentePessoa{
for (Fornecedor f : fornecedores) {
if (f.getNome().equalsIgnoreCase(razao)) {
return f;
}
}
throw new ExceptionGerentePessoa ("Fornecedor n��o cadastrado");
} | 2 |
@Override
public void drawUp(Point p, Node node) {
this.node = node;
// Adjust color when we are selected
updateColors();
// Update the button
updateButton();
// Update font
updateFont();
// Draw the TextArea
setText(node.getValue());
int indent = node.getDepth() * pIndent;
int wid... | 3 |
public ListNode deleteDuplicates(ListNode head) {
ArrayList<Integer> visited = new ArrayList<Integer>();
if(head == null) return null;
ListNode p = head;
visited.add(new Integer(head.val));
while(p != null && p.next != null) {
if(visited.con... | 4 |
public void addNewPastMeeting(Set<Contact> contacts, Calendar date, String text)
{
try
{
if(contacts.equals(null) || date.equals(null) || text.equals(null))
{
throw new NullPointerException();
}
if(contacts.isEmpty() || !contactList.containsAll(contacts))
{
throw new IllegalArgumentExceptio... | 7 |
public static void main(String[] args) {
t = new TreeMap<Integer, Integer>();
int n = 201;
sol = new ArrayList[n];
for (int i = 0; i < n; i++) {
t.put( (i*i*i) , i );
}
for (int i = 2; i < n; i++) {
for (int j = i+1; j < n; j++) {
for (int k = j+1; k < n; k++) {
int m = i*i*i + j... | 9 |
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (!(obj instanceof Swear))
return false;
Swear other = (Swear) obj;
if (swearword == null) {
if (other.swearword != null)
return false;
} else if (!swearword.equals(other.swearword))... | 6 |
@Transient
public String getFunUnidad() {
return funUnidad;
} | 0 |
@Override
public void showGiveOptions(ResourceType[] enabledResources) {
giveAvailables = enabledResources;
givereload.setVisible(false);
giveAmount.setVisible(false);
//Show them all
givewood.setVisible(true);
givebrick.setVisible(true);
givesheep.setVisible(true);
givewheat.setVisible(true);
giv... | 6 |
public static void generateDataSet(String path, Connection connection) {
try {
IDatabaseConnection dbUnitConnection = new DatabaseConnection(connection);
IDataSet dataSet = dbUnitConnection.createDataSet();
File file = new File(path);
if (!file.getParentFile().exists()) {
file.getParentFile().mkdirs()... | 6 |
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
PersonInfo other = (PersonInfo) obj;
if (firstName == null) {
if (other.firstName != null)
return false;
} else if (!firstName.equals(other.firstNa... | 9 |
private CommandExecutionResult executeInternal(Map<String, RegexPartialMatch> line0, AbstractEntityDiagram system,
Url url, List<? extends CharSequence> s) {
final String pos = line0.get("POSITION").get(0);
final String code = line0.get("ENTITY").get(0);
final IEntity cl1;
if (code == null) {
cl1 = syst... | 8 |
public MandelbrotPanelDouble()
{
setLayout(new BorderLayout());
setUpFractalPanel();
setUpInfoPanel();
} | 0 |
public String loadExame() {
Map parametros = FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap();
String idExa = parametros.get("idExame").toString();
Integer id = Integer.parseInt(idExa);
int i;
for (i = 0; i < examesBean.size(); i++) {
i... | 2 |
private void endArguments() {
if (argumentStack % 2 != 0) {
buf.append('>');
}
argumentStack /= 2;
} | 1 |
@Override
public void drawImage(Function f, MyPanel image, double x, double y) {
Graphics g = image.getGraphics();
Graphics2D g2 = (Graphics2D) g;
g2.translate(150, 150);
g2.scale(x, y);
Complex tmp1 = f.evaluate(this.c1);
int p = 10;
for (int t = 0;... | 1 |
private Set<Card> twoKingsTwoQueensTwoJacksSix() {
return convertToCardSet("KS,6S,KD,JS,QD,QC,JH");
} | 0 |
@Override
public Icon getIcon() {
Icon retVal = null;
if (fRating == null || fRating == Rating.NO_RATING) {
retVal = null;
} else if (fPosition < fRating.ordinal()) {
retVal = getStarIcon();
} else if (fSelected) {
... | 4 |
public Person5(String pname) {
name = pname;
} | 0 |
@Override
public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
if(args.length != 3) {
printArgsError(args);
printHelp(sender, label);
return true;
}
String target = findTarget(args[1]);
int chargeId = -1;
try {
chargeId = Integer.valueOf(args[2]);
} catc... | 5 |
private static void DoMerge(Object[] numbers, int left, int mid, int right,
int sortColumn) {
int i, left_end, num_elements, tmp_pos;
left_end = (mid - 1);
tmp_pos = left;
num_elements = (right - left + 1);
Object[] temp = new Object[numbers.length];
while ((left <= left_end) && (mid <= right)) {
if... | 6 |
private File downloadBackupToFile(String backupName, String outputDirectory, long totalFileBytes) {
final PipedInputStream ftpDataInStream = new PipedInputStream();
File outFile = null;
try {
PipedOutputStream ftpDataOutStream = new PipedOutputStream(ftpDataInStream);
ou... | 5 |
final int[] method1046(int i, int i_8_) {
anInt1719++;
if (i < 0
|| (i ^ 0xffffffff) <= (anIntArrayArray1724.length ^ 0xffffffff)) {
if (anInt1715 == -1)
return new int[0];
return new int[] { anInt1715 };
}
if (!aBooleanArray1725[i]
|| (anIntArrayArray1724[i].length ^ 0xffffffff) >= -2)
r... | 7 |
public void countFiftyMoveRule(Move lastMove) {
if (lastMove instanceof CaptureMove || lastMove.piece instanceof Pawn) {
this.fiftyMoveRuleCount = 0;
} else {
this.fiftyMoveRuleCount++;
}
} | 2 |
private int getIndex(char letter) {
switch (letter) {
case 'I':
return 0;
case 'V':
return 1;
case 'X':
return 2;
case 'L':
return 3;
case 'C':
return 4;
case '... | 8 |
@Override
public void mouseExited(MouseEvent e) {} | 0 |
Class348_Sub33(int i, byte[] is) {
((Class348_Sub33) this).anInt6958 = i;
ByteBuffer class348_sub49 = new ByteBuffer(is);
((Class348_Sub33) this).anInt6965 = class348_sub49.getUByte();
((Class348_Sub33) this).anIntArrayArray6959
= new int[((Class348_Sub33) this).anInt6965][];
((Class348_Sub33) this).anIntArra... | 7 |
public final void relocate(String target, String... patterns) {
for (String path : patterns) {
pages.relocate(target, path);
}
} | 1 |
public void setEditValue(int n, EditInfo ei) {
if (ei.value > 0 && n == 0) {
onresistance = ei.value;
}
if (ei.value > 0 && n == 1) {
offresistance = ei.value;
}
if (ei.value > 0 && n == 2) {
breakdown = ei.value;
}
if (ei.value... | 8 |
public static Rectangle position(Rectangle outer, Rectangle inner, Alignment horizontalAlignment, Alignment verticalAlignment) {
switch (horizontalAlignment) {
case LEFT_TOP:
default:
inner.x = outer.x;
break;
case CENTER:
inner.x = outer.x + (outer.width - inner.width) / 2;
break;
case RI... | 6 |
private void dump (Document doc)
throws IOException, FileNotFoundException, XPathExpressionException,
ProtocolException, TransformerException {
long startMillis = System.currentTimeMillis();
String strFileName = null;
NodeList nl = (NodeList) xp.evaluate("//process... | 2 |
public void mouseClicked(int par1, int par2, int par3)
{
boolean flag = par1 >= xPos && par1 < xPos + width && par2 >= yPos && par2 < yPos + height;
if (canLoseFocus)
{
setFocused(isEnabled && flag);
}
if (isFocused && par3 == 0)
{
int i = pa... | 8 |
public double powHelper(double x, int n, Hashtable<Integer, Double> ht) {
if(x==0)
if(n<0) return Double.MAX_VALUE;
else if(n==0) return 1.0;
else return 0.0;
if(n==0) return 1.0;
if(n==1) return x;
if(n==-1) return 1.0/x;
if(ht.containsKey(n))... | 9 |
public void switchUser(String pUsername)
throws SQLException {
pUsername = pUsername.toUpperCase();
//Validate not attempting to CONNECT as the main user
if(mPromoteUserName.equals(pUsername)){
throw new ExFatalError("Illegal attempt to CONNECT as promotion control user " + pUsername + ";... | 9 |
/* */ public void keyReleased(KeyEvent e)
/* */ {
/* 323 */ if (activeClass != null)
/* 324 */ switch (e.getKeyCode()) {
/* */ case 87:
/* 326 */ activeClass.setGoingUp(false);
/* 327 */ activeClass.stop();
/* 328 */ break;
/* */ case 83:
/* 330 */ ... | 6 |
public static boolean isStandardDeviationParam(String accession) {
return INTENSITY_STD_SUBSAMPLE1.getAccession().equals(accession) ||
INTENSITY_STD_SUBSAMPLE2.getAccession().equals(accession) ||
INTENSITY_STD_SUBSAMPLE3.getAccession().equals(accession) ||
INTENS... | 7 |
public static void setLowInventoryWarning(DrugInventoryPage drugInv){
clearLowInventoryTable(Gui.getDrugPage());
String drugName="";
String drugCount="";
ArrayList<String> drug= null;
drug=DatabaseProcess.getDrugCount();
int i=0;
int j=0;
while(i<drug.size()){
drugName=drug.get(i);
drugCount=drug... | 2 |
private Initializable replaceSceneContent(String fxml) throws Exception {
FXMLLoader loader = new FXMLLoader();
InputStream in = getClass().getResourceAsStream(fxml);
loader.setBuilderFactory(new JavaFXBuilderFactory());
loader.setLocation(getClass().getResource(fxml));
AnchorPan... | 5 |
public static char determineGrade(double s) // s is for score, I reused my way to find the grade from the earlier assignment TestScore
{
if(s < 60)
return 'F';
else if(s < 70)
return 'D';
else if(s < 80)
return 'C';
else if(s < 90)
return 'B';
else
return 'A';
} | 4 |
public List<Movie> getMoviesByCineplex(Cineplex cineplex) {
moviesByCineplex = new ArrayList<Movie>();
for(Cinema c : cineplex.getCinemas()) {
for(ShowTime st : c.getShowTimes()) {
int month;
calendar.setTime(st.getTime());
month = calendar.get(Calendar.MONTH);
if(st.getMovieTickets().size() > 0... | 5 |
public ArrayList<Noeud> includedInto(int deb_x, int deb_y, int fin_x,
int fin_y) {
if (plan == null)
return null;
List<Noeud> noeuds = plan.getNoeuds();
ArrayList<Noeud> selection = new ArrayList<Noeud>();
// Pour tous les noeuds
for (Noeud n : noeuds) {
int x = screenX(n.getX());
int y = screenY(... | 6 |
private Clip initClip(String strIn, String strDefault)
{
Clip clipOut = null;
try
{
clipOut = AudioSystem.getClip();
try
{
clipOut.open
(
AudioSystem.getAudioInputStream
(
new java.io.File(strIn)
)
);
}
catch(Exception e)
{
if (null != strIn && 0 < strIn.l... | 4 |
public String getValue() {
if (isSortable()) {
WebElement el = element.findElement(By.tagName("div"));
return el.getText();
}
return element.getText();
} | 1 |
public void setWapSignal(int i)
{
switch (i)
{
case WAP_SIGNAL_NONE:
case WAP_SIGNAL_LOW:
case WAP_SIGNAL_MEDIUM:
case WAP_SIGNAL_HIGH:
case WAP_SIGNAL_DELETE:
wapSignal = i;
break;
default:
throw new RuntimeException("Invalid wap signal value: " + i);
}
} | 5 |
private void calcFEP() {
Map<String, Float> fep;
String name = name();
if ((name != null) && (fep = Config.FEPMap.get(name().toLowerCase())) != null) {
FEP = "\n";
for (String key : fep.keySet()) {
FEP += String.format("%s:%.1f ", key, (float) fep.get(key)
* qmult);
}
}
} | 3 |
final public void Unary_logical_operator() throws ParseException {
/*@bgen(jjtree) Unary_logical_operator */
SimpleNode jjtn000 = new SimpleNode(JJTUNARY_LOGICAL_OPERATOR);
boolean jjtc000 = true;
jjtree.openNodeScope(jjtn000);
jjtn000.jjtSetFirstToken(getToken(1));
try {
... | 3 |
public ArrayList<DBSong> getSongsById(ArrayList<Integer> ids){
StringBuilder sb = new StringBuilder();
for(Integer id : ids){
sb.append(id).append(',');
}
sb.deleteCharAt(sb.lastIndexOf(","));
HashMap<String, String> params = new HashMap<String, String>();
... | 3 |
public static void outTrace(String data){
if (trace != null) trace.println(data);
} | 1 |
public boolean ReceivedGiftToday(BirthdayRecord birthday) {
// Is there a birthday record for this player?
if (birthday != null) {
if (birthday.lastGiftDate == null) {
// Player has never received birthday gifts
Debug("Never received a gift");
return false;
}
// Get current date without time (... | 4 |
public static int findNumCommentsMentionedCodeReviews(String content) {
if (content != null && !content.equals(""))
if (content.contains("Code Review")
|| content.contains("code review")
|| content.contains("review")
|| content.contains("reviewed"))
return 1;
return 0;
} | 6 |
public void filterDocument(Dictionary dictionary, int docId, Map<Integer, String> docTable){
String line = "";
String []splitString;
String totalString = "";
StringBuilder sb = new StringBuilder();
while( true){
line = fileProcessor.readLineFromFile();
if( line =... | 9 |
public void deleteGroup( int id )
{
try
{
PreparedStatement ps = con.prepareStatement( "DELETE FROM groups WHERE id=?" );
ps.setInt( 1, id );
ps.executeUpdate();
ps.close();
}
catch( SQLException e )
{
e.printStackTrace();
}
} | 1 |
public void init()
{
boolean debug = CommandLine.booleanVariable("debug");
if (debug)
{
// Enable debug logging
Logger logger = Logger.getLogger("com.reuters.rfa");
logger.setLevel(Level.FINE);
Handler[] handlers = logger.getHandlers();
... | 6 |
@Override
public String toString() {
// Prometheus (2012), USA, 124 min, csfd: 70%, imdb: 7.5, http://csfd.cz/film/290958
String result = title + " ";
if (year != null)
result += "(" + year + ")";
result += ", ";
if (country != null)
... | 7 |
public void run()
{
try
{
this.MReading.acquire();
if(this.counter == 0)
this.MWriting.acquire();
this.counter++;
this.MReading.release();
System.out.println("Lecture");
Thread.sleep(1000);
this.MReading.acquire();
this.counter--;
if(this.counter == 0)
this.MWriting.re... | 3 |
public static Class[] getParams(String desc) {
if (desc.charAt(0) != '(')
throw new RuntimeException("$sig: internal error");
return getType(desc, desc.length(), 1, 0);
} | 1 |
private String extractAnnotationNameFromMethod(Annotation antFromMethod) {
int endOfAnnotationName = antFromMethod.toString().indexOf("(");
String upToAnnotationName = antFromMethod.toString().substring(0,endOfAnnotationName);
return upToAnnotationName.substring(upToAnnotationName.lastIndexOf(".") + 1);
} | 0 |
private void computeError()
{
for(int i = 0; i < targetMacroBlocks.size();i++)
{
RGB[][] t = targetMacroBlocks.get(i);
RGB[][] r = bestBlocks.get(i);
RGB[][] e = new RGB[16][16];
for(int j = 0; j < 16; j++)
for(int k = 0; k < 16; k++)
e[k][j] = new RGB(0,0,0);
for(int y = 0; y < 16; y+... | 5 |
public void heal(int heal) {
if (hurtTime > 0) return;
//level.add(new TextParticle("" + heal, x, y, Color.get(-1, 50, 50, 50)));
health += heal;
if (health > maxHealth) health = maxHealth;
} | 2 |
public void addPlayer(Player player)
{
if (playersNo < maxPlayers) {
players[playersNo] = player;
player.prepareToMission();
++playersNo;
wmap.removeShadow(player);
}
} | 1 |
public static boolean func_46154_a(ItemStack par0ItemStack, ItemStack par1ItemStack)
{
return par0ItemStack == null && par1ItemStack == null ? true : (par0ItemStack != null && par1ItemStack != null ? (par0ItemStack.stackTagCompound == null && par1ItemStack.stackTagCompound != null ? false : par0ItemStack.st... | 7 |
public Set<Tile> getTileArray() {
if (tiles != null) {
return tiles;
}
final Polygon polygon = getPolygon();
final Rectangle bounds = polygon.getBounds();
final Set<Tile> set = new HashSet<Tile>();
int x = 0;
while (x < bounds.width) {
int y = 0;
while (y < bounds.height) {
final int tempX ... | 4 |
public void draw(Graphics2D g) {
final int s = 30; // size of a cell
g.setColor(BACKGROUND);
g.fillRect(x * s, y * s, s, s);
g.setFont(FONT);
if (state == State.OPEN) {
g.setColor(OPENED);
g.fillRect(x * s, y * s, s, s);
if (type == Type.MINE)... | 5 |
public static void main(String[] args){
Conn con = PoolManager.getInstance().getConnection();
Connection conn = con.getConn();
Statement stmt = null;
ResultSet rs = null;
try {
stmt = conn.createStatement();
rs = stmt.executeQuery("select * from article ");
int c = rs.getMetaData().getColumnCount(... | 4 |
private void addVideo(Video video){
VideoPlayer videoPlayer;
if(scalingFactorX!= 1 || scalingFactorY != 1){
videoPlayer = new VideoPlayer(video,videoListener);
videoPlayer.resizeVideo(scalingFactorX, scalingFactorY);
}
else{
videoPlayer = new VideoPlayer(video,videoListener);
}
layeredPane.add(vide... | 2 |
final synchronized public String getString() throws Exception
{
if (type != Type.STRUCT)
throw new Exception("Type " + type + " does not contain string");
final short code = data.getShort(0);
final Type el_type = Type.forCode(code);
if (el_type != Type.STRUCT_STRING)
... | 3 |
public void saveToFile(String fileName) throws IOException {
/*
* This method writes the XML document in the following format:
*
* <?xml version="1.0" encoding="UTF-8" ?>
* <macro>
* <macroName>test</macroName>
* <action id="default-typed">abcdefg</action>
* [<action id=...>...</action>... | 8 |
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
BookstoreArtistEntity that = (BookstoreArtistEntity) o;
if (artistid != that.artistid) return false;
if (name != null ? !name.equals(that.name)... | 6 |
private void startField(){
if (field == null || !running)
{
field = new Thread(this);
field.start();
running = true;
}
} | 2 |
public static boolean isParameter(String line){
if(line.contains("=") == false){
return false;
}
String[] split = line.split("=");
if(split.length == 2){
return true;
}
return false;
} | 2 |
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.