method_id stringlengths 36 36 | cyclomatic_complexity int32 0 9 | method_text stringlengths 14 410k |
|---|---|---|
04867771-9199-441b-89e1-488e3ee57845 | 1 | private Symbol tryDeclareSymbol(Token ident)
{
assert (ident.isToken(Token.Kind.IDENTIFIER));
String name = ident.lexeme;
try
{
return symbolTable.insert(name);
}
catch (RedeclarationError re)
{
String message = reportDeclareSymbolError(name, ident.lineNumber, ident.charPosition);
return new Err... |
2f5ab912-9de2-4495-8aa0-7e5f84ad4165 | 3 | public Quaternion slerp( Quaternion dest, float lerpFactor, boolean shortest )
{
final float EPSILON = 1e3f;
float cos = this.dot( dest );
Quaternion correctedDest = dest;
if ( shortest && cos < 0 )
{
cos = -cos;
correctedDest = new Quaternion( -dest.getX(), -dest.getY(), -dest.getZ(), -dest.getW() )... |
17a4b8bb-fbd1-46d3-8286-d4285eb50d33 | 9 | private static void ensembleMethodOverlap() throws ParserConfigurationException, Exception {
Scanner sc = new Scanner(System.in);
System.out.println("How many systems for the ensemble?");
int numSystems = sc.nextInt();
//sc.close();
ArrayList<String> testSets[] = new ArrayList[numSystems];
AbstractResult... |
9f895b79-c762-4022-b8cd-cb3f3c50f279 | 8 | @Override
public void invoke(ChatSocket socket) throws InvalidCommandException {
// Sanity check the command
if (present && socket.getPresenceManager().isPresent(roomName, socket.getUUID())) {
throw new InvalidCommandException("Could not join " + roomName + ": Already present.");
... |
c23b35b4-dd62-4608-9ba7-fe61af52891c | 0 | public ScreenManager() {
GraphicsEnvironment environment =
GraphicsEnvironment.getLocalGraphicsEnvironment();
device = environment.getDefaultScreenDevice();
} |
3b4a28f0-c033-470b-af56-7c16eea95120 | 3 | public ArrayList<Tree> findLoopControlStatements(){
ArrayList<Tree> loopControlstatements = new ArrayList<Tree>();
if(this.statement instanceof LoopControlStatement)
loopControlstatements.add(this.statement);
if(this.statements instanceof LoopControlStatement)
loopControlstatements.add(this.statements... |
7f464e23-b7b7-43f0-8cda-e8dca9678d88 | 8 | @Override
public boolean equals(Object object) {
if (object == this) {
return true;
}
if (object == null || !(object instanceof AABB3)) {
return false;
}
AABB3 aabb = (AABB3) object;
return aabb.x1 == x1 && aabb.y1 == y1 && aabb.z1 == z1 && aabb.x2 == x2 && aabb.y2 == y2 && aabb.z2 == z2;
} |
de60a0e3-16ce-40d1-be80-e44c58b2a9e2 | 5 | @Override
public Boolean save(ModelUser oUser) {
try {
if (oUser.getId() != null) {
if (oUser.getPassword() == null
|| oUser.getPassword().equals("")
|| oUser.getPassword().equals("********")) {
String password =... |
84114b14-aa19-4359-8857-6eecfbb80885 | 4 | private void foo(String str, int starts, int ends, ArrayList<String> result) {
if (starts > ends)
return;
if (starts < 0)
return;
if (starts == 0 && ends == 0) {
result.add(str);
return;
}
foo(str + '(', starts - 1, ends, result);
... |
2c83d785-bf4f-42a7-8cec-855fe2bd5bbc | 6 | final boolean method2535(AbstractToolkit var_ha, long l) {
if (aLong6472 != aLong6471)
method2534();
else
method2537();
if (l - aLong6472 > 750L) {
method2530();
return false;
}
int i = (int) (l - aLong6471);
if (aBoolean6484) {
for (Class318_Sub7 class318_sub7
= (Class318_Sub7) aC... |
39d4c0b9-bd07-4d49-a620-4acb475fb9bc | 8 | @Override
public List<Node> shortestPath(Node source, Node dest) throws IOException {
// System.out.println("Calling shortestPath.");
LinkedList<Node> list = null;
String input = null;
try {
StringBuilder sb = new StringBuilder("shortestPath\n");
sb.append(ProtocolParser.encodeEmptyNode(source));
s... |
7567f088-f953-4eed-af2e-975f743122a8 | 0 | @Basic
@Column(name = "SOL_FECHA_HORA")
public Date getSolFechaHora() {
return solFechaHora;
} |
7c446a9f-ebc6-4ce5-88fe-0ccbc25e1c9b | 8 | public MobileScriptBuilder() {
initialize();
// Perform these after UI setup
try { createDependencies(); } catch (Exception e) { Helpers.showExceptionError(frmPswgToolsMbs, e.getLocalizedMessage());}
// Populate Default Attacks combobox
Vector<String> defaultAttacks = new Vector<String>();
try(BufferedRea... |
9ac2eaa1-5188-4547-b58d-8eaab6bfef98 | 9 | public static List<FreightBean> get56(String oringHarborName,String destHarborName){
List<FreightBean> retFreightBeans = new ArrayList<FreightBean>();
HttpClient httpClient = new HttpClient();
httpClient.getParams().setParameter(HttpMethodParams.SO_TIMEOUT, 50000);
httpClient.getHttpConnectionManager().getParam... |
692943e1-a7f8-42ed-9e1b-acccf317cb2e | 5 | private final String stringFilter( String line )
{
if ( line == null || line.equals( "" ) )
{
return "";
}
StringBuffer buf = new StringBuffer();
if ( line.indexOf( "\"" ) <= -1 )
{
return keywordFilter( line );
}
int start = 0;... |
5af948d1-8fcf-4f97-854a-5aa99604111a | 1 | public boolean equals(Object o) {
return (o instanceof TreeElement)
&& fullName.equals(((TreeElement) o).fullName);
} |
5692c04e-fa08-49f1-86a6-c699bf093596 | 9 | private void makeDiagonalMove(Player player)
{
int diagonalDown = 0;
int diagonalUp = 0;
for(int i = 0; i < 3; i++)
{
if(this.gameField.getGameField()[i][i] == player)
{
diagonalDown++;
}
if(this.gameField.getGameField... |
f683c5be-9aee-43b3-85df-5d9bee0a8eb3 | 4 | public static void main(String[] args) {
Scanner keyboard = new Scanner(System.in);
System.out.print("Please enter x: ");
double x = keyboard.nextDouble();
int terms = 0;
while (terms == 0) {
System.out.print("Please enter the number of terms, an integer (>1 and <64): ");
terms = keyboard.nextInt();
... |
c970d71b-68ab-4aaa-8387-e7f2f22ac218 | 4 | public static String toString(JSONObject jo) throws JSONException {
StringBuffer sb = new StringBuffer();
sb.append(escape(jo.getString("name")));
sb.append("=");
sb.append(escape(jo.getString("value")));
if (jo.has("expires")) {
sb.append(";expires=");
s... |
16c30908-3b93-451a-9b95-1c4418ada70f | 1 | private void Speedup(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_Speedup
if (currSpeed < 10)
{
++currSpeed;
world.setSpeed(currSpeed);
speedCounter.setText("Speed: " + currSpeed);
}
}//GEN-LAST:event_Speedup |
0451a8b2-cd77-47e3-bc8e-a2a4b5bd1daa | 5 | protected static final
synchronized void putCachedRaster(ColorModel cm,
WritableRaster ras) {
if (cached != null) {
WritableRaster cras = (WritableRaster) cached.get();
if (cras != null) {
int cw = cras.getWidth();
... |
e02aa431-fc53-476c-85d6-64b815f2b690 | 2 | public static void removeFromListById(List<AchievementRecord> achList, String achievementId) {
for ( ListIterator<AchievementRecord> it = achList.listIterator(); it.hasNext(); ) {
AchievementRecord rec = it.next();
if ( rec.getAchievementId().equals(achievementId) ) {
it.remove();
}
}
} |
5b25ee9e-1b99-45b5-a46b-3f317a14c098 | 6 | public boolean get_mbr(){
if (!proj_IA_network_x.calculate() || !proj_IA_network_y.calculate()){ return false;}
//if any of the IA networks is unsatisfiable, return false
mbr = new Rectangle[var_num];
for(int i=0;i<var_num;i++){
mbr[i] = new Rectangle();
}
//Arrays.fill(mbr, new Rectangle());
maxX=0;m... |
947bc43a-15b1-4724-83ff-91c1c11f50d3 | 4 | public void color(int i, int x, int y) {
if(x < texture.getWidth() && y < texture.getHeight() && x >= 0 && y >= 0) {
texture.setRGB(x, y, new Color(i).getRGB());
this.repaint();
}
} |
60879d57-3c49-4cd7-b961-3fe8944154df | 5 | public IVPBoolean ivpEqualTo(IVPValue num, Context c, HashMap map, DataFactory factory) {
IVPBoolean result = factory.createIVPBoolean();
map.put(result.getUniqueID(), result);
boolean resultBoolean = false;
if(getValueType().equals(IVPValue.INTEGER_TYPE) && num.getValueType().equals(IVPValue.INTEGER_TYPE)){
... |
ae4fa401-23a9-461a-b110-1a76226fe560 | 7 | public static String extractAlbumFrom(String filePath)
/*
* The extractAlbumFrom method checks the ID3 version of the mp3 file and
* extracts the artist's name from the MP3 file.
*/
{
String albumName = null;
try
{
Mp3File mp3File = new Mp3File(filePath);
if (mp3File.hasId3v2Tag())
{
ID3... |
702c88fb-4e62-44f1-869d-24ec6fd9cbd7 | 4 | public static void sort(Comparable[] a){
for(int i = 0; i < a.length; i++){
int k = i;
for(int j = i + 1; j < a.length; j++){
if(a[j].compareTo(a[k]) < 0){
k = j;
}
}
if( k == i) continue;
Comparable tmp = a[k];
a[k] = a[i];
a[i] = tmp;
}
} |
fe561a5c-fb7a-4354-bbb4-f30504e12158 | 2 | private byte[] rehash(byte[] passwordHash, byte[] salt) {
try {
MessageDigest md = MessageDigest.getInstance("SHA-256");
byte[] bytes = new byte[passwordHash.length + salt.length];
// Join passwordHash and salt together into a single array, seed
System.arraycopy(passwordHash, 0, bytes, 0, passwordHash.le... |
6b9fa482-169d-4530-89b3-80f555541105 | 1 | public void terminateSesion() {
endSesion = true;
try {
clientSocket.close();
clientSocket = null;
} catch (IOException e) {
e.printStackTrace();
}
} |
a9c7a751-9912-4039-af61-4809d35e2a2e | 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 Medico)) {
return false;
}
Medico other = (Medico) object;
if ((this.idMedico == null && other.idMedico != null... |
9d6b8d50-a002-489e-98aa-e23934f73f0d | 1 | public static void main(String[] args) {
int[][] array = new Spiral_Matrix_II().generateMatrix(6);
for(int i=0;i< array[0].length;i++)
System.out.println(Arrays.toString(array[i]));
} |
c007e617-d8ea-43a7-acf0-c9c2a6fcc53a | 3 | private boolean isStoppingCriterionNotMet(int currentIteration) {
if (!UserStopCondition.shouldStop()) {
if (isStoppingCriterion) {
return (population.getBestFitness() > FITNESS_THRESHOLD);
} else {
return ((maxIterations == 0) || (currentIteration < maxIterations));
}
} else {
return false;
}... |
6e76d391-ae4d-4d07-b746-617eba3c590d | 9 | public boolean step(Point where) {
Viewport port = findViewport(owner);
Rectangle rect = Rectangle.SINGLETON;
port.getClientArea(rect);
port.translateToParent(rect);
port.translateToAbsolute(rect);
if (!rect.contains(where) || rect.crop(threshold).contains(where))
return false;
// set scroll offset (... |
ae476b44-5452-4c9b-a967-b695d63be634 | 0 | public AttributeResource(int id) {
this.attributeID = id;
} |
fa731c0c-e804-48ee-9997-21c409a8a507 | 3 | protected WordText buildSpaceWord(GlyphText sprite) {
// because we are in a normalized user space we can work with ints
Rectangle2D.Float bounds1 = currentGlyph.getBounds();
Rectangle.Float bounds2 = sprite.getBounds();
float space = bounds2.x - (bounds1.x + bounds1.width);
//... |
83d35d1a-3c32-49ff-af08-397147d14764 | 7 | @Path("editUser.html")
@Produces(MediaType.TEXT_HTML)
@GET
public Response getEditUserView(@CookieParam("authUser") String token, @QueryParam("message") String message, @QueryParam("userName") String userName) {
try {
UserToken verifiedUserToken = doVerifyUserToken(token);
/... |
6b24404a-e923-401e-9ac1-7c6838987ff9 | 2 | @Override
public boolean decideDraw(int turn) {
int[] votes = new int[2];
for (Model m: ensemble)
votes[m.decideDraw(turn) ? 1 : 0]++;
return votes[1] > votes[0];
} |
ad3ba3ff-f3de-42e8-80c3-391892428d5a | 3 | private void verificarInvariante() {
int i,x1,y1,x2,y2 ;
ArrayList<Integer> actual;
Nodo nodoAEvaluar;
Nodo posibleAdyacente;
int N=(int) Math.sqrt(V);
for(i = 0; i< V; i++){
actual=adj(i);
x1=i%N;
y1=(i-x1)/N;
nodoAEvaluar=malla[y1][x1];
for (Integer j : actual)
{
x2=j%N;
y2=(j-x... |
6c65d6f7-0200-4aaa-b1d5-5362b6e2fdf3 | 7 | public static void main(String[] args)
{
System.out.println("Starting network example ...");
try
{
//////////////////////////////////////////
// First step: Initialize the GridSim package. It should be called
// before creating any entities. We can't run ... |
945b0f2d-8131-466c-9207-9bf39933cfe4 | 0 | protected Icon getIcon() {
java.net.URL url = getClass().getResource("/ICON/state_collapse.gif");
return new ImageIcon(url);
} |
a4bebd92-66d6-4912-bd44-b12468da8433 | 1 | public Channel getChannel() {
if (name.equals(Server.get().getButler().getName())) {
return null;
}
synchronized (channels) {
return channels.get(channels.size() - 1);
}
} |
f6eecdf1-9e9b-4d64-8f6b-c724634c7409 | 9 | @Override
public void run(int interfaceId, int componentId) {
if (stage == -1) {
sendEntityDialogue(SEND_1_TEXT_CHAT,
new String[] { player.getDisplayName(), "I'm hoping this is worth the time Reaper." },
IS_PLAYER, player.getIndex(), 12379);
stage = 1;
} else if (stage == 1) {
sendEntityDialogue(SE... |
6fbfdbd3-0742-4590-ae6f-b9e524f7d99e | 8 | protected static ArtifactType getArtifactTypeFromEntry(Entry entry) {
// Take a look at what's in the JAXB artifact wrapper (if one exists).
try {
Artifact artifactWrapper = getArtifactWrapper(entry);
if (artifactWrapper != null) {
String hint = null;
... |
5e4c6b52-8f06-436b-aef9-e65b2980332e | 0 | public float getMaxSpeed() {
return 0;
} |
cdef3b75-ecfc-409a-974c-ac3b244acb82 | 1 | public void testConstructorEx1_Type_int() throws Throwable {
try {
new Partial(null, 4);
fail();
} catch (IllegalArgumentException ex) {
assertMessageContains(ex, "must not be null");
}
} |
ca1040e7-fe51-40ac-a099-1803c73c3fa8 | 6 | void copyUtf8ReadBuffer(int count) throws java.lang.Exception
{
int i = 0;
int j = readBufferPos;
int b1;
boolean isSurrogate = false;
while (i < count) {
b1 = rawReadBuffer[i++];
isSurrogate = false;
// Determine whether we are dealing
... |
74f79f13-b876-4f41-8c0a-57804d6c0cae | 2 | public void printCosts(){
System.out.println("costs matrix for the traveling salesman problem:");
for(int i = 0;i<costs.length;i++){
for(int j = 0;j<costs[i].length;j++){
System.out.print(costs[i][j]+" ");
}
System.out.print("\n");
}
} |
82bf0c38-0ed0-495d-81d7-4b423284f314 | 5 | private void createPaths() {
if( path == null ) {
path = new Path2D.Float();
closedPath = new Path2D.Float();
Iterator<Point> line = createLine().iterator();
if( line.hasNext() ) {
Point previous = line.next();
List<Line2D> lines = new ArrayList<>();
List<Line2D> reverse = new ArrayList<>()... |
0b1ce90d-bb65-49ea-82ee-c1bcf34385bc | 8 | private boolean checkFields() {
if(employeeName.getText().equals(""))
{
JOptionPane.showMessageDialog(this,
"There is no such employee with that ID. Please enter a valid ID",
"Incomplete Form",
JOptionPane.WARNING_MESSAGE);
return false;
}
if(employerName.getText().equals(""))
{
... |
b0ab1f64-53fd-4e7e-9c8f-e3f5447d533e | 8 | private static String cutString(final String string, final boolean deleteDelimiters, final String ending, final String... begining) throws Exception
{
if(!string.contains(ending))
throw new Exception();
boolean exists = false;
for(final String temp : begining)
if(string.contains(temp))
exists = true;
... |
d4915552-3c5c-4c35-bfce-69e6520d5057 | 2 | private void quitter() {
System.out.println("Déconnexion du client...");
if (emetteur != null) {
try {
emetteur.close();
} catch (IOException e) {
System.out.println("Problème de déconnexion.");
}
}
System.out.println("Client déconnecté. Bye !");
} |
b4bf18c7-2344-4edb-b121-a35d268df9c0 | 8 | public static void main(String[] args) {
GraphDatabaseService graphDb = new GraphDatabaseFactory().newEmbeddedDatabase(Name.DB_PATH);
Node refeNode = graphDb.getReferenceNode();
// 查找所有单位
logger.debug("==查找所有单位:");
Traverser orgTraverser = TraverserHelper.findAllOrg2(refeNode);
for (Path orgPath : orgTrave... |
1029bda8-f184-48b8-9ae8-3e97859c336b | 3 | private boolean inBounds(int x, int y) {
return ( ((x >= 0) && (x < width))
&& ((y >= 0) && (y < height)) );
} |
19620432-89d3-4c1d-b759-ae813307f702 | 0 | public void onStop() throws JFException {
// ストラテジーを停止した際に呼ばれます。
LOGGER.info("onStop");
printWriter.close();
} |
7b2e2028-aea2-4319-b896-913769bbe4ce | 0 | public int getRatingId() {
return ratingId;
} |
72fd79aa-8166-4948-828b-810247853dc9 | 8 | @Override
public int[][] findMatching(DeviceGraph graph) {
ObjectGraphBuilder ogb = new ObjectGraphBuilder();
HashSet<Requestor> requestors = ogb.buildObjectGraph(graph);
int requestorCount = requestors.size();
HelperGroupFinder hgf = new HelperGroupFinder();
ArrayList<Requestor> matchedRequestors = new Arra... |
d6425126-fddb-4f38-b083-4be0a5f8f468 | 9 | public void uimsg(String msg, Object... args) {
if(msg == "set") {
synchronized(ui) {
int i = 0, o = 0;
while(i < equed.size()) {
if(equed.get(i) != null)
equed.get(i).unlink();
int res = (Integer)args[o++];
if(res >= 0) {
int q = (Integer)args[o++];
Item ni = new Item(Coord.z, res,... |
86ed1ee6-bc44-4a88-aa79-3a4858c640cb | 9 | public void outputPMFile(PMFile file, File outputFile) {
try {
byte[] key = new BASE64Decoder().decodeBuffer(file.getPassword());
if (file.getNum() != null) {
for (int i = 0; i < file.getNum().intValue(); i++) {
File f = new File(Setting.DIRNAME_OF_SAVING_PMFILE
+ file.getName() + i + Setting.EN... |
821079a5-cd79-4baa-a27a-d8f5290fa466 | 9 | public AdjacencyList getMinBranching(Node root, AdjacencyList list) {
AdjacencyList reverse = list.getReversedList();
// remove all edges entering the root
if (reverse.getAdjacent(root) != null) {
reverse.getAdjacent(root).clear();
}
AdjacencyList outEdges = new Adjac... |
7e879b95-5fd8-4c96-a523-6b427111ac17 | 4 | public void calculateInternals(double duration) {
if (body[0] == null) swapBodies();
if (body[0] != null)
{
calculateContactBasis();
relativeContactPosition[0] = new Vector3d(contactPoint);
relativeContactPosition[0].Substract(body[0].getPosition());
if (body[1] != null)
{
relativ... |
d91e6717-5ae5-4a1a-aa70-f8c2b3b9fd2c | 9 | @Override
public boolean execute(MOB mob, List<String> commands, int metaFlags)
throws java.io.IOException
{
final PlayerStats pstats=mob.playerStats();
if(pstats==null)
return false;
String channelName=commands.get(0).toUpperCase().trim().substring(2);
commands.remove(0);
int channelNum=-1;
for(int ... |
d0c307bf-4b2b-4984-9aa6-b3fd42d47df5 | 5 | public BigDecimal mean_as_BigDecimal() {
BigDecimal mean = BigDecimal.ZERO;
switch (type) {
case 1:
double[] dd = this.getArray_as_double();
double meand = 0.0D;
for (int i = 0; i < length; i++)
meand += dd[i];
meand /= length;
mean = new BigDecimal(meand);
break;
case 12:
BigDecimal[] ... |
e77bd9eb-a385-4950-bde9-8c25207d946a | 1 | private static Boolean runStatement(String statement)
{
try
{
getConnection();
PreparedStatement st = con.prepareStatement(statement);
st.executeUpdate();
return true;
}
catch (SQLException ex)
{
System... |
97f11d2a-40f2-47bd-8e80-ec16cb41cc24 | 4 | public void makeNonVoid() {
if (type != Type.tVoid)
throw new jode.AssertError("already non void");
ClassInfo clazz = getClassInfo();
InnerClassInfo outer = getOuterClassInfo(clazz);
if (outer != null && outer.name == null) {
/* This is an anonymous class */
if (clazz.getInterfaces().length > 0)
ty... |
12814a03-d31a-4841-9770-b9c8dff4ce5a | 4 | public static Comparator comparator() {
if (Type.comparator != null) {
return (Type.comparator);
}
Type.comparator = new Comparator() {
public int compare(final Object o1, final Object o2) {
// o1 < o2 : -1
// o1 == o2 : 0
// o1 > o2 : 1
if (!(o1 instanceof Type)) {
throw new IllegalA... |
9131ce70-1ad8-4775-9cb7-5694553308cb | 6 | private void initialize(final int flags) {
this.flags = flags;
count = 0;
count += ((flags&InputFlags.TA_IN_PRICE_OPEN)!=0) ? 1 : 0;
count += ((flags&InputFlags.TA_IN_PRICE_HIGH)!=0) ? 1 : 0;
count += ((flags&InputFlags.TA_IN_PRICE_LOW)!=0) ? 1 : 0;
count += ((flags&Input... |
6eabc296-6dbc-49a6-b2c6-60d09c12da02 | 9 | @Override
public boolean invoke(MOB mob, List<String> commands, Physical givenTarget, boolean auto, int asLevel)
{
if((!mob.isInCombat())||(mob.rangeToTarget()<1))
{
mob.tell(L("You really should be in ranged combat to cast this."));
return false;
}
for(int i=0;i<mob.location().numItems();i++)
{
fi... |
a5d41cbc-bc3d-4f84-b142-7b42050b461c | 7 | HubNode (
Device dev,
TreeNode parent
) throws IOException
{
super (dev, parent);
hub = new Hub (dev);
addr = dev.getAddress ();
// Flat tree display: devices connect to root hub.
if (isFlatTree) {
if (hub.isRootHub ()) {
Bus bus = dev.getBus ();
children = new USBNode [127];
last = 0;
f... |
8baab08d-89dd-4af9-a523-bc0eafa969d0 | 4 | public String RetrieveActualPassword(String userName) throws SQLException{
String actualPassword=null;
try{
databaseConnector=myConnector.getConnection();
stmnt=(Statement) databaseConnector.createStatement();
SQLQuery="SELECT passwor... |
1eab75dc-7b2a-4c81-9144-2e310c9e5db7 | 3 | public void render(GameContainer gc, Graphics g) throws SlickException{
if(dx == 0 && dy == 0){
if(facingRight)
animation = idleRight;
else
animation = idleLeft;
}
animation.draw(x, y);
g.setColor(Color.red);
g.drawRect(x, y - 12, 16, 4);
g.setColor(Color.green);
g.drawRect(x, y - 12, 16 ... |
3e613467-4b34-4123-ac9b-648e352c5c31 | 4 | private boolean containsExcludeToken(String agentString)
{
if (excludeList != null) {
for (String exclude : excludeList) {
if (agentString != null && agentString.toLowerCase().indexOf(exclude.toLowerCase()) != -1)
return true;
}
}
return false;
} |
4b467544-2d3c-419b-af5c-5428ff946bf0 | 0 | public String getaddress()
{
return address;
} |
dad712b1-93ec-4609-bfdb-3b9e46b773a1 | 2 | public static String getString(String urlString) throws MalformedURLException, IOException {
URL url;
InputStream is = null;
BufferedReader br;
String line;
StringBuilder result = new StringBuilder();
try {
url = new URL(urlString);
HttpURLConnect... |
29551617-0b6b-4734-80eb-166afefdb6cf | 0 | public void reset() {
this.year=-1;
this.month=-1;
this.day=-1;
this.hour=-1;
this.minute=-1;
this.second=-1;
this.extraData=null;
} |
8f7d2b87-eb47-4de2-b7ac-e7a7856b3312 | 9 | private String parsePrefix(final ByteArrayInputStream is) {
final StringBuilder b = this.b;
b.setLength(0);
int ch;
is.mark(0);
ch = is.read();
if (ch != ':') {
is.reset();
return "";
}
ch = is.read();
while (ch != ' ' && ch... |
0f3cba82-1d59-468f-bc96-0ea9eef4fd29 | 0 | public ClientListenerHandler(ServerSocket socket, String userName) {
// TODO Auto-generated constructor stub
socketListen = socket;
run = true;
myUserName = userName;
} |
d457b3bd-056c-42f8-8999-6d73984f48c0 | 8 | protected boolean automatonActionPermissible(Component source) {
if (!(getObject() instanceof Automaton))
return true;
if (automaton.getInitialState() == null) {
JOptionPane.showMessageDialog(source,
"Simulation requires an automaton\n"
+ "with an initial state!", "No Initial State",
JOptionP... |
2e68b970-0ca6-440c-a399-3427d2f63545 | 7 | static private boolean jj_3R_18() {
Token xsp;
xsp = jj_scanpos;
if (jj_3_5()) {
jj_scanpos = xsp;
if (jj_3R_39()) {
jj_scanpos = xsp;
if (jj_3R_40()) {
jj_scanpos = xsp;
if (jj_3R_41()) {
jj_scanpos = xsp;
if (jj_3_6()) {
jj_scanpos = xsp;
if (jj_3R_42()) {
jj_sc... |
aeae884a-7073-4fb9-8704-999d4b021726 | 1 | @Override
public int getPages(int intRegsPerPag, ArrayList<FilterBean> hmFilter, HashMap<String, String> hmOrder) throws Exception {
int pages;
try {
oMysql.conexion(enumTipoConexion);
pages = oMysql.getPages("cliente", intRegsPerPag, hmFilter, hmOrder);
oMysql.de... |
fe9a267e-646b-4558-9b5f-ae0bd10c3e5c | 8 | public Position GetPositionInFront(int Rotation)
{
Position Return = new Position(this.X, this.Y, this.Z);
switch(Rotation)
{
case 0:
Return.Y--;
break;
case 1:
Return.X--;
Return.Y--;
break;
case 2:
Return.X++;
break;
case 3:
Return.X--;
Return.Y++;
... |
1c202c34-3107-4bc2-a9e8-64fcbb099767 | 9 | public void evaluate(Instance instance, Prediction prediction) {
Label correct = instance.label();
Label predicted = prediction.winner();
if (correct.equals(predicted)) {
if (correct.isPositive() && predicted.isPositive())
TP++;
else if (!correct.isPositive() && !predicted.isPositive())
TN++;
els... |
5fdaf280-fafd-404a-a0e1-8a1c28aced28 | 1 | public void refuel(int fuel) {
tank.refuel(fuel);
if(!tank.isEmpty()) {
setDead(false);
}
} |
ba318d85-fcf7-485e-86d1-397b37024e9d | 7 | private boolean versionCheck(String title)
{
if (this.type != UpdateType.NO_VERSION_CHECK) {
final String version = this.plugin.getDescription().getVersion().replace("dev", "");
if (title.split(" v").length == 2) {
final String remoteVersion = title.split(" v")[1].sp... |
028a2b5a-1d2f-4395-bae5-ab7cf5317519 | 2 | public void visitShiftExpr(final ShiftExpr expr) {
if (expr.expr == from) {
expr.expr = (Expr) to;
((Expr) to).setParent(expr);
} else if (expr.bits == from) {
expr.bits = (Expr) to;
((Expr) to).setParent(expr);
} else {
expr.visitChildren(this);
}
} |
31c30a26-ff5a-44f0-bd89-4a96b209ec7b | 4 | public void close() {
System.out.println("tcp servers closed");
TCPServer tcpServer;
for (int i = 0; i < tcpServers.size(); i++) {
tcpServer = tcpServers.get(i);
if (tcpServer != null) {
tcpServer.keepRunning = false;
}
}
shut... |
1b84019f-be9b-4301-b26b-9d4cbbe26733 | 5 | @Override
public boolean equals(Object obj) {
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final OutputCanDDeliveryOrderItemDetailPK other = (OutputCanDDeliveryOrderItemDetailPK) obj;
if (!Objects.equal... |
1cd5883b-1647-4df5-914b-56f9903fbddf | 0 | public synchronized Robot getRobot(String robot_name) {
return robots.get(robot_name);
} |
c56f0919-69e7-4a0d-b805-8468f29e6bff | 4 | public void update() throws IOException {
checkTileMapCollision();
setPosition(xtemp, ytemp);
if(dx == 0 && !hit) {
setHit();
}
animation.update();
if(hit && animation.hasPlayedOnce()) {
remove = true;
}
} |
c176d262-ac5e-4618-8ff3-36e76c1161a5 | 6 | public boolean isReturn() {
switch (opcode) {
case opc_areturn:
case opc_ireturn:
case opc_lreturn:
case opc_freturn:
case opc_dreturn:
case opc_return:
return true;
default:
return false;
}
} |
be5fcb81-94d7-49f3-bd17-ca8d0429bf70 | 6 | public static void displayCalendar(int year) {
Calendar cal = Calendar.getInstance();
cal.set(year, 0, 1);
String[] months = { "January", "February", "March", "April", "May",
"June", "July", "August", "September", "October", "November",
"December" };
String[] days = { "", "Su", "Mo", "Tu", "We", "Th", ... |
7355bb48-cd66-446d-9508-4947eaf81b1e | 8 | public static void main (String [] args )
{
Piece p;
Scanner keyboard = new Scanner (System.in);
System.out.print ("Would you like to play with a Bishop, Knight or King? ");
String answer = keyboard.nextLine ();
if (answer.charAt(0) == 'b' || answer.charAt(0) == 'B') p = ne... |
19a014aa-60a5-4333-98e4-4c5301955d5c | 7 | public void compFinalResult() {
do {
iStage++;
compAllocation();
if (compDistribution()) {
/* deadline can not be satisfied */
if (!bDeadline) {
System.out.println("THE DEADLINE CAN NOT BE SATISFIED!");
return;
} else {
System.out.println("\nNEW ROUND WITHOUT CHECKING:");
dEv... |
c7b9b251-d65d-4429-ae58-410ecf0c60dc | 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... |
980a1710-dc65-413a-ba02-b559deb97d4d | 0 | public void setNote(Note note){
myNote = note;
} |
a1906f86-694a-4970-a2ba-bc917bb825d1 | 1 | @Override
protected Unmarshaller create() {
try {
return context.createUnmarshaller();
} catch (JAXBException e) {
throw new XmlTransformationException("Failed to create jaxb unmarshaller", e);
}
} |
6a57e92e-47e2-410f-99dc-80e818d717e9 | 1 | public int patientsLengthRecursively() {
if (this.isLast) {
return 1;
} else {
return 1 + nextPatient.patientsLengthRecursively();
}
} |
3af11879-fd46-47db-a95e-ac8fbb59f3d8 | 0 | @Basic
@Column(name = "PCA_DESCRIPCION")
public String getPcaDescripcion() {
return pcaDescripcion;
} |
9b9e7db3-19db-4a33-a08d-1f332bb7156b | 0 | public Village getVillage() { return village; } |
251965f8-b5ae-477f-94d8-17ae74811e57 | 5 | public String ObtenerImagen(String Ruta, String Nombre){
try {
Mp3File mp3file = null;
mp3file = new Mp3File(Ruta);
if (mp3file != null && mp3file.hasId3v2Tag()) {
ID3v2 id3v2Tag = mp3file.getId3v2Tag();
byte[] imageData = id3v2Tag.getAlbumI... |
f8202152-136c-43eb-98d3-2b9ac3170386 | 1 | private String twoDigitString(int timeValue)
{
String result = Integer.toString(timeValue);
if (result.length() == 1)
{
result = "0" + result;
}
return result;
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.