text stringlengths 14 410k | label int32 0 9 |
|---|---|
public Result fire(int ...coords) throws BadCoordinate {
if (coords.length != 3)
throw new BadCoordinate();
for (int d=0; d<3; d++) {
if (coords[d] < 0 || coords[d] >= 10) {
throw new BadCoordinate();
} else {
coords[d] = pos[d... | 6 |
public void setUpdatedTime(Date time)
{
if (time == null) throw new IllegalArgumentException("Time cannot be null");
this.time = time;
} | 1 |
private static float reservedForCollection(
Batch <Behaviour> doing, Service goodType
) {
float sum = 0 ;
for (Behaviour b : doing) {
if (b instanceof Delivery) for (Item i : ((Delivery) b).items) {
if (i.type == goodType) sum += i.amount ;
}
}
return sum ;
} | 4 |
public MainMenuWindow() {
super();
getContentPane().setLayout(null);
JLabel lblVersion = new JLabel(Constants.NAVALBATTLE_VERSION_TITLE);
lblVersion.setForeground(Color.WHITE);
JLabel lblNavalBattle = new JLabel("NavalBattle");
JButton btnSingleplayer = new JButton("Singleplayer");
JButton btnHelp = new... | 6 |
public static long read32bitLittleEndianUnsignedInt(RandomAccessFile f) throws IOException {
Integer d0,d1,d2,d3;
d0=0xff & read_sure(f);
d1=0xff & read_sure(f);
d2=0xff & read_sure(f);
d3=0xff & read_sure(f);
return (long)(d3<<24) + (d2<<16) + (d1<<8) + d0;
} | 0 |
public void move(int direction) {
boolean temp = this.moveBoolean(direction);
if (this.moveBoolean(direction) == true) {
switch (direction) {
case 2:
this.row++;
break;
case 4:
this.col--;
... | 5 |
public Sentence (CoreMap annotatedSentence, int index, int docnum)
{
this.sentence = annotatedSentence.get(TextAnnotation.class);
this.terms = new ArrayList<String>();
this.posTags = new ArrayList<String>();
this.index = index;
this.docnum = docnum;
for (CoreLabel token: annotatedSentence.get(TokensAnnotat... | 3 |
private static boolean is4Prime(int n){
if (didThis[n] == true) return is4Prime[n];
didThis[n] = true;
Set<Integer> used = new HashSet<Integer>();
int t = n;
for(Integer p : primes){
if (t%p==0){
t/=p;
used.add(p);
if(used.size()==4) break;
}
}
while(t!=1){
boolean found = false;
... | 9 |
public int size() {
return exceptions.size();
} | 0 |
public String[][] searchProgrammsLinux() {
//
// These method searches for some standard programs
// with are usually installed on a linux system.
// The return String[] includes:
// [0] - FileBrowser
// [1] - WebBrowser
// [2] - mp3/ogg Player
// [3] - streamripper
//
String[][] programNames = {
/*[0]*/ {"... | 5 |
@SuppressWarnings("unchecked")
public static Entry<String, Object> getEntry(Object obj)
{
if (obj instanceof Entry)
{
Entry<?,?> e = (Entry<?,?>) obj;
if (e.getKey() instanceof String)
return (Entry<String, Object>) e;
}
return null;
} | 6 |
public boolean inferenceCheckerHelper(LinkedList<String> curQueue,ArrayList<LinkedList<String>> Queues) throws IllegalInferenceException
{
String curSymbol = (String) curQueue.pop();
if(curSymbol.equals("=>"))
{
boolean bol1 = inferenceCheckerHelper(curQueue,Queues);
boolean bol2 = inferenceCheckerHelper(... | 7 |
@SuppressWarnings("unchecked")
private void disableMash() {
// one source of references to PySystemState
Py.getSystemState().cleanup();
Py.setSystemState(null);
Py.defaultSystemState = null;
// another reference, the ThreadLocal - doesn't get cleaned up *ever*
Object... | 9 |
public void Top100(String Top100Sort) throws IOException {
if (!Top100Sort.equals(TOP100REALTIME) && !Top100Sort.equals(TOP100WEEKLY)) {
try {
throw new Top100SearchException("You Must use TOP100REALTIME or TOP100WEEKLY");
} catch (Top100SearchException e) {
... | 5 |
private int getPriority(String priority) {
if (priority.equals(m_settings.getLocalizedMessage("priority.vlow")))
return 1;
else if (priority.equals(m_settings.getLocalizedMessage("priority.low")))
return 2;
else if (priority.equals(m_settings.getLocalizedMessage("priority.medium")))
return 3;
else if ... | 5 |
protected PlayerStartPosition getPlayerStartPosition(Grid grid, Player player) {
if (grid == null || player == null)
throw new IllegalArgumentException("The given arguments are invalid!");
return new PlayerStartPosition(grid, player);
} | 2 |
protected double getNumericValue(Cell cell) throws InvalidCellException {
int cellType = cell.getCellType();
if (cellType != Cell.CELL_TYPE_STRING && cellType != Cell.CELL_TYPE_NUMERIC) {
throw new InvalidCellException(cell);
} else if (cellType == Cell.CELL_TYPE_STRING) {
try {
double value = Double.pa... | 7 |
public void mouseExited(MouseEvent event) {
} | 0 |
public final static Opponent getById(String id) throws NotFound {
Opponent o = new Opponent();
String profilePage = Utils.getString("characters/profile/" + id);
int pos = profilePage.indexOf("href=\"/fights/start/");
if (pos == -1) {
throw new NotFound();
}
String page = profilePage.substring(pos);
... | 3 |
public synchronized static void configure(File... files) {
if (INSTANCE == null) {
INSTANCE = new LaunchProxy(files);
try {
// Give it a chance to terminate this run...
Thread.sleep(1500);
} catch (Exception exception) {
// Ignore
}
} else {
Log.error("Can only call configure once."); //$... | 2 |
public void func_50032_g(int par1)
{
int var2 = this.text.length();
if (par1 > var2)
{
par1 = var2;
}
if (par1 < 0)
{
par1 = 0;
}
this.field_50048_p = par1;
if (this.fontRenderer != null)
{
if (th... | 9 |
private Tile getTile(int x, int y){
return x >= 0 && y >= 0 && x < width && y < height ? grid[x][y] : null;
} | 4 |
@Override
public boolean execute(CommandSender sender, String identifier,
String[] args) {
if (sender instanceof Player) {
Player player = (Player) sender;
if (DonorTitles.chat.getPlayerPrefix(player) != null
&& DonorTitles.chat.getPlayerPrefix(player) != "") {
DonorTitles.chat.setPlayerPrefix(play... | 3 |
public void setValue(Object value){
int currentValue = (Integer) getValue();
int v = (Integer) value;
int result = v;
if(v > getMaximum()){
result = getMaximum();
}
else if(v < getMinimum()){
result = getMinimum();
}
... | 3 |
public void drawProps(Graphics g){
if( number % 4 == 0 ){
for(Prop p : PropsContainer.getValidProps()){
if( p.getStatus() == PropStatus.ALIVE)
switch( p.getType()){
case PropType.mime :
g.drawImage(this.prop_mime, p.getX(), p.getY(), Constant.PROP_WIDTH_HEIGHT, Constant.PROP_WIDTH_HEIGHT, th... | 7 |
public static void main(String[] args) {
TotalOrder g;
String arg;
long timeout=200;
int num_fields=3;
int field_size=80;
String props=null;
int num=0;
props="udp.xml";
for(int i=0; i < args.length; i++) {
arg=args[i];
if... | 8 |
public NioSocketServer() {
try {
// Create an AsynchronousServerSocketChannel that will listen on port 5000
final AsynchronousServerSocketChannel listener =
AsynchronousServerSocketChannel.open().bind(new InetSocketAddress(5000));
// Listen for a new requ... | 9 |
public void addCircle(Circle circle) {
if (this.next == start) {
this.next = circle;
circle.next = start;
} else {
this.next.addCircle(circle);
}
} | 1 |
public static void stopPlayback() {
try {
if(currentPlayback != null) {
currentPlayback.stop();
}
} catch (MediaException e) {
System.out.println("Invalid media type.");
}
} | 2 |
private byte[] insertGapCore0w(byte[] code, int where, int gapLength, boolean exclusive,
ExceptionTable etable, CodeAttribute ca, Gap newWhere)
throws BadBytecode
{
if (gapLength <= 0)
return code;
ArrayList jumps = makeJumpList(code, code.leng... | 4 |
public static JnlpCache create() {
try {
Class<? extends ServiceManager> cl = Class.forName("javax.jnlp.ServiceManager").asSubclass(ServiceManager.class);
Method m = cl.getMethod("lookup", String.class);
BasicService basic = (BasicService)m.invoke(null, "javax.jnlp.BasicService");
PersistenceServic... | 2 |
private MapSquare getMapSquare(int x, int y)
{
ArrayList<MapSquare> d_map = dp.getDisplay();
for (int i = 0; i < d_map.size(); i++)
{
//find which square was clicked
if(d_map.get(i).getDisplayX() * GlobalSettings.SQUARE_SIZE <= x &&
d_map.get(i).getDisplayX() * GlobalSettings.SQUARE_SIZE + GlobalSetti... | 5 |
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {try {
//GEN-FIRST:event_jButton1ActionPerformed
list = new DessertDao();
} catch (SAXException ex) {
Logger.getLogger(addItemToDessertMenu.class.getName()).log(Level.SEVERE, null, ex);
} catch (ParserConfigur... | 8 |
public double kurtosisExcess_as_double() {
boolean hold = Stat.nFactorOptionS;
if (nFactorReset) {
if (nFactorOptionI) {
Stat.nFactorOptionS = true;
} else {
Stat.nFactorOptionS = false;
}
}
double kurtosis = 0.0D;
switch (type) {
case 1:
double[] dd = this.getArray_as_double();
kurto... | 5 |
public void setEmail(String email) {
this.email = email;
} | 0 |
public void testFactory_monthsBetween_RPartial_YearMonth() {
YearMonth start1 = new YearMonth(2011, 1);
for (int i = 0; i < 6; i++) {
YearMonth start2 = new YearMonth(2011 + i, 1);
YearMonth end = new YearMonth(2011 + i, 3);
assertEquals(i * 12 + 2, Months.monthsBetwe... | 1 |
public boolean isMaximized() {
return ((OutlinerDesktopManager) getDesktopManager()).isMaximized();
} | 0 |
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Tag other = (Tag) obj;
if (id == null) {
if (other.id != null)
return false;
} else if (!id.equals(other.id))
return false;
if (val... | 9 |
public static void saveDataToFile(File file, String content) throws IOException {
File storage = getStorageFolder();
if(!storage.exists()) {
if(!storage.mkdir()) {
throw new IOException("Can not create a storage folder " + storage.getAbsolutePath());
}
}
... | 3 |
public static void confirmationNouvellePartie(int lignes, int colonnes) {
fenetrePrincipale = new WindowPrincipale(lignes, colonnes);
fenetreNouvellePartie.dispose();
} | 0 |
public static int dehexchar(char c) {
if (c >= '0' && c <= '9') {
return c - '0';
}
if (c >= 'A' && c <= 'F') {
return c - ('A' - 10);
}
if (c >= 'a' && c <= 'f') {
return c - ('a' - 10);
}
return -1;
} | 6 |
private String getTestName(int no) {
return name != null ? name : ("test-" + no);
} | 1 |
@Override
public Object clone( ){// Clone an IntTreeBag object.
IntTreeBag answer = null;
try{
answer = (IntTreeBag) super.clone();
}catch(CloneNotSupportedException e){
System.out.println(e.toString());
}
answer.root = IntBTNode.treeCopy(root);
return answer;
} | 1 |
public void setRange(Map m)
{
tilesInRange = new ArrayList<Tile>();
Tile[][] grid = m.getGrid();
//grab which tiles are in range
int xMin = location.getX() - attacks.get(0).getHorizontalRange();
int xMax = location.getX() + attacks.get(0).getHorizontalRange();
int yMin = location.getY() - attacks.get(0).ge... | 8 |
public void stop() {
if(this.thread != null) {
this.cont = false;
try {
logger.info("Stopping monitor thread.");
this.thread.join(JOIN_TIME);
} catch(Exception e) {
logger.info("Error in thread processing.", e);
} finally {
logger.info("Thread is destroyed.");
this.thread = null;
}
... | 2 |
public static void addGolden(JSONObject fight) {
if (isHtmlOutput()) {
try {
// Dateinamen generieren
String filename = String.valueOf(new Date().getTime())
+ fight.getJSONObject("opponent").getString("name")
.replaceAll("[^a-zA-Z0-9]", "_") + ".html";
// Kampf-Daten schreiben
add(n... | 2 |
private void managePeerConnection() throws Exception{
//Send/ receive handshake
if(!manageHandshake()){
//handshake failed - quit connection to this peer.
return;
}
//After handshake, instantiates a message sender;
this.messageSender = new MessageSen... | 4 |
public boolean contains(StructuredBlock child) {
while (child != this && child != null)
child = child.outer;
return (child == this);
} | 2 |
void close ()
throws USBException
{
if (fd < 0)
return;
try {
// make sure this isn't usable any more
int status = closeNative (fd);
if (status < 0)
throw new USBException (
"error closing device",
-status);
} finally {
// make sure nobody else sees the device
usb.remov... | 2 |
@Override
public TreeModel getTreeModel() {
DefaultMutableTreeNode root = new DefaultMutableTreeNode("Threats");
List<Archive> archives = new ArrayList<Archive>();
archives.add(FileManager.getRuntimeArchive());
archives.addAll(FileManager.getPlugins());
for (Archive archive : archives)
for (ClassNode clas... | 2 |
@Override
public void setValueAt(Object value, int rowIndex, int columnIndex) {
Contestant contestant = contestants.get(rowIndex);
switch (columnIndex) {
case COLUMN_USERNAME:
contestant.setUsername(value.toString());
break;
case COLUMN_PASSWORD:
contestant.setPassword(value.toString());
break;
... | 2 |
public final synchronized Complex readComplex(){
this.inputType = true;
String word="";
Complex cc = null;
if(!this.testFullLineT) this.enterLine();
word = nextWord();
if(!eof)cc = Complex.parseComplex(word.trim());
... | 2 |
public boolean test(int i){
return (datamap[i>>5] & (1<<(i & 0x1F))) != 0;
} | 0 |
private int[] extractSameValues(ArrayList<Card> cards) {
int[] valueCount = new int[VALUE.values().length];
for (int i = 0; i < valueCount.length; i++) {
valueCount[i] = 0;
}
// sort highest first
for (int i = 0; i < cards.size(); ++i) {
valueCount[cards.get(i).value.ordinal()]++;
}
return valueCoun... | 2 |
private Class<?> createRelated(Class<?> type, Class<?> relatedType) {
if (relatedType == null && type.isArray()) {
relatedType = Array.newInstance(type, 0).getClass();
}
if (!type.equals(relatedType)) {
return type.getSuperclass();
}
return null;
} | 6 |
public void setTimestamp(Date timestamp) {
this.timestamp = timestamp;
} | 0 |
private void setupLiseners()
{
addHipsterButton.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent click)
{
sendHipsterInfoToController();
updateHipsterComboBox();
blankFields(false);
}
});
showSelfButton.addActionListener(new ActionListener()
{
public... | 4 |
public static void main(String[] args) throws Exception{
//ColorDisplay is a frame. 1,1 in arguments mean 7*7. 2,1 is 14*7 and so on.
ColorDisplay d = new ColorDisplay(1,1,Color.RED, Color.CYAN);
//An object with all possible characters
ArrayChars chars = new ArrayChars();
//An input window as... | 5 |
public static void main(String[] args) throws IOException {
int height = 15;
int[][] triangle = new int[height][height];
File file = new File("0018/triangle.txt");
List<String> lines = FileUtils.readLines(file);
int y = 0;
for (String line : lines) {
String[] numbers = line.split(" ");
int x = 0;
... | 4 |
public void render(GameContainer gc, StateBasedGame sbg, Graphics g)throws SlickException
{
if(!isGameOver)
{
if(!isPause)
{
}
else
{
}
}
else
{
}
} | 2 |
private void draw(Graphics g) {
Graphics2D g2d = (Graphics2D) g;
// antialiasing ON
g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
RenderingHints.VALUE_ANTIALIAS_ON);
//enable user input
if(fleetEditorModel.getVehicles().size() > 0){
saveVehicleJB.setEnabled(true);
deleteVehicleJB.se... | 9 |
public CanonicalizationMethodType createCanonicalizationMethodType() {
return new CanonicalizationMethodType();
} | 0 |
@Override
public boolean keyUp(int keycode) {
switch(keycode) {
case Keys.W:
direction.y = 0;
animationTime = 0;
break;
case Keys.A:
direction.x = 0;
animationTime = 0;
break;
case Keys.S:
direction.y = 0;
animationTime = 0;
break;
case Keys.D:
direction.x = 0;
animationTime ... | 4 |
public String readField(String fields[], int fieldNum) {
if (fields.length > fieldNum) {
if (fields[fieldNum].equals(MISSING)) return EMPTY;
return fields[fieldNum];
}
return EMPTY;
} | 2 |
@Override
public boolean tick(Tickable ticking, int tickID)
{
if(!super.tick(ticking,tickID))
return false;
if(affected==null)
return false;
if(!(affected instanceof MOB))
return true;
final MOB mob=(MOB)affected;
if((!mob.amDead())&&((--diseaseTick)<=0))
{
diseaseTick=DISEASE_DELAY();
fin... | 8 |
public static void main(String[] args) throws Throwable{
long[] arr = new long[30001];
int[] costos = new int[]{10000, 5000, 2000, 1000, 500, 200, 100, 50, 20, 10, 5};
arr[0]=1;
for (int i = 0; i < costos.length; i++)
for (int j = costos[i]; j < arr.length; j++)
arr[j]+=arr[j-costos[i]];
BufferedRead... | 8 |
public int getXSize() {
return xSize;
} | 0 |
public static void cleanUp () {
Map map = Map.getMap(LaunchFrame.getSelectedMapIndex());
File tempFolder = new File(OSUtils.getCacheStorageLocation(), MAPS.replace("/",sep) + map.getMapName() + sep);
for (String file : tempFolder.list()) {
if (!file.equals(map.getLogoName()) && !fil... | 5 |
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
response.setContentType("text/javascript");
String voornaam = request.getParameter("voornaam");
String username = request.getParameter("username");
String wachtwoord = request.getParameter("wac... | 9 |
public ImageIcon getFrame() {
return frame;
} | 0 |
public void setAnd(TAnd node)
{
if(this._and_ != null)
{
this._and_.parent(null);
}
if(node != null)
{
if(node.parent() != null)
{
node.parent().removeChild(node);
}
node.parent(this);
}
... | 3 |
private static void startTheGame() {
System.out.println("Консольные крестики-нолики");
System.out.println("Разработка, дизайн и саундтрек: Илья Серебряков (aka Lungo)");
System.out.println("Все права защищены");
try {
Thread.sleep(2000);
} catch (InterruptedException ... | 3 |
@Override
public boolean matches(String[] input) {
for (String word: input) {
matcher.reset(word);
if (matcher.find()) {
return true;
}
}
return false;
} | 2 |
public JPanel getShutdownmenuMenu() {
if (!isInitialized()) {
IllegalStateException e = new IllegalStateException("Call init first!");
throw e;
}
return this.shutdMenu;
} | 1 |
public String suitToString() {
switch(suit) {
case DIAMONDS:
return "Diamonds";
case CLUBS:
return "Clubs";
case HEARTS:
return "Hearts";
case SPADES:
return "Spades";
default:
return null;
}
} | 4 |
private void scanDirectory(String directoryName, String fileNameFilter)
{
File dir = new File(directoryName);
FilenameFilter filter = new FilenameFilterImpl(fileNameFilter);
if(DEBUG) System.out.println("Scanning '" +directoryName +"' for file matching '" +fileNameFilter +"'");
String[] files = dir.list(... | 8 |
public String getEmail(String username)
{
Connection connection = null;
String email = null;
String query = null;
PreparedStatement statement = null;
try
{
connection = dataSource.getConnection();
query = "SELECT email FROM users WHERE username = ?;";
statement = (PreparedStatement)conne... | 3 |
@GET
@Produces(MediaType.LIBROS_API_RESENA_COLLECTION)
public ResenaCollection getResenas(@PathParam("idlibro") String idlibro) {
ResenaCollection resenas = new ResenaCollection();
Connection conn = null;
Statement stmt = null;
String sql;
try {
conn = ds.getConnection();
} catch (SQLException e) {
... | 5 |
public void getInput() {
if(Keyboard.isKeyDown(Keyboard.KEY_W))
move(0,1);
if(Keyboard.isKeyDown(Keyboard.KEY_S))
move(0,-1);
if(Keyboard.isKeyDown(Keyboard.KEY_A))
move(-1,0);
if(Keyboard.isKeyDown(Keyboard.KEY_D))
move(1,0);
if(Keyboard.isKeyDown(Keyboard.KEY_SPACE) && attackDelay.isOver())
... | 7 |
private void establishCanvas() {
alloyWindow = new JPanel();
alloyWindow.setLayout(new BorderLayout());
drawing = new BufferedImage(alloy.getWidth(), alloy.getHeight(), BufferedImage.TYPE_INT_ARGB);
int color = (Color.decode("#770077")).getRGB();
for (int x = 0; x < drawing.getWi... | 2 |
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
else if (!(obj instanceof GenericList))
return false;
GenericList gl = (GenericList) obj;
return (quotes == gl.quotes) && varname.equals(gl.varname) && list.equals(gl... | 4 |
public String NetSpanProcess(String url,String data,String tagName){
try{
URL oURL = new URL(url);
HttpURLConnection soapConnection = (HttpURLConnection) oURL.openConnection();
System.out.println("connect to server...");
//prop= new PropertiesConfiguration("NetSpanIntegrator.properties")... | 7 |
public String getUserInfo(String appKey, String userKey) {
try {
appKey = URLEncoder.encode(appKey, "UTF-8");
userKey = URLEncoder.encode(userKey, "UTF-8");
} catch (UnsupportedEncodingException e) {
BmLog.error(e);
}
return String.format("%s/api/rest/... | 1 |
@Override
public void draw(Graphics2D drawScreen, int offsetX, int offsetY) {
for (Entity entity : entityList) {
Spatial spatial = entity.getComponent(Spatial.class);
Health health = entity.getComponent(Health.class);
HealthBar healthBarInfo = entity.getComponent(HealthBar.class);
// Draw the red
... | 2 |
private void buildTree(TeaClassifier tc, TeaNode parent, String[] valueCombo, int level, List<Integer> usedAttributes, double sugar) {
if (length < level + 1) {
length = level + 1;
}
if (parent.getAttributeNum() == 0) {
for (String val : Tea.TEA_TYPE_VALUES) {
buildForStringFeature(tc, parent, valueComb... | 6 |
public IntelligenceArtificielle getIntelligenceArtificielle(Parametre parametre) {
IntelligenceArtificielle intelligenceArtificielle = null;
switch (parametre.getDifficulte()) {
case "Facile":
intelligenceArtificielle = new IntelligenceArtificielleFacile(parametre);
... | 3 |
@Override
public void unInvoke()
{
// undo the affects of this spell
if(!(affected instanceof MOB))
return;
super.unInvoke();
if((canBeUninvoked())&&(clan1!=null)&&(clan2!=null))
{
final Clan C1=clan1;
final Clan C2=clan2;
if((C1!=null)&&(C2!=null))
{
if(C1.getClanRelations(C2.clanID())=... | 9 |
@Override
public void actionPerformed(ActionEvent e) {
OutlinerDocument doc = (OutlinerDocument) Outliner.documents.getMostRecentDocumentTouched();
OutlinerCellRendererImpl textArea = doc.panel.layout.getUIComponent(doc.tree.getEditingNode());
if (textArea == null) {
return;
}
Node node = textArea.n... | 3 |
public boolean setPWfieldHeight(int height) {
boolean ret = true;
if (height <= 10) {
this.pwfield_Height = UISizeInits.PWFIELD.getHeight();
ret = false;
} else {
this.pwfield_Height = height;
}
somethingChanged();
return ret;
} | 1 |
@Override
public void simpleInitApp() {
flyCam.setMoveSpeed(2); /** Translucent/transparent cube. Uses Texture from jme3-test-data library! */
ContentManager.getInstance().setAssetManager(assetManager);
ContentManager.getInstance().setMinecraft(this);
Bloc... | 0 |
Entry insert(int key, int value) {
Entry node = new Entry(key, value);
node.degree = 0;
node.marked = false;
node.left = node.right = node;
node.parent = null;
node.child = null;
// Podpinamy pod korzen
// ++
access += 1;
if (minimum == n... | 2 |
private void btn_buscarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btn_buscarActionPerformed
ocultarMensaje();
try{
// buscar por numero de factura
if((!campo_buscar1.getText().equals(""))&&(!campo_buscar1.getText().e... | 9 |
public static void load(File par1File) {
InputStreamReader isr = null;
BufferedReader br = null;
StringBuilder sb = new StringBuilder();
try {
isr = new InputStreamReader(new FileInputStream(par1File));
br = new BufferedReader(isr);
while(br.ready()){
sb.append(br.readLine());
sb.appen... | 7 |
public void setAttributeValue(String value) {
if (value == null || value.length() < 7 || value.length() > 15)
throw new IllegalArgumentException("bad IP number");
StringTokenizer tok = new StringTokenizer(value, ".");
if (tok.countTokens() != 4)
throw new IllegalArgumentException("bad IP number: 4 number... | 7 |
public void addLightSource(int x, int y, int r, int br) {
x -= xOff;
y -= yOff;
for (int yy = -r; yy < r; yy++) {
if ((yy + y) < 0 || (yy + y) >= height)
continue;
for (int xx = -r; xx < r; xx++) {
if ((xx + x) < 0 || (xx + x) >= width)
continue;
int d = (xx * xx) + (yy * yy);
if (d > ... | 8 |
public static void main(String args[]) {
/*
* Set the Nimbus look and feel
*/
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
/*
* If Nimbus (introduced in Java SE 6) is not available, stay with the
* default look and fe... | 6 |
public double standardizedStandardDeviationCorrelationCoefficientsWithTotals(){
if(!this.dataPreprocessed)this.preprocessData();
if(!this.covariancesCalculated)this.covariancesAndCorrelationCoefficients();
return this.standardizedStandardDeviationRhoWithTotals;
} | 2 |
@Override
public boolean equals(Object obj) {
if (this == obj) return true;
if (obj == null) return false;
if (getClass() != obj.getClass()) return false;
final Transaction another = (Transaction) obj;
if (getTransactor().equals(another.getTransactor())) {
if (getReceiver().equals(another.getRece... | 6 |
private void onopen() {
logger.fine("open");
this.cleanup();
this.readyState = ReadyState.OPEN;
this.emit(EVENT_OPEN);
final com.github.nkzawa.engineio.client.Socket socket = this.engine;
this.subs.add(On.on(socket, Engine.EVENT_DATA, new Listener() {
@Over... | 2 |
private static boolean formQueryStay(Criteria crit, List params, StringBuilder sb, StringBuilder sbw, Boolean f234) {
List list = new ArrayList<>();
StringBuilder str = new StringBuilder(" ( ");
String qu = new QueryMapper() {
@Override
public String mapQuery() {
... | 3 |
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.