method_id stringlengths 36 36 | cyclomatic_complexity int32 0 9 | method_text stringlengths 14 410k |
|---|---|---|
9538661a-fb3d-4419-8bfa-0589dcb2976e | 7 | public void addItem(String ttype, int ccount){
int cccount = ccount;
for (int i = 0;i<fullCount;i++){
if(items.get(i).type.equals(ttype)&&(items.get(i).count<items.get(i).maxCount)){
while(cccount>0 && items.get(i).count<items.get(i).maxCount){
items.get(i... |
9e22eede-f83c-4332-a3e7-44bb48678dd6 | 7 | public Result combine(EvaluationCtx context, List parameters,
List policyElements) {
boolean atLeastOnePermit = false;
Set permitObligations = new HashSet();
Iterator it = policyElements.iterator();
while (it.hasNext()) {
AbstractPolicy policy =
... |
fb1d8adc-b027-4393-beb5-ca04c238f89d | 2 | static int F1(int op, int a, int b, int c) {
if (c < 0) c ^= 0xFFFF0000;
if ((a & ~0x1F | b & ~0x1F | c & ~0xFFFF) != 0) {
System.out.println("Illegal Operand(s) for F1 Format.");
bug(1);
}
return op << 26 | a << 21 | b << 16 | c;
} |
81ff0ca0-cccf-4b56-8535-64aa38501c83 | 0 | public String getName() {
return name;
} |
ac814e79-4941-4181-8f3f-49bff0a6ee68 | 7 | private void showPopupText(SiteAnnotation a, int xPressed, int yPressed, int xCallOut, int yCallOut) {
int wWindow = getView().getWidth();
int hWindow = getView().getHeight();
int x = xPressed;
int y = yPressed;
int w = a.getWidth() > 0 ? a.getWidth() : wWindow >> 1;
int h = a.getHeight() > 0 ? a.getHeight(... |
24a0cdc1-44a2-4a82-867d-f2abf18f01cf | 2 | public boolean write (SocketBase s)
{
int size = 4 + 1 + addr.length () + 1; // event + len(addr) + addr + flag
if (flag == VALUE_INTEGER)
size += 4;
ByteBuffer buffer = ByteBuffer.allocate (size);
buffer.putInt (event);
b... |
56d94718-71fb-4411-8cbc-e7b7a7444389 | 9 | protected void sendBidAndAds() {
bidBundle = new AdxBidBundle();
/*
*
*/
int dayBiddingFor = day + 1;
/* A fixed random bid, for all queries of the campaign */
/*
* Note: bidding per 1000 imps (CPM) - no more than average budget
* revenue per imp
*/
double rbid = 10000.0;
/*
* add... |
258f493c-5c74-4ca5-9e9b-27b9fdc6e866 | 2 | public Inventory() {
for (int y = 0; y < slots[0].length; y++) {
for (int x = 0; x < slots.length; x++) {
int centerLineX = (Main.getScaledWidth() - (slotSize * invWidth) - (invWidth * 4));
int centerLineY = (Main.getScaledHeight() - (slotSize * invHeight) - (invHeight * 4));
slots[x][y] = new Inventor... |
bb426c29-15a3-4fe8-a58e-60e50bc0e9e9 | 3 | @BeforeClass
public static void init() {
testdataDirectory = TestUtil.directoriesToFile("resources", "testdata");
if(!testdataDirectory.exists() || !testdataDirectory.isDirectory() || testdataDirectory.listFiles().length == 0) {
throw new IllegalStateException("Test data directory \"" + testdataDirectory.getA... |
b4cb3d49-5794-4b81-9be1-d47160a8c9d8 | 8 | public final String correct(String word)
{
if(nWords.containsKey(word))
return word;
ArrayList<String> list = edits(word);
HashMap<Integer, String> candidates = new HashMap<Integer, String>();
for(String s : list)
if(nWords.containsKey(s))
candidates.put(nWords.get(s),s);
if(can... |
4ae91e1c-0e0c-4d87-b997-049e755b9f31 | 2 | public static ArrayList<Question> getQuestionsByQuizID(int quizID) {
ArrayList<Question> questionList = new ArrayList<Question>();
try {
String statement = new String("SELECT * FROM " + DBTable + " WHERE quizid = ?");
PreparedStatement stmt = DBConnection.con.prepareStatement(statement);
stmt.setInt(1, qui... |
90cbc076-3ee0-4ce0-9d12-98b2e104e9e2 | 7 | void setPoints(int length, float[] x, float[] y, float[] z) {
if (x == null || y == null || z == null)
return;
if (points == null || points.length < x.length) {
points = new Point3f[x.length];
for (int i = 0; i < points.length; i++) {
points[i] = new Point3f();
}
}
this.length = length;
for (i... |
6155eeed-2d80-400b-9518-6268a7aaf59c | 2 | public void enable() throws IOException {
// This has to be synchronized or it can collide with the check in the task.
synchronized (optOutLock) {
// Check if the server owner has already set opt-out, if not, set it.
if (isOptOut()) {
configuration.set("opt-out", ... |
cae80562-4e42-4e45-b2cf-ce4a8d28c267 | 2 | public static String hump2snake(String source){
String regexStr = "[A-Z]";
Matcher matcher = Pattern.compile(regexStr).matcher(source);
StringBuffer sb = new StringBuffer();
while (matcher.find()) {
String g = matcher.group();
matcher.appendReplacement(sb, "_" + g... |
a87c2b0d-f9b7-438e-85ed-9c9b12570f57 | 3 | public synchronized void actualiza(long tiempoTranscurrido) {
if (cuadros.size() > 1) {
tiempoDeAnimacion += tiempoTranscurrido;
if (tiempoDeAnimacion >= duracionTotal) {
tiempoDeAnimacion = tiempoDeAnimacion % duracionTotal;
indiceCuadroActual = 0;
... |
c5179788-ac97-407c-bce2-7f045d38131e | 7 | public boolean isPalindrome(String s) {
if (s.trim().length() <= 1) {
return true;
}
char[] strArray = s.toCharArray();
int forward = 0;
int backward = strArray.length - 1;
while (forward <= backward) {
char cForward = clean(strArray[forward]);
char cBackward = clean(strArray[backward]);
while (... |
302b7500-4f1c-45ed-b7cb-eb7cfdcaee06 | 3 | @Override
public ActorModel addActor(ActorModel actor) throws WebshopAppException
{
if (actor != null)
{
int generatedId;
try (Connection conn = getConnection())
{
String sql = "INSERT INTO actors (firstname, lastname, dob)"
+ "VALUES (?, ?, ?)";
try (PreparedStatement pstmt = conn.prepa... |
024b95e1-f0b7-4644-84b4-525912cc8521 | 1 | public final boolean wasStarted() {
return myServerSocket != null && myThread != null;
} |
ef81e525-09ab-407e-83ab-8a1b42f4252e | 5 | private HashMap<Character, ITrieNode> getAvailableChildren(HashMap<Integer,Integer> frontierMap) {
if (this.children == null || this.children.size() == 0) {
return null;
}
HashMap<Character, ITrieNode> returnMap = new HashMap<Character, ITrieNode>(this.children.size());
for (... |
0ace2ac8-3103-44ed-8f15-5a6b1c2398ec | 3 | private Map readParameters(Document document) {
Map p = new HashMap();
NodeList list = document.getDocumentElement().getElementsByTagName(
PARAMETER_NAME);
for (int i = 0; i < list.getLength(); i++) {
Map e2t = elementsToText(list.item(i));
String name = (String) e2t.get(PARAMETER_NAME_NAME), value = (S... |
48f0682e-014d-42ea-be19-751f8885b893 | 2 | public int[][] convert(Object[][] g) {
int[][] gf = new int[g.length][g[0].length];
for (int i = 0; i < g.length; i++) {
for (int j = 0; j < g[0].length; j++) {
gf[i][j] = Integer.parseInt(g[i][j] + "");
}
}
return gf;
} |
31f44375-906b-4519-a3a6-26da8dd36f6d | 4 | @Override
public boolean equals(final Object orderedItem)
{
if (this == orderedItem)
{
return true;
}
if (!(orderedItem instanceof LineItem))
{
return false;
}
final LineItem that = (LineItem) orderedItem;
/* @formatter:off */
return this.item == that.getItem() ||
... |
09d83d10-33a0-4788-a7b3-cfd778f223c3 | 5 | @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 LoginInfo)) {
return false;
}
LoginInfo other = (LoginInfo) object;
if ((this.loginInfoId == null && other.logi... |
e0fc63ce-fdee-48d2-9991-71ef4f6873d6 | 7 | public int pop(int stackId, int data){
if(stackId == 1){
if(topleft == -1)
return 0;
int num = array[this.topleft];
this.topleft = this.topleft - 1;
return num;
}else if(stackId == 2){
if(topright == -1)
return 0... |
76192de6-eb2d-4cda-ad1a-3fa7072b5307 | 4 | public static void main(String[] args) throws IOException {
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
String line = "";
StringBuilder out = new StringBuilder();
while ((line = in.readLine()) != null && line.length() != 0) {
tracks = retInts(line);
totalLength = tracks[0];
... |
3fbec2ed-67bf-431e-b6be-64b158556e94 | 0 | @Test
public void findHandFromCardSet_whenTwoPairsExist_returnsTwoPairPlusHighestKicker() {
Hand hand = findHandFromCardSet(twoSixesTwoFoursAceKicker());
assertEquals(HandRank.TwoPair, hand.handRank);
assertEquals(Rank.Six, hand.ranks.get(0));
assertEquals(Rank.Four, hand.ranks.get(1));
assertEquals(Rank.Ace... |
f5ac38da-66e7-4bf0-a63b-fffbf9c2b0a2 | 1 | public void mouseup(MouseEvent ev, Coord c, int button) {
setmods(ev);
mc = c;
if (mousegrab == null)
root.mouseup(c, button);
else
mousegrab.mouseup(wdgxlate(c, mousegrab), button);
} |
8bc9fe5c-2516-4a9f-8d98-dd6227929263 | 5 | public void reposition() {
time++;
if (reached && time >= idleTime){
reached = false;
goal = new Vector2((float)((Math.random() * range.x * 2) - range.x + center.x),
(float)((Math.random() * range.y * 2) - range.y + center.y));
}
if (!reached){
float dx = goal.x - body.getPosition().x; float dy... |
f71318a4-a067-4bc5-a5bd-312e082f0c5e | 5 | public void render(Graphics g, float scale){
Vec2i topLeft = new Vec2i((int)((box.x*scale-Game.cameraLocation.x*scale)),(int)((box.y*scale-Game.cameraLocation.y*scale)));
Vec2i botLeft = new Vec2i((int)((box.x*scale-Game.cameraLocation.x*scale)+box.w*scale),(int)((box.y*scale-Game.cameraLocation.y*scale)+box.h*scal... |
4f7dd0ad-469e-4018-80d9-2a24c68dcf18 | 1 | public String getBroadcastData() {
//broadcast data consumer
String data = broadcastData.poll();
while(data==null) {
data = broadcastData.poll();
}
return data;
} |
03e85d51-baeb-4274-9e0c-77e5eeed9550 | 2 | public DefaultUmlDiagram toDefault( UmlDiagram diagram ) {
if( diagram instanceof DefaultUmlDiagram ) {
DefaultUmlDiagram result = (DefaultUmlDiagram) diagram;
if( result.getRepository() == this ) {
return result;
}
}
throw new IllegalArgumentException( "the diagram was not created by this repository... |
9c1ba6b7-4381-41f0-adad-11f6025c7f6c | 8 | private void fitEparams(String s){
String firstParam = getToken(s,1);
String sysFile = getToken(s,2);
// Pull search parameters
String confResFile = getToken(s,3);
String runName = getToken(s,4);
boolean ligPresent = (new Boolean(getToken(s,5))).booleanValue();
String ligType = null;
if (ligPrese... |
f151c594-8a09-4ba5-b949-2ced3712e4b3 | 8 | public synchronized void removeClient(SimClient client) {
bodyArray = null;
if (clients == null) {
return;
}
int i;
for (i = 0; i < clients.length; i++) {
if (clients[i] == client) {
break;
}
}
if (i == clients... |
a75f5b61-458f-4f93-a165-5f38158bdfd3 | 3 | public void visitLabel(final Label label) {
mv.visitLabel(label);
if (constructor && branches != null) {
List frame = (List) branches.get(label);
if (frame != null) {
stackFrame = frame;
branches.remove(label);
}
}
} |
ba7f0df5-ed0c-4fac-97da-db831abc3613 | 4 | public boolean onGameCommand(final CommandSender sender,
final Command command, final String label, final String[] args) {
final String[] split = new String[args.length + 1];
split[0] = label;
for (int i = 0; i < args.length; i++) {
split[i + 1] = args[i];
}
... |
113c83eb-1cae-47d8-88a8-a3279072fb15 | 0 | private void readObject(ObjectInputStream stream) throws IOException, ClassNotFoundException {
stream.defaultReadObject();
callObjectId = stream.readLong();
meta = (IRemoteCallObjectMetaData)stream.readObject();
data = (IRemoteCallObjectData)stream.readObject();
complete = stream.readBoolean();
... |
6b395cdc-73e3-421e-90b3-d012c88fbf12 | 7 | protected static Ptg calcPRICEDISC( Ptg[] operands )
{
if( operands.length < 4 )
{ // not supported by function
return new PtgErr( PtgErr.ERROR_NULL );
}
debugOperands( operands, "calcPRICEDISC" );
try
{
GregorianCalendar sDate = (GregorianCalendar) DateConverter.getCalendarFromNumber( operands[0].g... |
b4afa786-88e9-4b77-83e2-8d6dcfac279b | 0 | public A1JFrame(String title, int x, int y, int width, int height) {
// Set the title, top left location, and close operation for the frame
setTitle(title);
setLocation(x, y);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
// Create an instance of the JPanel class, and ... |
2b6efdc4-cdcc-4bfb-9ec5-66fb07b6a265 | 2 | public void dropInfo(int howMuch) {
if ((howMuch & KNOWNATTRIBS) != 0) {
bytecode = null;
exceptions = null;
}
if (bytecode != null)
bytecode.dropInfo(howMuch);
super.dropInfo(howMuch);
} |
de280b90-d1b9-4f16-b316-9ce9bd41d7fc | 6 | public void paintComponent(Graphics g){
Graphics2D g2 = (Graphics2D)g;
rect.height = 75; //reset every draw, otherwise it will continually grow on repaint.
int stringWidth = g.getFontMetrics().stringWidth(name);
int lineHeight = g.getFontMetrics().getHeight()+5;
//For every attribute, add a new line's worth o... |
e49c27d7-23fd-40d5-bb01-8ea5e00a0be9 | 9 | @Override
public void execute(User user, String args) {
StringBuilder zingBuilder = new StringBuilder();
zingBuilder.append("ZING");
float absurdity = random.nextFloat();
int absurdityAmt = 0;
if(.03f >= absurdity) {
absurdityAmt+=3;
}else if(.10f >= absu... |
59c19b61-bf00-4542-9309-bc7dd019b113 | 2 | public int attackSpecial(Character opponent){
int type = (int)(Math.random()*2);
int damage = 0;
if (type == 0){
System.out.println(_name+" gets help from his trusty Adam!\n"+
"Adam pulls out his laptop for an additional "+helper.laptop(this)+" damage!");
damage = askAdam(opponent);}
else {
... |
7f6d9c52-323c-4cbe-960c-b15ce171553d | 3 | protected boolean func_27006_a(EntityCreeper var1, int var2, float var3) {
if(var1.getPowered()) {
if(var2 == 1) {
float var4 = (float)var1.ticksExisted + var3;
this.loadTexture("/assets/armor/power.png");
GL11.glMatrixMode(5890 /*GL_TEXTURE*/);
GL11.glLoad... |
cdcd1faf-231d-4a75-a157-860ac401e740 | 3 | protected static short[][] unpackFromStrings(String[] sa)
{
// Concatanate initialization strings.
StringBuilder sb = new StringBuilder(sa[0]);
for (int i=1; i<sa.length; i++)
sb.append(sa[i]);
int n=0; // location in initialization string
int size1 = (((int)sb.charAt(n))<<16) | ((int... |
e4b1efe8-261f-4697-859a-6ac2e9fb36df | 7 | @Override
List<Player> determineWinners() {
// TODO Implement the winner stuff and distribute the pot...
List<Player> winners = new ArrayList<Player>();
// Is there a tie?
// boolean tie = false;
// Get the first player who did not fold
int firstPlayerWhoDidNotFold = 0;
for (int i = 0; i < players.size... |
5ac91e84-57f7-4c9b-a24d-ed426924387e | 9 | private int jjMoveStringLiteralDfa13_0(long old1, long active1)
{
if (((active1 &= old1)) == 0L)
return jjStartNfa_0(11, 0L, old1, 0L);
try { curChar = input_stream.readChar(); }
catch(java.io.IOException e) {
jjStopStringLiteralDfa_0(12, 0L, active1, 0L);
return 13;
}
switch(curChar)
... |
a945ff90-967c-45b0-9039-66af63f578c9 | 5 | static public void findCoauthorNames(){
Iterator it = Person.iterator();
Person pers;
FileWriter fw = null;
PrintWriter pw = null;
Person key = null;
try {
fw = new FileWriter("parserResult/coauthor_degree.csv");
pw = new PrintWriter(fw);
System.out.println("Person and their Coau... |
8859f35f-d06b-46e5-9d9d-6ab71a36908d | 6 | private static String compile(String template, Object[] params) throws IllegalArgumentException {
if (params.length == 0) {
return template; // For the sake of efficiency, don't parse templates with no dynamic data
}
StringBuilder sb = new StringBuilder();
for (int i = 0; i <... |
54ee3a34-d8c1-48b2-aa67-182ae9da807a | 4 | @Test
public void TestAll() throws IOException, SyntaxFormatException {
for (File file : new File("src/test/resources/testprogs/").listFiles()) {
if (file.isFile()) {
if (file.getPath().indexOf(StatementTest.simpleFuncTest4) >= 0) {
continue;
}
if (!file.getPath().endsWith(".txt")) {
continu... |
1de15ac5-feff-4d67-9ec3-edb63d5d0700 | 3 | public void updateLoadingBar(double nodesLoaded, double edgesLoaded, double streetsLoaded)
{
loadingBar.setValues(nodesLoaded, edgesLoaded, streetsLoaded);
if (streetsLoaded >= 1)
{
messageField.setText("Step 4/4 - Preparing the last details...");
} else if (edgesLoaded >= 1)
{
messageField.setText("St... |
c0f3e5f8-ec41-438f-afad-c2dfb2639675 | 9 | public static IntegerLinkedList sum(IntegerLinkedList integerLinkedList1, IntegerLinkedList integerLinkedList2) {
Node<Integer> node1 = integerLinkedList1.head();
Node<Integer> node2 = integerLinkedList2.head();
boolean get1 = node1 != null;
boolean get2 = node2 != null;
IntegerL... |
84bf46e4-3064-432d-9b8b-664101bc765c | 6 | public static String generateName() {
String templates[] = {
"Cvc",
"Cvcc",
"Ccvcv Vc'Ccvvcv",
"Ccvcvc CvcCcvccvc",
"Ccvcvcvcvvc",
"Ccvcccvcc",
"Cvccvc",
"Cvcvc",
"Cvcc... |
184d1dab-13b7-4605-9ed5-ef78ba201116 | 0 | public TicketQueryAction getAction() {
return this._action;
} |
0df3623e-76e4-4b53-8446-09f2e64f9d13 | 6 | public void merge() throws MVDException
{
if ( match == null )
match = getBestMatch();
// create left and right subarcs
if ( match.dataOffset > 0 )
leftSubArc = splitOffLeftArc();
if ( match.length+match.dataOffset < arc.dataLen() )
rightSubArc = splitOffRightArc();
// create left and right subgraph... |
93cff5a0-ccae-4252-af2b-ab3e21360797 | 4 | public void run(){
while(true){
Socket client = null;
try {
client = server.accept();
handleConnection( client );
} catch ( IOException e ) {
System.err.println( "Error in ServerImpl " + e.getMessage() );
e.printStackTrace();
} finally {
if ( client != null )
try {
clien... |
e435d56c-d91b-4e6c-9d2c-eeeb55601743 | 0 | public boolean isThisPlayersTurn() {
return this.playerThisInstance == this.playersTurn;
} |
615e6d83-87da-42dd-8f18-7826428c2df8 | 8 | private void doTestCaching (String field, FieldScoreQuery.Type tp) throws CorruptIndexException, Exception {
// prepare expected array types for comparison
HashMap expectedArrayTypes = new HashMap();
expectedArrayTypes.put(FieldScoreQuery.Type.BYTE, new byte[0]);
expectedArrayTypes.put(FieldScoreQuery.T... |
5bb6c565-bdcf-4f01-8b4c-46fb9e072926 | 2 | public void resize(int sizeBytes, int size) {
assert sizeBytes > 0 && size > 0;
int oldSizeBytes = this.sizeBytes;
address = $.reallocateMemory(address, sizeBytes);
if (sizeBytes > oldSizeBytes)
$.setMemory(address + oldSizeBytes, address + sizeBytes, (byte) 0);
this.sizeBytes = sizeBytes;
this.size = si... |
4ed49335-8bc9-42f3-8474-5cdd942a9912 | 3 | public static void main(String[] args) throws IOException {
if (args.length != 1) {
System.err.println("Usage: java KKMultiServer <port number>");
System.exit(1);
}
int portNumber = Integer.parseInt(args[0]);
try (ServerSocket serverSocket = new ServerSocket(portNu... |
fbcefc4e-056c-4e70-a806-628dad9f78b2 | 0 | private SimpleLogger() {} |
dd6d02a2-cdde-4920-918f-0f7d4f6b2b7e | 7 | public static Device read(BufferedReader reader) throws IOException {
boolean finished = false;
String line;
Map<String, String> properties = new HashMap<String, String>();
reader.mark(1024);
line = reader.readLine();
if ((line != null) && line.startsWith("[")) {
reader.reset();
finished = true;
}... |
859ad8ee-360e-4e1d-b60a-de1bfd0c9ac4 | 4 | private void compileStructFields(StructType structType)
throws ParseException, IOException
{
do {
// <data-type>
Type type = compileDataType();
// <field-name>
if (tokenizer.tokenType() != Tokenizer.IDENTIFIER) {
throw new ParseException("field name is excepted after typ... |
5f4bf851-504c-4249-8a7b-3e0e8eebf79c | 6 | 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... |
b426174c-3195-44a4-9774-bf6b7bd12830 | 9 | public String randomWordFromDictionary(boolean withPunctuation)
{
String word = null;
try
{
int pos = rand.nextInt((int)dictionary.length());
dictionary.seek(pos);
word = dictionary.readLine(); // we surely only get the end of a word
word = dictionary.readLine(); // this one should... |
b72039f9-c867-45fb-904a-dda73ba2ade6 | 3 | synchronized void setChar( Message client_msg ){
//System.out.println("Char written by Thread : " + Thread.currentThread() );
//System.out.println("Char written : " + client_msg.getCharacter_pressed() + ", pos : "+ client_msg.getPosition() +" , revnum : "+ client_msg.getClient_version_number() + " , cid : " +client... |
a9bb2a26-2a51-4e6f-91c1-cd4571c32c97 | 8 | public static ImageData convertAWTtoSWT(BufferedImage bufferedImage) {
if (bufferedImage.getColorModel() instanceof DirectColorModel) {
DirectColorModel colorModel = (DirectColorModel)bufferedImage.getColorModel();
PaletteData palette = new PaletteData(colorModel.getRedMask(), colorModel.getGreenMask(), colorMo... |
e393493a-d7b4-44ae-a46a-727c7be23f68 | 1 | public void run()
{
try
{
System.out.println( "reception du message -- " + message + " -- du socket: " + socket);
String answer = interpreteurRequete.ParseCommand(message);
//System.out.println(answer);
serveur.EnvoyeAClient(socket, answer);
}
catch (InterruptedException e) {
e.printStackTrace()... |
7ff18e19-839c-4e5b-a452-6ef317559484 | 6 | public static void main(String[] args) {
boolean ok=true;
int op;
FCliente cliente = null;
try{
cliente=new FCliente();
}
catch(IOException e){
Pantalla.muestra("Imposible abrir el fichero");
ok=false;
}
... |
fe9e48f1-3abc-464b-9b9c-5ef0b649cbf4 | 0 | public void setNombre(String nombre) {
this.nombre = nombre;
} |
d1b8053f-3812-4618-9fbd-53abffbcb260 | 3 | @Override
public void onEndChild(CssNavigator handler, CharSequence tag) {
String tagStr = tag.toString().toLowerCase();
if(tagStr.equals("br") || tagStr.equals("div"))
this.builder.append('\n');
else if(tagStr.equals("p"))
this.builder.append("\n\n");
} |
8ae81b4b-39b5-4fb3-a917-9925eb4a1172 | 1 | public Selection getSelection() {
SelectableCapability selection = getCapability( CapabilityName.SELECTABLE );
if( selection == null ) {
return Selection.NOT_SELECTED;
} else {
return selection.getSelected();
}
} |
96272778-9f76-49f7-93ce-c800bd4b2463 | 2 | public int genererNumeroLocation(){
System.out.println("ModeleLocations::genererNumeroLocation()") ;
int numMax = 0 ;
for(Location location : this.locations){
if(location.getNumero() > numMax){
numMax = location.getNumero() ;
}
}
return numMax + 1 ;
} |
68145fc7-24e0-4547-9fac-06dbaecb30d9 | 3 | @Override
public String toString() {
StringBuffer buf = new StringBuffer();
for (int i = 0, limit = nodes.size(); i < limit; i++) {
Node node = nodes.get(i);
// Since a node may be a root node, and depthPaddedValue doesn't throw in root level text,
// let's put it back in.
if (node.isRoot()) {
... |
e2a5f935-e21d-48c9-b10c-32159a1f7950 | 9 | @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-... |
d3701539-0014-41db-917d-1bc31fc463ba | 1 | protected boolean isStr(Object obj) {
return (obj != null && obj instanceof String);
} |
ce2b3b9c-f41d-4d37-977b-a6f96400d11b | 2 | public static final boolean isFXML(String fileName) {
for (String file : FXML) {
if (file.equals(fileName)) {
return true;
}
}
return false;
} |
83407fbc-2f1d-4f68-aaa7-9b619dfd8309 | 2 | public String getUIDByPhonenumber(Statement statement,String phonenumber)//根据电话获取UID
{
String result = null;
sql = "select UID from Users where phonenumber = '" + phonenumber +"'";
try
{
ResultSet rs = statement.executeQuery(sql);
while (rs.next()) {
result = rs.getString("UID");
}
}
catch (... |
098b3e03-62d3-4887-b06a-f49b7d89ea49 | 2 | public static boolean isEmpty(String arg) {
if (arg == null || arg.trim().length() == 0) {
return true;
} else {
return false;
}
} |
f8efbdfb-db45-4cee-b23d-f0ffa5f51a16 | 7 | public String generateLogs(LoggingServerThread ls) {
//need to generate 1 log per machine
//with the following
//1. rare keys
//2. somewhat frequent keys
//3. frequent keys
//4. bonus ultra rare
//rest random
ArrayList<String> knownKeys = new ArrayList<String>();
knownKeys.add("_ULTR_");
knownKeys.a... |
e7359dc9-4c8a-41c6-8a37-03edb7327cf0 | 7 | public List<Map<String, String>> parse(long start, String[] statistics) throws IOException
{
String header = "";
if (statistics.length > 0) {
header = statistics[0];
}
List<String> columns = new ArrayList<String>();
List<Map<String, String>> series = new ArrayLis... |
59547b84-6d1c-4edc-b3f7-a99b9365cdf3 | 4 | private void cboShapeTypeItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_cboShapeTypeItemStateChanged
// TODO add your handling code here:
//adding helpful volume displays
int shapeIndexDisplayValue = cboShapeType.getSelectedIndex();
if (shapeIndexDisplayValue ... |
42eef1a7-b680-4cbe-8de8-d3cdac81017e | 2 | static private boolean containsLiteral(List<Literal> litList, Literal literal){
for (Literal thisLiteral: litList){
if(thisLiteral.equals(literal))
return true;
}
return false;
} |
6fed1556-d180-4904-8325-a0072cae7285 | 1 | @Override
protected int parseInt(String input) {
int i;
try {
i = Integer.parseInt(input);
} catch (NumberFormatException e) {
throw new IllegalArgumentException();
}
return i;
} |
48ece2b1-e588-417a-88f9-8544577e73cc | 9 | public void init() {
panel_tool = new JPanel();
panel_tool.setBackground(Color.WHITE);
panel_table = new JPanel();
panel_table.setBackground(Color.WHITE);
panel_1 = new JPanel();
panel_1.setBackground(Color.WHITE);
GroupLayout groupLayout = new GroupLayout(this);
groupLayout.setHorizontalGroup(
gr... |
35e4670e-edb7-40f5-af84-c6180a5fa3f6 | 0 | @Override
public void onSent(long delta, long bytes) {
ProjectMainView.updateProgressBar(bytes);
} |
3f98cd59-9da3-42bc-9387-330a5cc5ab25 | 0 | protected void deleteArray(String fieldName) throws SQLException {
Data._deleteArray(this.tableName + "_" + fieldName, this.getId());
} |
209746bd-c215-42f5-90f6-feffd29c426f | 3 | public static void main (String[] args) throws java.security.NoSuchAlgorithmException {
if (args.length < 1) {
System.out.println("usage: java PeerID <number of tries>");
return;
}
int runs = Integer.parseInt(args[0]);
int i = runs;
int totaltries = 0;
System.out.printf("%6s, %4s, ", "tries", "ms");
... |
96b4d8aa-56e6-4001-bfea-f0f0b6537c76 | 3 | public void notify_agent(Packet packet)
{
if (packet.get_data() != null && packet.get_data().length() > 1)
{
File file = new File("http_file_received");
try
{
BufferedWriter bw = new BufferedWriter(new FileWriter(file));
bw.write(packet.get_data());
bw.close();
}
catch (IOException e)... |
ad995b41-c1e7-425a-ba2a-ff8f27fd2723 | 4 | public static void main(String[] args) {
// TODO 自動生成されたメソッド・スタブ
TwitterModel twitterModel = null;
if (args.length != 2) {
try {
twitterModel = TwitterConfParser
.readConf("conf/twitter_conf.json");
} catch (IOException e) {
// TODO 自動生成された catch ブロック
e.printStackTrace();
}
} else {
... |
ea39c540-28eb-4c58-a2e1-b46ad71dd736 | 3 | private void writeIDAT() throws IOException
{
IDATOutputStream ios = new IDATOutputStream(dataOutput, 8192);
DeflaterOutputStream dos = new DeflaterOutputStream(ios,
new Deflater(9));
// Future work - don't convert entire image to a Raster It
// might seem that you could just call image.getData() but
//... |
7b2e8098-fe37-469c-93f2-e467bdd73b32 | 4 | @Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Board other = (Board) obj;
if (!Arrays.equals(board, other.board))
return false;
return true;
} |
26469763-ef0b-4ad2-999a-06202c65ece7 | 8 | public void tranform(Object objeto){
List nomeCampos = new ArrayList();
List valoresCampos = new ArrayList();
Class clazz = objeto.getClass();
Entidade enti = (Entidade) clazz.getAnnotation(Entidade.class);
System.out.format("insert into %s (", enti.nome());
for(Method metodo : clazz.getDeclaredMethods()){
... |
bcc5f6e3-d0e2-4210-8491-fa0f0224aaf8 | 4 | public static boolean isSameTime( Date date1, Date date2 )
{
Calendar cal1 = Calendar.getInstance();
cal1.setTime( date1 );
Calendar cal2 = Calendar.getInstance();
cal2.setTime( date2 );
return( ( cal1.get( Calendar.YEAR ) == cal2.get( Calendar.YEAR ) ) &&
( c... |
c5dca1ab-8d16-4850-9633-071c03d950e5 | 7 | static void testValidity(Object o) throws JSONException {
if (o != null) {
if (o instanceof Double) {
if (((Double)o).isInfinite() || ((Double)o).isNaN()) {
throw new JSONException(
"JSON does not allow non-finite numbers.");
... |
d8797a2f-a8c7-4c6c-a958-501ec2cdd40e | 7 | public void update(){
player.update();
player.checkAttack(enemies);
player.checkCoins(coins);
finish.update();
finish.checkGrab(player);
bg.setPosition(tileMap.getx(), 0);
tileMap.setPosition(
GamePanel.WIDTH / 2 - player.getx(),
GamePanel.HEIGHT / 2 - player.gety());
if(player... |
c6165ad0-4290-4c3a-95da-71c66ab56ac1 | 3 | @Override
public void onExecute(String[] args, CommandSender sender) {
if (sender instanceof Player) {
RBlockType type = RBlockType.get(args[1]);
if (type == null) {
Material material = Material.getMaterial(args[2].toUpperCase());
if (material != null) {
new RBlockType(args[1], materia... |
134c6bd6-6f85-41b4-9420-6fce544b1f43 | 6 | public void testDragoonDemotedBySoldier() {
Map map = getTestMap(plains);
Game game = ServerTestHelper.startServerGame(map);
InGameController igc = ServerTestHelper.getInGameController();
List<CombatResult> crs;
Player dutch = game.getPlayer("model.nation.dutch");
Player... |
ead75ba1-72b3-4f20-a423-3b0cd5817a57 | 3 | public boolean equals(int[] fin) {
return this.w0 == fin[0] && this.w1 == fin[1] && this.w2 == fin[2]
&& this.w3 == fin[3];
} |
1d9084f0-2bfb-4550-8ba9-e7e94acaf57b | 4 | void parse_frame() throws BitstreamException
{
// Convert Bytes read to int
int b=0;
byte[] byteread = frame_bytes;
int bytesize = framesize;
// Check ID3v1 TAG (True only if last frame).
//for (int t=0;t<(byteread.length)-2;t++)
//{
// if ((byteread[t]=='T') && (byteread[t+1]=='A') && (byteread[t+2]=='G'))
... |
7219edf9-1b17-4f5e-b2a7-02cc6018ee2d | 9 | public static int largestRectangleArea(int[] height) {
int len = height.length;
if(len == 0) {
return 0;
}else {
int[] h = Arrays.copyOf(height, len+1);
h[len] = 0;
Stack<Integer> stack = new Stack<Integer>();
int last = h[0];
stack.push(0);
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.