text stringlengths 14 410k | label int32 0 9 |
|---|---|
public void SimpleRunOpposingSideLinks(String dataFile, String outputFile){
globalLinkCounter = 0;
L = new LinkSet();
if(localconditions == null)
{
localconditions = new String[0];
}
MatchData M = new MatchData(dataFile);
Match m;
int c = 0;
... | 5 |
public DiscoveredClient(String username, InetAddress address)
{
this.username = username.trim();
this.address = address;
timeout = (System.currentTimeMillis()/1000L)+10;
} | 0 |
public E next() {
if (currentIterator.hasNext()) {
while (true) {
try {
E e = currentIterator.next();
lastIteratorToReturn = currentIterator;
advance();
return e;
} catch (Exception e) {
System.err.println("bad file");
if (!sourceIter... | 4 |
public void regularTurn(Player player, Point location) throws Connect4Exception, GameException {
if (location == null) {
throw new IllegalArgumentException("GameCommands - regularTurn: location is null");
}
if (game.getStatus() != GameStatus.PLAYING &&
game.getS... | 3 |
public void setNumInt(TNumInt node)
{
if(this._numInt_ != null)
{
this._numInt_.parent(null);
}
if(node != null)
{
if(node.parent() != null)
{
node.parent().removeChild(node);
}
node.parent(this);
... | 3 |
@Before
public void setUp() {
} | 0 |
public void simplificarNodos(String key, List<Shape> shapes, double threshold) {
// Recorremos todos los shapes
for(Shape shape : shapes){
// Todos sus poligonos
for(int pos = 0; pos < shape.getPoligons().size(); pos++)
// De cada poligono todos sus ways
for(WayOsm way : utils.getWays(key, shape.ge... | 9 |
@Override
public void stateChanged(ChangeEvent e) {
if(isLiveDecode()) parent.executeCipher(40);
} | 1 |
@Override
public int compareTo(Hand that) {
int hr = this.handRank.value - that.handRank.value;
if (hr == 0) {
for (int index = 0; index < this.ranks.size(); index++) {
int rankCompare = this.ranks.get(index).value - that.ranks.get(index).value;
if (rankCompare == 0) {
continue;
} else {
r... | 3 |
public static String getNameFromADNEntry(byte[] input) {
if ((input[0] & 0xff) == 0x80) {
return UCS2toUTF16(input);
}
if ((input[0] & 0xff) == 0x81) {
return UCS2toUTF16(input);
}
if ((input[0] & 0xff) == 0x82) {
return UCS2toUTF16(input);
... | 5 |
public void setWidthInChars( int newWidth )
{
/* if an image falls upon this column,
* adjust image width so that it does not change
*/
ArrayList iAdjust = new ArrayList();
ImageHandle[] images = myCol.getSheet().getImages();
if( images != null )
{
// for each image that falls over... | 5 |
@Override
public List<UserDTO> getAllUsers() throws SQLException {
Session session = null;
List<UserDTO> users = new ArrayList<UserDTO>();
try {
session = HibernateUtil.getSessionFactory().openSession();
users = session.createCriteria(UserDTO.class).list();
} ... | 3 |
@Test
public void testCompareTextStringStringString()
{
assertTrue(true);
} | 0 |
@Override
public void eventDispatched(AWTEvent awtEvent)
{
if (awtEvent.getID() != MouseEvent.MOUSE_PRESSED || !isHandle)
return;
MouseEvent mouseEvent = (MouseEvent) awtEvent;
int button = mouseEvent.getButton();
State state = StateManager.getInstance().getState();
... | 4 |
public void loadWorldDescriptor(String fname) {
WDLoader loader = new JAXBWDLoader(fname);
WorldDescriptor descr = loader.load();
if (descr != null) {
long dly = 100;
if (sim != null) {
dly = sim.getDelay();
sim.stopSimulation();
}
sim = new Simulation(descr, dly);
} else
ui.error("Could ... | 2 |
private void exitActions () {
try {
// action: delete outdated autosave files
int validDays = getClientOptions().getInteger(ClientOptions.AUTOSAVE_VALIDITY);
long validPeriod = (long)validDays * 86400 * 1000; // millisecond equivalent of valid days
long timeNow = System.c... | 6 |
public double getScale(){
return scaleBy;
} | 0 |
public int getGerberas() {
return gerberas;
} | 0 |
public boolean is_AllowedHod(int[] hod) {
for (int i : hod) {
if ((i < 0) || (i > 3)) {
return false;
}
}
if (!((hod[0] - hod[2] == 0) || (hod[1] - hod[3] == 0))) {
return false;
}
return true;
} | 5 |
public static boolean initTree(Map<String , PluginImpl> plugins){
List<PluginImpl> list = new ArrayList<PluginImpl>() ;
for(PluginImpl plugin : plugins.values()) {
list.add(plugin) ;
}
Collections.sort(list) ;
PluginTree tree = PluginTree.getInstance() ;
try{
for(PluginImpl plugin : list){... | 3 |
public void run() {
@SuppressWarnings("unused")
int fps = 0, updates = 0;
long fpsTimer = System.currentTimeMillis();
double nsPerUpdate = 1000000000.0 / 60;
// last update time in nano
double then = System.nanoTime();
double unprocessed = 0;
while(running){
boolean shouldRender = false;
double... | 5 |
private static EnumOS2 getOs()
{
String var0 = System.getProperty("os.name").toLowerCase();
return var0.contains("win") ? EnumOS2.windows : (var0.contains("mac") ? EnumOS2.macos : (var0.contains("solaris") ? EnumOS2.solaris : (var0.contains("sunos") ? EnumOS2.solaris : (var0.contains("linux") ? Enum... | 6 |
@Test
public void testBytelArrayRead() throws Exception{
final byte[] input = new byte[10 * BYTES_PER_MB];
final byte[] output = new byte[input.length];
final byte[] expected = new byte[input.length];
Arrays.fill(expected, (byte)0);
new Random().nextBytes(input);
fina... | 0 |
public void checkUserInput() {
ControlLoading controlLoad = new ControlLoading(mySpringies, myBoardSetup);
if(mySpringies.getKey(JGEngine.KeyUp)){
ControlWallOut wallOut = new ControlWallOut(mySpringies, myBoardSetup, myEnvForces);
wallOut.moveWall();
}
if(mySpringies.getKey(JGEngine.KeyDown)){
Con... | 4 |
public void renderGameObj(int xp, int yp, Sprite s){
if(s == null) return;
for (int y = 0; y < s.H; y++) {
int ya = y + yp;
for (int x = 0; x < s.W; x++) {
int xa = x + xp;
if (xa < 0 - s.W || xa >= width || ya < 0 || ya >= height) {
... | 9 |
public boolean isAdmin() {
for( String s : roles ) {
if( s.equals(UserRole.ADMIN.getTag()) ) {
return true;
}
}
return false;
} | 2 |
public String getRequest_WithoutSession(String request, String uri) {
HttpURLConnection connection = null;
BufferedReader rd = null;
StringBuilder sb = null;
String line = null;
try {
java.net.URL URL = new java.net.URL(uri);
//Set up the initial conn... | 4 |
static void testValidity(Object o) throws JSONException {
if (o != null) {
if (o instanceof Double) {
if (((Double) o).isInfinite() || ((Double) o).isNaN()) {
throw new JSONException(
"JSON does not allow non-finite numbers.");
... | 7 |
@Override
public StringBuffer getOOXML( String catAxisId, String valAxisId, String serAxisId )
{
StringBuffer cooxml = new StringBuffer();
// chart type: contains chart options and series data
cooxml.append( "<c:barChart>" );
cooxml.append( "\r\n" );
cooxml.append( "<c:barDir val=\"col\"/>" );
cooxml.app... | 6 |
public void mousePressed(MouseEvent event) {
State s = getDrawer().stateAtPoint(event.getPoint());
if (s != null) {
controller.stateCollapse(s);
}
} | 1 |
private void processNonRedirectQueryResult(URL query) throws IOException, ParserConfigurationException, SAXException, XPathExpressionException {
incrementAutoFlushCounter();
URLConnection wikiConnection = query.openConnection();
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
DocumentBuil... | 9 |
private void onHeartbeat(long timeout) {
if (this.pingTimeoutTimer != null) {
pingTimeoutTimer.cancel(true);
}
if (timeout <= 0) {
timeout = this.pingInterval + this.pingTimeout;
}
final Socket self = this;
this.pingTimeoutTimer = this.heartbeatS... | 3 |
public void listMenu()
{
do
{
System.out.println();
System.out.println("---------------------------");
System.out.println("1. All students");
System.out.println("2. A given major");
System.out.println("3. GPA above a certain value");
System.out.println("4. GPA below a certain value");
System.o... | 6 |
private void getActivities() {
String[] temp = manager.getActivityNames();
activityNames = new String[temp.length + 1];
activityNames[0] = "<New>";
for (int i = 0; i < temp.length; ++i) {
activityNames[i + 1] = temp[i];
}
if (activityList != null) {
... | 4 |
public static ArrayList<ArrayList<String>> getuserlist(PrintStream os) throws SQLException
{
String sql="select FName,LName,GPA,UserID,Password from Table2";
String sql2="select UserID from Table2";
ArrayList<ArrayList<String>> feedback = new ArrayList<ArrayList<String>>();
ArrayList<String> feed = null;
Re... | 5 |
public void update() {
if (delay == -1) {
return;
}
final long elapsed = (System.nanoTime() - startTime) / 1000000;
if (elapsed > delay) {
currentFrame++;
startTime = System.nanoTime();
}
if (currentFrame == frames.length) {
currentFrame = 0;
playedOnce = true;
}
} | 3 |
public static void main(String[] args) throws IOException {
StreamTokenizer st = new StreamTokenizer(new BufferedReader(
new InputStreamReader(System.in)));
while (st.nextToken() != StreamTokenizer.TT_EOF) {
int m = (int) st.nval;
st.nextToken();
int n = (int) st.nval;
LinkedList<Integer> list1 = ne... | 8 |
boolean isLeepYear(int year) {
if (year % 400 == 0) {
return false;
} else if (year % 100 == 0) {
return true;
} else if (year % 4 == 0) {
return true;
}
return false;
} | 3 |
@Override
public boolean equals(Object obj) {
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final EntityPosition other = (EntityPosition) obj;
if (Double.doubleToLongBits(this.x) != Double.doubleToLongBi... | 7 |
public List<EntidadBancaria> findByNombre(String nombre) {
try{
List<EntidadBancaria> listaEntidades;
listaEntidades = new ArrayList();
String selectEntidades = "SELECT * FROM entidadbancaria WHERE nombre LIKE ?";
EntidadBancaria entidadBancaria;
Connection connecti... | 2 |
public void close(){
this.vue.setVisible(false);
} | 0 |
public static void main(String argv[]) {
System.out.println("command line args: (" + argv.length + ")");
for (int i = 0; i < argv.length; i++) {
System.out.println(" argv[" + i + "]: " + argv[i]);
}
System.out.println();
System.out.println("old (built in) default init args:");
String[] defaultInitArgs... | 7 |
private Object[] scanBlockScalarIndicators () {
boolean chomping = false;
int increment = -1;
char ch = peek();
if (ch == '-' || ch == '+') {
chomping = ch == '+';
forward();
ch = peek();
if (Character.isDigit(ch)) {
increment = Integer.parseInt(("" + ch));
if (increment == 0)
throw new... | 9 |
public byte[] code() {
if (code != null) {
return code.code();
}
return new byte[0];
} | 1 |
public static void main(String[] args) {
int[] data = {10, 20, 150, 40, 2};
for (int barrier = 0; barrier < data.length-1; barrier++) {
for (int index = data.length - 1; index > barrier; index--) {
if (data[index] < data[index - 1]) {
swap (data, index);
... | 3 |
public String getNick() { return Nick; } | 0 |
public BitmapPixelPerfectMask(IBitmap bitmap, float pTextureX, float pTextureY,
float pTextureWidth, float pTextureHeight, int pAlphaThreshold) {
final int bitmaskWidth = (int) pTextureWidth;
final int bitmaskHeight = (int) pTextureHeight;
int X = (int) pTextureX;
int Y = (int) pTextureY;
if(pAlphaThresh... | 4 |
public void writeDataMap(String fileName, int nrecords, int setMod, int range, int seed, HashMap<String, String> binMap){
File file = new File(fileName);
// if file doesnt exists, then create it
try {
if (!file.exists()) {
file.createNewFile();
}
Writer bw = new BufferedWriter(new OutputStreamWrit... | 9 |
private void jButtonPlayActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonPlayActionPerformed
this.setVisible(false);
String name = this.game_name;
Game game_frame = null;
try {
game_frame = new Game(name, PlayerMode.fromOrdinal(jSliderPlayerMode.getValue()), Co... | 6 |
private Cluster beginTopDown() {
Cluster rootCluster = new Cluster();
for (int i = 0; i < this.instances.numInstances(); i++){
rootCluster.addInstance(this.instances.instance(i));
}
return rootCluster;
} | 1 |
public CtClass getCtClass() {
CtClass clazz = component.getCtClass();
if (clazz == null)
return null;
ClassPool pool = clazz.getClassPool();
if (pool == null)
pool = ClassPool.getDefault();
String name = arrayName(clazz.getName(), dims);
try {
... | 3 |
private String rankAsString() {
if (rank.getValue() < 10)
return Integer.toString(rank.getValue());
if (rank.getValue() == 10)
return "T";
if (rank.getValue() == 11)
return "J";
if (rank.getValue() == 12)
return "Q";
if (rank.getValue() == 13)
return "K";
return "A";
} | 5 |
@Override
public Double deposit(String id, Double in) {
if(id == null || "".equals(id.trim()) || in < 0) {
return -1.0;
}
for(Account a : accounts) {
if(id.equals(a.getId())) {
a.setBalance(a.getBalance()+in);
System.out.println("Deposi... | 5 |
@Override
public List<Integer> save(List<Tour> beans, GenericSaveQuery saveGeneric, Connection conn) throws DaoQueryException {
try {
return saveGeneric.sendQuery(SAVE_QUERY, conn, Params.fill(beans, (Tour bean) -> {
Object[] objects = new Object[7];
objects[0] = ... | 1 |
@Test
public void WhenUpdatingCollection_ExpectContainedSizeChange()
throws UnknownHostException {
int tableLevel = localhost_.getHostPath().length();
RoutingTable table = new RoutingTable();
table.setLocalhost(localhost_);
Assert.assertTrue(table.levelNumber() == tableLe... | 3 |
public int getEmptyNum() {
int num = 0;
for(ParkBoy boy : this.parkBoyList) {
num += boy.getEmptyNum();
}
if(this.park != null) {
num += this.park.getEmptyNum();
}
return num;
} | 2 |
public static Operator getBuiltinOperator(final char symbol, final int numArguments) {
switch(symbol) {
case '+':
if (numArguments != 1) {
return builtinOperators[INDEX_ADDITION];
}else{
return builtinOperators[INDEX_UNARYPLUS];... | 8 |
protected void unplayAllByThis(MOB mob, MOB invoker)
{
if(mob!=null)
{
for(int a=mob.numEffects()-1;a>=0;a--)
{
final Ability A=mob.fetchEffect(a);
if((A instanceof Play)
&&(!A.ID().equals(ID()))
&&((invoker==null)||(A.invoker()==null)||(A.invoker()==invoker)))
((Play)A).unplayMe(mob,inv... | 7 |
@Override
public void getFromWeb(URL getFileFrom, Callback<String> callback)
{
InputStream inputStream = null;
StringBuilder stringBuilder = new StringBuilder();
try
{
inputStream = getFileFrom.openStream();
InputStreamReader bufferedInputStream = new Inpu... | 4 |
@Override
public void removeAllRecords()
{
// this.setSheetRecs();
XLSRecord[] rx = new XLSRecord[SheetRecs.size()];
SheetRecs.toArray( rx );
for( int t = 0; t < rx.length; t++ )
{
int opcode = rx[t].getOpcode(); // Handle continues masking mso's
if( (opcode != MSODRAWING) && !((opcode == CONTINUE... | 5 |
public Version(final String version) {
this.original = version;
if (version == null) {
this.major = null;
this.minor = null;
this.revision = null;
this.type = null;
this.build = null;
return;
}
final Matcher m = Pa... | 3 |
private void sendAsFixedLength(OutputStream outputStream, int pending) throws IOException {
if (requestMethod != Method.HEAD && data != null) {
int BUFFER_SIZE = 16 * 1024;
byte[] buff = new byte[BUFFER_SIZE];
while (pending > 0) {
int read... | 5 |
public int getLastID(String table, String nameID){
int n = 0;
try {
con = DriverManager.getConnection(url, user, password);
Statement stmt;
stmt = con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,
ResultSet.CONCUR_READ_ONLY);
ResultSet rs = stmt.executeQuery("select * from " + table + " order ... | 4 |
protected void fireClientConnect(ConnectOnServerEvent evt) {
Object object = evt.getClientConnection();
if (!(object instanceof ISocketServerConnection)) {
throw new IllegalArgumentException("fireClientConnect: ClientConnection is not instance of ISocketServerConnection");
}
ISocketServerConnectio... | 1 |
@Override
public long startEvolution(long cycleLimit) {
int cycle = 0;
boolean finalForm = false;
List <E>newList = null;
A : while(cycle < cycleLimit && finalForm == false){
//calculate fitness values
for(E c : candidates){
c.setFitness(c.fitness(problemSet));
}
Collections.sort(candidates)... | 8 |
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException{
response.setContentType("text/html");
String action = request.getParameter("action");
log.info("*** Action is "+action);
if(action.equals("Save") || action.equals("Update")){
PatientMana... | 6 |
public static void main(String[] args) {
// read picture
File file = new File("pf.png");
File fileSmall = new File("pf-small.png");
DataInputStream fis;
byte[] pic = new byte[(int) file.length()];
try {
fis = new DataInputStream(new FileInputStream(file));
fis.readFully(pic);
} catch (IOException e)... | 3 |
* @return
* @see addArrayFormula
*/
public Object getArrayFormulaParent( int[] rc )
{
Iterator<String> i = arrFormulaLocs.keySet().iterator();
while( i.hasNext() )
{
String addr = i.next();
int[] arrayRC = ExcelTools.getRangeRowCol( arrFormulaLocs.get( addr ) );
if( (rc[1] >= arrayRC[1]) && (rc[1] ... | 5 |
public String getType()
{
return TYPE;
} | 0 |
@SuppressWarnings("unused")
public BinaryNode getSuccessor()
{
if(hasChildren()){
if(getLeft() == null && getRight() != null)
return getRight();
else if(getLeft() != null && getRight() == null)
return getLeft();
else // the two children case
return getRight().getLeftmostNode();
... | 5 |
public void updContactPort(InetAddress iaIn, int iPort)
{
InetAddress iaTmp = this.normalizeAddressIfLocal(iaIn);
int iIdx = this.idxContact(iaTmp);
if (iIdx > -1)
{
try
{
EzimContact ecTmp = this.getElementAt(iIdx);
if (ecTmp != null && ecTmp.getAddress().equals(iaTmp))
{
ecTmp.setPor... | 4 |
public void createScene(int screenHeight, int screenWidth, GLAutoDrawable drawable, Cell[][] cells, ArrayList<Passenger> passengers) throws IOException {
rowCount = cells.length;
columnCount = cells[0].length;
float chairWidthBoundarySize = 2.f / (float) rowCount;
float chairHeightBound... | 5 |
public void dropItem(int droppedItem, int slot) {
// misc.printlnTag("droppeditem ["+playerItems[slot]+"] which is ["+(droppedItem+1)+"]");
if(playerItemsN[slot] != 0 && droppedItem != -1 && playerItems[slot] == droppedItem+1) {
ItemHandler.addItem(playerItems[slot]-1, absX, absY, playerItemsN[slot], playerId, fa... | 3 |
public static double wrapTheta(double theta) {
while (theta < 0) {
theta = theta + (2 * Math.PI);
}
while (theta > 2 * Math.PI) {
theta = theta - (2 * Math.PI);
}
return theta;
} | 2 |
private JButton getJButton1() {
if (jButton1 == null) {
jButton1 = new JButton();
jButton1.setText("UPDATE");
jButton1.addMouseListener(new MouseAdapter() {
public void mouseClicked(MouseEvent event) {
jButton1MouseMouseClicked(event);
}
});
}
return jButton1;
} | 1 |
public void setDirect(String DATA, String ADDR) {
DATA = (DATA.length()!=20) ? String.format("%0"+ (20-DATA.length())+ "d", 0)+ DATA : DATA;
String BankNumber="";
int OffSet;
BankNumber = ADDR.substring(ADDR.length()-3, ADDR.length());
OffSet = Integer.parse... | 9 |
@Override
public String getStat(String code)
{
if(CMLib.coffeeMaker().getGenItemCodeNum(code)>=0)
return CMLib.coffeeMaker().getGenItemStat(this,code);
switch(getCodeNum(code))
{
case 0:
return "" + powerCapacity();
case 1:
return "" + activated();
case 2:
return "" + powerRemaining();
case ... | 7 |
public CharacterClass intersect(CharacterClass cc) {
CharacterClass i = new CharacterClass();
int p2 = 0;
for (int p1 = 0; p1 < size / 2; ++p1) {
int f1 = ranges[p1 * 2];
int t1 = ranges[p1 * 2 + 1];
while (true) {
if (p2 >= cc.size / 2) {
return i; // done
}
int f2 = cc.r... | 8 |
public static void parser(String s,CmdFactory cmdFactory) throws CmdException{
try {
if(s.trim().indexOf("#")==0){
}
else
if (s.trim().indexOf(' ')>0 && cmdFactory.getCmd().containsKey(s.trim().toLowerCase().substring(0,s.trim().indexOf(' '))))
... | 5 |
private HttpResponse buildHttpResponse(HttpURLConnection conn, byte[] bytes) {
try {
if (conn.getHeaderFields() != null) {
Map<String, List<String>> headers = new HashMap<String, List<String>>(conn.getHeaderFields());
logger.d("Http response headers:", headers);
... | 5 |
public boolean intersectsX(Rectangular other)
{
if (this.isEmpty() || other.isEmpty())
return false;
else
return !(other.x1 > x2 || other.x2 < x1);
} | 3 |
public ArrayList<Double> getSeparateCosts()
{
ArrayList<Double> costs = new ArrayList<Double>();
for (Edge edge : edges)
costs.add(edge.getCost());
return costs;
} | 1 |
public void windowOpened(WindowEvent e)
{
System.out.println("Open My Frame 2 ");
} | 0 |
@Override
public void paintComponent(Graphics g) {
((Graphics2D) g).setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
if (autoResize) {
boolean preserveAlpha = false;
float imageWidth = image.getWidth();
float imageHeight = image.getHeight();
float maxWidth = getWi... | 5 |
public static ModelCommand getCommand(String commandName) {
for (Iterator<ModelCommand> iterator = commands.iterator(); iterator.hasNext();) {
ModelCommand command = iterator.next();
if (commandName.equals(command.getCommand())) {
return command;
}
... | 2 |
public void creaMatriz(int ren, int col, double valdefault, String tipo) {
if (tipo.equals(ManejadorMatrizXML.REGULAR)) {
mat = new double[ren * col];
} else if (tipo.equals(ManejadorMatrizXML.TRIID)
|| tipo.equals(ManejadorMatrizXML.TRISD)
|| tipo.equals(ManejadorMatrizXML.... | 6 |
public void draw() {
super.draw();
for(UIElement e : uiElements) {
e.draw();
}
if(pointer != null) {
pointer.draw();
}
} | 2 |
public static void readCards(String fn){
if(verbose)
System.out.println("Reading card list from file "+fn);
try{
Scanner in = new Scanner(new File(fn));
while(in.hasNext()){
LegalCards.add(in.nextLine());
}
}catch(Exception e){
System.out.println(e);
}
} | 3 |
public String nextToken() throws JSONException {
char c;
char q;
StringBuffer sb = new StringBuffer();
do {
c = next();
} while (Character.isWhitespace(c));
if (c == '"' || c == '\'') {
q = c;
for (;;) {
c = next();
... | 9 |
public void onKeyTyped(char c, int i)
{
for(Gui sub : this.subs)
sub.onKeyTyped(c, i);
if(this.focused != -1)
{
switch(i)
{
case KeyEvent.VK_UP:
this.subs.get(this.focused).isFocused = false;
this.focused--;
break;
case KeyEvent.VK_DOWN:
this.subs.get(this.focused).isFocused ... | 7 |
private boolean read() {
try {
final URLConnection conn = this.url.openConnection();
conn.setConnectTimeout(5000);
if (this.apiKey != null) {
conn.addRequestProperty("X-API-Key", this.apiKey);
}
conn.addRequestProperty("User-Agent", "U... | 4 |
private void btnOpenDirectoryActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnOpenDirectoryActionPerformed
// TODO add your handling code here:
if (evt.getSource() == this.btnOpenDirectory) {
int returnVal = fc.showOpenDialog(FileDestinationChooser.this);
i... | 3 |
public boolean interact(Level level, int xt, int yt, Player player, Item item, int attackDir) {
if (item instanceof ToolItem) {
ToolItem tool = (ToolItem) item;
if (tool.type == ToolType.pickaxe && tool.level == 4) {
if (player.payStamina(4 - tool.level)) {
hurt(level, xt, yt, random.nextInt(10) + (too... | 4 |
public static void isTrue(boolean condition, String message)
throws IllegalArgumentException
{
if(!condition)
{
throw new IllegalArgumentException(message);
}
} | 1 |
private void save(Script[] mainScripts, String file) throws IOException
{
// for (Script script : endScripts)
// add(this.allScripts, script);
// Collections.reverse(this.allScripts);
// for (Script script : this.allScripts)
// this.used.put(script, false);
// for (Script script : this.allScripts)
// ... | 7 |
private int asrL(int dest, int n) {
clearFlags(SR_N, SR_Z, SR_V, SR_C);
boolean hibitSet = msbSetL(dest);
boolean hasOverflow = false;
int result = dest;
boolean msbSet;
for (int i = 0; i < n; i++) {
msbSet = msbSetL(result);
if (msbSet) setFlags(SR_X, SR_C);
else clearFlags(SR... | 9 |
public void stop() {
if (this.cPointer == 0) {
throw new ClosedException();
}
final int r = ppaml_phase_stop(this.cPointer);
switch (r) {
case 0:
break;
case 1:
throw new ClockAcquisitionException();
case 2:
throw ne... | 4 |
@Override
public String[] getHelp() {
return new String[]{
"ttp dump [-command/-player/-plugin] [username] [page]",
"Shows the data for a particular field"
};
} | 0 |
private void descendreNoeudUnCran(NoeudArbre<E> noeud) throws Exercice1Exception {
// père du noeud
NoeudArbre<E> p = noeud.pere;
// fils droit du noeud
NoeudArbre<E> d = noeud.filsDroit;
// fils gauche du noeud
NoeudArbre<E> g = noeud.filsGauche;
// noeud tempora... | 6 |
public void createEdgesForThisGraph()
{
Node focus = null;
//==== here we save the node that is the parent/focus paper
//==== there will be only one expanded node when creating a graph
for (Node node:graph)
{
if (node.getAttribute("ui.class").equals("EXPANDED"))
... | 5 |
Subsets and Splits
SQL Console for giganticode/java-cmpx-v1
The query retrieves a limited number of text entries within a specific length range, providing basic filtering but minimal analytical insight.