text stringlengths 14 410k | label int32 0 9 |
|---|---|
public boolean matchesSub(Identifier ident, String name) {
for (int i = 0; i < matchers.length; i++) {
if (matchers[i].matchesSub(ident, name) == isOr)
return isOr;
}
return !isOr;
} | 2 |
public int trap1(int[] height) {
int N=height.length;
int water=0;
for (int i=0;i<N-1;){
if(height[i]==0){
i++;
continue;
}
// System.out.println("i "+i);
int maxIndex=i+1;
for (int j=i+1;j<N;j++){
if(height[j]>height[maxIndex]){
maxIndex=j;
}
if(height[j]>=height[i]){
... | 7 |
private Move(int col0, int row0, int col1, int row1) {
assert ((col0 > 0) && (col0 < 8)) && ((col1 > 0) && (col0 < 1))
&& ((row0 > 0) && (row0 < 8)) && ((row1 > 0) && (row1 < 8));
_col0 = col0;
_row0 = row0;
_col1 = col1;
_row1 = row1;
} | 7 |
public static String[] getDecoderNames(SeekableStream src) {
if (!src.canSeekBackwards() && !src.markSupported()) {
throw new IllegalArgumentException(JaiI18N.getString("ImageCodec2"));
}
Enumeration enumeration = codecs.elements();
Vector nameVec = new Vector();
St... | 9 |
private void btn_SubmitActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btn_SubmitActionPerformed
//Checking for missing details
if ( !txt_Name.getText().equals("")
&& cmbbx_DOBDate.getSelectedIndex() != 0
&& cmbbx_DOBMonth.getSelectedIndex... | 8 |
public static int trap3(int[] a) {
int l = a.length;
int[] before = new int[l];
int[] after = new int[l];
int max = 0;
for (int i = 0 ; i < l ; i++) {
before[i] = max;
max = max > a[i] ? max : a[i];
}
max = 0;
for (int i = l-1 ; i >= 0 ; i--) {
after[i] = max;
max = max > a[i] ? max : a[i];
... | 7 |
private Client getClientByName(String name) {
for (Client client : clients) {
if (client.getName().equals(name)) {
return client;
}
}
return null;
} | 2 |
public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4)
{
int var5 = 0;
if (par1World.getBlockId(par2 - 1, par3, par4) == this.blockID)
{
++var5;
}
if (par1World.getBlockId(par2 + 1, par3, par4) == this.blockID)
{
++var5... | 8 |
private void debugAddGoodsToUnit(final Game serverGame, Unit unit) {
Specification spec = serverGame.getSpecification();
List<ChoiceItem<GoodsType>> gtl
= new ArrayList<ChoiceItem<GoodsType>>();
for (GoodsType t : spec.getGoodsTypeList()) {
if (t.isFoodType() && t != spec... | 6 |
@Override
public void windowDeactivated(WindowEvent arg0)
{
} | 0 |
public static Object getAnnotatedFieldValue(Object source, Class<? extends Annotation> annotation){
Class<?> clazz = source.getClass();
try {
for(Field field:clazz.getDeclaredFields()){
field.setAccessible(true);
if(field.getAnnotation(Id.class) != null)
return field.get(source);
}
return ... | 6 |
public Object getObjectPosition(int x, int y) {
for (int i = 0; i < getNumPlace(); i++) {
PlaceUI p = (PlaceUI) getPlace(i);
if (p.inPlace(x, y)) {
selectedPlace = i;
return p;
}
}
for (int i = 0; i < getNumTransition(); i++) {
TransitionUI t = (TransitionUI) getTransition(i);
if (t.inTran... | 8 |
public void actionPerformed( ActionEvent e ) {
if( e.getSource() == this.buttonOK ) {
InetAddress address = this.addressComboBoxModel.getSelectedAddress();
int port = this.portSpinnerModel.getNumber().intValue();
String protocol;
if( this.radioTCP.isSelected() ) protocol = "TCP";
else ... | 4 |
public static int min3(int a, int b, int c) {
if( a > b )
return (( c > b) ? b : c);
else
return (( c > a) ? a : c);
} | 3 |
public static String encodeFromFile( String filename )
throws java.io.IOException {
String encodedData = null;
Base64.InputStream bis = null;
try
{
// Set up some useful variables
java.io.File file = new java.io.File( filename );
byte[] bu... | 3 |
@Override
public void actionPerformed(ActionEvent e) {
JCheckBox source = (JCheckBox) e.getSource();
boolean state = source.isSelected();
if (state) {
this.setTitle("JCheckbox example");
} else {
this.setTitle("");
}
} | 1 |
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
// TODO Auto-generated method stub
String page=request.getParameter("page");
HttpSession session=request.getSession(false);
String role=(String)session.getAttribute("role");
String id=(String... | 3 |
@Deprecated
protected static Iterator<IPluggable> getIteratorFromComplexMap(Map<PlugMode, TreeSet<IPluggable>> map) {
Iterator<IPluggable> it;
PlugMode[] modes = PlugMode.getAllModes();
Set<IPluggable> set = new HashSet<IPluggable>();
for(PlugMode mode : modes) {
it = map.get(mode).iterator();
while(i... | 3 |
public static void main(String[] args) {
File file = new File("breast-cancer-wisconsin.data");
List<Point> data = new ArrayList<>();
try (BufferedReader br = new BufferedReader(new FileReader(file))) {
String line;
String[] values = new String[11];
double[] attributes = new double[9];
boolean valid ... | 6 |
private boolean isSymmetricAux(TreeNode left, TreeNode right) {
if (left == null && right == null) {
return true;
}
if (left == null || right == null) {
return false;
}
if (left.getVal() != right.getVal()) {
return false;
}
re... | 6 |
private Canvas()
{
if (System.getProperty("com.horstmann.codecheck") == null)
{
frame = new JFrame();
if (!System.getProperty("java.class.path").contains("bluej"))
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
fr... | 4 |
public static String[] trimArrayElements(String[] array) {
if (isEmpty(array)) {
return new String[0];
}
String[] result = new String[array.length];
for (int i = 0; i < array.length; i++) {
String element = array[i];
result[i] = (element != null ? element.trim() : null);
}
return result;
} | 3 |
public void update(String line, LineStatus status, Scanner fileScan) throws IOException
{
ArrayList<UrlCard> allUrls = UrlCard.getAllUrls();
boolean isUrlObjectComplete = false;
do {
switch (status)
{
case BlankLine: {
isUrlObjectComplete = true;
}
break;
case ... | 8 |
public static void main(String[] args) {
new Test().howdy();
} | 0 |
@Override
public String toString()
{
return "isAbstract()";
} | 0 |
public void parseExpressions(String expressions, Handler handler) {
for(String expression : expressions.split("[\n\r]+")) {
parseExpression(expression, handler);
}
} | 1 |
protected Object getDefault(String path) {
Configuration root = getRoot();
Configuration defaults = root == null ? null : root.getDefaults();
return (defaults == null) ? null : defaults.get(createPath(this, path));
} | 2 |
static void rellenarBlancos(int[][] mat, int posI, int posJ){
LinkedList<int[]> cola = new LinkedList<int[]>();
mat[posI][posJ]=3;
cola.add(new int[]{posI,posJ});
while(!cola.isEmpty()){
int[] pos=cola.removeFirst();
if(pos[0]<mat.length-1&&mat[pos[0]+1][pos[1]]==0){
cola.add(new int[]{pos[0]+1,pos[1]... | 9 |
public JSONArray toJSONArray(JSONArray names) throws JSONException {
if (names == null || names.length() == 0) {
return null;
}
JSONArray ja = new JSONArray();
for (int i = 0; i < names.length(); i += 1) {
ja.put(this.opt(names.getString(i)));
}
re... | 3 |
public ParkingPlace getParkingPlace(long maxWaitMillis)
throws ParkingException {
try {
if (SEMAPHORE.tryAcquire(maxWaitMillis, TimeUnit.MILLISECONDS)) {
return pollParkingPlace();
}
} catch (InterruptedException e) {
throw new ParkingException(e);
}
throw new ParkingException("Timeout");
} | 2 |
public void removeSolutions(int[] sol, int index)
{
ArrayList<PossibleSol> temp = new ArrayList<PossibleSol>();
for (int i= 0; i < sol.length; i++)
{
System.out.print(sol[i] + " ");
}
System.out.println();
for (PossibleSol current: this.possibleSol)
{
boolean found = true;
for (int j = 0; j < in... | 6 |
public static void filledRectangle(double x, double y, double halfWidth, double halfHeight) {
if (halfWidth < 0) throw new RuntimeException("half width can't be negative");
if (halfHeight < 0) throw new RuntimeException("half height can't be negative");
double xs = scaleX(x);
double ys ... | 4 |
@Override
public HallEventType getTypeByName(final String name) throws WrongTypeNameException {
if (name == null) {
throw new WrongTypeNameException("Type name is empty");
}
switch (name) {
case CONFERENCE_TYPE_NAME:
case HACKATHON_TYPE_NAME:
... | 3 |
private void drawHeatFluxSensors(Graphics2D g) {
List<HeatFluxSensor> heatFluxSensors = model.getHeatFluxSensors();
if (heatFluxSensors.isEmpty())
return;
g.setStroke(thinStroke);
Symbol.HeatFluxSensor s = new Symbol.HeatFluxSensor(false);
float w = HeatFluxSensor.RELATIVE_WIDTH * model.getLx();
float h ... | 9 |
private void collectTypeHierarchy(Set<Class<?>> typeHierarchy, Class<?> type) {
if (type != null && !IGNORED_CLASSES.contains(type)) {
if (typeHierarchy.add(type)) {
Class<?> superclass = type.getSuperclass();
if (type.isArray()) {
superclass = primitiveTypeToWrapperMap.get(superclass);
}
... | 9 |
private boolean isName(String token)
{
boolean isPossible = false;
for (String name : getNames())
{
if (name.equalsIgnoreCase(token))
{
isPossible = true;
break;
}
}
return isPossible;
} | 2 |
public static void main(final String[] args) throws Exception {
int runs = 1;
int eat = 0;
if (args.length <= 1) {
Nonstop.usage();
}
for (eat = 0; eat < args.length; eat++) {
if (args[eat].equals("-run")) {
if (++eat >= args.length) {
Nonstop.usage();
}
runs = Integer.parseInt(args[... | 9 |
@XmlElementDecl(namespace = "http://www.w3.org/2000/09/xmldsig#", name = "Signature")
public JAXBElement<SignatureType> createSignature(SignatureType value) {
return new JAXBElement<SignatureType>(_Signature_QNAME, SignatureType.class, null, value);
} | 0 |
@Override
public boolean matches(Object argument) {
if (argument instanceof PropertyChangeEvent) {
PropertyChangeEvent event = (PropertyChangeEvent) argument;
return propertyName.equals(event.getPropertyName())
&& event.getOldValue() != null
&& event.getNewValue() != null
... | 7 |
public void makeSelection() {
if(list.getSelectedIndex() != -1) {
selection = list.getSelectedValue();
dispose();
}
} | 1 |
@Override
public void performNavigateAction(KeyEvent evt) {
if (evt.isControlDown()) {
switch (evt.getKeyCode()) {
case KeyEvent.VK_DOWN:
if (txtUsuario.equals(this.getFocusOwner())) {
txtSenha.requestFocus();
} else... | 9 |
private String tagStyle(Cell cell, CellStyle style) {
if (style.getAlignment() == ALIGN_GENERAL) {
switch (ultimateCellType(cell)) {
case HSSFCell.CELL_TYPE_STRING:
return "style=\"text-align: left;\"";
case HSSFCell.CELL_TYPE_BOOLEAN:
... | 5 |
@Override
public boolean setChartOption( String op, String val )
{
boolean bHandled = false;
if( op.equalsIgnoreCase( "Shadow" ) )
{
setHasShadow( true );
bHandled = true;
}
else if( op.equalsIgnoreCase( "ShowLdrLines" ) )
{
setShowLdrLines( true );
bHandled = true;
}
else if( op.equalsIgn... | 4 |
public Path getImgPath_CommandBtn(Imagetype type) {
Path ret = null;
switch (type) {
case KEYFOCUS:
ret = this.imgComBtn_KFoc;
break;
case MOUSEFOCUS:
ret = this.imgComBtn_MFoc;
break;
case PRESSED:
... | 4 |
public char skipTo(char to) throws JSONException {
char c;
try {
long startIndex = this.index;
long startCharacter = this.character;
long startLine = this.line;
this.reader.mark(1000000);
do {
c = this.next();
if... | 3 |
private void dealCards() {
// Give three cards to each player.
for (int i = 0; i < players.length; i++)
deck.dealCards(players[i].getHandPile(), 3);
// Put two cards in the skat.
deck.dealCards(skat, 2);
// Give four cards to each player again.
for (int i = 0; i < players.length; i++)
deck.dealCards... | 3 |
public synchronized void removeMember(Long id){
if (ids.contains(id)){
int pos = ids.indexOf(id);
ids.remove(pos);
types.remove(pos);
roles.remove(pos);
}
} | 1 |
private void calcRow(int step, String expression) {
int variableCount = Expression.getVariableCount();
String binaryStep = Integer.toBinaryString(step);
while (binaryStep.length() < variableCount) {
binaryStep = "0" + binaryStep;
}
int binaryCounter = binaryStep.length() - 1;
for (int i = expression.le... | 7 |
public String getShortSuit() {
switch ( suit ) {
case SPADES: return "S";
case HEARTS: return "H";
case DIAMONDS: return "D";
case CLUBS: return "C";
default: return "J";
}
} | 4 |
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
ContainerHolder that = (ContainerHolder) o;
if (image != null ? !image.equals(that.image) : that.image != null)
return false;
if (u... | 7 |
public void scaleHunger() {
// Cancel if the player is not applicable
if (!utils.isValidWorld(player) || !utils.isEnabled()) {
setCancelled(true);
return;
}
if (utils.isExempt(player)) {
setCancelled(true);
return;
}
FileConfiguration c = plugin.getConfig();
// Scale the hunger
if(play... | 8 |
public double getEntrega() {
return entrega;
} | 0 |
private Weibo parseToWeiboSina(JSONObject info) {
Weibo weibo = new Weibo();
try {
String geo = info.getString("geo");
if (geo==null||geo.equals("null")) {
return null;
}
if (setGeo(weibo,geo)==0) {
return null;
}
JSONObject user = info.getJSONObject("user");
weibo.setUid(String.valueO... | 4 |
@SuppressWarnings("serial")
public Action graphLayout(final String key, boolean animate)
{
final mxIGraphLayout layout = createLayout(key, animate);
if (layout != null)
{
return new AbstractAction(mxResources.get(key))
{
public void actionPerformed(ActionEvent e)
{
final mxGraph graph = grap... | 3 |
@Test
public void TestaaVasemmaltaOikealleEste() {
rakentaja = new Kartanrakentaja(10, 6);
rakentaja.asetaEste(5, 3);
rakentaja.asetaEste(4, 3);
rakentaja.asetaEste(6, 3);
char[][] kartta = rakentaja.getKartta();
Solmu aloitus = new Solmu(5, 0);
Solmu maali = ... | 5 |
@Override
public void run() {
this.init();
while (running) {
this.doLoop();
this.calculateDelta();
drawManager.draw();
try {
Thread.sleep(20);
} catch (InterruptedException e) {}
}
} | 2 |
public void keyReleased(KeyEvent e) {
int key=e.getKeyCode();
if(key == KeyEvent.VK_UP)
dy=0;
if(key == KeyEvent.VK_DOWN)
dy=0;
if(key == KeyEvent.VK_LEFT||key == KeyEvent.VK_RIGHT){
dx=0;
ChangeTex(1);
}
} | 4 |
public static Graph randomTree2() {
int depth = 10;
Graph graph = new Graph(depth * 50, depth * 50);
int a = 0;
int b = -1;
int c = 0;
for (int i = 0; i < depth; i++) {
for (int j = 0; j <= i; j++) {
graph.addVertex(new Vertex(c++, 25 + 25 * (depth - i - 1) + 50
* j, 25 + 50 * i));
}
i... | 4 |
public static void notifyEOS( String sourcename, int queueSize )
{
synchronized( streamListenersLock )
{
if( streamListeners == null )
return;
}
final String srcName = sourcename;
final int qSize = queueSize;
new Thread()
{
... | 4 |
@Override
public boolean invoke(MOB mob, List<String> commands, Physical givenTarget, boolean auto, int asLevel)
{
MOB target=mob;
if((auto)&&(givenTarget!=null)&&(givenTarget instanceof MOB))
target=(MOB)givenTarget;
if(target.fetchEffect(this.ID())!=null)
{
mob.tell(target,null,null,L("<S-NAME> <S-IS-... | 7 |
public void stepTestOn(PrintWriter oo) {
Stepper stepr;
ScruSet keyPile;
ScruSet valuePile;
SetTable tab;
oo.print("Test fetching of steppers (stepper at a key).\n"+
"");
keyPile = testKeys();
valuePile = testValues();
tab = SetTable.make(testCS());
Stepper stomper = keyPile.stepper();
for (; stomper.hasValue... | 9 |
private HttpRequestBase getMethod(String url, HttpMethod requestMethod, Map<String, String> headers,
Map<String, String> params, File data) {
if (requestMethod == HttpMethod.POST) {
HttpPost httpPost = new HttpPost(url);
setReqHeaders(httpPost, head... | 9 |
public static String logging(String xliffFilename, String applicationName) {
System.getProperties().put("proxySet", "true");
System.getProperties().put("proxyHost", "www-proxy.cs.tcd.ie");
System.getProperties().put("proxyPort", "8080");
LoggerStatus status = null;
Properties pr... | 4 |
public void processEdit()
{
// set new size to accommodate additional components
setSize(GUI_WIDTH_AFTER_EDIT, GUI_HEIGHT_AFTER_EDIT);
// create south JPanel
south = new JPanel(new BorderLayout());
south.setBackground(Color.LIGHT_GRAY);
// create topSouth JPanel and add components to it
JPanel topSouth... | 8 |
public static void main(String[] args) {
File inputFile = new File("QuickSort.txt");
String inputFilePath = inputFile.getAbsolutePath();
// read and parse input file
try {
String strLine = "";
int count = 0;
FileInputStream fstream = new FileInputStream(inputFilePath);
DataInputStream in = new Data... | 4 |
public static int getCategoryIdByName(String categoryName)
{
ResultSet rs=null;
Connection con=null;
PreparedStatement ps=null;
int result=0;
try{
String sql="SELECT CATEGORYID FROM CATEGORY WHERE CATEGORY_NAME=?";
con=ConnectionPool.getConnectionFromPool();
ps=con.prepareStatement(sql);
ps.setSt... | 8 |
public Combination<Colors> generate(){
List<Token<Colors>> combination = new ArrayList<Token<Colors>>();
List<Colors> colors = Colors.getColors();
Random r = new Random();
for (int i = 0; i < Combination.SIZE; i++) {
int n = r.nextInt(colors.size());
combination.add(new Token<... | 1 |
public static void main(String[] args) throws IOException {
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
String line = "";
StringBuilder out = new StringBuilder();
ArrayList<Integer> primes = primeNumbers(32769);
while ((line = in.readLine()) != null && line.length() != 0) {
in... | 6 |
@Override
public int hashCode() {
int result = access != null ? access.hashCode() : 0;
result = 31 * result + (refresh != null ? refresh.hashCode() : 0);
result = 31 * result + (scope != null ? scope.hashCode() : 0);
return result;
} | 3 |
public ArrayList subledger1(String type, String loanid, float amount)
{ //get all details subledger needs
arrayTemp= new ArrayList();
String query = "select * from loan_dtl where loanid="+loanid+" and amordate between to_date('"+startDate.substring(0, 10)+"','yyyy-mm-dd') and to_date('"+endDa... | 7 |
private static boolean isValidCharCode(int code) {
return (0x0020 <= code && code <= 0xD7FF)
|| (0x000A == code)
|| (0x0009 == code)
|| (0x000D == code)
|| (0xE000 <= code && code <= 0xFFFD)
|| (0x10000 <= code && code <= 0x10ffff);
} | 8 |
protected boolean canBreed()
{
return getAge() >= getBreedingAge();
} | 0 |
protected boolean hasGotCollision(Position myFreeposition, List<Position> piecesPositions) {
int x = myFreeposition.getX();
int y = myFreeposition.getY();
Position tmp = new Position(x + 1, y - 2);
if (piecesPositions.contains(tmp)) {
return true;
}
tmp.setY(y... | 8 |
public boolean addRecord(long value, int blockID){
//System.out.println( "addRecord() " + value + ", " + blockID );
boolean success = false;
if( !isLeafNode() ){
//System.out.println( "Adding record to internal node! " );
//System.out.println( "addRecord() " + value + ", " + blockID );
//... | 8 |
public boolean checkOpposites(String elementDesc)
{
String oppositeElement, oppositeElement2 = "";
elementDesc = elementDesc.toLowerCase();
if(elementDesc.equalsIgnoreCase("earth")) oppositeElement = "lightning";
else if(elementDesc.equalsIgnoreCase("arcane")) oppositeElement = "life... | 9 |
public ListNode deleteDuplicates(ListNode head) {
if(head == null) return null;
ListNode preHead = new ListNode(0);
ListNode lastNot = preHead;
preHead.next = head;
head = head.next;
while(head != null){
if(lastNot.next.val != head.val && lastNot.next... | 7 |
@Test
public void testThrowExceptionOnReceiveTimeoutIfClosed() {
try {
consumer = new AbstractMessageConsumer(mockTopic) {
};
assertNotNull("No subscription was made",
mockTopic.getTopicSubscriber());
FutureTask<Message> f = getMessageFuture(consumer, 50);
consumer.close();
Message m = f.get(... | 4 |
public boolean initializeGame(ArrayList<String> playerNames, ArrayList<String> playerTypes) throws FileNotFoundException {
isLoaded = false;
this.playerNames = playerNames;
this.playerTypes = playerTypes;
board = new Board();
try {
// Reads countries file
reader = new BufferedReader(new FileReader(... | 8 |
public String addOperator(String s){
if (position ==0){
return getMessage();
}
if (position ==1){
if(s.equals("="))
return getMessage();
setCalculatorSequence(position,s);
return getMessage();
}
if (position ==2){
... | 9 |
public static void mouseRelease() {
if(mousePressed) {
mousePressed = false;
mouseHeld = false;
//mouseRelease = new Point2D.Double(Mouse.getX(), -(Mouse.getY() - Camera.get().displayHeight));
}
} | 1 |
public TurnContext playTurn(Game g) {
TurnContext state = new TurnContext(g, false);
currentCx = state;
if (!getHand().isEmpty())
switchToHand(state);
else if (!getFaceUp().isEmpty())
switchToFaceUp(state);
else if (!getFaceDown().isEmpty())
switchToFaceDown(state);
if (hasValidMove(state) || sta... | 7 |
public void testSetDayOfYear_int2() {
MutableDateTime test = new MutableDateTime(2002, 6, 9, 5, 6, 7, 8);
try {
test.setDayOfYear(366);
fail();
} catch (IllegalArgumentException ex) {}
assertEquals("2002-06-09T05:06:07.008+01:00", test.toString());
} | 1 |
private static ConcurrentHashMap<String, String> readHashMap(
String directory) throws IOException, ClassNotFoundException {
FileInputStream fin;
try {
fin = new FileInputStream(directory);
} catch (FileNotFoundException e) {
writeHashMap(directory, new ConcurrentHashMap<String, String>());
fin = new ... | 1 |
public void doAction(String value) {
char choice = value.toUpperCase().charAt(0);
while (choice != 'A' && choice != 'B' && choice != 'C' && choice != 'D') {
System.out.println("Invalid selection");
choice = getInput().toUpperCase().charAt(0);
}
if (choi... | 5 |
public void nextFlight(ArrayList<Flight> currentPath, ArrayList<String> visited, String fromDest, String toDest) {
Flight recentFlight = currentPath.get(currentPath.size() - 1);
// Are we at our destination?
if (recentFlight.getToDest().equals(toDest)) {
// This is... | 7 |
public boolean isMember(User user) {
if (this.isAdmin(user)) return true;
for (int i = 0; i < members.size(); i++) {
if(members.get(i)==user) return true;
}
return false;
} | 3 |
public LinkedList<Theater> getTheatersList(int zone) throws RemoteException{
if(this.lastRequest == -1)
this.lastRequest = System.currentTimeMillis();
if(connectionTimout()){
System.out.println("Connection timout");
return null;
}
if(list.size() > 0)
for(LinkedList<Theater> l : list)
if... | 7 |
private int processZipFile(File file, String targetPath) {
List<Branch> branchs = CsvTool.getBranchs();
int count = 0;
for (Branch branch : branchs) {
if (file.getName().length() < 10) {
continue;
}
/**
* 4~10byte are bank code of branch file ext name should be .zip
*/
if (file.getName().s... | 6 |
@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 Detallecotizacion)) {
return false;
}
Detallecotizacion other = (Detallecotizacion) object;
if ((this.idDetalle... | 5 |
public void testRec(Configuration conf,byte depth){
depth++;
nbAppelListeFils++;
if (depth == 2)
System.out.println("nbappelListeFils : "+nbAppelListeFils);
ArrayList<Configuration> listeConfig = listeFils(conf);
if (depth<depthMax){
for (Configuration c : listeConfig) {
testRec(c, depth);
... | 5 |
@Override
public boolean tick(Tickable ticking, int tickID)
{
if((affecting()==null)||(!(affecting() instanceof MOB)))
return false;
final MOB mob=(MOB)affecting();
if((affected==mob)
&&(mob!=getCharmer())
&&((mob.amFollowing()==null)||(mob.amFollowing()!=getCharmer()))
&&(mob.location()!=null)
&&(mo... | 8 |
private CorbaOrocosConnection(OrocosDataPort port, ConnectionType connectionType,
boolean init, LockPolicy lockPolicy, boolean pull, int bufferSize,
int transport, int dataSize, String connectionName) throws CNoCorbaTransport, CNoSuchPortException {
logger = Logger.getLogger(CorbaOrocosConnection.class);
t... | 5 |
public List<Posizione> adiacenti(Posizione posizione) {
List<Posizione> adiacenti = new LinkedList<Posizione>();
int x = posizione.getX();
int y = posizione.getY();
for(int i = -1; i<2; i++) {
for(int j = -1; j<2; j++) {
adiacenti.add(new Posizione(x+i, y+j));
}
}
Iterator<Posizione> it = adiac... | 8 |
public Light(String color, String location) {
this.color = color;
this.location = location;
light.addMouseListener(this);
switch (location) {
case "north":
rotate(180);
updatePosition(320, 220);
break;
case "east":
rotate(27... | 4 |
public static AppServer getInstance(String strTypeConn) throws Exception
{
if (strTypeConn == null || strTypeConn.equals("Oracle"))
{
if (instanceOracle == null)
{
instanceOracle = new AppServer("Oracle");
}
return instanceOracle;
}
else if (strTypeConn == null || strTypeConn.equals("MySQL"))
... | 9 |
@Test
public void resolve() {
print(digitalSum(1000));
} | 0 |
public void givereward(int cluelevel)
{
if (cluelevel == 1)
{
cluereward(Clues.randomClue1(), Clues.randomClue1(), Clues.randomNonClue1(), Clues.randomNonClue1(), Clues.randomRunes1(), 1, 1, 1, 1, 500);
deleteItem(2681, GetItemSlot(2681), 1);
cluelevel = 0;
cluestage = 0;
clueid = 0;
savemoreinfo();
}
if (cluelevel == ... | 3 |
@Override
public void action() {
if(agente.getPasso() == 9 && agente.getCuponsCompradosComSucesso().size() > 1){
System.out.println("PASSO 9 AI");
for(ListaDeCupons lista : agente.getCuponsCompradosComSucesso()){
for(Cupom cupom : lista){
System.out.println("************************************... | 4 |
public FieldVisitor visitField(final int access, final String name,
final String desc, final String signature, final Object value) {
String s = remapper.mapFieldName(className, name, desc);
if ("-".equals(s)) {
return null;
}
if ((access & (Opcodes.ACC_PUBLIC | Opcodes.ACC_PROTECTED)) == 0) {
if ((acce... | 8 |
public static List<TestData> loadData(final String componentName) {
List<TestData> result = new ArrayList<TestData>();
File componentDir = new File("res/testdata/" + componentName);
if (!componentDir.exists() || !componentDir.isDirectory()) {
throw new IllegalArgumentException("Test directory does not exist or... | 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.