text stringlengths 14 410k | label int32 0 9 |
|---|---|
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 |
private void loadWhitespaceFreeNode(Node nodeToLoadFrom, WhitespaceFreeXMLNode nodeToLoad)
{
// FIRST GET ALL THE ATTRIBUTES
NamedNodeMap attributes = nodeToLoadFrom.getAttributes();
int numAttributes = attributes.getLength();
for (int i = 0; i < numAttributes; i++)
{
... | 6 |
@Override
public void onInvalidCommand(CommandSender sender, String[] args, String command) {
tickets = plugin.getTicketHandler();
if (sender instanceof Player) {
Player p = (Player) sender;
if (p.hasPermission("modreq.reopen")) {
if (args.length > 0) {
... | 6 |
@Override
public boolean equals(Object obj) {
if (this == obj) return true;
if (obj == null) return false;
if (getClass() != obj.getClass()) return false;
Quat other = (Quat) obj;
if (Double.doubleToLongBits(w) != Double.doubleToLongBits(other.w)) return false;
if (Double.doubleToLongBits(x) != Double.doub... | 7 |
@Override
public int attack(double agility, double luck) {
if(random.nextInt(100) < luck)
{
System.out.println("Holy Hit, I messed that monster up!");
return random.nextInt((int) agility) * 2;
}
return 0;
} | 1 |
public void update(long elapsedTime) {
// select the correct Animation
Animation newAnim = anim;
if (getVelocityX() < 0) {
newAnim = left;
}
else if (getVelocityX() > 0) {
newAnim = right;
}
if (state == STATE_DYING && newAnim == left) {
... | 9 |
public int getMinimalCut(NonDirectedGraph<Integer> graph) {
history = new LinkedHashMap<Vertex<Integer>, List<Vertex>>();
while (graph.numVertices() > 2) {
Edge<Integer> edge = getRandomEdge(graph);
Vertex<Integer> remainingVertex = graph.getVertex(graph.numVertices() % 2 == 0 ... | 8 |
public String toStringNoClose(InputStream is, int length) {
byte bytes[] = new byte[length];
try {
int total = 0;
for (int read; total < length && (read = is.read(bytes, total, length-total)) != -1; total += read);
assert total == length;
return new String... | 3 |
public void removeEventListener(String type, ipsilonS3ToolEngineListener listener) {
if(type.equals(ipsilonS3ToolEvent.TYPE_DELETING)){
listenerDeleting.remove(ipsilonS3ToolEngineListener.class, listener);
}
if(type.equals(ipsilonS3ToolEvent.TYPE_UPLOADING)){
li... | 8 |
public static void allocateObject(Item i, String readerName) {
ObjectInfo oi = GenerateForSpim.getParams().get(i.getVal());
Item next = Scanner.get();
if(next.getSym() == Constants.BECOMES) {
next = Scanner.get();
if(next.getSym() == Constants.CAST) {
next = Scanner.get();
}
if(readerName !=... | 5 |
private String parseReg(String firstParam) {
firstParam = firstParam.toUpperCase();
if (firstParam.contains("$T0"))
return "$T0";
if (firstParam.contains("$T1"))
return "$T1";
if (firstParam.contains("$T2"))
return "$T2";
if (firstParam.contains("$T3"))
return "$T3";
if (firstParam.contains("$... | 9 |
private void killCheck() {
try {
for (Shot s : lev.player.shots) {
for (Enemy e : lev.enemies) {
if (Math.sqrt(Math.pow((s.y-e.y),2)+Math.pow((s.x-e.x),2))<10) {
lev.player.shots.remove(s);
lev.enemies.remove(e);
newSpawn--;
lev.player.score+=(120-newSpawn);
killedEnemies++;
... | 6 |
public static void main(String[] args) throws IOException {
String serverIp = "localhost";
System.out.println("Welcome to Client side");
Socket fromserver = null;
/*
if (args.length==0) {
System.out.println("use: client hostname");
System.exit(-1);
}
* */
System.out.print... | 2 |
public List<Tuple2<PixelType, Integer>> shrink(PixelType[] line){
List<Tuple2<PixelType, Integer>> list = new ArrayList<Tuple2<PixelType, Integer>>();
PixelType past = null;
PixelType cur = null;
int count = 0;
for (int i=0; i<line.length; i++) {
... | 7 |
private static void usage() {
System.out.println("Runs either a client, tracker or creates " +
"a torrent metainfo file depending on arguments.\n");
System.out.println("Usage:" +
"java -jar ttorrent<version>.jar <client|tracker" +
"|create> <arguments>");
System.out.println("\tclient\t-\tstart the cl... | 0 |
public void loadRocketImages(){// loads rocket images into a 2d arraylist
rocketImages = new ArrayList();
int i = 1;
int j = 1;
while(true){ //cycle through i
ArrayList r_img = new ArrayList();
while(true){ //cycle through j
String name = "rockets/" + i + "r" + j + ".... | 4 |
@Override
public void actionPerformed(ActionEvent arg0) {
if(arg0.getActionCommand().equals("create"))
{
int authLevel = 0;
if(cManager.isSelected())
authLevel = 1;
int result = timeMan.addEmployee(tFName.getText(), tLName.getText(), new String(tPassword.getPassword()), authLevel);
if(result < 1)
... | 7 |
public static int Kruskal(Graph input) {
input.setState(States.ARR_ADJ);
Log.print(Log.system, "Kruskal algorithm:");
// init:
int N = input.getVertexCount();
int M = input.getEdgeCount();
int[][] arr_inc = new int[N][M];
int[][] arr_adj = new int[N][N];
@SuppressWarnings("unchecked")
ArrayList<ListN... | 3 |
public static InputStream getFileInputStream(String pathToFile) {
if (Game.isRunningInIdea()) {
try {
return new FileInputStream("src/main/resources/" + pathToFile);//FileUtils.class.getClassLoader().getResourceAsStream(pathToFile);
} catch (Exception e) {
... | 4 |
public static String wordsToPhrase(List words) {
StringBuffer stringBuffer = new StringBuffer();
for (int i = 0; i < words.size(); i++) {
if (i > 0)
stringBuffer.append(" ");
stringBuffer.append(words.get(i));
}
return stringBuffer.toString();
} | 2 |
public static void doDonation(MapleClient c, String name, short damount, String email) {
ChannelServer cserv = c.getChannelServer();
try {
WorldLocation loc = cserv.getWorldInterface().getLocation(name);
if (loc != null) {
MapleCharacter victim = ChannelServer.get... | 7 |
public boolean newLibrary(Class<?> libraryClass)
throws SoundSystemException {
initialized(SET, false);
CommandQueue(new CommandObject(CommandObject.NEW_LIBRARY, libraryClass));
commandThread.interrupt();
for (int x = 0; (!initialized(GET, XXX)) && (x < 100); x++) {
snooze(400);
commandThread.interru... | 5 |
public static void insertionSort( int[] a ){
int j;
for ( int p = 1; p < a.length; p++ ){
int tmp = a[p];
for ( j = p; j > 0 && tmp<a[j-1]; j-- ){
a[j] = a[j-1];
}
a[j] = tmp;
}
} | 3 |
public boolean isLambdaTransition(Transition transition) {
return false;
} | 0 |
@Override
public Value evaluate(Value... arguments) throws Exception {
// Check the number of argument
if (arguments.length == 1) {
// get Value
Value value = arguments[0];
// If numerical
if (value.getType().isNumeric()) {
return new Value(new Double(Math.round(value.getDouble())));
}
if (v... | 4 |
static List<String> read(File script) {
List<String> commands = Lists.newArrayList();
if (! script.exists()) {
return commands;
}
try {
BufferedReader br = new BufferedReader(new FileReader(script));
String line;
while ((line = br.readLin... | 3 |
public ModifiedNode put(T value)
{
N node = construct(value);
if (m_root == null)
{
m_size = 1;
m_root = node;
return new ModifiedNode(true, node);
}
N parent = m_root;
N t = m_root;
int cmp = 0;
while (t != null)
{
parent = t;
cmp = compare(node, t);
... | 5 |
private DCStation getStation(ArgSet args) {
if(!args.hasArg()) return null;
String alias = args.pop();
if(servers.containsKey(alias)) {
return servers.get(alias);
} else if(clients.containsKey(alias)) {
return clients.get(alias);
} else {
return null;
}
} | 3 |
private static synchronized void say(Socket s, String message){
try {
PrintWriter printWriter = new PrintWriter(s.getOutputStream(), true);
printWriter.println(message);
} catch (Exception e){
e.printStackTrace();
}
} | 1 |
protected StateDist expandChildren(SearchState oldState, int oldDist) {
int[] pieceIndices = oldState.numDroppedPieces >= forcedPieces.length ? ALL_PIECES : new int[]{forcedPieces[oldState.numDroppedPieces]};
StateDist bestStateDist = null;
for (int pieceIndex : pieceIndices) {
LockPiece<Integer> lock... | 9 |
public ListNode reverseBetween(ListNode head, int m, int n) {
if(head == null || m == n)
return head;
Stack<Integer> stack = new Stack<Integer>();
ListNode prev = null;
ListNode p = head;
int count = 0;
while(true){
count ++ ;
if(count == m)
prev = p;
if(count >= m && count <= n)
stack.... | 8 |
private void loadBackups() {
new Thread() {
@Override
public void run() {
DefaultListModel model = new DefaultListModel();
File backupDir = new File(System.getProperty("user.home") + "/.androidtoolkit/backups");
if (debug)
... | 3 |
public static void mousePointReleased(MouseEvent e) {
boolean isDelete = false;
if (isClicked) {
boolean isContained = false;
//Проверка, отпускаем ли над областью точки
for (Shapes.Point point : points) {
isContained = point.equals(new Shapes.Point(e.... | 9 |
public void quickSort(int[] array, int begin, int end){
int left = begin;
int right = end;
int t = array[left];
// int temp[] = new int[array.length];
while(left < right){
while(left < right && t <= array[right])
right--;
if(left < right)
array[left] = array[right];
while(left < right && t > a... | 9 |
protected void readAttribute(String name, int length,
ConstantPool constantPool, DataInputStream input, int howMuch)
throws IOException {
byte[] data = new byte[length];
input.readFully(data);
if ((howMuch & UNKNOWNATTRIBS) != 0) {
if (unknownAttributes == null)
unknownAttributes = new SimpleMap();
... | 2 |
public void update(GameContainer gc, StateBasedGame sbg, EnemyManager enemyManager, int delta){
if (this.currentWave < this.waves.length) {
if (!this.waveOver) {
if (this.waves[this.currentWave].isOver()) {
this.waveOver = true;
this.nextWaveIn = WaveManager.TIMEBETWEENWAVES;
//wave is over, che... | 6 |
static List<String> findCSVElements(File f, String tag) throws IOException {
List<String> l = new ArrayList<String>();
Reader r = new FileReader(f);
CSVParser csv = new CSVParser(r, CSVStrategy.DEFAULT_STRATEGY);
String[] line = null;
while ((line = csv.getLine()) != null) {
... | 3 |
public static void main(String[] Args) {
actions.setUpDisplay(); // Creates the window and sets the parameters in setUP;
actions.setUpVariables();
while (actions.run) {
try {
actions.movement();
actions.shoot();
actions.repaint();
... | 2 |
public String setItemRank(int number){
int r = number;
if(r == 1){
return "*";
}else if(r == 2){
return "**";
}else if(r == 3){
return "***";
}else if(r >= 4){
return "****";
}else{
return "X";
}
} | 4 |
public static void GardenRoom() {
currentRoomName = "Garden Room";
currentRoom = 6;
RoomDescription = "You nostrils are assulted with the pungant smell of roses and various other flowers. The sudden " +
"change of light makes you double back slightly as you slowly try to gain back your vision. This is clearl... | 0 |
@Override
public boolean equals(Object object) {
// TODO: Warning - this method won't work in the case the id fields are not set
if (!(object instanceof Business)) {
return false;
}
Business other = (Business) object;
if ((this.businessID == null && other.business... | 5 |
private ImageProcessor gaussDifference(ImageProcessor ip, double weight1, double weight2){
double weight3 = Math.max(weight1, weight2);
ImageProcessor src = ip.duplicate();
ImageProcessor dst = ip.duplicate();
dst.blurGaussian(2);
dst.multiply(weight1/weight3);
src.blurGaussian(15);
src.multiply(weight... | 0 |
public static void setUserOperators(Map<String, UserOperator> userOperators) {
Scheduler.userOperators = userOperators;
} | 0 |
final void method3622(boolean bool, int i, Component component) {
WComponentPeer wcomponentpeer = (WComponentPeer) component.getPeer();
int i_2_ = wcomponentpeer.getTopHwnd();
if ((anInt7461 ^ 0xffffffff) != (i_2_ ^ 0xffffffff)
|| !bool == aBoolean7460) {
if (i != 13259)
method3622(true, -90, null);
... | 6 |
private String informations(String name, String infos){
String temp = "";
for (int i = 1; i < listContacts.size(); i++) {
if ((listContacts.get(i).getNom()).equals(name)) {
if(infos.equals("adresse"))
temp = listContacts.get(i).getAdress... | 9 |
@Override
public boolean contains(Object o) {
for (int i = 0; i < list.length; i++) {
if (list[i] == null) {
return false;
}
if (list[i].equals(o)) {
return true;
}
}
return false;
} | 3 |
public void setValue(ELContext context, Object base, Object property, Object value) {
if (base != null) {
return;
}
if (property == null) {
throw new PropertyNotFoundException("No property specified");
}
context.setPropertyResolved(true);
String ... | 5 |
@SuppressWarnings("unused")
public PersonStatistics generateStatClean(String first, String last, PersonalData... cleaned) {
PersonStatistics ret = new PersonStatistics(first, last);
Set<String> attributeSkip = new HashSet<>();
cleanLocation: {
OrderTable locationAttributeOrder = new OrderTable();
List<Stri... | 6 |
private static String getTagValue(String tag, Element element) {
NodeList nlList = null;
if (element.getElementsByTagName(tag).item(0) == null)
return "";
nlList = element.getElementsByTagName(tag).item(0).getChildNodes();
Node nValue = null;
if (nlList.getLength() > 0)
nValue = (Node) nlList.item(0);... | 3 |
private Conn createConnection(DbPoolConfig singleConfig) {
Connection con = null;
try {
if(MyStringUtil.isBlank(singleConfig.getUser())){
con = DriverManager.getConnection(singleConfig.getUrl());
}else{
con = DriverManager.getConnection(singleConfig.getUrl(), singleConfig.getUser(), singleConfig.getPa... | 2 |
public AbstractPage getChildByURLString(String string) {
try {
return getChildByURL(resolveLink(string));
} catch (MalformedURLException e) {
return null;
}
} | 1 |
private int jjMoveStringLiteralDfa24_0(long old0, long active0)
{
if (((active0 &= old0)) == 0L)
return jjMoveNfa_0(0, 23);
try { curChar = input_stream.readChar(); }
catch(java.io.IOException e) {
return jjMoveNfa_0(0, 23);
}
switch(curChar)
{
case 48:
return jjMoveStringLiter... | 5 |
@Override
public boolean sil(int siraID) {
try {
/*
HbmIslemler hbm = new HbmIslemler();
return hbm.sil(siraID, this.getClass());
* */
Sira sira = siraBul(siraID);
if(sira!=null){
if(siradakiler.remov... | 5 |
public boolean stem() {
int v_1;
int v_2;
int v_3;
int v_4;
// (, line 133
// do, line 134
v_1 = cursor;
lab0: do {
// call prelude, line 134
if (!r_prelude()) {
break lab0;
}
} while (false);
cursor = v_1;
// do, line 135
v_2 = cursor;
lab1: do {
// call mark_regions, line 135... | 8 |
private static Area valueOf(int i) {
switch (i) {
case 0:
return NORTH;
case 1:
return NORTHEAST;
case 2:
return EAST;
case 3:
return SOUTHEAST;
case 4:
return SOUTH;
case 5:
return SOUTHWEST;
case 6:
return WEST;
... | 8 |
public static double lag1(double[] vals) {
double mean = mean(vals);
int size = vals.length;
double r1;
double q = 0;
double v = (vals[0] - mean) * (vals[0] - mean);
for (int i = 1; i < size; i++) {
double delta0 = (vals[i - 1] - mean);
double delt... | 1 |
public void initArea(){
Random r = new Random();
height = startHeight;
width = startWidth;
x = 0;
y = 0;
survived=0;
area = new boolean [height+2][width+2];
for(int i=1; i<=height; i++){
for(int j=1; j<=width; j++){
area[i][j] = r.nextBoolean();
if (area[i][j]){
survived++;
}
}... | 3 |
@Override
public void mouseMoved(MouseEvent e) {
this.MouseInput.setLocationX(e.getX());
this.MouseInput.setLocationY(e.getY());
if(this.UIManager != null)
{
this.UIManager.mouseMove(e);
}
} | 1 |
public static MovementAction convertDirToAct(Direction currentDirection){
switch(currentDirection){
case EAST:
return MovementAction.MOVE_RIGHT;
case NORTH:
return MovementAction.MOVE_UP;
case SOUTH:
return MovementAction.MOVE_DOWN;
case WEST:
return MovementAction.MOVE_LEFT;
default:
return ... | 4 |
@Override
public Validator getValidator() {
return this.validator;
} | 0 |
private void prepareInstallButton() {
installButton = new JButton(CONFIG_LABEL_BUTTON);
installButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
try {
if(MODE.INSTALL.equals(mode)){
operationSystemManager.install(new ArrayList<JDK>( jdks ),jTextPane);
... | 6 |
public static boolean hasMethod(Class<?> clazz, String methodName,
Class<?>... paramTypes) {
return (getMethodIfAvailable(clazz, methodName, paramTypes) != null);
} | 2 |
public void cambiarPosicionJugado1(){
for(int x=0;x<8;x++){
for(int y=0;y<8;y++){
if(pd.mapa_jugador2[x][y].equals(codigo))
pd.mapa_jugador2[x][y]="";
}
}
int x=rd.nextInt(0)+7;
int y=rd.nextInt(0)+7;
set... | 3 |
private void packFlac() throws IOException {
// get output file
File outFile = getOutputFile();
if (outFile == null) return;
BitOutputStream os = null;
FileOutputStream fos;
try {
fos = new FileOutputStream(outFile);
os = new BitOutputStream(fos);
... | 8 |
@Override
public void run()
{
if(minecraft.session != null)
{
HttpURLConnection connection = null;
try {
connection = (HttpURLConnection)new URL("http://www.minecraft.net/skin/" + minecraft.session.username + ".png").openConnection();
connection.setDoInput(true);
connection.setDoOutput(false);... | 4 |
public void deleteLevel(int ID) {
if (ID < 0 || ID > 4) {
if (ChristmasCrashers.isDebugModeEnabled())
System.err.println("Failed to delete level " + ID + " - invalid level ID (must be between 0 and 4, inclusive).");
return;
}
if (levels[ID] == null) {
if (ChristmasCrashers.isDebugModeEnabled())
S... | 5 |
public JavaClassNameParser(String className){
if(StringUtils.isBlank(className)){
throw new InvalidParameterException("className is empty");
}
if(!className.contains(".")){
className = className;
return;
}
this.packageName = className.substrin... | 2 |
public boolean isAdminPlayer(Player p) {
parent.log.debug("Checking if " + p.getName() + " is a CB admin");
if (parent.getConfig().getBool(Option.ServerOpIsAdmin) && p.isOp()) {
parent.log.debug(p.getName() + " is a server operator, and serverOpIsAdmin is set");
return true;
}
if (checkNijikokunPermiss... | 5 |
@Override
public String toString() {
return convertToString(cur);
} | 0 |
public void handleAddInputAlphabetButton() {
String alphabet = startView.getInputAlphabetTextField().getText().trim();
if((alphabet.length() > 0) && (startView.getInputAlphabetItems().contains(alphabet) == false)){
startView.getInputAlphabetItems().addElement(alphabet);
s... | 6 |
void loadFile(File file) {
try {
if (file.isAbsolute() && file.exists()) {
BufferedReader in = new BufferedReader(new FileReader(file));
String str;
StringBuilder b = new StringBuilder();
while ((str = in.readLine()) != null) {
... | 4 |
private boolean checkPsd() throws IOException {
byte[] a = new byte[24];
if (read(a) != a.length) {
return false;
}
final byte[] PSD_MAGIC = {0x50, 0x53};
if (!equals(a, 0, PSD_MAGIC, 0, 2)) {
return false;
}
format = FORMAT_PSD;
width = getIntBigEndian(a, 16);
height = getIntBigEndian(a, 12);
... | 5 |
public void writeToFile(List<Entry> entryList) {
Path file = Paths.get(mPath + "/database-1psw.csv");
try {
Files.deleteIfExists(file);
Files.createDirectories(Paths.get(mPath));
file = Files.createFile(file);
} catch (IOException e) {
System.err.p... | 3 |
public Status solve() {
Status status = grid.solve();
if (status != Status.SOLVED) {
return status;
}
for (int i = 0; i < size*size; i++) {
for (int j = 0; j < size*size; j++) {
if (!containsValue[i][j]) {
containsValue[i][j] =... | 4 |
private void initEvents(){
startButtonclick();
} | 0 |
@Override
public Object getAsObject(FacesContext context,
UIComponent component, String newValue)
throws ConverterException {
logger.log(Level.INFO, "Entering CreditCardConverter.getAsObject");
if (newValue.isEmpty()) {
return null;
}
// Since t... | 6 |
public void setPriority(Priority priority) {
this.priority = priority;
} | 0 |
private void initialize() {
this.setBounds(100, 100, 250, 140);
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
JButton b1 = new JButton("Nouveau");
b1.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent arg0) {
// On demande d'abord où l'utilisateur souhaite enreg... | 6 |
@Test
@Ignore
public void runTestReflection2() throws IOException {
InfoflowResults res = analyzeAPKFile("Reflection_Reflection2.apk");
Assert.assertEquals(1, res.size());
} | 0 |
@Override
protected boolean processSourceMessage(CMMsg msg, String str, int numToMess)
{
if(msg.sourceMessage()==null)
return true;
int wordStart=msg.sourceMessage().indexOf('\'');
if(wordStart<0)
return true;
String wordsSaid=CMStrings.getSayFromMessage(msg.sourceMessage());
if(wordsSaid == null)
... | 7 |
public static void main(String[] args) {
if (args.length < 1) {
System.out.println("Usage: DirListing DirectoryName");
System.exit(0);
}
Path dirPath = Paths.get(args[0]);
DirectoryStream<Path> directory = null;
try {
directory = Files.newDirectoryStream(dirPath);
for (Path p : directory) {
S... | 5 |
public boolean iniciarConexion() throws GlobalException, NoDataException, SQLException{
boolean exito = false;
try {
conectar(user, pass,ip,port,db);
exito = true;
}
catch(ClassNotFoundException ex)
{
exito = false;
}
... | 2 |
public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
Player player = null;
if (sender instanceof Player) {
player = (Player) sender;
}
if (args.length == 0) {
if (player == null) {
sender.sendMessage(ChatColor.RED+"This command can o... | 9 |
@Override
public boolean isGameOver() {
boolean gameOver = true;
for (WarMachine w : warMachine) {
if (!w.isVersenkt())
gameOver = false;
}
if (gameOver) {
Regeln.setGameOver();
return true;
} else
return false;
} | 3 |
public void copyJump(Jump jump) {
if (this.jump != null)
throw new AssertError("overriding with moveJump()");
if (jump != null) {
this.jump = new Jump(jump);
this.jump.prev = this;
}
} | 2 |
private MouseAdapter createPlaylistTreeMouseListener()
{
return new MouseAdapter()
{
@Override
public void mousePressed(MouseEvent e)
{
handleMouseEvent(e);
}
@Override
public void mouseReleased(MouseEvent e)
{
handleMouseEvent(e);
}
private void handleMouseEvent(MouseEvent e)
... | 9 |
@Override
public void run() {
// TODO Auto-generated method stub
try {
System.out.println("sendMail()");
MimeMessage message = new MimeMessage(session);
DataHandler handler = new DataHandler(new ByteArrayDataSource(
messageBody.getBytes(), "text/plain"));
message.setSender(new InternetAddress(mess... | 5 |
public boolean isMouseOverCloseButton(Point mousePosition) {
if(mousePosition == null || fButtonShape == null) {
return false;
}
return fButtonShape.contains(mousePosition);
} | 2 |
public void setErrorMessage(final String errorMessage) {
this.errorMessage = errorMessage;
} | 0 |
private static void addMetadata( OtuWrapper wrapper, File inFile, File outFile) throws Exception
{
int metaLineSize = getMetaLine().split("\t").length;
HashMap<Integer, String> metaMap = getMetadataLines();
BufferedReader reader = new BufferedReader(new FileReader(inFile));
BufferedWriter writer = new Bu... | 6 |
public static ArrayList<RobotIntel> forget(String name) {
if (debug)
System.out.println("Removing " + name + " from log");
return log.remove(name);
} | 1 |
private void verifDoublonId(List<Noeud> reseau, List<Livraison> livraisons, int id) throws XmlParserException
{
try
{
if (!(reseau==null))
{
if(!reseau.get(id).equals(null))
{
throw new XmlParserException("Erreur s???mantique:Pr???sence de doublons (M???mes identifiants)");
}
}
if (!(... | 6 |
@Override
public boolean assembleCode() {
this.readAssemblyFile();
if (this.fileReference != null) { //Only assemble if file successfully opened
//Operands are assembled first so their symbolic references can be mapped to actual addresses
this.separateOperands();
//Assemble the operands (represented... | 6 |
public final static ArrayList<DropTargetContainer<JPanel, JPanel, JPanel>> createTargets() {
final Field[] instrumentFields = MidiInstrument.class.getFields();
final ArrayList<DropTargetContainer<JPanel, JPanel, JPanel>> instruments = new ArrayList<>(
instrumentFields.length + 1);
final Class<MidiInstrument> ... | 4 |
private Error removeProtection() {
Error ret = null;
try {
FileUtil.createDirectory(Constants.PROGRAM_BACKUP_PATH);
if (!FileUtil.setProtection(this.authuiSystemfilePath, false) || // Make the systemfiles replaceable.
!FileUtil.setProtection(this.basebrdSyste... | 3 |
public void writeDefaultIniFilesIfNeeded()
{
BufferedWriter output;
FileOutputStream outputStream;
File testDir = new File(Constants.DATA_DIR);
if (!testDir.exists())
{
testDir.mkdir();
}
File testFile = new File(Constants.MEDIA_LIBRARY_INI);
if (!testFile.exists() || (testFile.exists() && testFil... | 9 |
public void validaCamposEndereco(String cep, String rua, String numero, String bairro, String cidade) {
if (cep.replaceAll("-", "").trim().isEmpty()) {
JOptionPane.showMessageDialog(null, "CEP Inválido");
txt_cep.requestFocus();
} else {
if (rua.isEmpty()) {
... | 5 |
private void jButton9ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton9ActionPerformed
liceu.Administrator admin = new liceu.Administrator(usernameSecretar.getText(), parolaSecretar.getText(),ncSecretar.getText(),cnpSecretar.getText(),"Secretar");
admin.addUser();
userna... | 5 |
private static int grade(int beh) {
switch (beh) {
case 0: return 0;
case 1: case 2: case 3: return 1;
case 12: case 13: case 14: return 2;
case 15: return 3;
default: return 4;
}
} | 8 |
public void generateDatabase(int sequenceCount, int maxDistinctItems, int itemCountByItemset,
int itemsetCountBySequence, String output, boolean withTimestamps) throws IOException {
// We create a BufferedWriter to write the database to disk
BufferedWriter writer = new BufferedWriter(new FileWriter(output));... | 7 |
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.