text stringlengths 14 410k | label int32 0 9 |
|---|---|
public static void main(String[] args) {
try {
for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
if ("Nimbus".equals(info.getName())) {
javax.swing.UIManager.setLookAndFeel(info.getClassName());
... | 3 |
public void saveProgress(boolean overwrite) {
//
// In the case of an overwrite, just save under the current file-
if (overwrite) {
PlayLoop.saveGame(fullSavePath(savesPrefix, CURRENT_SAVE)) ;
return ;
}
//
// If necessary, delete the least recent save.
if (timeStamps.size() >=... | 5 |
public void fetchReplicaUsers()
{
LOGGER.info("Fetching Replicas for : " + orgMap.size() + " Orgs");
if(orgMap!=null && orgMap.size()>0)
{
XLSHandler orgXLS = new XLSHandler();
ArrayList<HashMap<String, String>> replicaData = orgXLS.getExcelRows("C:\\temp\\Replicas.xlsx");
//load users in Org from S... | 8 |
private static void Factor()
{
if( sym == ident )
{
Designator();
if( sym == assign )
{
Scan();
ActPars();
}
else if( sym == lpar )
{
ActPars();
}
}
els... | 8 |
protected void init() {
GridBagLayout layout = new GridBagLayout();
this.setLayout(layout);
nameLabel = new JLabel("Name");
phoneLabel = new JLabel("Phone");
nameField = new JTextField(20);
phoneField = new JTextField(20);
addButton = new JButton("Add");
... | 7 |
public static String strip_vt100(String line)
{
int i;
StringBuffer nline = new StringBuffer();
for(i = 0; i < line.length(); i++) {
while(i < line.length() && line.charAt(i) == vt_esc.charAt(0)) { // Got escape sequence
// OK. All VT100 cmds seems to end either with m or H
while(i < line.length() ... | 7 |
@Override
protected boolean doSecondPhase(String query, Configuration conf, String outputPath, String[] dimensionTables,
String[] filter_table, int numberOfReducer) {
try {
List<String> AllDimensionTalbes = new ArrayList<String>();
AllDimensionTalbes.add(TABLE_CUSTOMER);
AllDimensionTalbes.add(TABLE_DATE... | 5 |
@Override
public void executeMsg(Environmental host, CMMsg msg)
{
super.executeMsg(host,msg);
if((msg.source()==affected)
&&(msg.targetMinor()==CMMsg.TYP_EAT)
&&(msg.target() instanceof Food)
&&(msg.target() instanceof Item))
{
if(((((Item)msg.target()).material()&RawMaterial.MATERIAL_MASK)==RawMateria... | 9 |
@Override
public Class<?> getColumnClass(int columnIndex) {
if (columnIndex == DELIVERY_PACKET_ID) {
return Integer.class;
} else if (columnIndex == MEMBER_NAME) {
return String.class;
} else if (columnIndex == EVENT) {
return String.class;
} else ... | 6 |
@Override
public Object execute(HttpServletRequest request, HttpServletResponse response) throws Exception {
Contexto oContexto = (Contexto) request.getAttribute("contexto");
switch (oContexto.getSearchingFor()) {
case "usuario": {
oContexto.setVista("jsp/usuario/list.jsp... | 3 |
private static boolean backtrack(int[][] maze, Cell end, int y, int x, Deque<Cell> path) {
// GQ!
//if (end.equals(path.peek())) {
if (end.equals(path.peekLast())) {
return true;
}
final int R = maze.length;
final int C = maze[0].length;
for (int i = 0... | 9 |
public boolean canFallthrough() {
return opcode != opc_goto && opcode != opc_goto_w && opcode != opc_ret &&
!(opcode >= opc_ireturn && opcode <= opc_return) && opcode != opc_athrow
&& opcode != opc_jsr && opcode != opc_tableswitch && opcode != opc_lookupswitch;
} | 8 |
public static Filter not( Filter delegate )
{
if ( delegate == null )
{
throw new IllegalArgumentException( "Parameter 'delegate' must be not null" );
}
return new Not( delegate );
} | 1 |
protected void onEntryRemove(Object key, ICacheable data){
} | 0 |
private void maybeShowPopup(MouseEvent e) {
int x = e.getX() / imagemapPanel.zoomFactor;
int y = e.getY() / imagemapPanel.zoomFactor;
if (e.isPopupTrigger()
&& (shapeList.isPointInsideShape(x, y) || shapeList
.isShapePointAt(x, y))) {
menuItem_rempoint.setEnabled(shapeList.getFoundKeyPoint() > ... | 4 |
private Grammar readGrammar(File file) {
Grammar g = new UnboundGrammar();
int lineNum = 0;
try {
BufferedReader reader = new BufferedReader(new FileReader(file));
String line = null;
while ((line = reader.readLine()) != null) {
line = line.trim();
lineNum++;
if (line.length() == 0)
cont... | 9 |
@Override
public String print() {
String numberToReturn = "" + number;
if (((number % number) == 0 ) || number == 0)
numberToReturn = "" + (int) number;
if (number < 0)
return "( " + numberToReturn + " )";
return numberToReturn;
} | 3 |
private void joinChan(String user_name, CommandArgsIterator args_it)
throws IOException
{
if (args_it.hasNext()) {
String chan_arg = args_it.next();
if (!args_it.hasNext() && chan_arg.length() >= 2
&& chan_arg.charAt(0) == '#') {
Strin... | 7 |
public int maxArea(int[] height) {
if (height.length == 0) {
return 0;
}
int result = 0;
int left = 0;
int right = height.length - 1;
while (left < right) {
int lh = height[left];
int rh = height[right];
int temp = (right - left) * Math.min(lh, rh);
if (temp > result) {
result = temp;
... | 8 |
public static void main(String[] args) throws IOException, InterruptedException {
int portNumber = 7777;//Integer.parseInt(args[0]);
ServerSocket serverSocket= new ServerSocket(portNumber);
try {
while (true){
//System.out.println(available.getQueueLength());
So... | 2 |
public boolean merge() throws FileNotFoundException, IOException {
//Select your favourate Jersey No to assign it to the final Index. :)
//Ok we need similarity and we reuse indexreaders for merging so using the same constructor.
int fileNumber = 2;
//Modify here to expand for a distributed index structur... | 7 |
public static SolveMethod getSolveMethod(Scanner scan) {
while (true) {
System.out.print("Choose Right, Left, Middle, or Trapazoid: ");
switch (scan.nextLine().toLowerCase().charAt(0)) {
case 'r':
return SolveMethod.RIGHT;
case 'l':
... | 5 |
public static void main(String[] args) {
SummaryRanges summaryRanges=new SummaryRanges();
summaryRanges.addNum(6);
summaryRanges.addNum(6);
summaryRanges.addNum(0);
summaryRanges.addNum(4);
summaryRanges.addNum(8);
summaryRanges.addNum(7);
summaryRanges.ad... | 0 |
public List<List<Integer>> levelOrder(TreeNode root){
List<List<Integer>> result = new ArrayList<List<Integer>>();
List<TreeNode> levelNode = new ArrayList<TreeNode>();
if(root == null)
return result;
else
levelNode.add(root);
order(result,levelNode);
... | 1 |
private Response dequeueMessage(ByteBuffer buffer) {
int receiverId = buffer.getInt();
int senderId = buffer.getInt();
int queueId = buffer.getInt();
int peekFlag = buffer.getInt();
boolean peek = false;
if (peekFlag == 1) {
peek = true;
}
Mess... | 5 |
public MainGUI(Player p){
this.p = p;
nextSongButton = new GenericButton("Music On"); //The first button.
nextSongButton.setAnchor(WidgetAnchor.CENTER_CENTER); //We are "sticking" it from the center_center, from there we will be shifting.
nextSongButton.setWidth(90).setHeight(20); //Setting the width and height... | 7 |
public boolean addAll(Collection<? extends T> arg0) {
boolean result = false;
for (T object : arg0) {
if (add(object)) {
result = true;
}
}
return result;
} | 3 |
public void addUserToDB() {
try {
String statement = new String("INSERT INTO " + DBTable
+ " (username, password, url, permission, isblocked, isdead, practicenumber, highscorenumber)"
+ " VALUES (?, ?, ?, ?, ?, ?, ?, ?)");
PreparedStatement stmt = DBConnection.con.prepareStatement(statement, new Str... | 1 |
public void removePerson(Person P){
Persons.remove(P);
setCantPerson(CantPerson-1);
} | 0 |
private Token jj_consume_token(int kind) throws ParseException {
Token oldToken;
if ((oldToken = token).next != null) token = token.next;
else token = token.next = token_source.getNextToken();
jj_ntk = -1;
if (token.kind == kind) {
jj_gen++;
if (++jj_gc > 100) {
jj_gc = 0;
... | 6 |
public short getId() {
return id;
} | 0 |
public void run() {
int[] route = new int[salesman.n];
minRoute = new int[salesman.n];
minCosts = -1;
count = 0;
route[0] = 0;//first city always zero
for(int i = 1;i < salesman.n;i++){
route[1] = i;
checkRoute(route,2);
}
System.out.println("Brute force results count: "+count+", mi... | 1 |
public static int eggOnFloor (int f, int e, int[][] s, int[][] c ) {
if ( s[f][e] != -9999999) {
return s[f][e];
}
if ( f == 0 ) {
return 0;
}
if ( e <= 0) {
return 9999999;
}
int min = 99999999;
for (int i = 1; i <= f; ++i) {
int tmp = Math.max(eggOnFloor(i-1, e-1, s, c),
... | 5 |
private void init() {
isRunning = true;
gcCallbackProcessor = new Thread(new Runnable() {
@Override
public void run() {
while (isRunning) {
try {
listen();
} catch (Throwable e) {
e.printStackTrace();
}
}
}
private void listen() throws InterruptedException {
fi... | 6 |
public String getLatestMessage() {
if(history.size()>0) {
return history.get(history.size()-1).getMessageText();
} else {
return null;
}
} | 1 |
private void processCatalogueAddReplicaResult(Sim_event ev)
{
if (ev == null) {
return;
}
Object[] pack = (Object[]) ev.get_data();
if (pack == null) {
return;
}
String filename = (String) pack[0]; // get file name
int msg = (... | 5 |
public void stop() {
if(playList != null) {
stopping = true;
GameSong gs = null;
if(currentSongIndex < playList.size()) {
gs = playList.get(currentSongIndex);
currentSongIndex++;
}
if(currentSongIndex > playList.size()) ... | 6 |
@Override
public String execute(SessionRequestContent request) throws ServletLogicException {
String page = ConfigurationManager.getProperty("path.page.createorder");
try {
Criteria criteria = new Criteria();
Order order = (Order) request.getSessionAttribute(JSP_CURRENT_ORDER... | 3 |
private int calculateSpeed(Street currentStreet) throws InterruptedException {
int speedLimit = 0;
// Limit by street type
if(!SimulationOption.IGNORE_SPEEDLIMIT.equals(vehicle.getSimulationOption())) {
speedLimit = Math.min(currentStreet.getStreetType().getSpeedLimit(), vehicle.getMaxSpeed());
}el... | 7 |
private int numberOfEnemiesToFight(int number){
int res = 0;
for (int i = 0; i < beings.size(); i++){
if (((beings.get(i).isZombie() && beings.get(number).isHuman()) || (beings.get(i).isHuman() && beings.get(number).isZombie())) && getDistance(i, number) < RADIUS_FIGHT){
res+... | 6 |
public Object getValueAt(int row, int col) {
if (data == null) {
return null;
}
if (row == -1 || col == -1) {
return null;
}
return data[row][col];
} | 3 |
private static void RelationalOperators() {
System.out.println("Start of RelationalOperators");
int a = 1;
int b = 2;
// Check Equality
if (a == b) {
System.out.println("a is equal to b");
} else {
System.out.println("a is not equal to b");
}
// Check Inequality
if (a != b) {
System.out.p... | 6 |
protected TorrentMetaInfo (
TorrentInfoSection info, String announce, List<Set<String>> announceList, DateTime creationDate,
String comment, String createdBy)
{
if (announce == null | info == null)
throw new NullPointerException();
this.announce = announce;
this.... | 6 |
final void method3287() {
if (secondInt == -1) {
secondInt = 0;
if (aByteArray3899 != null && aByteArray3899.length == 1
&& aByteArray3899[0] == 10)
secondInt = 1;
for (int i_13_ = 0; i_13_ < 5; i_13_++) {
if (options[i_13_] != null) {
secondInt = 1;
break;
}
}
}
if (anInt38... | 8 |
private void renderPatch(MeshPatch patch, Rendering rendering, float time) {
if (patch == null) return ;
final float alphaVal =
patch.inceptTime == TIME_DONE ? 1 :
((time - patch.inceptTime) / 2f) ;
if (alphaVal >= 1 && patch.previous != null) {
patch.previous = null ;
patch.inceptTi... | 7 |
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 feel.
* For details see http://down... | 6 |
public void testBug4706479() throws Exception {
Random rnd = new Random( 1234 );
TCustomHashMap<byte[], Integer> map =
new TCustomHashMap<byte[], Integer>( new ByteArrayStrategy() );
List<byte[]> list = new ArrayList<byte[]>();
List<Integer> expected = new ArrayList<Integer>();
for ( int i = 0; i < 1000; ... | 8 |
public int createGroup( String name, String members ){
int id = dao_id.getID( IDListDao.PARA_GROUP_ID );
if( !handler_group.initialize() ){
System.out.println( "GroupServer : failed to initialize group hander!" );
return 0;
}
if( id == -1 || !handler_group.insertNewGroup( id, name ) ){
handler_group.c... | 4 |
private int tabulateTrees(TreeReader reader,
Map<String, TreeItem> clades) throws IOException {
int countedTrees = 0;
int examinedTrees =0;
SunFishFrame.getSunFishFrame().setInfoLabelText("Parsing trees file");
progressMonitor.setNote("Counting clades");
progressMonitor.setProgress(0);
DrawableTree ... | 9 |
public ArrayList<ArrayList<Course>> getPrereqs(String crn, String term, String year, String subj, String crse) throws Exception {
ArrayList<ArrayList<Course>> prereqs = new ArrayList<ArrayList<Course>>();
// Make url
String courseUrl = COURSE_URL + "?CRN=" + crn + "&TERM=" + term + "&YEAR=" + year +
"&SUBJ="... | 8 |
@Override
public void run() {
/**
* Monitor para que se ejecute la funcion cada tick de reloj.
*/
synchronized (this) {
while (simulacion) {
try {
wait();
} catch (InterruptedException ex) {
System.... | 4 |
private void addItem(String title, String name, ComponentType type, boolean isSimple, JMenuItem classCheckItem) {
if (isSimple && simpleMode) {
simpleMenu.add(classCheckItem);
return;
}
switch (type) {
case ACTIVE:
activeMenu.add(classCheckItem... | 9 |
public static String payXP(Player p, int tier, double basepay, String job) {
double iTimes = tier;
double totalPay = PlayerCache.getEarnedIncome(p.getName());
String pLang = PlayerCache.getLang(p.getName());
String jobName = UpperCaseFirst.toUpperFirst(McJobs.getPlugin().getLanguage().ge... | 5 |
public void levelCheck()
{
boolean found1 = false;
int i = 0;
while(!found1 && i < arraySecondOrdering.length)
{
if (arraySecondOrdering[i].getQualification().charAt(3) > '1')
{
allocatedReferee1 = arraySecondOrdering[i];
found1 = true;
}
i++;
}
boolean found2 = false;
int j = 0;
... | 9 |
private void calculate(int[] aux,int[] prices,int i){
int max=0;
for( int j=i+1;j<aux.length;++j){
int temp=0;
if(prices[j]>prices[i]) temp+=prices[j]-prices[i];
if(j+2<aux.length){
temp+=aux[j+2];
}
if(temp>max) max=temp;
... | 5 |
public static void printData(List<?> objects){
for(Object object: objects){
System.out.println(object);
}
} | 2 |
public String getDirection(int tape) {
return (String) direction.get(tape);
} | 0 |
public void writeRefereesOutFile()
{
// create file writer object
FileWriter refereesOutWriter = null;
try
{
try
{
// instantiate file writer object
refereesOutWriter = new FileWriter(refereesOutFile);
// array length for use as iterator limit
int arrayLength = refereeProgram.getreferee... | 4 |
private void expand(int[] array, int lay) {
int k = 0;
for (int i = 0; i < HEIGHT; i++) {
for (int j = 0; j < HEIGHT; j++) {
yCbCr[i][j][lay] = array[k++];
}
}
} | 2 |
public static <E> List<E> set2list(Set<E> set) {
ArrayList<E> list = new ArrayList<E>();
for (E e : set) {
list.add(e);
}
return list;
} | 1 |
@Override
public void init() {
log.info("BasicSIRModel - init");
/////////////////////////////////////////////////////////////////
// INITIALISE TRANSITION KERNEL
/////////////////////////////////////////////////////////////////
// an empty kernel f... | 6 |
public static void getOOXML( WorkBookHandle bk, String path ) throws IOException
{
try
{
if( !OOXMLAdapter.hasMacros( bk ) )
{
path = StringTool.replaceExtension( path, ".xlsx" );
}
else // it's a macro-enabled workbook
{
path = StringTool.replaceExtension( path, ".xlsm" );
}
java.... | 4 |
private String derivationString() {
StringBuffer sb = new StringBuffer();
for (int i = 1; i < STACK.size(); i += 2)
sb.append(STACK.get(i));
sb.append(STRING.substring(P, STRING.length() - 1));
return sb.toString();
} | 1 |
public boolean doMostFavorableMove(Integer[] nextMove) {
Integer[] noMove = nextMove.clone();
Object[] bestCount = getBestLineCount();
String type = bestCount[0].toString();
int i = Integer.parseInt(bestCount[1].toString());
if(type.equals("row")) {
... | 5 |
public void onKeyEvent(KeyEvent e) {
if (player == null) return;
switch (e.getKeyCode()) {
// 上
case KeyEvent.VK_UP:
player.moveUp();
break;
case KeyEvent.VK_DOWN:
player.moveDown();
break;
case KeyEvent.VK_LEFT:
player.moveLeft();
break;
case KeyEvent.VK_RIGHT:
player.moveRight(... | 6 |
public void deleteMethod(final int nameIndex, final int typeIndex) {
final List newMethods = new ArrayList();
boolean foundIt = false;
for (int i = 0; i < this.methods.length; i++) {
final Method method = this.methods[i];
if ((method.nameIndex() == nameIndex)
&& (method.typeIndex() == typeIndex)) {
... | 4 |
public Atvalinajums() {
} | 0 |
private void annuleer() {
try {
quizWijzigenView.confirmationWindow(
"Ben je zeker dat je de wijzigingen wilt annuleren?",
"Annuleer wijzigingen");
if (quizWijzigenView.isTrueIndicator()) {
for (Quiz q : quizCatalogus.getQuizzen()) {
if (q.getId() == copyQuizOld.getId()) {
q = copyQuiz... | 4 |
private String cleanInput(String input) {
if (input == null) {
return null;
}
input = input.trim();
if (input.length() == 0) {
return null;
}
return input.toUpperCase();
} | 2 |
static Subject populate() {
ArrayList<Subject> data = new ArrayList<>();
Subject sun = new Subject(1392e+6);
sun.meta.color = new Color(0xFEE640);
sun.meta.name = "Sun";
sun.meta.type = SubjectType.STAR;
sun.meta.scale = 0.5f;
Subject mercury = new Subject(2439... | 1 |
public int antiFire() {
int toReturn = 0;
if (c.antiFirePot)
toReturn++;
if (c.playerEquipment[c.playerShield] == 1540 || c.prayerActive[12] || c.playerEquipment[c.playerShield] == 11284)
toReturn++;
return toReturn;
} | 4 |
public void saveResult(GameResult result) {
cacheGameResultsMaps(result);
FileOutputStream fo = null;
BufferedWriter bw = null;
try {
fo = new FileOutputStream(new File(this.resultsDataFilePath));
bw = new BufferedWriter(new OutputStreamWriter(fo));
fo... | 7 |
@Override
public void setPrerequisites(String prerequisites) {
if(prerequisites == null || prerequisites.length() == 0) {
JOptionPane.showMessageDialog(null,
"Error: prerequisites cannot be null of empty string");
System.exit(0);
}
this.prerequisit... | 2 |
@Override
public Object getValueAt(int i, int i1) {
Tenant t=tenants.get(i); //To change body of generated methods, choose Tools | Templates.
switch(i1){
case 0:
return t.getId();
case 1:
return t.getName();
... | 7 |
@Test
public final void testIntersectCorners() {
SpaceRegion sr1 = new SpaceRegion("sr1");
SpaceRegion sr2 = new SpaceRegion( sr1, "sr1");
Assert.assertTrue( sr1.intersects( sr1 ) );
Assert.assertTrue( sr1.intersects( sr2 ) );
for ( float x = -1.0f; x <= 1.0f; x += 0.1f ) {
sr2.localPosition.... | 6 |
private boolean check(EdgeWeightedDigraph G) {
// edge-weighted digraph is cyclic
if (hasCycle()) {
// verify cycle
DirectedEdge first = null, last = null;
for (DirectedEdge e : cycle()) {
if (first == null) first = e;
if (last != null... | 6 |
@Override
//Controls the MainCharacterFigure's movement based on user input from the arrow keys
public void keyPressed(KeyEvent e) {
// TODO Auto-generated method stub
if (e.getKeyCode() == KeyEvent.VK_ESCAPE) {
System.exit(0);
} else if (e.getKeyCode... | 9 |
protected XPathFactory newFactory()
throws XPathFactoryConfigurationException
{
// First try to force the default JRE impl
try
{
return XPathFactory.newInstance(
XPathFactory.DEFAULT_OBJECT_MODEL_URI,
"com.sun.org.apache.xpath.internal.jaxp... | 1 |
public String readLine() throws IOException
{
String s = super.readLine();
if (s.indexOf('\\') >= 0)
{
StringBuffer buffer = new StringBuffer(s.length());
for (int i = 0; i < s.length();)
{
char c = s.charAt(i++);
if (c == '... | 9 |
public int mergeAdjacentFace (HalfEdge hedgeAdj,
Face[] discarded)
{
Face oppFace = hedgeAdj.oppositeFace();
int numDiscarded = 0;
discarded[numDiscarded++] = oppFace;
oppFace.mark = DELETED;
HalfEdge hedgeOpp = hedgeAdj.getOpposite();
HalfEdge hedgeAdjPrev = hedgeAdj.prev;
Ha... | 6 |
@Override
public void start()
{
worker = new Thread()
{
@Override
public void run()
{
while (!this.isInterrupted())
{
int currentFrame = Integer.parseInt(pModel.getProperty(PRP_CURRENT_PLAYBACK_FRAME));
... | 3 |
public boolean contains(Coordinate p) {
double res = 0;
for(int i=1; i<this.corners.length; i++)
res += this.corners[i-1].sub(p).angle(this.corners[i].sub(p));
return Math.abs(res) > 6;
} | 1 |
public void mouseClicked(MouseEvent e) {
} | 0 |
public static void main(String[] args) {
logger.info("Trains application started");
TrainGenerator tGenerator = null;
try {
tGenerator = new TrainGenerator( 20 );
PassengerTrain pTrain = tGenerator.buildPassengerTrain();
double commonBaggageWeight = TrainOperations.commonBaggageWeight( pTrain );... | 1 |
public void setStartStop(int value) {
this._startStop = value;
} | 0 |
public static void main(String[] args) throws Exception {
if (args.length > 0 && args[0].equals("-r")) {
remove = true;
String[] nargs = new String[args.length - 1];
System.arraycopy(args, 1, nargs, 0, nargs.length);
args = nargs;
}
new ProcessFiles(new AtUnitRemover(), "class").start(args);
} | 2 |
public Ventana() {
initComponents();
leerProperties();
//PERSONAS
//creo el modelo, sobreescribiendo el método isCellEditable para que
//sólo pueda modificarse el campo persona.
DefaultTableModel modeloPersona = new DefaultTableModel() {
@Override
... | 4 |
@Override
public void mouseClicked(final MouseEvent e) {
this.e = e;
player.setActivityTimer(1000);
//if(player.getActivityTimer()==0){
new Thread(new Runnable(){
@Override
public void run() {
FlirtOverlay overlay = (FlirtOverlay)((JLabel) e.getSource()).getParent();
overlay.progress... | 6 |
public void start(MouseEvent e, mxCellState state)
{
startState = state;
movingCells = getCells(state);
previewStates = (!placeholderPreview) ? getPreviewStates() : null;
if (previewStates == null || previewStates.length >= threshold)
{
placeholder = getPlaceholderBounds(startState).getRectangle();
in... | 3 |
public void upByThrees(int n) {
/*int tracker = 1;
for (int i = 0; i < n; i++) {
System.out.println(tracker);
tracker +=3;
}*/
int tracker = 1;
int i = 0;
while(i < n){
System.out.println(tracker);
tracker=tracker+3;
i++;
}
} | 1 |
public void run(){
while (!stop) {
String randData = Rndm.randString(Rndm.intRandInt(32, 1024));
int port = Rndm.intRandInt(1, 65535);
send(randData, port);
}
} | 1 |
public ProvaDequantizzazione(String fileName) throws Exception {
encoder = new LayerIIIEnc(N_FRAME);
is = getClass().getResourceAsStream(fileName);
bitstream = new BitStream(is);
real_stream = getClass().getResourceAsStream(fileName);
//byte [] b = new byte [100000];
... | 6 |
@Override
protected void paintComponent(Graphics g) {
super.paintComponent(g); //To change body of generated methods, choose Tools | Templates.
g.drawImage(image, 0, 0, image.getWidth(this), image.getHeight(this), this);
g.setColor(Color.red);
if(points != null && !points.is... | 8 |
@Test
public void testGetCondVal() {
System.out.println("getCondVal");
Sense instance = new Sense(Sense.senseDir.HERE, 3, 6, Sense.condition.FOE);
Sense.condition expResult = Sense.condition.FOE;
Sense.condition result = instance.getCondVal();
assertEquals(expResult, result);... | 0 |
private void fatalErrorOccured(String message, Exception ex){
if (ex != null) ex.printStackTrace();
frame.txtrn.setText("Ошибка: " + message);
try {
this.finalize();
} catch (Throwable e) {
e.printStackTrace();
}
} | 2 |
public void registerEvents(Plugin plugin, EventListener listener) {
for (Method method : listener.getClass().getMethods()) {
Annotation annotation = method.getAnnotation(EventHandler.class);
if (annotation == null)
continue;
Class[] params = method.getParame... | 5 |
public void run(){
while(true){
try {
if(Go==true){
if (vehicleList.size()>0){
printStreet(this);
Vehicle toMove = vehicleList.getFirst();
Street target = toMove.getTargetStreet();
if (target == null) {
vehicleList.removeFirst();
toMove.stopVehicleThread();
}
... | 6 |
protected AudioDeviceFactory[] getFactoriesPriority()
{
AudioDeviceFactory[] fa = null;
synchronized (factories)
{
int size = factories.size();
if (size!=0)
{
fa = new AudioDeviceFactory[size];
int idx = 0;
Enumeration e = factories.elements();
while (e.hasMoreElements())
{
Audi... | 2 |
private void render(Graphics2D graphics2D) {
for (Cell[] cells1 : cells) {
for (Cell cell : cells1) {
cell.render(graphics2D);
}
}
} | 2 |
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Genre other = (Genre) obj;
if (myName == null) {
if (other.myName != null... | 9 |
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.