text stringlengths 14 410k | label int32 0 9 |
|---|---|
public void setMinCount(int newMin) {
if (headCount < newMin) {
GlobalOptions.err
.println("WARNING: something got wrong with scoped class "
+ clazzAnalyzer.getClazz() + ": " + newMin + ","
+ headCount);
new Throwable().printStackTrace(GlobalOptions.err);
headMinCount = headCount;
} else... | 2 |
@SuppressWarnings("unchecked")
@Override
protected boolean canRun(ClassNode node) {
if (node.superName.isEmpty()) {
return false;
}
int string = 0, model = 0;
ListIterator<FieldNode> fnIt = node.fields.listIterator();
while (fnIt.hasNext()) {
FieldNode fn = fnIt.next();
if ((fn.access & Opcodes.ACC... | 6 |
private void redTeamWin() {
for (String n : this.getPlayers()) {
if (this.getBlueTeam().getPlayers().contains(n)) {
PlayerStats s = plugin.getPlayerStats().get(n);
if (s != null) {
s.setLosses(s.getLosses() + 1);
} else {
... | 4 |
static String getUnitText(double v, String u) {
double va = Math.abs(v);
if (va < 1e-14)
return "0 " + u;
if (va < 1e-9)
return showFormat.format(v*1e12) + " p" + u;
if (va < 1e-6)
return showFormat.format(v*1e9) + " n" + u;
if (va < 1e-3)
return showFormat.format(v*1e6) + " " + CirSim.muString... | 8 |
public static void main(String[] args) {
String name = AdjustFileNotice.class.getSimpleName();
Attributes attributes = new Attributes();
attributes.putValue(BundleInfo.BUNDLE_NAME, name);
attributes.putValue(BundleInfo.BUNDLE_VERSION, VERSION);
attributes.putValue(BundleInfo.BUNDLE_COPYRIGHT_OWNER, COPYRIGHT_... | 5 |
public int getS1() {
return s1;
} | 0 |
public static StringBuilder grabVal() throws IOException
{
String genLine = "";
while((genLine = input.readLine())!= null)
{
sb.append(genLine);
}
return sb;
} | 1 |
public Instances getDataSet() throws IOException {
Instances result;
Vector<Double> row;
double[] data;
int i;
int n;
if (m_sourceReader == null)
throw new IOException("No source has been specified");
if (getRetrieval() == INCREMENTAL)
throw new IOException("Cannot m... | 7 |
public static int[] rotateBilinear(int[] pix, float beta, int iw, int ih, int owh) {
int[] opix = new int[owh * owh];
double t = beta / 180;
float cos_beta = (float) Math.cos(t * Math.PI);
float sin_beta = (float) Math.sin(t * Math.PI);
for (int i = 0; i < owh-1; i++) {
for (int j = 0; j < owh-1; j++) {... | 6 |
@Override
public void setValueAt(Object obj, int rowIndex, int columnIndex){
if(rowIndex > customers.size())
throw new IllegalArgumentException("Row index greater than customers size");
Customer c = customers.get(rowIndex);
switch(columnIndex){
case 1:
c.setFirstna... | 5 |
void increaseRightScore(int score)
{
setRightScore(getRightScore() + score);
} | 0 |
public static <T> ObserverMethod<T> create(ForkJoinPool pool, BeanManager bm, AnnotatedType<?> type, AnnotatedMethod<?> method, AnnotatedParameter<?> param) {
ObserverMethodHolder<T> objectMethodHolder = new ObserverMethodHolder<>();
objectMethodHolder.pool = pool;
objectMethodHolder... | 6 |
public static boolean isConnected(Board board, BoardNode node1, BoardNode node2){
//vertically aligned
if(isVerticallyAligned(node1, node2) && node1.getColor() == node2.getColor() && notBlocked(board, node1, node2)){
return true;
}
//horizontally aligned
if(isHorizontallyAligned(node1, node2) && node1.getC... | 9 |
public void addColumn(ColumnAttributes attributes) {
if (!data.isEmpty()) {
throw new MLException("Cannot add a column to a matrix that contains rows");
}
columnAttributes.add(attributes);
} | 1 |
public static boolean isFileURL(URL url) {
String protocol = url.getProtocol();
return (URL_PROTOCOL_FILE.equals(protocol) || protocol.startsWith(URL_PROTOCOL_VFS));
} | 1 |
private void initLargerView()
{
table = new GrammarTable(model);
table.getTableHeader().setReorderingAllowed(false);
TableColumn lhs = table.getColumnModel().getColumn(0);
TableColumn arrows = table.getColumnModel().getColumn(1);
TableColumn rhs = table.getColumnModel().getColumn(2);
lhs.setHeaderValue("LH... | 0 |
@Override
public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException {
Path p = file.getFileName();
if (attrs.isRegularFile() && p != null) {
Pattern pat = Pattern.compile(combineRegex(), Pattern.CASE_INSENSITIVE);
Matcher m = pat.matcher(p.toString());
while (m.fin... | 3 |
public void setName(String name) {
if (StringUtils.isBlank(name)) {
throw new IllegalArgumentException("Name shouldn't be NULL or empty.");
}
this.name = name;
} | 1 |
public GenericNode getOther(GenericNode node) {
// TODO Auto-generated method stub
if(node == nodeOne)
return nodeTwo;
else if(node == nodeTwo)
return nodeOne;
else
return null;
} | 2 |
@EventHandler
public void onInventoryClick(InventoryClickEvent event) {
if (event.getWhoClicked() instanceof Player) {
ClickType clickType = event.getClick();
Player player = (Player) event.getWhoClicked();
String uuid = player.getUniqueId().toString();
ShopId... | 6 |
public static void setTypeInfoOption(int opt){
switch(opt){
case 1: Db.inputTypeInfo = true;
break;
case 2: Db.inputTypeInfo = false;
break;
default: throw new IllegalArgumentException("Option " + opt + " not rec... | 2 |
private void createMidi(Attributes attrs) {
midi = new Midi(midiDef);
// loop through all attributes, setting appropriate values
for (int i = 0; i < attrs.getLength(); i++) {
if (attrs.getQName(i).equals("x"))
midi.getStartPoint().setX(Integer.valueOf(attrs.getValue(i)));
else if (attrs.getQName(i).equa... | 9 |
private void setUp() {
File tmpUser = null;
File tmpMusic = null;
try{
tmpUser = new File("res/users.data");
tmpMusic = new File("res/musics.data");
this.setuserFileOut(new FileOutputStream(tmpUser));
this.setUserFileIn(new FileInputStream(tmpUser));
this.setMusicFileOut(new FileOutputStream(tmpMus... | 7 |
public void setIdDiagnostico(Integer idDiagnostico) {
this.idDiagnostico = idDiagnostico;
} | 0 |
protected Behaviour getNextStep() {
final Profile p = actor.base().profiles.profileFor(actor) ;
if (p.daysSinceWageEval(actor.world()) < 1) return null ;
if (pays instanceof AuditOffice) {
final AuditOffice office = (AuditOffice) pays ;
if (office.assessRelief(actor, false) <= 0) return nul... | 4 |
public String getString(int index) throws JSONException {
Object object = this.get(index);
if (object instanceof String) {
return (String) object;
}
throw new JSONException("JSONArray[" + index + "] not a string.");
} | 1 |
void smbFft(float[] fftBuffer, int fftFrameSize, int sign)
/*
FFT routine, (C)1996 S.M.Bernsee. Sign = -1 is FFT, 1 is iFFT (inverse)
Fills fftBuffer[0...2*fftFrameSize-1] with the Fourier transform of the
time domain data in fftBuffer[0...2*fftFrameSize-1]. The FFT array takes
and returns the cosine and sine... | 7 |
@Override
public void documentRemoved(DocumentRepositoryEvent e) {
// local vars
int whichOne = isThisOneOfOurs(PropertyContainerUtil.getPropertyAsString(e.getDocument().getDocumentInfo(), DocumentInfo.KEY_PATH));
// if it's one of ours ...
if (whichOne != DOCUMENT_NOT_FOUND) {
// mark it closed
docOp... | 1 |
@Override public boolean equals(Object obj) {
if (null == obj) {
return false;
}
if (this == obj) {
return true;
}
if (obj instanceof PostParameter) {
PostParameter that = (PostParameter) obj;
if (file != null ? !file.e... | 6 |
public void draw(Graphics2D g) {
if (!visible) return;
Rectangle rect = shape.getBounds();
int bx = (int)rect.getX();
int by = (int)rect.getY();
int bw = (int)rect.getWidth();
int bh = (int)rect.getHeight();
/*
if (checked) {
g.setColor(Color.GRAY)... | 5 |
void workerStop() {
if (workerThread == null) return;
synchronized(workerLock) {
workerCancelled = true;
workerStopped = true;
workerLock.notifyAll();
}
while (workerThread != null) {
if (! display.readAndDispatch()) display.sleep();
}
} | 3 |
@Override
public Object visitUnary(unary_AST node, ScopeElement data) {
if (node.primary != null) {
if (node.primary instanceof primaryExisting_AST) {
primaryExisting_AST p = (primaryExisting_AST) node.primary;
p.jjtAccept(this, data);
node.typeObj = p.typeObj;
} else if (node.primary instanceof ne... | 8 |
public static void main(String[] args){
for(int a=1;a<1000;a++){
for(int b=1;b<1000;b++){
for(int c=1;c<1000;c++){
if(a<b && b<c && a+b+c==1000 && Math.pow(a,2) + Math.pow(b,2) == Math.pow(c,2)){
System.out.println("a:" + String.valueOf(a) + " b:" + String.valueOf(b) +" c:"+ String.valueOf(c));
... | 7 |
public void mouseClicked(MouseEvent e) {
TableColumnModel colModel = table.getColumnModel();
int columnModelIndex = colModel.getColumnIndexAtX(e.getX());
int modelIndex = colModel.getColumn(columnModelIndex)
.getModelIndex();
if (modelIndex < 0)
return;
TerminalTableRowEntry.sorting = modelInde... | 2 |
public void setConstructorParameters (Class type, Class[] parameterTypes, String[] parameterNames) {
if (type == null) throw new IllegalArgumentException("type cannot be null.");
if (parameterTypes == null) throw new IllegalArgumentException("parameterTypes cannot be null.");
if (parameterNames == null) throw ... | 4 |
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
final Student other = (Student) obj;
if (!Objects.equals(this.stuName, other.stuName)){
return false;
}
if (!Objects.eq... | 5 |
private Set floodFill(int x, int y) {
Set group = new HashSet();
LinkedList points = new LinkedList();
points.add(new int[] {x, y});
while (!points.isEmpty()) {
int[] point = (int[]) points.removeFirst();
group.add(point);
for (int dx = -1; dx <= 1; dx... | 9 |
public static void main(String[] args){
Scanner in = new Scanner(System.in);
int n = in.nextInt();
int[] A = new int[n];
int[] l = new int[n];
for(int i=0;i<n;i++){
A[i]=in.nextInt();
}
l[0]=1;
int result = 1;
int prev = A[0];
for(int i=1;i<n;i++){
if(A[i]>prev){
l[i]=l[i-1]+1;
prev... | 4 |
public String getServer() {
return serverVersion;
} | 0 |
private List<IArticle> parseArticles(String[] args) throws IOException {
List<IArticle> result = new ArrayList<>(args.length);
String[] postIds = Arrays.copyOfRange(args, 1, args.length);
for (String postId : postIds) {
UrlWrapper url = new UrlWrapper(format(URL_TEMPLATE, postId));
... | 1 |
private void retrieveAllProducts() {
this.allProducts = this.userFacade.retrieveAllProducts();
this.sizeOfProducts = this.allProducts.size();
} | 0 |
public CompareImagesWindow(String imageFile1, String imageFile2)
throws IOException {
super("Compare images");
this.imageFile1 = imageFile1;
this.imageFile2 = imageFile2;
setDefaultCloseOperation(DISPOSE_ON_CLOSE);
setLocationRelativeTo(null);
addWindowListener(new WindowListener() {
@Override
... | 8 |
@Override
public CharSequence subSequence(int start, int end) {
if (start >= length || end >= length) {
throw new IllegalArgumentException("start or end cannot be greater than length");
}
Integer startOfSubMap = sequences.lowerKey(start);
NavigableMap<Integer, CharSequen... | 9 |
@Override
public void update() throws IOException
{
if (isNotReady())
{
readyToSend = false;
return;
}
long startTime = System.nanoTime();
long currentTime = System.currentTimeMillis();
readyToSend = (currentTime >= nextTime);
if (readyToSend)
{
while (nextTime <= currentTim... | 3 |
@Override
public void trainOnInstanceImpl(Instance inst) {
double d = 1.0;
int[] m = new int[this.ensemble.length];
for (int j = 0; j < this.ensemble.length; j++) {
int j0 = 0; //max(0,j-K)
pipos[j] = 1.0;
pineg[j] = 1.0;
m[j] = -1;
... | 9 |
public void write_multiple(short address, byte[] msg) throws IOException {
if ((this.mode==0) || (this.mode==SET_MODE_I2C_SERIAL)) this.set_mode(SET_MODE_I2C_100);
byte[] data=new byte[msg.length+2];
data[0]=(byte)RW_MULTIPLE;
data[1]=(byte)address;
System.arraycopy(msg, 0, data, 2, msg.le... | 4 |
public void setUpdateExisting(boolean updateExisting) {
this.updateExisting = updateExisting;
} | 0 |
public boolean check_Status(String status){
String book_Status=status.toLowerCase();
if (book_Status.equals("lost") || book_Status.equals("checked-in")|| book_Status.equals("in-queue") || book_Status.equals("available"))
return true;
else if (book_Status.isEmpty())
return... | 5 |
@Override
public Object execute() throws OperationNotSupportedException {
Object result;
switch (operation) {
// facebook specific actions
case ADD_COMMENT:
result = FacebookActionImplementation.sendComment("resource", "text");
break;
case LIKE_AS:
result = FacebookActionImplementation.likeAs("r... | 9 |
@Override
public void mouseClicked(MouseEvent event)
{
Iterator<MouseClickedListener> it = mouseListeners.iterator();
while(it.hasNext())
{
try
{
MouseClickedListener listener = it.next();
if(listener.isFinished())
{
//TODO: gets removed next time the mouse is clicked...
it.remove... | 4 |
public List<List<Integer>> threeSum(int[] num) {
final int len = num.length;
List<List<Integer>> list = new LinkedList<List<Integer>>();
if(len < 3)
return list;
Set<String> set = new HashSet<String>();
Arrays.sort(num);
for(int i=0; i<len-2; i++){
if(num[i]>0)
break;
if(i == 0 || num[i] > n... | 9 |
@Override
public void writeToSave(DataTag data) {
super.writeToSave(data);
DataList list = new DataList();
for(int slot = 0; slot < getMaxSlots(); slot++){
ItemStack stack = getStackInSlot(slot);
if(stack != null){
DataTag tag = new DataTag();
stack.writeToSave(tag);
tag.writeInt("slot", slot)... | 2 |
public ShieldMinigame(int level, Vector2 chunk, LD ld) {
Util.clearBodies();
this.level = level;
if (level == 0) {
new IllegalArgumentException("0 isn't a valid level").printStackTrace();
}
// TODO: clear bodies
Objects.world.setContactListener(new ShieldMinigameContactManager(this));
life = 20 - level... | 1 |
@Override
public void undo() {
node.setCommentState(oldState);
} | 0 |
public boolean processCommand(Terminal terminal, List<String> words) {
boolean leave = false;
leave = super.processCommand(terminal, words);
if (!words.isEmpty()) {
switch (words.get(0)) {
case "add":
terminal.add();
break;
... | 7 |
private Vector<byte[]> segmentFile(String f) throws Exception
{
Vector<byte[]> sequenceList = new Vector<byte[]>();
try
{
//Open the input and out files for the streams
FileInputStream file= new FileInputStream(f);
while (file.available() > PAYLOADLENGTH)
{
byte[] b = new byte[PAYLOADLENGTH];
... | 3 |
public Date getNextDate() {
Calendar c = Calendar.getInstance();
c.set(Calendar.HOUR_OF_DAY, h);
c.set(Calendar.MINUTE, m);
if (c.before(Calendar.getInstance())) {
c.add(Calendar.DATE, 1);
}
return c.getTime();
} | 1 |
@Override
public BufferedImage getImage(int pageNumber) {
Logger.getLogger(PdfHandler.class.getName()).entering(PdfHandler.class.getName(), "getImage", pageNumber);
if (!isImageInRange(pageNumber)) {
Logger.getLogger(PdfHandler.class.getName()).exiting(PdfHandler.class.getName(), "getIma... | 3 |
public Throwable getCause() {
return this.cause;
} | 0 |
private void search(int i,int target,int[] cand, ArrayList<Integer> tmp,ArrayList<ArrayList<Integer>> rst)
{
if (cand[i] > target) return;
if (cand[i] == target)
{
ArrayList<Integer> element = new ArrayList<Integer>();
element.addAll(tmp);
element.add(cand[i]);
rst.add(element);
return;
}
i... | 6 |
public Boolean isNewGameOk() {
if (this.height != 0 && this.width != 0 && this.nbMines != 0 && this.nbFlags != 0 && cells[8][9] != null) {
return true;
}
else {
return false;
}
} | 5 |
public void setSpNum(String spNum) {
this.spNum = spNum;
} | 0 |
public CheckResultMessage checkG(int day) {
return checkReport.checkG(day);
} | 0 |
private void updateTabla(){
//** pido los datos a la tabla
Object[][] vcta = this.getDatos();
//** se colocan los datos en la tabla
DefaultTableModel datos = new DefaultTableModel();
tabla.setModel(datos); ... | 5 |
public Model getDialogueModel(int gender) {
int dialogueModelId = maleDialogueModelId;
int dialogueHatModelId = maleDialogueHatModelId;
if (gender == 1) {
dialogueModelId = femaleDialogueModelId;
dialogueHatModelId = femaleDialogueHatModelId;
}
if (dialogueModelId == -1)
return null;
Model dialogue... | 5 |
public String getCode_lab() {
return code_lab;
} | 0 |
@Override
public boolean filter(String url)
{
if (null == url || "".equals(url))
{
return false;
}
Pattern pattern = Pattern.compile("^(http|https)://.+$");
Matcher matcher = pattern.matcher(url);
return matcher.matches();
} | 2 |
private void trHeapSort (final int ISA, final int ISAd, final int ISAn, final int sa, final int size) {
final int[] SA = this.SA;
int i, m;
int t;
m = size;
if ((size % 2) == 0) {
m--;
if (trGetC (ISA, ISAd, ISAn, SA[sa + (m / 2)]) < trGetC (ISA, ISAd, ISAn, SA[sa + m])) {
swapElements (SA, sa + ... | 5 |
public static void main(String[] args) {
Reader.init(System.in);
try {
int numCasos = Reader.nextInt();
for(int i=0;i<numCasos;i++)
{
int n = Reader.nextInt();
int p = Reader.nextInt();
int q = Reader.nextInt();
W = new int[n];
val = new int[n + 1][q + 1][p + 1];
for(in... | 7 |
public void print() {
System.out.println("*** Draw Deck ***");
if ( draw_.isEmpty() )
System.out.print("No Cards Available");
else
for ( Card c : draw_ )
System.out.print(c.toString() + ", ");
System.out.println("\n*** Discard Deck *** ");
... | 4 |
public void update(User u) throws InvalidFieldException {
if (u.getFirstName() != null) {
setFirstName(u.getFirstName());
}
if (u.getLastName() != null) {
setLastName(u.getLastName());
}
if (u.getID() != null) {
setID(u.getID());
}
if (u.getPoints() != getPoints()) {
setPoints(u.getPoints()... | 9 |
public ShapeElemtex(SimpleFeature f, String tipo) {
super(f, tipo);
shapeId = "ELEMTEX" + super.newShapeId();
// Elemtex trae la geometria en formato MultiLineString
if ( f.getDefaultGeometry().getClass().getName().equals("com.vividsolutions.jts.geom.MultiLineString")){
MultiLineString l = (MultiLineStri... | 3 |
float func_526_b(int var1) {
return var1 >= 0 && var1 < this.leafDistanceLimit?(var1 != 0 && var1 != this.leafDistanceLimit - 1?3.0F:2.0F):-1.0F;
} | 4 |
public static String javaPackagePrefix(Module module, String separator) {
{ String result = "";
char separatorChar = separator.charAt(0);
String packagePrefix = module.javaPackage();
if (packagePrefix != null) {
if (separatorChar == '.') {
result = packagePrefix;
}
... | 6 |
public AttributesImageIconCellEditor(AbstractAttributesPanel panel) {
super(new JCheckBox(), OutlineEditableIndicator.ICON_IS_PROPERTY, OutlineEditableIndicator.ICON_IS_NOT_PROPERTY);
this.panel = panel;
} | 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 |
@Override
public void render(Drawer drawer) {
for (int x = 0; x < map.length; x++) {
for (int y = 0; y < map[x].length; y++) {
int drawX = (x * tileSize) + offsetX;
int drawY = (y * tileSize) + offsetY;
if (map[x][y] == 0) {
... | 3 |
void renderOffscreen() {
do {
if (vImg.validate(getGraphicsConfiguration()) == VolatileImage.IMAGE_INCOMPATIBLE) {
// old vImg doesn't work with new GraphicsConfig; re-create it
vImg = this.getGraphicsConfiguration()
.createCompatibleVolatileImage(workingImage.getWidth(),
workingImage.getHeig... | 2 |
private void reduce(){
int[] primeNumbers = getPrimeNumbers();
for (int primeNumber: primeNumbers){
while (isReducible(primeNumber)){
numerator /= primeNumber;
denominator /= primeNumber;
}
}
} | 2 |
private void validateTileDimension(String targetPath, String tilePath)
throws IOException {
try {
// Create a buffer of target image.
BufferedImage targetBuffer = ImageIO.read(new File(targetPath));
// Creating a new file instance.
File tileDirectory = new File(tilePath);
// Total number of tiles in... | 7 |
public void FullBack_findBall() throws UnknownHostException, InterruptedException {
//Pos origin = new Pos(0,0);
//System.out.println("in FullBack_findBall");
if(mem.isObjVisible("ball")) {
ObjBall ball = mem.getBall();
if((ball.getDirection() > 5.0 || ball.getDirection() < -5.0)) {
rc.turn(ball.getD... | 8 |
public Collection<String> getMainGroops()
{
// A Map of groopName --> Count
Map<String, Integer> mainGroopMap = new TreeMap<String, Integer>();
Collection<String> mainGroops = new Vector<String>();
Iterator<Track> tIt = tracks.iterator();
while (tIt.hasNext())
{
// Incre... | 5 |
@Override
public int analyse(LexicalAnalyser analyser, int beginIndex)
throws AnalyseException {
String content = analyser.getSentence();
char character = content.charAt(beginIndex);
char characterNext = beginIndex + 1 == content.length() ? ' ' : content
.charAt(beginIndex + 1);
// if (!WordTable.isDeli... | 5 |
public boolean getBoolean(int index) throws JSONException {
Object object = this.get(index);
if (object.equals(Boolean.FALSE)
|| (object instanceof String && ((String) object)
.equalsIgnoreCase("false"))) {
return false;
} else if (object.equal... | 6 |
private void jButton1KeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jButton1KeyReleased
if (evt.getKeyChar() == evt.VK_ENTER) {
i++;
if (i == 1) {
jButton1.doClick();
} else if (i == 2) {
i = 0;
}
}
}//GEN-LAST:event_jButton1KeyReleased | 3 |
public static void main(String[] args) {
try {
EntityUi dialog = new EntityUi();
dialog.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
dialog.setVisible(true);
} catch (Exception e) {
e.printStackTrace();
}
} | 1 |
private void updateSelectionLocation(final MouseEvent _event,
final boolean _applyChanges) {
if (pnt_start == null || _event == null) {
//print error message.
State.getLogger().severe("the pnt_start or the _event is null"
+ "\n\tpnt_start: \t" + pnt_start
+ "\n\t_event: \t" + _event);
ret... | 9 |
public void getMails(MailAccount account) {
List<String> mailContent;
sTrace.debug("getting Mails");
List<Integer> mailNumberList = new ArrayList<Integer>();
error = false;
/* Ab Java 7: try-with-resources mit automat. close benutzen! */
// Socket, inklusive Streams, einrichten
openSocket(account);
i... | 9 |
protected List<Section> loadDataFromInternet() throws IOException {
File tmpFile = File.createTempFile("uas", ".txt");
try {
// Download file to temp location
BufferedReader reader = null;
FileWriter writer = null;
try {
URL url = new UR... | 8 |
public static void back(int index, int cur) {
if (totalLength - cur < dif) {
dif = totalLength - cur;
sum = cur;
ans = taken;
}
if (index + 1 >= tracks.length)
return;
if (cur + tracks[index + 1] <= totalLength) {
taken |= 1 << (index);
back(index + 1, cur + tracks[index + 1]);
taken ^= 1 <... | 3 |
public void dotBrowserChanged(String newText) {
setErrorMessage(null);
setMessage(null);
if (newText == null) {
newText = dotBrowser.getText();
}
if (specifyDotButton.getSelection()) {
if (newText.length() == 0) {
setErrorMessage("Please en... | 8 |
public boolean deleteDirectory(String sPath) {
//如果sPath不以文件分隔符结尾,自动添加文件分隔符
if (!sPath.endsWith(File.separator)) {
sPath = sPath + File.separator;
}
File dirFile = new File(sPath);
//如果dir对应的文件不存在,或者不是一个目录,则退出
if (!dirFile.exists() || !dirFile.isDirectory()) {... | 9 |
public static String trimTextWithWidth(String text, int width) {
if (null == text || "".equals(text.trim()) || width <= 0) return "";
StringBuilder sb = new StringBuilder();
String[] textList = text.replace("\r", "").split("\n");
int c = 0;
for (String t : textList) {
String trimedText = trimLineTextWithWi... | 6 |
public boolean cooking() {
if (playerLevel[playerCooking] >= cooking[1]) {
if (actionTimer == 0 && cooking[0] == 1 && playerEquipment[playerWeapon] >= 0) {
actionAmount++;
actionTimer = 4;
OriginalShield = playerEquipment[playerShield];
OriginalWeapon = playerEquipment[playerWeapon];
playerEqui... | 9 |
private void addSolutionModifiers(Query arq, Resource query) {
long limit = arq.getLimit();
if(limit != Query.NOLIMIT) {
query.addProperty(SP.limit, query.getModel().createTypedLiteral(limit));
}
long offset = arq.getOffset();
if(offset != Query.NOLIMIT) {
query.addProperty(SP.offset, query.getModel().c... | 7 |
Option(boolean hasArg, String... aliases) {
this.hasArg = hasArg;
this.aliases = aliases;
} | 9 |
public void initTableModel(JTable table, List<CreditProgram> list) {
//Формируем массив программ для модели таблицы
Object[][] crProgArr = new Object[list.size()][table.getColumnCount()];
int i = 0;
for (CreditProgram prog : list) {
//Создаем массив для кредитной программы
... | 2 |
public final void updatePath(boolean aquireTargetImeediately) {
if ((path == null) || (pathTarget == null)) {
path = GameCtrl.get().getCurrentPathingGraph(def.size).iterator();
nextPathTarget();
} else {
PointI p1 = path.getLastPoint();
if (aquireTargetImeediately) {
path = GameCtrl.get().getCurrent... | 6 |
@Override
public void actionPerformed(ActionEvent e) {
if (e.getSource() == exit) {
System.exit(1);
} else if (e.getSource() == createMaster) {
CreateMasterFrame.getInstance().setVisible(true);
parent.dispose();
} else if (e.getSource() == measurePath) {
MeasurePathFrame.getInstance().start();
par... | 5 |
public boolean executeDistributedQuery(String keyRegExp, String valRegExp, String unitTestName)
{
System.out.println("Executing Distributed query for unit test cast : " + unitTestName);
ProcessBuilder pb = null;
try
{
if(keyRegExp != "" && valRegExp != "")
pb = new ProcessBuilder("./dgrep", "-key", keyR... | 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.