text stringlengths 14 410k | label int32 0 9 |
|---|---|
public void onAnalog(String name, float value, float tpf) {
if (stateManager.hasState(game)) {
if (name.equals("Lift")) {
if (selected == -1) {
return;
}
Spatial selectedBox = rootNode.getChild("box-" + selected);
if... | 8 |
public static void recordForwardGoal(Proposition forwardrule, Vector arguments, Proposition consequentproposition) {
{ ForwardGoalRecord fwdgoalrec = null;
Cons iter000 = consequentproposition.forwardChainingGoals().theConsList;
for (;!(iter000 == Stella.NIL); iter000 = iter000.rest) {
fwdgoalr... | 9 |
public static void main(String[] args) {
In in = new In(args[0]);
int N = in.readInt();
double[][] weight = new double[N][N];
for (int i = 0; i < N; i++) {
for (int j = 0; j < N; j++) {
weight[i][j] = in.readDouble();
}
}
Assignmen... | 7 |
public static Texture loadTexture(String ref) {
Texture tex = table.get(ref);
if (tex != null) {
return tex;
}
try {
tex = TextureLoader.getTexture("PNG",
ResourceLoader.getResourceAsStream(System.getProperty("resources") + "/textures/" + ref));
} catch (IOException e) {
e.printStackTrace();... | 2 |
private void write(BufferedWriter out)
{
StringBuffer sb = new StringBuffer();
sb.append("db." + JSONWriter.COLLECTION_NAME + ".insert({");
sb.append("ministry: \"" + _ministry + "\"");
sb.append(", party: \"" + _party + "\"");
sb.append(", start: {");
sb.append("date: \"" + String.format... | 1 |
public double[][] getDataAs2DArray() {
TunableParameters params = TunableParameters.getInstance();
int n = params.getDataSetSize();
int numAttributes = params.getFileAttributeNum();
double[][] data = new double[n][numAttributes];
ArrayList<BCNode>... | 2 |
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
btnbuscar = new javax.swing.JButton();
txtNombreArchivo = new javax.swing.JTextField();
jLabel1 = new javax.swing.JLabel();
jS... | 0 |
public static USState fromCode(String code){
if (!StringUtils.isBlank(code)){
String codeUpper = code.toUpperCase().trim();
for (USState s : USState.values()){
if (codeUpper.equals(s.stateCode)){
return s;
}
}
}
return null;
} | 3 |
@Test
public void testDealingCards() {
boolean equalHands = true;
Player human = game.getHuman();
ArrayList<ComputerPlayer> computers = game.getComputer();
//test each player has equal hands
for (Player p : computers) {
if(Math.abs(human.getCards().size() - p.getCards().size()) > 1 )
equalHands = fals... | 6 |
public void testWrite()
{
try
{
java.io.File f = new java.io.File( wd + foutpath );
// create directories
try
{
if( !f.exists() )
{
f.mkdirs();
f.delete();
}
}
catch( Exception e )
{
;
}
FileOutputStream fos = new FileOutputStream( f );
// if the file is ... | 8 |
void addListeners() {
addPaintListener(new PaintListener() {
public void paintControl(PaintEvent e) {
GC gc = e.gc;
Display display = getDisplay();
Color c = display.getSystemColor(color);
gc.setBackground(c);
Rectangle rect = getClientArea();
int length = Math.min(rect.width, rect.height);... | 6 |
@Override
public void fireEvent(UIEvent e) {
super.fireEvent(e);
if(e instanceof ActionEvent) {
processActionEvent((ActionEvent) e);
}
} | 1 |
public boolean setup() throws FileNotFoundException, NoSuchAlgorithmException {
if ( pwManSQLite == null ) {
throw new RuntimeException( "PWManCipher: pwManSQLite not set" );
}
if ( password == null ) {
throw new RuntimeException( "PWManCipher: password not set" );
}
if ( algorithm == null ) {
throw ... | 8 |
public static Double[] getColumnDoubleValues(CSTable t, String columnName) {
int col = columnIndex(t, columnName);
if (col == -1) {
throw new IllegalArgumentException("No such column: " + columnName);
}
List<Double> l = new ArrayList<Double>();
for (String[] s : t.row... | 2 |
public boolean getRun(){
boolean test = false;
if (test || m_test) {
System.out.println("ConnectFourAI :: getRun() BEGIN");
}
if (test || m_test) {
System.out.println("ConnectFourAI :: getRun() END");
}
return m_running;
} | 4 |
public boolean cyclePortWorks() {
String osname = System.getProperty ("os.name");
if (osname != null && osname.indexOf ("XP") != -1) {
return true;
} else {
return false;
}
} | 2 |
@Override
public void flyNextKilometer(int additionalHeight)
throws GeneralFlightSimulatorException {
try {
if (getDistanceTraveled() < 2 || getIndividualRoute().getLengthOfTheRoute()-getDistanceTraveled()<=2) {
}
if (checkHeighDifferenzAboveCity(additionalHeight)
&& (getDistanceTraveled... | 5 |
public double calculateClusterDistance(Cluster cluster1, Cluster cluster2) {
Instance instance1, instance2;
double distance = 1.0/0.0, tempDist = 0;
for (int i = 0; i < cluster1.size(); i++) {
instance1 = cluster1.get(i);
for (int j = 0; j < cluster2.size(); j++) {
instance2 = clust... | 3 |
private static void removeIncoerentTransition(HashSet<Transition> tr, Set<Integer> s) {
HashSet<Transition> transitionToEliminate = new HashSet<Transition>();
for (Transition t : tr) {
if (!s.contains(t.node) || !s.contains(t.leftChildren) || !s.contains(t.rightChildren)) {
transitionToEliminate.add(t);
}... | 4 |
private static int[][] setRowColumnZero(int[][] matrix) {
boolean[] rows = new boolean[matrix.length];
boolean[] columns = new boolean[matrix[0].length];
for (int i = 0; i < matrix.length; i++) {
for (int j = 0; j < matrix[0].length; j++) {
if (matrix[i][j] == 0) {
rows[i] = true;
columns[j] = tr... | 7 |
public Server() throws Exception {
org.eclipse.jetty.server.Server server = new org.eclipse.jetty.server.Server();
ServerConnector connector = new ServerConnector(server);
connector.setPort(8080);
initializeWebContent();
server.setConnectors(new Connector[] { connector });
HandlerCollection handlers = ne... | 8 |
public static void insertUtilisateur(Utilisateur utilisateur) {
PreparedStatement stat;
try {
stat = ConnexionDB.getConnection().prepareStatement("insert into utilisateur (prenom, nom, dateNaissance, adresse, codePostal, ville, carteBancaire, dateValiditeCarteBancaire, rib, iban, dateCreati... | 3 |
public static void main(String[] args) throws Throwable {
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
StringBuilder sb = new StringBuilder();
init();
int casos = parseInt(in.readLine().trim());
in.readLine();
for(int caso = 0; caso < casos ; caso++){
numbers = new TreeMap<St... | 7 |
protected void drawHints(Graphics g) {
g.setColor(Color.WHITE);
g.setFont(new Font("Tahoma", Font.PLAIN, FONT_SIZE));
g.drawString("T:" + String.valueOf(player1.getTeleports()), FONT_SIZE * 2, FRAME_HEIGHT - 30);
g.drawString("T:" + String.valueOf(player2.getTeleports()), FRAME_WIDTH - (... | 2 |
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
Vertex other = (Vertex) obj;
if (id == null) {
... | 6 |
public Object getValueAt( int rowIndex, int columnIndex )
{
Object back = "" ;
if ( data != null)
{
TLanguageFile dummy = data.getData( rowIndex ) ;
if ( dummy != null )
{
switch ( columnIndex )
{
case -1:
if ( ( data.getDefaultLang() != null ) && (... | 9 |
@Override
public String getStrategyName() {
// TODO Auto-generated method stub
return "空置率策略";
} | 0 |
private boolean isValidPass(String pass) {
String pattern = "(";
if (plugin.getConfig().getBoolean("password.complexity.lowercase"))
pattern += "(?=.*[a-z])";
if (plugin.getConfig().getBoolean("password.complexity.uppercase"))
pattern += "(?=.*[A-Z])";
if (plugin.getConfig().getBoolean("password.comple... | 4 |
public boolean createLike(String username,int pid){
PreparedStatement stmt = null;
Connection conn = null;
ResultSet rs = null;
try {
conn = DbConnection.getConnection();
stmt = conn.prepareStatement(GET_UID_OWNER);
stmt.setString(1, username);
rs = stmt.executeQuery();
... | 9 |
void addMember(int memberId, int memberType, String userName)
{
switch (memberType)
{
case GameController.passiveUser: case GameController.userContributor: case GameController.userBugReporter:
case GameController.userTester: case GameController.userCommitter: case GameController.userLeader:
gameControl... | 6 |
public static void main(String[] args) {
Parcel p = new Parcel();
// Must use instance of outer class
// to create an instance of the inner class:
Contents c = p.new Contents();
Destination d = p.new Destination("Tasmania");
} | 0 |
public static void main(String[] args) {
SimpleDeclaration simple = new SimpleDeclaration();
simple.print();
} | 0 |
public boolean getTrimFirst()
{
return _trimFirst;
} | 0 |
private static String serialiseVersion( BitSet bs )
{
StringBuffer sb = new StringBuffer();
int start = bs.nextSetBit( 1 );
int end = start;
while ( end >= 1 )
{
int res = bs.nextSetBit( end+1 );
if ( res == -1 || res > end+1 )
{
if ( sb.length() > 0 )
sb.append(",");
if ( end > start )... | 5 |
public static final String arrayString(double[] d) {
return "( " + d[0] + ", " + d[1] + ", " + d[2] + " )";
} | 0 |
@Override
@SuppressWarnings("unchecked")
public void setMatrix(Color[][] colorMatrix) throws L8Exception
{
try {
JSONObject message = new JSONObject();
for (int i = 0; i< colorMatrix.length; i++) {
for (int j = 0; j < colorMatrix.length; j++) {
message.put("led" + i + j, printColor(colorMatrix[i][j... | 5 |
public Address getAddress() {
return Address;
} | 0 |
private void extractField(String[] array, int line) {
try {
Integer obj = null;
// get the job number
int id = 0;
if (JOB_NUM == IRRELEVANT) {
id = jobs.size() + 1;
}
else {
obj = new Integer( array[JOB_NUM]... | 7 |
public void run() {
Long theTime = null;
String theMessage = null;
while (isRunning) {
synchronized(messages) {
if (messages.isEmpty()) {
try {
messages.wait();
} catch (Exception e) {}
} else if (isRunning && !messages.isEmpty()) {
theMessage = messages.remove(0);
theTime = t... | 7 |
public void useRod(Item rod)
{
int randy=(int)(Math.random()*10);
paused=false;
Inventory.inventoryWindow.closeInventory();
messageBox=new ErrorWindow();
messageBox.addMessage("You use the "+rod.type+"!","Fishing");
messageBox.repaint();
while(messageBox.isVisible())
{
try
{
Thread.sleep(1... | 7 |
private JComponent drawDialogPane() {
// Create the panel
JPanel panel = new JPanel();
panel.setLayout(new GridLayout(5, 2));
panel.setBorder(BorderFactory.createTitledBorder("Product"));
// Combo items
JComboBox<String> combo = new JComboBox<String>();
combo.addItem("Select one");
// System.out.print... | 7 |
@Override
public boolean closeConnection(NetworkConnection targetConn)
{
boolean toRet = false;
TCPNetworkConnection targetTCPConn = (TCPNetworkConnection)targetConn;
if(targetTCPConn != null)
{
try
{
if(targetTCPConn.currentServSocket != null)
{
targetTCPConn.currentServSocket.close();
... | 4 |
private synchronized int getNextIdAndIncrement() {
int nextId = 0;
try (Connection connection = DriverManager.getConnection(connectionString);){
Statement statement = connection.createStatement();
ResultSet rs = statement.executeQuery("select max(id) as maxIng from ingredient");
if (rs.next()) {
nextId... | 2 |
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((code == null) ? 0 : code.hashCode());
result = prime * result + ((numberOfWholesaleProducts == null) ? 0 : numberOfWholesaleProducts.hashCode());
result = prime * result + ((price == null) ? 0 : price.hashCode... | 4 |
private boolean jj_3R_18() {
Token xsp;
xsp = jj_scanpos;
if (jj_3_39()) jj_scanpos = xsp;
xsp = jj_scanpos;
if (jj_3_40()) jj_scanpos = xsp;
xsp = jj_scanpos;
if (jj_3_45()) {
jj_scanpos = xsp;
if (jj_3_46()) return true;
}
xsp = jj_scanpos;
if (jj_3_47()) jj_scanpos = x... | 5 |
public int minimax(int depth)
{
Minimax mnx = new Minimax();
int i=0;
boolean flag;
try {
i = mnx.findBestMove(this, depth);
} catch (CloneNotSupportedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
Model2048 m = new Model2048(this);
int temp = 0;
switch(i){
case 0... | 9 |
public int treeHeight2(BTPosition<T> current)
throws InvalidPositionException {
if (current == null)
return 0;
Stack<BTPosition<T>> s = new Stack<>();
int max = 0;
int count = 0;
while (!s.isEmpty() || current != null) {
if (current != null) {
s.push(current);
count++;
current = current.... | 5 |
private void run(String url) {
// get the current date in short string format to use as filename
SimpleDateFormat dateformat = new SimpleDateFormat("yyyy-MM-dd_HH-mm-ss");
String dateStamp = dateformat.format((new Date()).getTime());
// create and initialise PrintStream object
Pr... | 4 |
@Override
public void perform() throws IOException {
URL websiteURL = new URL("http://www.runescape.com/game.ws?j=1");
URLConnection urlConnection = websiteURL.openConnection();
BufferedReader reader = new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));
String line;
while((line =... | 3 |
public boolean getControls(String control){
if(control == "Age"){ return true;}
if(control == "Fade"){ return true;}
if(control == "Mirror"){ return true;}
if(control == "InMode"){return true;}
return false;} | 4 |
private List<HantoCell> checkAdjacentCells(HantoCell cell)
{
List<HantoCell> emptyCells = new ArrayList<HantoCell>();
int x = cell.getX();
int y = cell.getY();
if (!isCellOccupied(x, y + 1)){
emptyCells.add(new HantoCell(x, y+1));
} if (!isCellOccupied(x + 1, y)){
emptyCells.add(new HantoCell(x +... | 6 |
@Override
protected Void doInBackground() {
try
{
l5.setText("Copying Images...");
for (int bc = 1001; bc <= 1051; bc++)
{
// copy images
File imageDir = new File(JarLocation.getLocation(new Setup()) + "\\images\\" + bc + ".jpg");
... | 5 |
@Override
public String toString() {
String ret = name;
ret += " " + seasonAndEpisode;
if (subtitled)
ret += " " + "VOSTFR";
ret += " " + quality;
ret += " " + source;
ret += " " + codec;
if (team != null)
ret += "-" + team;
return ret;
} | 2 |
@Override
public void run() {
while (isContinuar()) {
String reloj = "";
setCalendario(Calendar.getInstance());
hora = getCalendario().get(Calendar.HOUR_OF_DAY);
minuto = getCalendario().get(Calendar.MINUTE);
segundo = getCalendario().get(Calendar.... | 4 |
@Override
public void render(Graphics g, Visibility visibility, float x, float y, float scale) {
if(visibility == Visibility.VISIBLE) {
Animation anim;
if(isMoving())
anim = moveAnim[toIndex(getFacing())];
else if(isCancelingMove() || isRecoveringFromCanceledMove())
anim = bumpAnim[toIndex(getFacing... | 5 |
public Kodak (Device dev)
throws IOException
{
try {
// can we use usbdevfs?
socket = new USBSocket (dev);
in = socket.getInputStream ();
out = socket.getOutputStream ();
} catch (IOException e) {
if ("Linux".equals (System.getProperty ("os.name"))) {
// assume this is the LOCAL ... | 2 |
@Override
public boolean invoke(MOB mob, List<String> commands, Physical givenTarget, boolean auto, int asLevel)
{
final MOB target=this.getTarget(mob,commands,givenTarget);
if(target==null)
return false;
Room R=CMLib.map().roomLocation(target);
if(R==null)
R=mob.location();
if(!super.invoke(mob,comm... | 8 |
public static boolean checkUpdate() {
print("Searching for client files...");
print("Library files: " + client[4].list().length);
if ((!client[0].exists()) || (!client[1].exists()) || (!client[2].exists()) || (!client[3].exists()) || ((!client[4].isDirectory()) || (client[4].list().leng... | 8 |
public Speciality findSpecialityById(final Long id) {
return new Speciality();
} | 0 |
public void updateTime(long time) {
if (time > currentTime) {
for (Object detector : detectors.values()) {
((DaysStayTimeDetector) detector).update(time);
}
for (Object daysO : workerDays.entrySet()) {
Set<Long> days = ((Map.Entry<String, Set<L... | 7 |
synchronized int decodevs_add(float[] a, int offset, Buffer b, int n) {
int step = n / dim;
int entry;
int i, j, o;
if (t.length < step) {
t = new int[step];
}
for (i = 0; i < step; i++) {
entry = decode(b);
if (entry == -1) {
... | 5 |
private boolean checkPasswords() {
boolean returnV = false;
if (!"".equals(passwordField.getText()) && !"".equals(passwordField2.getText())) {
if (!passwordField.getText().equals(passwordField2.getText())) {
passwordCorrectField.setText("Doesn't Match.");
retu... | 4 |
public int getID(){
return IDNumber;
} | 0 |
public void expose(int x, int y) // exposes the surrounding 8 buttons
{
String surrbombs;
exposed[x][y] = true;
for (int q = x - 1; q <= x + 1; q++) {
for (int w = y - 1; w <= y + 1; w++) {
while (true) {
if (q < 0 || w < 0 || q >= row || w >= col) // makes sure
// that it wont
... | 8 |
private int flushValue(byte[] cards) {
byte[] count = new byte[4];
for (byte card : cards) {
count[getCardColor(card)]++;
}
if (count[0] >= 5 || count[1] >= 5 || count[2] >= 5 || count[3] >= 5) {
int color_idx = 0;
while (count[color_idx] < 5)
color_idx++;
int res = 0;
int todo = 5;
int ... | 8 |
public static int dehexchar(char c) {
if (c >= '0' && c <= '9') {
return c - '0';
}
if (c >= 'A' && c <= 'F') {
return c - ('A' - 10);
}
if (c >= 'a' && c <= 'f') {
return c - ('a' - 10);
}
return -1;
} | 6 |
public void handleAnimation(Packet18Animation par1Packet18Animation)
{
Entity var2 = this.getEntityByID(par1Packet18Animation.entityId);
if (var2 != null)
{
EntityPlayer var3;
if (par1Packet18Animation.animate == 1)
{
var3 = (EntityPlayer... | 9 |
public boolean findLoneRanger(int intAreaType) {
JLabel jl;
JLabel jlTmp;
int theArea; // Which box, row, or col (0-8)
String theValues; // Possible values for the square
String theChar; // One of the possible values
int theCount; // How many times it appears i... | 9 |
private PRPlayer() {
//Setting Icon and Location
this.setIconImage(
Toolkit.getDefaultToolkit().getImage(
Infofield.class.getResource("/images/Icon.png")));
this.setLocation(80, 20);
//Initializing Library Viewers and Librarys
deck1 = new ArrayDeque<Card>();
deck2 = new ArrayDeque<Card>();... | 8 |
public Date getDateOfJoining() {
return dateOfJoining;
} | 0 |
public void sqlClose() {
try {
// if (rs != null) {
// rs.close();
// }
if (stat != null) {
stat.close();
}
if (conn != null) {
conn.close();
}
} catch (SQLException ex) {
Log... | 3 |
@Override
public void executeMsg(Environmental myHost, CMMsg msg)
{
if((msg.source()==affected)
&&(msg.target() instanceof Item)
&&(msg.targetMinor()==CMMsg.TYP_EAT))
{
switch(((Item)msg.target()).material())
{
case RawMaterial.RESOURCE_ORANGES:
case RawMaterial.RESOURCE_PEPPERS:
case RawMateri... | 7 |
@Test
public void testAllDataTypesAggregate() throws Exception
{
PersistenceManager pm = new PersistenceManager(driver,database,login,password);
for(int x = 1;x<=100;x++)
{
AllPrimitives ap = new AllPrimitives();
if(x%2==0)
{
ap.setBoolobject(Boolean.TRUE);
ap.setBoolvalue(true);
}
else
... | 8 |
public boolean spacesAvailable(Vehicle v) {
int bikes = 0;
int sCars = 0;
// determine num of motorcycles in small car spaces
if(numMotorCycles > maxMotorCycleSpaces){
bikes = numMotorCycles - maxMotorCycleSpaces;
}
// determine num small cars in general car space
if(numSmallCars > (maxSmallCarSpaces -... | 9 |
public void pop() throws java.lang.Exception
{
if (vstack.empty())
throw new Exception(
"Internal parser error: pop from empty virtual stack");
/* pop it */
vstack.pop();
/* if we are now empty transfer an element (if there is one) */
if (vstack.empty())
get_from_real();... | 2 |
public ArrayList<Integer> findPlayerPieces(int player) {
ArrayList<Integer> playerPieces = new ArrayList<Integer>();
for (int i = 0; i < boardArray.length; i++)
if (boardArray[i] == player) playerPieces.add(i);
return playerPieces;
} | 2 |
protected int getWordEnd(RTextArea textArea, int offs)
throws BadLocationException {
RSyntaxDocument doc = (RSyntaxDocument)textArea.getDocument();
if (offs==doc.getLength()) {
return offs;
}
int line = textArea.getLineOfOffset(offs);
int end = textArea.getLineEndOffset(line);
if (line!... | 7 |
private void makeAlterTable(Class<?> c, Connection connection) throws SQLException {
StringBuilder query = new StringBuilder();
query.append("ALTER TABLE `" + mysqlDatabase + "` . `"
+ ORM.getTableName(c) + "` ");
Boolean first = true;
for (Field objectField : c.getFields()) {
// The field must be a p... | 9 |
@Override
public void endSetup(Attributes atts) {} | 0 |
public static String substitute(String source, String searchString, String replaceString) {
if (source == null) {
return null;
}
if (isEmpty(searchString)) {
return source;
}
if (replaceString == null) {
replaceString = "";
}
... | 8 |
@Override
public void actionPerformed(ActionEvent e) {
JFileChooser chooser = new JFileChooser();
if(optionsPane != null) {
chooser.setCurrentDirectory(new File(Settings.getSettings().getInstallPath()));
chooser.setDialogTitle(choosertitle);
chooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
... | 8 |
public static void main(String[] args) {
int port = Integer.parseInt(properties.getProperty("port0"));
String ip = properties.getProperty("serverIp");
String logFile = properties.getProperty("logFile");
Logger.getLogger(ChatServer.class.getName()).log(Level.INFO, "Sever started");
try {
Utils.... | 2 |
protected void wqu(Graph G, int s)
{
for (int i = 0; i < G.V(); i++)
for (int j : G.adj(i))
union(i, j);
} | 2 |
private <TEvent> void broadcastToMethod(EventHandler eh, TEvent event)
throws InvocationTargetException, IllegalAccessException {
Method[] methods = eh.getClass().getDeclaredMethods();
for(Method method : methods) {
Class<?>[] parameterTypes = method.getParameterTypes();
... | 5 |
private void showLine(int lineNumber){
for(int i = 0; i < fieldSize; i++){
showCell(i,lineNumber);
}
} | 1 |
@Override
public void mutate() {
Population offspring = new Population();
for (int i = 0; i < population.getSize(); i += 2){
HiffIndividual ancestorOne = getAncestor();
HiffIndividual ancestorTwo = getAncestor();
for (int k = 0; k < ancestorOne.getSize(); ++k){
... | 6 |
public int getHealth() {
return health;
} | 0 |
@Override
public void adjust() {
Undoable undoable = getTarget(Undoable.class);
if (undoable != null) {
UndoManager mgr = undoable.getUndoManager();
setEnabled(mgr.canRedo());
setTitle(mgr.getRedoPresentationName());
} else {
setEnabled(false);
setTitle(CANT_REDO);
}
} | 1 |
public void schedule() throws InterruptedException
{
throw new InterruptedException("This method will be completed in a later lab");
} | 0 |
public static void roveChange(){
rover = head;
while(rover != null){
String temp = "";
int a = 1;
while(a<rover.img.length()){
if(rover.img.charAt(a)!='/'){
temp = temp + rover.img.charAt(a);
}
else{
temp = temp + "\\";
}
a++;
}
rover.img = temp;
rover = rover.next;
... | 3 |
protected VcfEntry parseVcfLine(String line) {
try {
if (line.startsWith("#")) {
header.addLine(line); // Header?
} else if ((line.length() > 0) && (!line.startsWith("#"))) return new VcfEntry(this, line, lineNum, parseNow); // Vcf entry?
} catch (Throwable t) {
Gpr.debug("Fatal error reading file '" +... | 4 |
public void drawFlyMenu(Graphics g)
{
g.setColor(new Color(0,0,0,200));
g.fillRect(0,0,getWidth(),getHeight());
g.setFont(new Font("Sanserif",Font.BOLD,18));
g.setColor(Color.WHITE);
g.drawImage(icon,330,flyMenuInt*20+85,16,16,this);
g.drawString("Fly where? ('F' to cancel)",350,70);
try
{
for(in... | 2 |
public ArrayList<DateFile> getNextFilesForEvents(String eventname) {
try {
File[] files = new File(this.baseFolder.getPath() + File.separator
+ eventname).listFiles();
ArrayList<DateFile> eventsForExecution = new ArrayList<DateFile>();
for (File file : fil... | 3 |
private final void setMenuLayout()
{
if (isVertical)
{
double componentidth = Math.max(smallestComponentWidth, (width - (2 * borderSize)) - (usingScrollBar ? TScrollBar.scrollBarThickness : 0));
double componentHeight = Math.max(componentidth * (0.8 / 4.0), smallestComponentHeight);
for (... | 9 |
final public void Program_head() throws ParseException {
/*@bgen(jjtree) Program_head */
SimpleNode jjtn000 = new SimpleNode(JJTPROGRAM_HEAD);
boolean jjtc000 = true;
jjtree.openNodeScope(jjtn000);
jjtn000.jjtS... | 9 |
private static String reverseString(String input)
{
char [] inputStrArray = input.toCharArray();
char temp;
int min =0;
int max = inputStrArray.length;
for (int count =0; count < (max-min)/2;count++)
{
temp = inputStrArray[min+count];
inputStrA... | 1 |
public static void makeGrid(Container parent,
int rows, int cols,
int initialX, int initialY,
int xPad, int yPad) {
SpringLayout layout;
try {
layout = (SpringLayout)parent.getLayout();
} ... | 6 |
private void log( Level level, String msg, Throwable ex ) {
Logger logger = getLogger();
if (logger.isLoggable(level)) {
// Hack (?) to get the stack trace.
Throwable dummyException=new Throwable();
StackTraceElement locations[]=dummyException.getStackTrace();
... | 4 |
private List<GrantedAuthority> buildUserAuthority(Set<UserRole> userRoles) {
Set<GrantedAuthority> setAuths = new HashSet<>();
// Build user's authorities
for (UserRole userRole : userRoles) {
setAuths.add(new SimpleGrantedAuthority(userRole.getRole()));
}
return new... | 1 |
public static void main(String [] args)
{
Employee e = null;
try
{
FileInputStream fileIn = new FileInputStream("C:/tmp/employee.ser");
ObjectInputStream in = new ObjectInputStream(fileIn);
e = (Employee) in.readObject();
in.close();
... | 2 |
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.