text stringlengths 14 410k | label int32 0 9 |
|---|---|
public byte[] encrypt(byte[] text, String key){
// System.out.println("encrypting");
byte[] textEncrypted = null;
try{
//keygenerator.init(bits); // 192 and bits bits may not be available
byte[] keyPadded = new byte[bits / 8];
for(int i = 0; i < bits / 8 && i < key.length(); i++){
keyPadded[i] = ... | 7 |
protected void checkForHitRight(Paddle paddle) {
if (ballX >= (paddle.getX() - ballSize)) {
if (ballY >= paddle.getY() - ballSize + 1
&& ballY <= paddle.getY() + paddle.getLength() - 1) {
hits2++;
dx = left;
dy = 0; // this is a direct hit
int paddleCenter = paddle.getY() + paddle.getLeng... | 5 |
protected void doPost(HttpServletRequest request,
HttpServletResponse response) throws ServletException, IOException {
conn = DatabaseConnection.getConnection();
response.setContentType("text/html");
String name = request.getParameter("name");
String surname = request.getParameter("surname");
String number... | 6 |
private Object formatKeys(List<Number> keys, JdbcBatchUpdateDefinition batchUpdateDefinition) {
if (batchUpdateDefinition.isReturnList()) {
return keys;
}
int length = keys.size();
// 将返回结果从List<? extends Number>转换为数组
Class<?> componentType = batchUpdateDefinition.getReturnComponentType();
if (!ClassHel... | 3 |
private void readEvents(BufferedReader reader) throws IOException {
for(int i=0; i<nEvents; i++) {
String line = reader.readLine();
String[] fields = line.split(":");
int id = Integer.parseInt(fields[0]);
String type = fields[1];
if(type.equals("O")) {
String name = fields[2];
int idBranch = In... | 9 |
private static void addElement(ArrayList<ArrayList<Integer>> rowIndexes, ArrayList<ArrayList<String>> colIndexes, ArrayList<Double> values,
ArrayList<Double> diag, int row, int col, double value) throws NumberFormatException {
boolean positionOcupied = false;
if (row == col) {
Double diagElem = diag.get(col... | 6 |
private ConnectionBDD() {
try
{
Class.forName("com.mysql.jdbc.Driver");
conn= (Connection) DriverManager.getConnection(url,login,passwd);
st= (Statement) conn.createStatement();
}
catch(ClassNotFoundException cnfe){
Logger.getLogger(Conne... | 2 |
public static void parseLine(String line, Species s) {
line= line.trim();
int k= line.indexOf('=');
if (k < 0)
return;
String attribute= line.substring(0,k).trim();
String value= line.substring(k+1).trim();
if (attribute.equals("Name")) {
s.setNa... | 7 |
public static void main(String[] args) throws IOException
{
// get sheet
readExcel instance = new readExcel();
XSSFWorkbook riverside_jobs = instance.readWorkbook();
XSSFSheet sheet = riverside_jobs.getSheetAt(0);
// iterate through rows, construct full address, send to goog... | 4 |
public void done() throws IOException {
w.flush();
if (file != null) {
w.close();
}
} | 1 |
public void renderCollisionLayerTile(int xp, int yp, Tile tile) {
xp -= xOffset;
yp -= yOffset;
Sprite sprite = tile.getSprite();
for (int y = 0; y < sprite.SIZE; y++) {
int ya = y + yp;
for (int x = 0; x < sprite.SIZE; x++) {
int xa = x + xp;
if (xa < -sprite.SIZE || xa >= width || ya < 0 || ya >... | 8 |
@Override
public void start()
throws Exception {
String name, surname, alias, email, role;
Date joined;
List<Author> authors= par.getMFESetup().getAuthors();
Iterator<Author> iter= authors.iterator();
while(iter.hasNext()) {
Author aut= iter.next();
name= aut.getName();
surname= aut.ge... | 1 |
public static void q4(String[] args) throws Exception{
//Question 9.4: Write a method to return all subsets of a set
SOP("Running q4");
if(args.length < 2){
SOP("ERROR: Must specify at least one element for the set");
return;
}
int[] mArray = new int[args... | 5 |
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Position other = (Position) obj;
if (Double.doubleToLongBits(accuracy) != Double.doubleToLongBits(other.accuracy))
return false;
if (Double.... | 6 |
public void update() {
if (!won && !dead) {
if (hasStarted) {
elapsedMS = (System.nanoTime() - startTime) / 1000000;
fromattedTime = formatTime(elapsedMS);
} else {
startTime = System.nanoTime();
}
}
checkKeys();
for (int row = 0; row < ROWS; row++) {
for (int col = 0; col < COLS; col... | 6 |
private void insertArgument(int row) {
// Get the argument name
String argumentName = (String) JOptionPane.showInputDialog(
this, // owner
"Enter unique macro argument label", // Message
"Macro Builder", // Title
JOptionPane.PLAIN_MESSAGE);... | 5 |
public static byte[] decodeBase64(byte[] base64Data) {
// RFC 2045 requires that we discard ALL non-Base64 characters
base64Data = discardNonBase64(base64Data);
// handle the edge case, so we don't have to worry about it later
if (base64Data.length == 0) {
return new byte[0]... | 8 |
private QueueElement searchMax(){
QueueElement current = head;
QueueElement maxQueueElement = head;
while (current != tail.next()) {
if (current.getPriority() > maxQueueElement.getPriority()) {
maxQueueElement = current;
}
current = current.nex... | 2 |
public BigNumber add(BigNumber two) {
checkForDigitAmount(this, two); // Check to see if both BigNumbers being
// added have a difference in the number
// of digits
int carry = 0;
// BigNumber sum = new BigNumber("");
StringBuilder sb = new StringBuilder();
for (int i = digits.size() - 1,... | 6 |
@Override
public void keyPressed(KeyEvent e) {
} | 0 |
public void initGroup(String group, String[][] props) {
if (!isGroup(group)) {
RegistryGroup rg = new RegistryGroup();
for (int i = 0; i < props.length; i++) {
String[] prop = props[i];
if (prop == null || prop.length == 0) {
continue;
}
String propName = prop[0... | 6 |
public void save() throws IOException {
BufferedReader reader;
try {
reader = new BufferedReader(new FileReader(System.getProperty("resources") + "/database/factions"));
String line;
StringBuilder fileContent = new StringBuilder();
String newLine = null;
while((line = reader.readLine()) != null) {
... | 5 |
public void calculateLeader(){
for(int i = 1; i <= sizeOfNetwork; i++){
if(!isSuspect(i)){
if(i>leader){
leader = i;
}
}
}
} | 3 |
public void setTurnHolder(Player turnHolder) {
Player oldTurnHolder = this.turnHolder;
System.out.println("Chiamata a setTurnHolder");
if (this.turnHolder == turnHolder) return;
if (turnHolder == null) throw new NullPointerException("turnHolder is null");
//Check that is active
if (!turnHolder.isActive(... | 7 |
public int bitrate()
{
if (h_vbr == true)
{
return ((int) ((h_vbr_bytes * 8) / (ms_per_frame() * h_vbr_frames)))*1000;
}
else return bitrates[h_version][h_layer - 1][h_bitrate_index];
} | 1 |
protected int readBlock() {
blockSize = read();
int n = 0;
if (blockSize > 0) {
try {
int count = 0;
while (n < blockSize) {
count = in.read(block, n, blockSize - n);
if (count == -1)
break;
n += count;
... | 5 |
public static Hand Straight(Rank highCard) {
return new Hand(HandRank.Straight, null, highCard, Rank.Null, Rank.Null, Rank.Null, Rank.Null);
} | 0 |
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 int compare(Object a, Object b) throws ClassCastException
{
if(a == null){
return -1;
}
else if(b == null){
return 1;
}
else if(a == null && b == null ){
return 0;
}
else{
MessageBid bida = (MessageBid... | 4 |
protected void interrupted() {
end();
} | 0 |
public void setOpenHr(int i, int j, boolean k){
openHr[i][j]=k;
} | 0 |
public static void exportCapabilities(){
BufferedWriter file =null;
String nameFile = "UsiExporIlot";
try{
File dir = new File("export");
dir.mkdirs();
FileWriter fileWriter = new FileWriter("export\\" + nameFile + ".csv");
file = new Buf... | 6 |
private void editorPaneMouseMoved(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_editorPaneMouseMoved
int mousex=evt.getX();
int mousey=evt.getY();
int currentTab= this.editorPane.getSelectedIndex();
if (this.cursor==cursorTypes.WALL || this.cursor==cursorTypes.DOOR || this.cursor==... | 8 |
private static byte[] toPDF(final byte[] tex) throws IOException {
// find command
synchronized (PDF_LATEX_ARGS) {
if (pdfLaTeX == null) {
final File mac = new File("/usr/texbin/pdflatex");
if (mac.canExecute()) {
pdfLaTeX = mac.getPath();
} else {
final String... | 4 |
@Override
public boolean apply(ICreature input) {
if (input == observer) {
return false;
}
double dirAngle = input.directionFormAPoint(observer.getPosition(),
observer.getDirection());
return abs(dirAngle) < (observer.getFieldOfView() / 2)
&& observer.distanceFromAPoint(input.getPosition())... | 2 |
public boolean equals(Object obj)
{
if(obj instanceof MiniCompound)
{
MiniCompound miniCompound = ((MiniCompound)obj);
ArrayList<Element> copy = new ArrayList<Element>(miniCompound.elements.length); //populate ArrayList
copy.addAll(Arrays.asList(miniCompound.elements));
boolean matchFound = true;
... | 6 |
@Override
public String displayText()
{
if(juggles.size()>0)
{
final StringBuffer str=new StringBuffer(L("(Juggling: "));
final SVector<Item> V=juggles.copyOf();
for(int i=0;i<V.size();i++)
{
final Item I=V.elementAt(i);
boolean back=false;
for(int ii=0;ii<i;ii++)
{
final Item I2=... | 8 |
public void checkBricks() {
if (getFacedUpCount() < 2)
return;
ArrayList<BrickModel> facedUp = new ArrayList<BrickModel>();
for (BrickModel brick : bricks)
if (brick.getState() == State.FACE_UP)
facedUp.add(brick);
if (facedUp.size() > 2) {
... | 7 |
public String createSubForum(User invoker ,User moderator, String subForumName) {
if (!invoker.hasPermission(Permissions.CREATE_SUB_FORUM) || !TextVerifier.verifyName(subForumName, new Policy()) || moderator == null) return null;
SubForum newSF = new SubForum(subForumName, moderator);
subForums.add(newSF);
s... | 3 |
@Override
public boolean equals(Object other) {
if (other == null)
return false;
if (!(other instanceof HostInfo))
return false;
if (other == this)
return true;
HostInfo otherHost = (HostInfo) other;
if (this.address.equals(otherHost.address) && this.port == otherHost.port) {
return true;
} els... | 5 |
public JTextPane getLeftChatBox()
{
return leftChatBox;
} | 0 |
MultiThreadMultiplier(LinkedList<int[][]> matrices) {
System.out.println("From multi! Size: " + matrices.size());
this.matrices = matrices;
if(this.matrices.isEmpty())
return;
if(this.matrices.size()%2 != 0)
this.matrices.add(this.getDummy());
LinkedList<MatrixThread> threads = new LinkedList<MatrixT... | 7 |
@Override
public void move(Excel start, Excel end) {
// TODO Auto-generated method stub
if (start.getX() == begin.getX() && start.getY() == begin.getY())
{
begin = end;
setColoredExes();
}
} | 2 |
public int getData(int x, int y) {
if (x < 0 || y < 0 || x >= w || y >= h) return 0;
return data[x + y * w] & 0xff;
} | 4 |
static int figureOutIndex(Dimension[] dimensions, int[] indexes) {
int index = 0;
for (int i = (dimensions.length - 1); i > 0; i--) {
int mult = dimensions[0].getSize();
for (int j = 1; j < i; j++) {
mult = mult * dimensions[j].getSize();
}
... | 2 |
private static int findMostNeg(int[] a){
int min = 0;
int minIndex = -1;
for(int i=l;i<=r;i++){
if(a[i]<min && used[i]==false){
min = a[i];
minIndex = i;
}
}
if(minIndex > 0) used[minIndex]=true;
return min;
} | 4 |
private void initialize() {
OK = GUITreeLoader.reg.getText("ok");
CANCEL = GUITreeLoader.reg.getText("cancel");
RESTORE_TO_GLOBAL = GUITreeLoader.reg.getText("restore_to_application_preferences");
LINE_TERMINATOR = GUITre... | 2 |
public void setPanelWmarkFrom(JPanel newPanelWmark) {
this.panelWmark.setSize((int)(newPanelWmark.getWidth()/this.stretchKoeffBigImage),
(int)(newPanelWmark.getHeight()/this.stretchKoeffBigImage)) ;
ShapeDrawComponent shapeComp=null;
ImageComponent imageComp=null;
Component comps[]=newPanelWmark.getComponents()... | 7 |
public static int setMin_period(int new_min_period) {
if (new_min_period > 0 && new_min_period <= max_period) {
min_period = new_min_period;
return min_period;
} else {
return -1;
}
} | 2 |
@Override
public void setAsText(String text) throws IllegalArgumentException {
if (text == null || text.equals(""))
text = "0";
if (!StringUtils.hasText(text)) {
setValue(null);
} else {
setValue(Double.parseDouble(text));// 这句话是最重要的,他的目的是通过传入参数的类型来匹配相应的databind
}
} | 3 |
public static void main(String[] args) {
//ObjectFactory objFact = new ObjectFactory();
String movie = "";
TrivPost item = null;
while(true)
{
movie = CLib.input("Movie ID:");
//JAXBContext context = null;
try {
/*context = JAXBContext.newInstance(Root.class);
File file = new File("./omdbapi... | 5 |
@Override
public void execute(Player player, String[] args)
{
if(player.isAfk())
{
player.setAfk(false);
player.getChat().serverBroadcast(player.username + " is no longer afk.");
} else {
player.setAfk(true);
player.getChat().serverBroadcast(player.username + " is now afk...");
}
} | 1 |
public MethodInfo[] getMethods() {
if ((status & METHODS) == 0)
loadInfo(METHODS);
return methods;
} | 1 |
public Decision takeDecision(IPersonToStrategy person, PersonalEnvironment personEnvir, Habitat settlement)
{
if (inDangerous(person))
{
return new TraderHealing();
}
if (person.getEquipment().howMoneyInCash() < 10) {
ChangeProfession decision = new ChangeProf... | 6 |
public final Instruction getNextByAddr() {
if (nextByAddr.opcode == opc_impdep1)
return null;
return nextByAddr;
} | 1 |
public int sumLookback( int optInTimePeriod )
{
if( (int)optInTimePeriod == ( Integer.MIN_VALUE ) )
optInTimePeriod = 30;
else if( ((int)optInTimePeriod < 2) || ((int)optInTimePeriod > 100000) )
return -1;
return optInTimePeriod-1;
} | 3 |
public boolean equals(Object x)
{
if (! (x instanceof TypePlusCondition))
return false;
else
{
TraversalCondition c = (TraversalCondition)x;
return HGUtils.eq(startAtom, c.startAtom) &&
HGUtils.eq(linkPredicate, c.linkPredicate) &&
HGUtils.eq(siblingPredicate, c.siblingPredicate) &&
... | 7 |
private void analyzeCurrentMemoryStatus() {
System.out.println("================= Current Memory Status =================");
System.out.println("## Current framework objects (TODO: add configurations)");
System.out.println("| Location \t | FrameworkObj \t| Inner object \t| retainedHeap \t| Reason (from mappe... | 8 |
public static void main(String[] args) {
if (args.length > 0) {
System.out.println("ㅎ2ㄹ ㅂㄱㄹ");
System.out.println("ㅎ2ㄹ ㅂㄱㄹ");
}
} | 1 |
public static void addChildsToNanoPostsInList(ArrayList<NanoPost> npList) {
for (NanoPost np : npList) {
np.getChilds().clear();
for (NanoPost npp : npList) {
if (np.isParentOf(npp)) {
np.addChild(npp);
}
}
... | 3 |
@Override
public void setDef(String value) {this.def = value;} | 0 |
public Login() {
setTitle("Login");
setDefaultCloseOperation(JDialog.DO_NOTHING_ON_CLOSE);
setResizable(false);
setModal(true);
int width = 300;
int height =135;
Dimension screen = Toolkit.getDefaultToolkit().getScreenSize();
int x = (screen.width-width)/2;
int y = (scr... | 3 |
@Override
public boolean invoke(MOB mob, List<String> commands, Physical givenTarget, boolean auto, int asLevel)
{
MOB target=this.getTarget(mob,commands,givenTarget);
if(target==null)
return false;
if(target.fetchEffect(ID())!=null)
{
mob.tell(L("You already healed by electricity."));
return false;
... | 9 |
@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 TipoPessoa)) {
return false;
}
TipoPessoa other = (TipoPessoa) object;
if ((this.id == null && other.id != null... | 5 |
public void run()
{
int i = 0;
while(true)
{
// System.out.println("number : " + i++);
System.out.println("number : " + this.i++);
try{
Thread.sleep((long)Math.random() * 6000);
}
catch(InterruptedException e)
{
e.printStackTrace();
}
// if(50 == this.i)
if(50 == this.i)
... | 3 |
public String displayInfo() {
super.displayInfo();
return "The lion is the king of the Jungle. Lions\nlive in the "+location;
} | 0 |
private int maxChildPos( int pos ) {
int retVal;
int lc = 2*pos + 1; //index of left child
int rc = 2*pos + 2; //index of right child
//pos is not in the heap or pos is a leaf position
if ( pos < 0 || pos >= _heap.size() || lc >= _heap.size() )
retVal = -1;
//if no right child, then left child is only optio... | 5 |
@Override
public void applyUIFileInTempAuthui(SkinPropertiesVO props, final UIFileTextVO uifile) throws IOException, InterruptedException {
if ((props == null) || (uifile == null)) {
IllegalArgumentException iae = new IllegalArgumentException("The props/uiFile must not be null!");
Ma... | 2 |
public List<Column> tableColumns(String schemaName, String tableName) throws SQLException {
String query = String.format(getColumnsStatement, tableName, schemaName);
ResultSet rs = statement.executeQuery(query);
List<Column> result = new ArrayList<Column>();
while (rs.next()) {
... | 1 |
public boolean handleEvent (Event event) {
if (event.id == Event.WINDOW_DESTROY ||
(event.id == Event.ACTION_EVENT && event.target == okayButton) ||
(event.id == Event.KEY_PRESS && event.key == 0x1b))
{
hide();
return true;
}
else return super.handleEvent (event);
} | 9 |
@Override
public void setBirth(String birth) {
super.setBirth(birth);
} | 0 |
@Override
public List<AssemblyLine> generate(Context context)
{
final List<AssemblyLine> lines = Lists.newLinkedList();
if (Compiler.debug)
{
lines.add(new Comment("Start condition"));
}
if (children.size() == 1)
{
context.setValue... | 8 |
public void addFolder(String sent)
{
USBList hld = head;
Boolean exit = false;
while(hld != null && !exit)
{
if(hld.getName().equals(sent))
exit = true;
else
hld = hld.getNext();
}
if(hld == null || !exit)
return;
(hld.getWifiRC()).mkdirs();
} | 5 |
public final static String getAvailabilityString (int availabilityCode) {
switch (availabilityCode) {
case ROSTER_ABSENT: return "-";
case ROSTER_PARTICIPATES: return "T"; // Teilnehmer
case ROSTER_VACATION: return "U"; // Urlaub
case ROSTER_AVAILABLE: return "A"; // Arbeitet
case ROSTER_OFFICE... | 5 |
@Override
public void actionPerformed(ActionEvent e) {
if (e.getSource() == exitButton)
System.exit(0);
// must have been the 'seek' button that was pressed,
// so clear the output area of any previous output...
report.setText("");
// retrieve the url from the input text field...
String host = hostInpu... | 4 |
public static ArrayList<Integer> getMaps(String searchTerm, String criterion) {
ArrayList<Integer> result= new ArrayList<Integer>();
searchTerm= searchTerm.trim();
if(searchTerm.isEmpty()) return result;
String query= "";
if(criterion.equals("giorno")){
query= findStoriesForDay(searchTerm);
}
if(criter... | 7 |
public String FindMotif(Vector Set,Vector in,double cutoff,int[] Numbers) {
int size = in.size();
int Dim = Set.elementAt(0).toString().length();
int Pmatrix[][] = new int[Dim][21];
char template[] = new char[Dim];
int Number = 0 ;
Iterator list = in.iterator();
String temp = "";
int ... | 9 |
final void method3651(za var_za) {
do {
try {
((OpenGlToolkit) this).aNativeHeap7730
= ((za_Sub1) (za_Sub1) var_za).aNativeHeap9770;
anInt7573++;
if (anInterface2_7797 != null)
break;
FloatBuffer class348_sub49_sub1
= new FloatBuffer(80);
if (!((OpenGlToolkit) this).aBoolean7775) {
... | 5 |
@Override
public boolean equals(Object other)
{
boolean result = false;
if (other instanceof MultiConnectionRoute)
{
MultiConnectionRoute that = (MultiConnectionRoute)other;
result = this.connections.equals(that.connections);
}
return result;
} | 1 |
public boolean teleport() {
if (Players.getLocal().getAnimation() == -1) {
Timer wait = new Timer(1);
final WidgetChild TELEPORT_TAB = Widgets.get(275, 46);
if (Tabs.ABILITY_BOOK.open() && !TELEPORT_TAB.visible()) {
WidgetChild magicTabButton = Widgets.get(275... | 8 |
public PlayerEntity(TileLevel level, Tile startingTile) {
super(level, startingTile);
standAnim = null;
moveAnim = null;
bumpAnim = null;
if(PlayerEntity.STAND_ANIMATIONS != null && PlayerEntity.MOVE_ANIMATIONS != null && PlayerEntity.BUMP_ANIMATIONS != null)
copyAnimations();
} | 3 |
private void jButtonNextActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonNextActionPerformed
ctrlCR.suivant();
}//GEN-LAST:event_jButtonNextActionPerformed | 0 |
public static void main(String[] args) throws Exception {
ExecutorService exec = Executors.newCachedThreadPool();
CountDownLatch latch = new CountDownLatch(SIZE);
for (int i = 0; i < 10; i++)
exec.execute(new WaitingTask(latch));
for (int i = 0; i < SIZE; i++)
exe... | 2 |
@Override
protected void reduce(Text key, Iterable<Text> values, Context context) throws IOException, InterruptedException {
if (times == 0) {
context.write(new Text("grandchild"), new Text("grandparent"));
times++;
}
int parentCount = 0;
... | 8 |
@Override
public void paintComponent(Graphics graphics) {
super.paintComponent(graphics);
if (data == null) {
return;
}
final int xAxisSize = 40;
final int yAxisSize = 60;
final int yAxisLines = 10;
final... | 4 |
public T getFoo()
{
return foo;
} | 0 |
@Override
public List<Person> meetCriteria(List<Person> persons) {
List<Person> malePersons = new ArrayList<>();
for (Person person : persons) {
if (person.getGender().equalsIgnoreCase("Male")) {
malePersons.add(person);
}
}
return malePersons;
} | 2 |
public boolean contains(String datum) {
return indexOf(datum) >= 0;
} | 0 |
@Override
public synchronized void velocityChanged(float vx, float vy, float vz) {
long temp = System.currentTimeMillis();
long timeStamp = LastVelocityReadTime - temp;
LastVelocityReadTime = temp;
if(VelocityXSamples.size() >= NrOfSamples)
{
Vel... | 4 |
public boolean deleteFilesFromSystem(ArrayList<String> deleteFileRequests)
{
boolean status = true;
if(deleteFileRequests != null)
{
for(String fileName : deleteFileRequests)
{
ArrayList<String> localfiles = fileInventoryManager.getLocalFiles();
if(localfiles != null)
{
boolean isLoc... | 5 |
public boolean addFrame(BufferedImage im) {
LogPrint.note(this, "addFrame");
if ((im == null) || !started) { return false; }
boolean ok = true;
try {
if (!sizeSet) {
// use first frame's size
setSize(im.getWidth(), im.getHeight());
... | 7 |
public void sincronizarViewComModel(Servico model) {
if (model.getId() != null) {
txtItendificador.setText(model.getId().toString());
}
if (model.getTipoDeServico() != null) {
cbServicos.setSelectedItem(model.getTipoDeServico());
}
if (model.getCliente(... | 6 |
protected boolean parseArgs(String[] args)
{
boolean parsed = false;
if (args.length == 1)
{
init(args[0]);
parsed = true;
remote = false;
}
else if (args.length == 2)
{
if (!(args[0].equals("-url")))
{
showUsage();
}
else
{
init(args[1]);
parsed = true;
remote = tru... | 3 |
public static FileInputStream createInputStream(File file) throws IOException {
if (file.exists()) {
if (file.isDirectory()) {
throw new IOException("File '" + file + "' exists but is a directory");
}
if (!file.canRead()) {
throw new IOExceptio... | 3 |
private void handleBooleanProperty(final String name) {
String s = null;
try {
s = System.getProperty(name);
} catch (SecurityException x) {
if (DEBUG) debug("SecurityManager forbids reading system properties. Ignored");
}
if (s != null) {
s = s.trim().toLowerCas... | 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 ht... | 6 |
public static Object escape(Object original) {
if (original instanceof Character) {
char u = (char) ((Character)original);
int idx = "\b\t\n\f\r\"\'\\".indexOf(u);
if (idx >= 0)
return "\\"+"btnfr\"\'\\".charAt(idx);
if (u < 32)
re... | 8 |
public void kill(){
this.animation = deathAnim;
if(!dead){
dead = true;
SoundLibrary.playSound("catdead.wav");
deathAnim.start();
}
dead = true;
} | 1 |
@Override
public void run() {
while (monitor.isAlive()) {
inputSemaphore.take();
switch (input.getChoice()) {
case ClockInput.SET_TIME:
setTime = input.getValue();
break;
case ClockInput.SET_ALARM:
... | 5 |
private void avoidFromEdge(int[][] currentTokens) {
//move currentTokens to the right if they are at right edge
while (x0 < 0 || x1 < 0 || x2 < 0 || x3 < 0) {
currentTokens[0][0]++;
currentTokens[1][0]++;
currentTokens[2][0]++;
currentTokens[3][0]++;
... | 8 |
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.