text stringlengths 14 410k | label int32 0 9 |
|---|---|
private Map<Position, Tile> initGrid() {
HashMap<Position, Tile> map = new HashMap<Position, Tile>();
// first, fill all with empty
for(int i = 0; i < this.sizeX; i++) {
for(int j = 0; j < this.sizeY; j++) {
map.put(new Position(i, j), new Empty(i, j));
}
}
// central wall
for(int i = this.cent... | 9 |
public static boolean isBlank(CharSequence cs) {
if (null == cs)
return true;
int length = cs.length();
for (int i = 0; i < length; i++) {
if (!(Character.isWhitespace(cs.charAt(i))))
return false;
}
return true;
} | 3 |
public static synchronized void setCodec( String extension,
Class iCodecClass )
throws SoundSystemException
{
if( extension == null )
throw new SoundSystemException( "Parameter 'extension' null in ... | 7 |
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Person2 person2 = (Person2) o;
if (age != person2.age) return false;
if (!name.equals(person2.name)) return false;
return true;
} | 5 |
public void mouseExited(MouseEvent e) {} | 0 |
public boolean executeCommand(CommandSender sender, Command command, String label, String[] args)
{
if (command.getName().equalsIgnoreCase("locationalcrafting")) {
if (args.length == 0) {
// no arguments
} else {
if (args.length == 1 && args[0].equalsIgnoreCase("reload")) { // reloads config
if ... | 6 |
public static void copiaArquivo(File source, File destination) throws IOException {
if (destination.exists())
destination.delete();
FileChannel sourceChannel = null;
FileChannel destinationChannel = null;
try {
sou... | 5 |
public String getRole() {
return role;
} | 0 |
public BoolExpr add_sorted_theorem(Context ctx, HashMap<String, Expr> symbolTable) throws Z3Exception{
// a, begin, end
Expr a = this.a_inputs.get(0).to_smt(ctx, symbolTable );
Expr a_begin = this.a_inputs.get(1).to_smt(ctx, symbolTable );
Expr a_end = this.a_inputs.get(2).to_smt(ctx, symbolTable );
... | 8 |
public SyrianGraph(String filename) throws IOException {
super(new ArrayList<SyrianVertex>(), new ArrayList<SyrianEdge>());
System.out.println("Reading File: " + filename);
String contents = Utils.readFile(filename);
System.out.println("Contents: " + contents);
Scanner sc = new Scanner(contents);
while (s... | 8 |
private short[][] createNewSelection(int nx, int ny)
{
int cx = nx - asx, cy = ny - asy;
short[][] newsel = new short[getTilesWide()][getTilesHigh()];
for (int x = 0; x < getTilesWide(); x++)
for (int y = 0; y < getTilesHigh(); y++)
newsel[x][y] = -1;
for... | 8 |
private String paragraphToString(AbstractComponent component)
throws BookException {
StringBuilder sb = new StringBuilder();
try {
Iterator<AbstractComponent> iterator = component.getIterator();
while (iterator.hasNext()) {
AbstractComponent c = iterator.next();
if (c.getType() == EComponentType.SE... | 3 |
private void onModListCheck(NetClientHandler net, PacketModList packet)
{
if (DEBUG)
{
System.out.println("S->C: " + packet.toString(true));
}
ForgeHooks.networkMods.clear();
NetworkMod[] mods = MinecraftForge.getNetworkMods();
for (NetworkMod mod : mods)... | 9 |
public void actionPerformed(ActionEvent e) {
if (e.getSource()==agregarMaterial){
if (materialesComboBox.getSelectedItem()!= null && Controlador.getControlador().existeMaterial(materialesComboBox.getSelectedItem().toString())){
if(!contieneA(itemMateriales,materialesComboBox.getSelectedItem().toString())){
... | 8 |
public void actionPerformed(ActionEvent e) {
if(e.getSource() == readRow){
int temp[] = new int[7];
for(int i = 0; i < 7; i++){
temp[i] = Integer.parseInt(arrRow[i].getText());
}
controller.storeRow(temp);
}
if(e.getSource() == writeRow){
controller.writeRow();
updateArray();
}
if(... | 8 |
public byte[] getHash() {
StringBuilder sb = new StringBuilder();
Iterator<String> it = stations.iterator();
while(it.hasNext()){
sb.append(it.next() + "\n");
}
sb.append(stations.size());
return hu.digest(sb.toString().getBytes());
} | 1 |
@OnLoad
public void onLoad() {
super.onLoad();
TeamModel teamHome = DataStore.getTeam(getSched_home_team_id());
if(teamHome!=null) this.sched_home_team = teamHome;
TeamModel teamAway = DataStore.getTeam(getSched_away_team_id());
if(teamAway!=null) this.sched_away_team = teamAway;
ResultScoreModel resultSco... | 3 |
@Override
public List<String> splitCodeLine(String line) {
Scanner sc;
Pattern delimiterPattern = Pattern.compile("[\\,]?[\\s]+"); //splits a String on one or more white spaces, or a comma
//followed by a whitespace -> this separates each line of assembly code into bits for processing into instructions.
Lis... | 2 |
@Override
public void redo() {
JoeTree tree = parent.getTree();
// Remove node from visible nodes cache
tree.removeNode(oldNode);
// Swap the nodes
parent.removeChild(oldNode, index);
if (newNode != null) {
parent.insertChild(newNode, index);
// Insert the node into the visible nodes cac... | 1 |
private ArrayList algorithm1(String S, String T) {
ArrayList candidateList = new ArrayList();
int bound = (int) (1.0 / tr);
for (int t = 0; t < S.length(); t++) {
char chT = S.charAt(t);
double lastTr = -1;
for (int u = Math.max(0, t - bound), flag = 0;
u < Math.min(t + bound + ... | 9 |
public IllegalOrphanException(List<String> messages) {
super((messages != null && messages.size() > 0 ? messages.get(0) : null));
if (messages == null) {
this.messages = new ArrayList<String>();
}
else {
this.messages = messages;
}
} | 3 |
public List<Request> getAllBlocksLeft(){
//count blocks.
if(complete){return null;}
List<Request> list =new ArrayList<Request>();
SubPiece last=null;
//TODO: simplify? bit incomprehensible
int i = 0;
Iterator<SubPiece> itor = data.iterator();
while (itor.hasNext()) {
SubPiece sp = itor.next();
if... | 8 |
public void renderStationaryEntity(StaticEntity entity){
Camera camera = raycaster.getCamera();
Screen screen = raycaster.getBuffer();
double x0 = 0, x1 = 1;
double[] rot1 = Geometry.rotatePoint(entity.getX1(), entity.getZ1(), camera.getX(), camera.getZ(), this.sin, this.cos);
... | 8 |
public int doLogin() throws Exception
{
PreparedStatement psDoLogin;
PreparedStatement psDetermineUser;
ResultSet rsDoLogin = null;
ResultSet rsDetermineUser = null;
String sqlDoLogin = null;
int isLoginValidate = 0;
Connection conn = ConnectionUtils.getConnection();
... | 8 |
@Test
public void testArea_Body() {
System.out.println("geArea_Body");
assertEquals(6.0, new Cylinder(3,2,2.8).getArea_Body(), 0.00001);
} | 0 |
Alternating(Model model, ArrayList<Agent> _agents, Intersection[][] intersection, AnimatorBuilder builder) {
int rows = MP.getRows();
int columns = MP.getColumns();
boolean westToEast = false;
boolean isStreet = true;
for (int i = 0; i < rows; i++) {
CarHandlerList street = new CarHandlerList... | 8 |
public int count(Item item) {
if (item instanceof ResourceItem) {
ResourceItem ri = findResource(((ResourceItem)item).resource);
if (ri!=null) return ri.count;
} else {
int count = 0;
for (int i=0; i<items.size(); i++) {
if (items.get(i).matches(item)) count++;
}
return count;
}
return 0;
... | 4 |
protected void initDefinition(Method method) throws DaoGenerateException {
checkBeforeParse(method);
// 解析方法参数
Class<?>[] paramTypes = method.getParameterTypes();
Annotation[][] annotations = method.getParameterAnnotations();
Map<String, Integer> paramIndexes = new HashMap<String, Integer>(8, 1f);
Map<Stri... | 1 |
@Override
public void windowActivated(WindowEvent e)
{
} | 0 |
@Override
public void executeMsg(final Environmental myHost, final CMMsg msg)
{
super.executeMsg(myHost,msg);
if((affected!=null)
&&(affected instanceof MOB)
&&(msg.amISource((MOB)affected)||msg.amISource(((MOB)affected).amFollowing())||(msg.source()==invoker()))
&&(msg.sourceMinor()==CMMsg.TYP_QUIT))
{
... | 7 |
public static Format_Code fromInt( int val ){
switch ( val ) {
case 0x0001 : return WAVE_FORMAT_PCM;
case 0x0003 : return WAVE_FORMAT_IEEE_FLOAT;
case 0x0006 : return WAVE_FORMAT_ALAW;
case 0x0007 : return WAVE_FORMAT_MULAW;
cas... | 5 |
@Override
public FiveCardOmahaHiLoWorker build()
{
if (super.getRounds() <= 0) {
throw new IllegalStateException("The number of rounds must be a strictly positive number");
} else if (super.getProfiles() == null || super.getProfiles().size() < 2) {
... | 8 |
static private int jjMoveStringLiteralDfa9_0(long old0, long active0)
{
if (((active0 &= old0)) == 0L)
return jjStartNfa_0(7, old0, 0L);
try { curChar = input_stream.readChar(); }
catch(java.io.IOException e) {
jjStopStringLiteralDfa_0(8, active0, 0L);
return 9;
}
switch(curChar)
{
... | 6 |
@EventHandler
public void EnderDragonRegeneration(EntityDamageByEntityEvent event) {
Entity e = event.getEntity();
Entity damager = event.getDamager();
String world = e.getWorld().getName();
boolean dodged = false;
Random random = new Random();
double randomChance = plugin.getEnderDragonConfig().getDouble(... | 6 |
public static short getShort(byte[] b, int offset) {
if (isBlank(b)) {
throw new IllegalArgumentException("blank byte array.");
}
if (offset < 0) {
throw new IllegalArgumentException("invalid array offset:" + offset + ".");
}
short out = (short) (b[0] < 0 ? -1 : 0);
for (int l = b.length - offset, i =... | 5 |
public static void swap(IntegerStack one,int oneLim,
IntegerStack other,int otherLim) {
// this is used for swapping labels in logical expressions compilation
// usually there are not so many labels to swap... and the element
// by element copy should not incur significant peforman... | 5 |
public void weather()
{
if (hour24 > 6 && hour24 <= 12)
{ nightTime = false;
eveningTime = false;
afternoonTime = false;
morningTime = true;
setTime();
}
if (hour24 > 12 && hour24 <= 18)
{ nightTime = false;
eveningTime = false;
morningTime = false;
afternoonTime = true;
... | 8 |
@Override
public void handleIOException(SharingPeer peer, IOException ioe) {
logger.error("I/O problem occured when reading or writing piece " +
"data for peer " + peer + ": " + ioe.getMessage());
this.stop();
this.setState(ClientState.ERROR);
} | 0 |
static public List<GenericDatabase> populateDatabaseList()
{
List<GenericDatabase> databaseList = new ArrayList<GenericDatabase>();
File databaseDir = new File("Databases");
// if the directory does not exist, create it
if (!databaseDir.exists())
{
System.out.println( "creating Databases Directory" );
... | 6 |
public void genFile()
{
FileWriter baseGen = null;
String eol = System.getProperty("line.separator");
try
{
baseGen = new FileWriter(myInfo.USBGen.getWriteableString()+"RemoteBoot.rcf");
//Build the file header
baseGen.write("Remote Boot Information;" + eol);
//Sets the reset
baseGen.write(">R... | 9 |
@Override
public void setCenterLocation(double x, double y) {
super.setCenterLocation(x, y);
if (!lastLocations.isEmpty()) {
// do some averaving to show some intermediate positions for
// fast-moving object (rifle projectiles)
if (lastLocations.size() > 1) {
double[] c1 = lastLocations.get(lastLocat... | 4 |
public boolean ensureMinimums(int minMaxDS, int minMaxSize, long minMaxTime) {
boolean corrected = false;
if(stdCloseConditions.maxContAnzDS < minMaxDS) {
corrected = true;
stdCloseConditions.maxContAnzDS = minMaxDS;
}
if(stdCloseConditions.maxContSize < minMaxSize) {
corrected = true;
stdCloseCondi... | 7 |
public static void main(String[] args) {
Persoon p1 = new Persoon("Sander", "SchijfStraat 26B", "Teteringen");
Persoon p2 = new Persoon("Jeroen", "SchijfStraat 26B", "Teteringen");
Persoon p3 = new Persoon("Femke", "SchijfStraat 26B", "Teteringen");
ArrayList<Persoon> lijst = new ArrayList<Persoon>();
lijst... | 5 |
final int method2584(int[] is, int i, int i_115_, RasterToolkit[] class105s,
int i_116_, int i_117_, int i_118_, aa var_aa,
int i_119_, int i_120_, int i_121_, int i_122_,
int i_123_, boolean bool, int i_124_, String string) {
try {
if (bool != false)
getWidget(41);
anInt4057++;
return met... | 6 |
private void writeParameters(BufferedWriter writer) throws IOException{
int paramSize = this.configs.size();
for (int i=0; i<paramSize;i++){
int params=this.configs.get(i).size();
if (params==3){
writer.write(this.configs.get(i).get(0)+","+this.configs.get(i).get(1)+","+this.configs.g... | 4 |
private void buildResponse() throws IOException {
switch (request.getMethod()) {
case "GET":
case "POST":
Helper.buildGETorPostResponse(request, response);
break;
case "OPTIONS":
buildOPTIONSResponse();
break;
case "HEAD":
buildHEADResponse();
break;
case "TRACE":
buildTRACEResponse();... | 5 |
private void addRetPhi(final Subroutine sub, final Block block) {
if (phis[cfg.preOrderIndex(block)] != null) {
return;
}
final VarExpr target = (VarExpr) prototype.clone();
final PhiReturnStmt phi = new PhiReturnStmt(target, sub);
phis[cfg.preOrderIndex(block)] = phi;
if (SSA.DEBUG) {
System.out.p... | 2 |
public DisplayMode findFirstCompatibleMode(
DisplayMode modes[])
{
DisplayMode goodModes[] = device.getDisplayModes();
for (int i = 0; i < modes.length; i++) {
for (int j = 0; j < goodModes.length; j++) {
if (displayModesMatch(modes[i], goodModes[j])) {
... | 3 |
public void peek() throws IOException {
if (!cached) {
next();
}
cached = true;
} | 1 |
void initResources() {
final Class<ControlExample> clazz = ControlExample.class;
if (resourceBundle != null) {
try {
if (images == null) {
images = new Image[imageLocations.length];
for (int i = 0; i < imageLocations.length; ++i) {
InputStream sourceStream = clazz.getResourceAsStream(im... | 7 |
public static byte[] decode(String s) {
int end = 0; // end state
if (s.endsWith("=")) {
end++;
}
if (s.endsWith("==")) {
end++;
}
int len = (s.length() + 3) / 4 * 3 - end;
byte[] result = new byte[len];
int dst = 0;
try {
for (int src = 0; src < s.length(); src++) {
int code = charSet.in... | 9 |
public Embed(HtmlMidNode parent, HtmlAttributeToken[] attrs){
super(parent, attrs);
for(HtmlAttributeToken attr:attrs){
String v = attr.getAttrValue();
switch(attr.getAttrName()){
case "height":
height = Height.parse(this, v);
break;
case "src":
src = Src.parse(this, v);
break;
... | 5 |
private static String jovoKijelentoTargyas(Szo szo, SzamSzemely szamSzemely) {
String szoto = szo.getSzo();
if (szoto.endsWith("ni")) {
szoto = szoto.substring(0, szoto.length() - 2);
}
switch (szamSzemely) {
case EGYES_SZAM_ELSO_SZEMELY:
return ... | 7 |
public static void main(String[] args) {
int numberRead = 0;
InputStream readerStream = null;
OutputStream writerStream = null;
// buffers are typically allocated in multiples of 512
byte[] buffer = new byte[512];
if (args.length < 2) {
System.out.println("Usage: java FileCopy inputfile outputfile");
... | 6 |
public AndroidEntryPointCreator getEntryPointCreator() {
return entryPointCreator;
} | 0 |
public void preProcessQuery(String fileName, String outFile, int queryCol,
HashSet<String> prodWords) {
// HashSet for storing all the stop-words
HashSet<String> stopwordsSet = new HashSet<String>();
String stopwordFile = "xbox/stopwords.txt";
FileReader fReader;
BufferedReader bReader;
try {
fReader ... | 3 |
public static void main(String[] args) {
if (args.length < 1) {
System.err.println("Too few arguments.");
System.exit(1);
}
final AttributeSet all = makeAttributeSet(args[0]);
final Collection<FunctionalDependency> fds = new LinkedList<>();
for (int i = 1; i < args.length; ++i) {
String[] parts = a... | 4 |
public static void main(String[] args) throws Exception{
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
StringTokenizer st = new StringTokenizer(br.readLine());
n = Integer.parseInt(st.nextToken());
m = Integer.parseInt(st.nextToken());
s = Long.parseLo... | 9 |
private boolean isValidPawnMove(int sourceRow, int sourceColumn, int targetRow, int targetColumn) {
boolean isValid = false;
if (isTargetLocationFree()) {
if (sourceColumn == targetColumn) {
// same column
if (sourceFigure.getColor() == Figure.COLOR_BLACK) {
... | 9 |
@SuppressWarnings("unchecked")
private void getElementsList() {
try {
List<NetworkHardware> elements;
DataOutputStream dos = new DataOutputStream(socket.getOutputStream());
dos.writeBytes(ServerFrame.getElementsListCmd + "\n");
ObjectInputStream ois = new ObjectInputStream(socket.getInputStrea... | 3 |
public void draw(Graphics g, Display d, int bottomPixelX, int bottomPixelY,
boolean drawHealth) {
double percentMoved = count * 0.25;
// Tile coordinates of The Dude (x,y)
double x, y;
if(attacking == null) {
x = this.oldX + (this.x - this.oldX) * percentMoved;
y = this.oldY + (this.y - this.oldY) ... | 7 |
public Object getjComboBoxChercher() {
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
} | 0 |
@Override
public boolean equals(Object obj) {
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final TDatdslPK other = (TDatdslPK) obj;
if (!Objects.equals(this.transNo, other.transNo)) {
return... | 4 |
public boolean isReject() {
return type == REJECT;
} | 0 |
public void appMng() throws IOException
{
Scanner in = new Scanner(System.in);
System.out.println("-----------------------");
System.out.println("App Management Menu");
System.out.println("1.Create New App");
System.out.println("2.Delete App");
System.out.println("3.Edit ... | 6 |
public Vector getData(String query) throws SQLException
{
Connection connection = null;
Statement statement = null;
ResultSet result = null;
String val = "";
Vector value = new Vector();
try
{
Class.forName(driver);
connection = DriverManager.getConnection(url, username, passwd);
statement = c... | 6 |
@Override
public boolean execute(SimpleTowns plugin, CommandSender sender, String commandLabel, String[] args) {
final Localisation localisation = plugin.getLocalisation();
final Town town;
if (args.length == 0) {
if (sender instanceof Player) {
final Player pla... | 5 |
public void backMove(){
//cofa ostatni ruch
if((boardLog.getPossStart()==null)) return;
if((boardLog.getPossStart()[0]==-1)) return;
if(numbClick==1) {
JOptionPane.showMessageDialog(null, "Nie wykonales ruchu");
return;
}
boardLog.backMove(!site);
if(ai) {
if(aiDest==null) System.out.p... | 8 |
public static void main(String[]args)
{
int n = 0;
int limit = 20;
boolean test = true;
while(test)
{
n++;
for(int i = 1; i <= limit; i++)
{
if(n % i != 0)
{
//System.out.println(n + "%" + i + "=" + n % i);
break;
}
if(i == limit) test = !test;
}
}
System.out.printl... | 4 |
public double funct(double x[]) {
for (int j = 0; j < parameters.length; j++) {
parameters[j] = x[j];
}
//model run
// singleRun();
currentCount++;
//getting rid of pairs which contain missing data values
double[] preArr = prediction;
double[]... | 9 |
public RTT.corba.CSendHandle sendOperation (String operation, org.omg.CORBA.Any[] args) throws RTT.corba.CNoSuchNameException, RTT.corba.CWrongNumbArgException, RTT.corba.CWrongTypeArgException, RTT.corba.CCallInterrupted
{
org.omg.CORBA.portable.InputStream $in = null;
try {
o... | 6 |
public static int eval(double d)
{
if(d<=0.4)
return 0;
if(d<=0.7)
return 1;
if(d<=0.9)
return 2;
else
return 3;
} | 3 |
public static boolean levehetBabuSajat( String mit, int jatekos, int[][] tabla )
{
logger.info("Bábú levétel ellenőrzés.");
int mitS = 0, mitO = 0;
int[] SorOsz = Helyezz.helyMeghataroz( mit );
mitS = SorOsz[0];
mitO = SorOsz[1];
if(mitS == -1 || mitO == -1)
{
System.out.println( "Arra a helyre nem h... | 4 |
public void reset() throws IOException
{
if (! markSupported()){
throw new IOException("not resettable");
}
try{
close();
myInput = new BufferedInputStream(new FileInputStream(myFile));
}
catch (FileNotFoundException fnf){
Syste... | 2 |
public static void findZeros(int[][] matrix)
{
int rows[] = new int[matrix.length];
int columns[] = new int[matrix[0].length];
int pivot = -1;
for(int i=0; i<matrix.length; i++)
{
for(int j=0; j<matrix[0].length; j++)
{
if(matrix[i][j]==0)
{
rows[i]=pivot;
columns[j]=pivot;
... | 7 |
public void init() {
io = Hashtags.getIOManager();
configFile = new File(plugin.getDataFolder(), "config.yml");
config = plugin.getConfig();
if (!configFile.exists()){
io.sendConsole("Creating config.yml...", true);
try {
configFile.createNewFile();
updateConfig();
io.sendConsole("config... | 9 |
public AABB expand(float x, float y, float z) {
float var4 = maxX;
float var5 = maxY;
float var6 = maxZ;
float var7 = minX;
float var8 = minY;
float var9 = minZ;
if (x < 0F) {
var4 += x;
}
if (x > 0F) {
var7 += x;
}... | 6 |
private void markFocusedCell(Event event, ViewerCell cell) {
Color background = (cell.getControl().isFocusControl()) ? getSelectedCellBackgroundColor(cell)
: getSelectedCellBackgroundColorNoFocus(cell);
Color foreground = (cell.getControl().isFocusControl()) ? getSelectedCellForegroundColor(cell)
: getSelec... | 9 |
public List<List<Object>> calculateGreedyMostPopularKMer() {
List<List<Object>> mostProbableKMer = new ArrayList<List<Object>>();
List<String> allKMers = getAllKMers();
double highestProbability = -1;
greedyLetterSplit(matrixList);
for (String s : allKMers) {
double... | 3 |
public void titleOptions() {
if(Keybinds.CANCEL.clicked() || Keybinds.CONFIRM.clicked()) {
titleMenuType = TitleMenuType.TITLE;
buildTitleMenu();
}
} | 2 |
public static void readFile() {
// use a bufferedReader to read the transactions into the queue
BufferedReader br;
try {
br = new BufferedReader(new FileReader("assign4/" + filename));
String line;
while ((line = br.readLine()) != null) {
int[] transData = new int[NUM_DATA];
StringTokenizer st ... | 7 |
public SearchBar(String defaultText, String tooltip, final Component defaultComponent) {
this.defaultText = defaultText;
this.searchPanel = new CQueryField();
this.searchBar = this.searchPanel.getQueryField();
searchBar.setToolTipText(tooltip);
searchBar.setColumns(12);
... | 9 |
@Override
public List<String> onTabComplete(CommandSender sender, Command command,
String alias, String[] args) {
if (args.length == 1) {
List<String> matches = new ArrayList<String>();
for (String subcommand : subcommands) {
if (StringUtil.startsWithIgnor... | 6 |
public void run() {
ArrayList<Integer> primes = new ArrayList<Integer>();
for (int i=start;i<=stop;i+=2){
if (isPrime(i))
primes.add(i);
if (lead)
System.out.println(i+"/" + stop);
}
try {
PrintWriter print = new PrintWriter(new File(file));
for(int i=0;i<primes.size();i++... | 5 |
protected boolean isPrimitiveWrapper(Object input) {
return input instanceof Integer || input instanceof Boolean ||
input instanceof Character || input instanceof Byte ||
input instanceof Short || input instanceof Double ||
input instanceof Long || input instanceo... | 7 |
public static void main(String[] args){
ParallelPort lpt1 = new ParallelPort(0x378);
Boolean ligado = false;
Boolean butCarregado = false;
// Input
System.out.println("\nSair!!(Ctrl-Z)");
while(true){
if(lpt1.read() != 63 && butCarregado == true){
if(ligado){
// Liga o Led
lpt1.write(1);... | 6 |
public static void main(String[] args) {
if (args.length != 1) {
System.err.println("Uso: java MatrizPolinomio <archivo>");
System.exit(1);
}
try {
LectorMatrizXML lector = new LectorMatrizXML(args[0]);
int i;
System.out.println("Default " + lector.getDef... | 7 |
public void saveItems()
{
for (int i = 0; i < items.size(); i++)
{
TimerPreferences.getInstance().putTime("item" + i, items.get(i));
}
} | 1 |
public static void main(String[] args) {
new ChatController();
} | 0 |
public FieldInfo[] getFields() {
if ((status & FIELDS) == 0)
loadInfo(FIELDS);
return fields;
} | 1 |
public int getSentenceCount() throws BookException {
int count = 0;
ArrayList<AbstractComponent> list = getSentenceList(text);
for (AbstractComponent component : list) {
HashMap<AbstractComponent, Integer> map = getWordMap(component,
new HashMap<AbstractComponent, Integer>());
Collection<Integer> freqL... | 4 |
public static void main(String args[]) {
TowerDefenseControllerTest game=new TowerDefenseControllerTest();
game.init();
// Round 1
TowerDefense_TransData data;
// paint data
// Prep
while(true){
timestamp++;
//Look up Bridge
game.checkprepBridge();
data=control.getInfo(clientId, time... | 8 |
private void setUpCollectionMenu() {
ImageButton addFile = new ImageButton(parent, "Add File", 75, 550, 100,
25, 1) {
@Override
public void onMousePress(int x, int y) {
// Adding filePath to audioPathsArray
int result = jfile.showOpenDialog(new JFrame());
if (result == JFileChooser.APPROVE_OPTIO... | 1 |
static void findInRec(int l, int w){
for(int i=0;i<400;i++){
for(int j=0;j<400;j++){
validate(i, j, l, w);
// validate(...);
}
}
} | 2 |
public void draw(Graphics2D g2)
{
Rectangle r = new Rectangle(col*Puzzle.drawSize, row*Puzzle.drawSize, Puzzle.drawSize, Puzzle.drawSize);
g2.setStroke(new BasicStroke(3));
if(!selected)
{ g2.setColor(Color.BLACK); }
else
{ g2.setColor(Puzzle.stateColor); }
... | 4 |
public Vector2f getDir()
{
float x = (int) (goalPosition.x-currentPosition.x);
float y = (int) (goalPosition.y-currentPosition.y);
if(x < 0)
x = -speed;
else if(x > 0)
x = speed;
if(y < 0)
y = -speed;
else if(y > 0)
y = speed;
if(x == 0 && y == 0)
{
if(goalPosition == startPosition)
... | 8 |
private void buscar(){
GestionarCliente gc = new GestionarCliente();
ArrayList<Cliente> cBuscado = gc.buscarCliente(this.buscarPor(), textBuscar.getText());
System.out.println(opcionBusqueda);
if(opcionBusqueda){
buscar.setVisible(true);
buscar.setTitle("Resultado... | 3 |
public void drawSprite2(int i, int j) {
int k = 225;//was parameter
i += anInt1442;
j += anInt1443;
int i1 = i + j * DrawingArea.width;
int j1 = 0;
int k1 = myHeight;
int l1 = myWidth;
int i2 = DrawingArea.width - l1;
int j2 = 0;
if(j < DrawingArea.topY) {
int k2 = DrawingArea.topY - j;
k1 -= ... | 6 |
public void updateRefDisplay()
{
// first clear the main display
clearMainDisplay();
// create headings for the display
String headings = String.format("%-5s%-20s%-6s%-4s%-10s%-4s",
"ID", "Name", "Qual.", "AM", "HL", "VL");
refereeDisplay.append(headings + "\n");
// create break line between headings... | 2 |
@Override
public boolean equals(Object o) {
if (!(o instanceof ThumbsUp)) {
return false;
}
ThumbsUp t = (ThumbsUp) o;
if (this.getAccount().equals(t.getAccount())) {
return false;
}
if (this.getReply().equals(t.getReply())) {
re... | 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.