text stringlengths 14 410k | label int32 0 9 |
|---|---|
public int getUpperLeftX(){
if (x1 > x2) {
return x1;
} else {
return x2;
}
} | 1 |
private void startCollectionTab() {
ImageButton collectionButton = new ImageButton(parent,
"New Collection", (int) (posX + 60), 140, 200, 25, 1) {
@Override
public void onMousePress(int x, int y) {
// CREATES CREATION COLLECTION MENU
if (!creatingCollection) {
newCollection = new Collection<... | 1 |
public byte[] processBlock(byte[] in, int inOff, int len) throws InvalidCipherTextException {
if (param instanceof SHEBV11bPublicKeyParameters) {
// Enc
SHEBV11bPublicKeyParameters pk = ((SHEBV11bPublicKeyParameters) param);
SHEBV11bParameters parameters = pk.getParameters()... | 6 |
private void atividadesAtrasadas() {
if (usuarioLogado.getTipo().equals("Gerente")) {
AtividadesAtrazadasForm atividadesAtrazadasForm = null;
atividadesAtrazadasForm = new AtividadesAtrazadasForm(usuarioLogado);
atividadesAtrazadasForm.setVisible(true);
centrali... | 1 |
private void oilPasteBuffer(CPRect srcRect, CPRect dstRect, int[] buffer, byte[] brush, int w, int alpha) {
int[] opacityData = opacityBuffer.data;
int by = srcRect.top;
for (int j = dstRect.top; j < dstRect.bottom; j++, by++) {
int srcOffset = srcRect.left + by * w;
int dstOffset = dstRect.left + j *... | 4 |
public static void act(KeyEvent e) {
for(Player p: players) {
if (!p.isBot()) {
if (e.getKeyChar() == ' ')
p.setAction(8);
else if (!e.isActionKey())
p.setAction(e.getKeyChar());
else
p.setAct... | 4 |
void sendShips(Set<Planet> fromList, Planet to) {
double interval = 12;
double radiusDelta = 30;
Set<Ship> ships = new HashSet<Ship>();
for (Planet from : fromList) {
double radius = from.radius + 10;
int sendCount = from.shipsCount.get() / 2;
from.s... | 6 |
@Override
public void keyPressed( KeyEvent e ){
int key = e.getKeyCode();
if ( key == KeyEvent.VK_UP ){
if (!DOWN){
resetMoves();
UP = true;
}
}
else if ( key == KeyEvent.VK_DOWN ){
if (!UP){
resetMoves();
DOWN = true;
}
}
else if ( key == KeyEvent.VK_LEFT ){
if (... | 9 |
protected String buildFormatMultipleCommand(List<? extends Object> objList) {
String command = null;
if (shouldDisambiguate) {
command = SubLAPIHelper.makeSubLStmt(GENERATE_DISAMBIGUATION_PHRASES,
new CycList(objList), DEFAULT, DEFAULT, getFormatLanguageMt(), getDomainMt(), getCycSymbol(getM... | 5 |
@Override
public void handle(HttpExchange exchange) throws IOException {
System.out.println("In build road handler");
String responseMessage = "";
if(exchange.getRequestMethod().toLowerCase().equals("post")) {
try {
//TODO verify cookie method
String unvalidatedCookie = exchange.getRequestHeade... | 4 |
public void mousemove(Coord c) {
if (locked)
return;
if ((!locked) && (dragging == null) && (pressed != null)) {
dragging = pressed;
int slot = index(c);
if (slot >= 0) {
clearslot(slot);
}
pressed = null;
} ... | 5 |
@Override
public void run()
{
while(true)
{
try
{
Thread.sleep((random.nextInt(agent.getNumAgentsConnected()) + 1) * 250);
if (!Agent.getConflictExists())
{
Agent.Leader(agentId, agentType);
Thread.sleep((random.nextInt(agent.getNumAgentsConnected()) + 1) * 400);
Agent... | 3 |
public void reset()
{
for (int i=0; i<BANDS; i++)
{
settings[i] = 0.0f;
}
} | 1 |
void createExampleWidgets () {
/* Compute the widget style */
int style = getDefaultStyle();
if (horizontalButton.getSelection ()) style |= SWT.HORIZONTAL;
if (verticalButton.getSelection ()) style |= SWT.VERTICAL;
if (borderButton.getSelection ()) style |= SWT.BORDER;
/* Create the example widgets */
... | 3 |
public static RoutingTable deserializeRoutingTable(CorbaRoutingTable corbaRoutingTable) {
if (corbaRoutingTable == null) {
throw new NullPointerException("Cannot transform a null value to a Host object");
}
RoutingTable routingTable = new RoutingTable();
Host localhost = des... | 3 |
public void convertOldCircuitsYml(){
File oldYmlFile = new File(plugin.getDataFolder(),"circuits.yml");
if(oldYmlFile.exists()){
plugin.log(plugin.getMessage("found_old_file").replace("%file%",oldYmlFile.getName()));
FileConfiguration oldYml = YamlConfiguration.loadConfiguration... | 6 |
@EventHandler
public void onUrlCheckEvent(final SendDataEvent event) {
event.getURL().getPage(new URLResponseHandler() {
public void validResponse(BufferedReader br) throws IOException {
final String line;
try {
line = br.readLine();
} catch (Exception e) {
e.printStackTrace();
return;
... | 8 |
public static void handleGetEventMethod(HTSMsg msg, HTSPServerConnection conn, HTSPMonitor monitor) throws IOException {
Collection<String> requiredFields = Arrays.asList(new String[]{"eventId"});
if (msg.keySet().containsAll(requiredFields)){
//TODO handle several clients!!
HTSMsg reply = monitor.getEvent((L... | 2 |
private void tabClientesKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_tabClientesKeyReleased
performNavigateAction(evt);
if (evt.getKeyCode() == KeyEvent.VK_DOWN) {
if (booAlteracao) {
btnCancelar.doClick();
booAlteracao = false;
} el... | 9 |
public void tallennaPalaute(Palaute p) throws DAOPoikkeus {
Connection yhteys = avaaYhteys();
try {
String sql = "insert into Palaute(tilausID, nimi, kategoria, vastataanko, pvm, tiedot, sahkoposti) values (?, ?, ?, ?, ?, ?, ?)";
PreparedStatement ps = yhteys.prepareStatement(sql);
// La... | 2 |
public void invalidate() {
valid = false;
} | 0 |
int getMin(Vector<Sample> Q) {
double min = Double.MAX_VALUE;
int index = 0;
for (int i = 0; i < Q.size(); i++) {
if (Q.get(i).fx < min) {
min = Q.get(i).fx;
index = i;
}
}
return index;
} | 2 |
private void botonCargarComprasActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_botonCargarComprasActionPerformed
//limpio el modelo
DefaultTableModel modeloCompras = ((DefaultTableModel) jTableCompras.getModel());
modeloCompras.setRowCount(0);
//saco el id de la person... | 3 |
public void tick() {
if (input.up.clicked) selected--;
if (input.down.clicked) selected++;
int len = options.length;
if (selected < 0) selected += len;
if (selected >= len) selected -= len;
if (input.attack.clicked || input.menu.clicked) {
if (selected == 0) {
Sound.test.play();
game.resetGame(... | 9 |
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
try{
response.setContentType("text/html");
PrintWriter out = response.getWriter();
String userid=request.getParameter("sjsuid");
String password=request.getParameter("passwor... | 7 |
public Tile[][] generateRandomBlock()
{
Tile[][] piece = new Tile[0][0];
Random generator = new Random();
int randomIndex = generator.nextInt(7);
switch(randomIndex)
{
case 0:
piece = generat... | 7 |
private String DDCRET_String(int retcode)
{
switch ( retcode )
{
case DDC_SUCCESS: return "DDC_SUCCESS";
case DDC_FAILURE: return "DDC_FAILURE";
case DDC_OUT_OF_MEMORY: return "DDC_OUT_OF_MEMORY";
case DDC_FILE_ERROR: return "DDC_FILE_ERROR";
case DDC_INVALID_CALL:... | 7 |
@Override
public TLValue evaluate() {
TLValue a = lhs.evaluate();
TLValue b = rhs.evaluate();
// number + number
if(a.isNumber() && b.isNumber()) {
return new TLValue(a.asDouble() % b.asDouble());
}
throw new RuntimeException("illegal expression: " + this);
} | 2 |
private void jjCheckNAdd(int state)
{
if (jjrounds[state] != jjround)
{
jjstateSet[jjnewStateCnt++] = state;
jjrounds[state] = jjround;
}
} | 1 |
public void upd() {
bestNbrIndices.clear();
for (int i = 0; i < topk.size(); i++) {
bestNbrIndices.add(i);
}
boolean run = true;
while(run) {
run = false;
// add neighbor
//print(baseUserID + " begining: " + upd);
for (int i = 0; i < topk.size() + topr.size(); i++)... | 8 |
public void renderTile(int xp, int yp, Tile tile) {
xp -= xOffset;
yp -= yOffset;
for(int y = 0; y < tile.sprite.SIZE; y++) {
int ya = y + yp;
for(int x = 0; x < tile.sprite.SIZE; x++) {
int xa = x + xp;
if(xa < -tile.sprite.SIZE || xa >= w... | 7 |
@Override
public void affectPhyStats(Physical affected, PhyStats affectableStats)
{
if((whom!=null)&&(song!=null))
{
final Hashtable<Integer,Integer> H=getSongBenefits(song);
for(final Enumeration<Integer> e=H.keys();e.hasMoreElements();)
{
final Integer I=e.nextElement();
final String[] chk=stuf... | 8 |
public static boolean inventoryContains(int itemId) {
for(int i=0; i<Inventory.length; i++) {
if(Inventory[i] == itemId) {
return true;
}
}
return false;
} | 2 |
public static Game createGame(Game myGame, Move m) {
// TODO Auto-generated method stub
Board testBoard = new Board(false);
Piece thePieceMoving = myGame.getPiece(m.getPreviousLocation());
Point whereToMove=m.getCurrentLocation();
boolean theTurn = myGame.isWhitesTurn();//check if the new board set up puts th... | 2 |
public void addHandler(String handlername, Object handler)
{
logger.info("Registered " + handlername + " for " + handler.getClass());
if (handler instanceof XmlRpcHandler)
{
handlers.put(handlername, handler);
}
else if (handler != null)
{
... | 2 |
**/
public void print(int depth)
{
int i;
// Print the indentation and the data from the current node:
for (i = 1; i <= depth; i++)
System.out.print(" ");
System.out.println(data);
// Print the left subtree (or a dash if there is a right child and no left child)
... | 7 |
public void destroy(Integer id) throws IllegalOrphanException, NonexistentEntityException {
EntityManager em = null;
try {
em = getEntityManager();
em.getTransaction().begin();
InfoPaciente infoPaciente;
try {
infoPaciente = em.getReference... | 6 |
public static void main(String[] args) {
Map map = new Map(new int[]{16, 16}, new int[]{0, 0}, new int[]{15, 15});
Scout scout = new Scout(map.mapArray, map.startCoord, map.endCoord);
for(int i = 0; i < 25; i++){
scout.moveDirection();
}
Rectangle rectangle = new Rectangle(0, 0, 10, 10);
rectangle.add... | 5 |
@Override
public void beforeSample() {
try {
// input
BufferedReader ir = getInputReader();
String line = ir.readLine();
if (line == null) {
inputReader.close();
inputReader = null;
ir = getInputReader();
line = ir.readLine();
}
String[] split = line.split(",");
if (next... | 8 |
public boolean isExistForumUser(Connection con, String user) {
/* Compose query. */
String SQL_QUERY = "SELECT COUNT(username) entries "
+ "FROM xf_user "
+ "WHERE username=?;";
/* Execute query. */
try {
PreparedStatement stmt = con.prepareStatement(SQL_QUERY);
stmt.setString(1, user);
ResultS... | 2 |
private void initGUI() {
try {
this.setLayout(new BoxLayout(this, javax.swing.BoxLayout.X_AXIS));
// this.setPreferredSize(new Dimension(400, 300));
{
this.add(tablePanel);
tablePanel.setLayout(new BoxLayout(tablePanel, javax.swing.BoxLayout.Y_AXIS));
tablePanel.setPreferredSize(new java.awt.Dime... | 7 |
private void animate() {
getDisplay().timerExec(msDelay, new Runnable() {
@Override
public void run() {
if( !label.isDisposed() )
{
if( isVisible() && frames.size() > 0 )
{
curFrame++;
if( curFrame > frames.size()-1 )
{
curFrame=0;
}
label.setI... | 5 |
private String getTypeStr(PointCloud2 cloud) {
String typeStr = new String("TYPE");
for(PointField field: cloud.fields){
switch(field.datatype){
case(1):
case(3):
case(5):
typeStr = typeStr + " I";
break;
case(2):
case(4):
case(6):
typeStr = typeStr + " U";
break;
case(7):
... | 9 |
private boolean buildFriendsListMenu(RSInterface rsInterface) {
int type = rsInterface.contentType;
if (type >= 1 && type <= 200 || type >= 701 && type <= 900) {
if (type >= 801)
type -= 701;
else if (type >= 701)
type -= 601;
else if (type >= 101)
type -= 101;
else
type--;
menuAction... | 9 |
private void auraAttack(){
Point startPoint = new Point(Game.PLAYER.getX(), Game.PLAYER.getY());
Point endPoint = new Point(Mouse.getX() + Game.PLAYER.getCameraX(), Mouse.getY() + Game.PLAYER.getCameraY());
double m = (endPoint.getY() - startPoint.getY())/(endPoint.getX() - startPoint.getX());
double startAngle... | 6 |
private void calculateSelectedRect() {
double startX = start.getX();
double startY = start.getY();
double endX = end.getX();
double endY = end.getY();
double swidth = endX - startX;
double sheight = endY - startY;
if (swidth > 0 && sheight > 0) {
rect... | 8 |
public static void moveLeftText(OutlinerCellRendererImpl textArea, JoeTree tree, OutlineLayoutManager layout) {
Node currentNode = textArea.node;
if (textArea.getCaretPosition() == 0) {
// Get Prev Node
Node prevNode = tree.getPrevNode(currentNode);
if (prevNode == null) {
tree.setCursorPosition(tre... | 4 |
public void simulate(long simulationTime)
{
state = true;
while (state)
{
SimEvent event = eventQueue.poll();
if (event == null) break;
if (simulationTime > 0 && event.getOccurringTime() >= simulationTime) break;
currentTime = event.getOccurringTime();
event.getOwner().process(event);
}
} | 4 |
@SuppressWarnings("unchecked")
private Set<WFF> makeCorrectDepthResults(WFF source) {
HashSet<WFF> results = new HashSet<WFF>();
try {
Logic logic = new ClassicalLogicS();
if (source.getFormula().length() < 1) {
return results;
};
formula = (Formula) logic.createExpression(source.getFormula());
... | 6 |
@Override
public void exportWrite(String path) {
try {
PrintStream ps = new PrintStream(path);
ps.println("Number of nodes: " + Tools.getNodeList().size());
Configuration.printConfiguration(ps);
ps.println(separator);
Iterator<Node> it = Tools.getNodeList().iterator();
Iterator<Edge> eIt;
... | 3 |
public GetDocumentsListResult genLoad() {
HashoutListToDocument hashoutListToDocument = new HashoutListToDocument();
Id listId = parentId;
if (listId == null) {
listId = HashoutList.ALL_DOCUMENTS.getId();
}
List<EntityDocument> documents = hashoutListToDocument.loadEntities(listId.getKey());
... | 3 |
private void initializePerson(){
//Roles and Job
mRoles = new HashMap<Role, Boolean>(); //role to active
mAtJob = false;
//Lists
mFriends = new ArrayList<Person>();
mEvents = Collections.synchronizedList(new ArrayList<Event>());
mItemInventory = Collections.synchronizedMap(new HashMap<EnumItemType, Int... | 8 |
public final void pauseLayer(GameLayer layer) {
if (!gameLayers.containsValue(layer)) {
logger.error(new NullPointerException(),
"Tried to pause a game layer that isn't registered to the GameScreen :: ", this);
} else {
layer.pause();
}
} | 1 |
public static void WritePaymentLog(String log, String id_payment){
StringBuilder sb = new StringBuilder();
try{
String path_log = "/home/terminal/Log/LogPayment/Payment_"+id_payment+".txt";
File Log_path = new File(path_log);
if (!Log_path.exists()){
t... | 6 |
private static boolean isCPFPadrao(String cpf) {
if (cpf.equals("11111111111")
|| cpf.equals("22222222222")
|| cpf.equals("33333333333")
|| cpf.equals("44444444444")
|| cpf.equals("55555555555")
|| cpf.equals("66666666666")
... | 9 |
public int get(final int index) {
final int i0 = index >>> 26;
int[][] map1;
if (i0 != 0) {
if (map == null)
return NOT_FOUND;
map1 = map[i0];
if (map1 == null)
return NOT_FOUND;
} else
map1 = map10;
int[] map2 = map1[(index >>> 13) & 0x1fff];
if (map2 == null)
return NOT_FOUND;
... | 4 |
void removeDev (DeviceImpl dev)
{
synchronized (devices) {
DeviceImpl d = (DeviceImpl)getDevice (dev.getAddress ());
int i;
//if (MacOSX.trace)
// System.err.println ("notify removeDev " + dev.getPath());
if (d == null || d != dev)
... | 7 |
private double calculateScore(ArrayList<seed> seedlist) {
double total = 0.0;
for (int i = 0; i < seedlist.size(); i++) {
double score = 0.0;
double chance = 0.0;
double totaldis = 0.0;
double difdis = 0.0;
for (int j = 0; j < seedlist.size(); j++) {
if (j != i) {
totaldis = totaldis + Math.... | 9 |
private void drawMap()
{
int c;
for(int i = 0; i < width; i++)
{
for(int j = 0; j < height; j++)
{
c = gameMap[i][j];
if(c == 0)
mapView[i][j].setIcon(new ImageIcon(getClass().getResou... | 7 |
@Override
public void onClick(MouseEvent e, int x, int y) {
if(boardTool == BoardTool.MAKE_MOVE) {
if(currentPlayerTurn == player) {
int stat = board.makeMove(player, x, y);
if(stat >= 0) {
SoundManager.playStoneSound();
... | 8 |
public static List<CongressionalDistrict> createDistricts(List<CensusTract> tracts, int numDistricts, MapCoordinate seedCoordinate)
{
List<CongressionalDistrict> districts = new ArrayList<CongressionalDistrict>();
Quicksort sorter = new Quicksort(tracts, seedCoordinate);
tracts = sorter.getS... | 7 |
public static void main(String[] args) throws Exception {
game = new XPilotGame();
view = new View(game);
SoundManager.load();
JEasyFrameFull win = new JEasyFrameFull(view);
win.addKeyListener((Keys)game.getCtrl());
// run the game
while (true) {
game.... | 5 |
@Override
public <T> T select( String msg, Collection<T> candidates) {
ImmutableList<T> copyList = ImmutableList.copyOf( candidates);
this.writeln( msg);
this.write( Message.CANDIDATE_BOX, this.formatCandidates( 0, copyList));
try {
BufferedReader reader = new BufferedR... | 4 |
@XmlElementDecl(namespace = "http://www.w3.org/2001/04/xmlenc#", name = "OriginatorKeyInfo", scope = AgreementMethodType.class)
public JAXBElement<KeyInfoType> createAgreementMethodTypeOriginatorKeyInfo(KeyInfoType value) {
return new JAXBElement<KeyInfoType>(_AgreementMethodTypeOriginatorKeyInfo_QNAME, Key... | 0 |
public void setStrategy(Strategy strategy) {
this.strategy = strategy;
} | 0 |
private void closeWindow(final JWindow window) {
fWindowClosed = true;
if(fFadeOut && sWindowApi.isTranslucencySupported(Translucency.TRANSLUCENT, sMainScreen)) {
final AnimationTimer animationTimer = new AnimationTimer(FrameRate.FPS_25);
animationTimer.setDuration(ANIMATION_FADE_OUT_DURATION);
animationTi... | 2 |
public static AsmProgram loadProgram(String fileName)
throws AssemblerException {
File file = new File(fileName);
AsmProgram prog = new AsmProgram(Definitions.getInstance().getAddressesTable());
if (!file.exists())
throw new AssemblerException(fileName + " doesn't exist");
if (fileName.endsWith(".hack")) ... | 8 |
public static void main(String[] args) {
System.out.println("Question 8: Duped");
Scanner keyboard = new Scanner(System.in);
boolean invalid = true;
String inputStr;
do {
System.out.print("Enter integers separated by commas: ");
inputStr = keyboard.nextLine();
String[] strArray = inputStr.split(",")... | 4 |
@Override
public void onLoad() {
LogOre.NAME = this.getDescription().getFullName();
this.getLogger().log(Level.INFO, "Loading configuration...");
this.cloader = new ConfigurationLoader(this);
} | 0 |
int getMaxCond(String name) {
// returns the maximum condition, default is 0
File conditions = new File(subjects.getAbsolutePath() + "\\" + name + "\\conditions");
try {
BufferedReader cFile = new BufferedReader(new FileReader(conditions));
Scanner scanner = new Scanner(cFile);
int n;
if (scanner.hasN... | 2 |
public void setChild(Position pos, QuadTreeNode newNode){
switch (pos){
case northWest: this.nw = newNode; break;
case northEast: this.ne = newNode; break;
case southWest: this.sw = newNode; break;
case southEast: this.se = newNode; break;
}
} | 4 |
@Override
public void run() {
try (
OutputStream outputStream = socket.getOutputStream();
Scanner in = new Scanner(System.in);
PrintWriter out = new PrintWriter(outputStream, true)
) {
boolean done = false;
while (!done && in.hasNextLine()... | 5 |
public void SetMinimumPassenger(int minimumPassenger)
{
if(minimumPassenger < this.minimumPassenger)
this.minimumPassenger = minimumPassenger;
} | 1 |
@Override
public void update(GameContainer gc, StateBasedGame s, int delta) throws SlickException {
Thread timing = new Thread(new Runnable() {
@Override
public void run() {
if(rectOn) {
try {
Thread.sleep(200);
... | 6 |
public void playSpells(){
String manaPool = "";
Collections.sort(p1.getHand());
for(Land l : this.p1.getLands())
if(!l.isTapped())
manaPool += l.getManaTypes();
for(int i = 0; i < this.p1.getHand().size(); i++){
Card c = this.p1.getHand().get(i);
if(!c.getType().equals("land"))
if(c.ca... | 5 |
@SuppressWarnings("rawtypes")
public static Boolean isNullOrEmpty(Object object) {
if (object == null) {
return Boolean.TRUE;
}
if (object instanceof String) {
return ((String) object).trim().length() == 0;
}
if (object instanceof Map) {
return ((Map) object).isEmpty();
}
if (object instanceof C... | 4 |
@Override
public void applyReservePolicy(LibraryModel model, List<LibraryView> views,
List<Item> toReserve, String borrowerID) {
List<Item> availableItems = new LinkedList<Item>();
List<Item> toRemove = new LinkedList<Item>();
for (Item item : toReserve) {
List<Reservation> reservations = getReservationsOf... | 5 |
public void move(int key) {
Position p = new Position(position.x, position.y);
switch (key) {
case KeyEvent.VK_UP:
currentOrientation = PLAYER_ORIENTATION.UP;
p.y -= speed;
break;
case KeyEvent.VK_RIGHT:
currentOrie... | 5 |
public String goToUserProductsList() {
this.retrieveAllProducts();
return "userProductsList";
} | 0 |
private void getResourcesFromXML(Document doc, PetriNet pn) {
NodeList resourcesList = doc.getElementsByTagName("resource");
for (int i = 0; i < resourcesList.getLength(); i++) {
Node nNode = resourcesList.item(i);
if (nNode.getNodeType() == Node.ELEMENT_NODE) {
... | 8 |
public Descriptor findMessageTypeByName(String name) {
// Don't allow looking up nested types. This will make optimization
// easier later.
if (name.indexOf('.') != -1) {
return null;
}
if (getPackage().length() > 0) {
name = getPackage() + '.' + name;
}
final ... | 5 |
public static ArrayList<String> load(String packageName) {
URL root = Thread.currentThread().getContextClassLoader().getResource(packageName.replace(".", "/"));
File[] files = new File(root.getFile()).listFiles(new FilenameFilter() {
public boolean accept(File dir, String name) {
... | 3 |
private void itmMnuDepartamentoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_itmMnuDepartamentoActionPerformed
// Menu - Cadastro > ItemMenu - Departamento
//Instancia uma tela de cadastro de Departamento se o usuario que esta logado for Um diretor;
//caso não seja um dire... | 1 |
@SuppressWarnings("unchecked")
private Object checkTypeAndReturnObject(Column column, Class clazz) {
if (clazz.isAssignableFrom(column.getType()) ||
clazz == Long.class && java.util.Date.class.isAssignableFrom(column.getType())) {
if (columns.containsKey(column)) {
return columns.get(column)... | 4 |
private void updateGate(String CLK, String CLR, String J, String K, String Q, String NQ) throws InvalidPinException {
if (this.isLow(CLR)) {
this.setPin(Q, Pin.PinState.LOW);
this.setPin(NQ, Pin.PinState.HIGH);
} else if (this.isRisingEdge(CLK)) {
if (this.isLow(J) && this.isHigh(K)) {
this.setPin(Q, P... | 9 |
private static eCoreInventory loadInventory(OfflinePlayer player, YamlConfiguration yamlConfig, boolean eventInv){
String configPath = eventInv?"eCoreInv.":"normalInv.", tempPath;
eCoreInventory inv; int amount; List<ItemStack> tempItems = new ArrayList<ItemStack>();
Map<String, ItemStack[]> serialized = new Hash... | 6 |
public static void addTile(String tileName, Point2D pos) {
if(tiles.get(tileName) == null) {
tiles.put(tileName, new Model2D(new String[]{tileName}));
}
if(tilePos.get(tileName) != null) {
tilePos.get(tileName).add(pos);
} else {
tilePos.put(tileName, new ArrayList<Point2D>(Arrays.asList(pos)));
}... | 2 |
public Dirt() {
super(new Color(95, 75, 9), true);
} | 0 |
public static void render(World world){
GL11.glDisable(GL11.GL_TEXTURE_2D);
GL11.glColor3f(0.2f, 0.2f, 0.2f);
GL11.glBegin(GL11.GL_QUADS);
GL11.glVertex2f(0 + Game.PLAYER.getCameraX(), 0 + Game.PLAYER.getCameraY());
GL11.glVertex2f(Game.SCREEN_WIDTH + Game.PLAYER.getCameraX(), 0 + Game.PLAYER.getCameraY... | 6 |
public void makeMenus() {
JMenuItem mi; // used in various spots
JMenuBar mb = new JMenuBar();
parentFrame.setJMenuBar(mb);
ResourceBundle b = ResourceBundle.getBundle("Menu");
JMenu fm = mkMenu(b, "file");
fm.add(mi = mkMenuItem(b, "file", "open"));
mi.addActionListener(new ActionListener() {
pub... | 3 |
public Diamant(Rectangle masse, IntHolder unit, int points) {
super(masse, unit);
this.points = points;
} | 0 |
private String getSlotContents(int par, int chi) {
String scLine = "";
int[] contents = c.widgets.get(par, chi).getSlotContents();
if (contents != null) {
for (int i = 0; i < contents.length; i++) {
scLine = scLine + contents[i];
if (i < contents.lengt... | 3 |
@Override
public String getMessageText() {
String msg = oldName + " " + settings.getLanguage().getLabel("text_rename") + " " + newName;
return msg;
} | 0 |
public boolean delete_text(int beginIndex, int endIndex) {
if(beginIndex < 0
|| beginIndex > endIndex
|| endIndex > maxChars) {return false;}
int deletionLength = endIndex - beginIndex;
length -= deletionLength;
for(int currentIndex = beginIndex; curre... | 5 |
public boolean EliminarTrabajo(Trabajo p){
if (p!=null) {
cx.Eliminar(p);
return true;
}else {
return false;
}
} | 1 |
public void setId(Long id) {
this.id = id;
} | 0 |
public Tree relationalExpressionPro(){
Tree firstConditionalExpression = null, secondConditionalExpression = null;
Symbol operator = null;
if((firstConditionalExpression = additiveExpressionPro()) != null){
if((operator = accept(Symbol.Id.PUNCTUATORS,"(>=?|<=?)")) != null){
if((secondConditionalExpression... | 3 |
@Override
public SemiLease write(final ISemiSpaceTuple entry, final long leaseTimeMs) {
if (entry == null) {
return null;
}
// log.logDebug( "WRITE: "+entry.getJSON());
//System.out.println("SemiSpace.write-1 "+entry);
WrappedInternalWriter write = new WrappedInternalWriter(... | 8 |
public boolean equals(Object o) {
GUID g = (GUID)o;
return d1 == g.d1 && d2 == g.d2 && d3 == g.d3 && d4 == g.d4 && d5 == g.d5;
} | 4 |
public static void main(String[] args) {
int run = 13;
boolean roll = true;
long rollingProduct = 0;
long largestProduct = 0;
int largestProductIndex = 0;
String numbers = "731671765313306249192251196744265747423553491949349698352031277450632623957831801698480186947885184385861560789112949495459501737958331... | 8 |
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.