method_id stringlengths 36 36 | cyclomatic_complexity int32 0 9 | method_text stringlengths 14 410k |
|---|---|---|
7c13de01-95b9-44f6-bf1d-821cbd2dfdcd | 3 | @Override
public boolean equals(Object obj) {
if (obj == this)
return true;
if(!(obj instanceof Operation))
return false;
Operation op = (Operation) obj;
return (operation.equals(op.getString()) && timeStamp == op.gettimeStamp());
} |
251d2183-1312-4360-ae5b-c2465b93752c | 9 | @Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Picture other = (Picture) obj;
if (id == null) {
if (other.id != null)
return false;
} else if (!id.equals(other.id))
return false;
... |
358459d5-01bc-4cb1-8cc3-9bc54a9d1f82 | 3 | @SuppressWarnings("unchecked")
<T> T getArrayForType(Class<? extends T> type) {
if (!type.isArray()) {
throw new IllegalArgumentException("Not an array type");
}
Class cType = getArrayBaseType(type);
Object o = new Parser(co.get(key(String.class, cType))).parse(0,
layout, types(dims, cType));
... |
53046c31-e36e-4f75-8bdf-1463dce0ea53 | 3 | @Override
public Account removeAccount(User owner, Account account) {
PreparedStatement pStmt = null;
Account ac = null;
Integer result;
ac = getAccount(account.getId());
if (ac != null){
try {
pStmt = conn.prepareStatement("DELETE FROM ACCOUNT WHERE user_login = ? AND id = ?;");
... |
33bbd606-befc-4b14-8915-df3c861b577a | 5 | public void mouseUp(MouseEvent e, int x, int y) {
// ask the associated board figure to perform its associated action based
// upon the coordinates of mouse down and mouse up (move or click)
if ( clickedFigure != null ) {
boolean valid = clickedFigure.performAction(fStartX, fStartY,
... |
20653446-1b9e-4d6b-951b-1ce343de0988 | 3 | public void volverCero(){
if(Calendar.getInstance().get(Calendar.MONTH) != mes || Calendar.getInstance().get(Calendar.YEAR) != anio){
mes = Calendar.getInstance().get(Calendar.MONTH);
anio = Calendar.getInstance().get(Calendar.YEAR);
for(beansMiembro miembro : miembros){
miembro.setEgresos(0);
miemb... |
9cd7d0cb-447e-4188-851e-6dcfa85d2732 | 5 | public void layoutContainer(Container target) {
synchronized (target.getTreeLock()) {
Insets insets = target.getInsets();
int top = insets.top;
int bottom = target.getHeight() - insets.bottom;
int left = insets.left;
int right = target.getWidth() - insets.right;
int centerWidth = 0;
int centerHei... |
aa706496-38c0-42ea-9e47-6b0bc02f0f5f | 3 | private int getClusterInPlot(int x, int y) {
int clusterId = -1;
float xInPixels, yInPixels, radiusInPixels;
double dist, smallerRadius = Double.MAX_VALUE;
ChartItem clusterItem;
for (Integer id : ChartData.getAllIds()) {
clusterItem = ChartData.getItemById(id);
xInPixels = getPointXInPixels(clusterIte... |
efede0d9-92e0-46ec-827f-e53fe9e49fa2 | 9 | public int compareTo( Object obj ) {
if( obj == null ) {
return( 1 );
}
else if( obj instanceof GenKbContactListByUDescrIdxKey ) {
GenKbContactListByUDescrIdxKey rhs = (GenKbContactListByUDescrIdxKey)obj;
if( getRequiredTenantId() < rhs.getRequiredTenantId() ) {
return( -1 );
}
else if( getRequ... |
4400ba7a-c1db-4aa7-b4d1-03daa25ef6a2 | 7 | public void updateItems() {
try {
String strResult = ""+(char)6,
strStore;
int i;
Item itmStore;
LifoQueue qStore;
Iterator iter=vctItems.keySet().iterator();
while(iter.hasNext()) {
qStore = (LifoQueue)vctItems.get(iter.next());
if (qStore.size() > 0) {
itmStore = (Item)qStore.fir... |
fc49a94a-3db6-4419-bd57-5cb54a275228 | 4 | @Override
public void addEdge(N from, N to, W weight) {
if(containsNode(from) && containsNode(to) && !containsEdge(from, to)) {
nodes.get(from).add(new WeightedEdge<N, W>(from, to, weight));
if(!isDirected) {
nodes.get(to).add(new WeightedEdge<N, W>(to, from, weight));
}
}
} |
69d3a036-8dc0-451d-ae51-6385d0d7d778 | 3 | public Shoe(int numDecks) {
this.deckCount = numDecks;
this.numCards = deckCount * numDecks;
if (numDecks >= minDecks) {
for (int i = 1; i < 14; i++) {
for (int j = 1; j < 4; j++) {
Shoe.add(new Card(i, j));
}
}
} else {
throw new IllegalStateException("Minimum decks is 4");
}
Collecti... |
1bf2b76c-6940-44d5-a448-6d08c051d03c | 7 | public CheckResultMessage checkDayofMonth() {
// clear message list
messageList.clear();
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMM");
try {
Date date = dateFormat.parse(monthDate);
Calendar cal = Calendar.getInstance();
cal.setTime(date);
maxDay = cal.getActualMaximum(Calendar.D... |
43f82e1a-1011-4e21-8a56-a613cb80a65e | 4 | public void solve(){
int m = this.y.length;
double[] w = new double[m]; // weights
Arrays.fill(w, 1.0);
double[][] D = new double[this.T][m]; // distribution of row's pure strategy
Arrays.fill(D[0], 1.0/((double)m));
double sum = 0.0;
for ( int t = 0; t < T; t++ ){
int j = getMaxJ(D[t]);
sum += g... |
c2b730f8-0fe1-4bbd-a2bf-2a6ffc7aa01a | 1 | public Object clone() {
try {
SimpleSet other = (SimpleSet) super.clone();
other.elementObjects = (Object[]) elementObjects.clone();
return other;
} catch (CloneNotSupportedException ex) {
throw new alterrs.jode.AssertError("Clone?");
}
} |
14097b8e-5157-4716-90b2-af744cd36144 | 3 | private static void addToVariables(Character var) throws ValidationException {
for (Character c : variables) {
if (c.equals(var)) {
return;
}
}
variables.add(var);
if (variables.size() > MAX_VARIABLES) {
throw new ValidationException("You have more than " + MAX_VARIABLES + " variables");
}
} |
2c43f8c7-d6c6-47b5-8799-36582dab918b | 1 | public boolean isOddNumber(int num){
if(num%2 == 0)
return false;
else
return true;
} |
06dac4bf-f762-4338-aa88-17e04e7c3814 | 2 | public WorldMap(int sizex, int sizey) {
rand = new Random();
seed = (int) (rand.nextInt(100000000) * rand.nextFloat());
System.out.println(seed);
map = new ArrayList<ArrayList<Region>>();
for (int x = 0; x < sizex; x++) {
map.add(new ArrayList<Region>());
... |
f074af9d-aa63-4b63-88ee-f32f0f1fb443 | 0 | public void setEntradasIdEntrada(Entradas entradasIdEntrada) {
this.entradasIdEntrada = entradasIdEntrada;
} |
1f596164-8f62-4954-943a-230de927ed2f | 6 | public <T> TypeAdapter<T> create(final Gson gson, final TypeToken<T> type) {
Class<?> rawType = type.getRawType();
final boolean skipSerialize = excludeClass(rawType, true);
final boolean skipDeserialize = excludeClass(rawType, false);
if (!skipSerialize && !skipDeserialize) {
return null;
}
... |
4f85059a-26cb-4cf7-8b64-5bfaff464e86 | 0 | private List<Generator> test1Generators() throws ParseException {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
List<Generator> result = new ArrayList<>();
result.add(new NumberedStringGenerator("dim1", "dim1_key", "key"));
result.add(new IntegerGenerator("dim1", "num1", 0))... |
2ae077dd-f60c-4fef-b770-4270b5ec7e97 | 8 | void pushDuskObject(DuskObject objIn)
{
synchronized(objEntities)
{
if (objIn.intLocX < 0 || objIn.intLocY < 0 || objIn.intLocX >= MapColumns || objIn.intLocY >= MapRows)
{
return;
}
DuskObject objStore;
objStore = objEntities[objIn.intLocX][objIn.intLocY];
if (objIn == objStore) // needed to... |
6af33373-3005-4f62-851e-a62b7373ae00 | 5 | private final boolean method3960(boolean bool) {
int i = ((DirectxToolkit) this).anIDirect3DDevice9810.TestCooperativeLevel();
if (bool)
method3880(null, null, (byte) -68);
if (i == 0 || -2005530519 == i) {
Class53 class53 = (Class53) ((DirectxToolkit) this).anObject7919;
method3922(false);
class53.me... |
3f614f11-b2d5-4057-b18c-119608647e36 | 2 | public double getKiihtyvyys2X() {
double res = 0;
if(getNappaimenTila(VASEN2)){
res -= KIIHTYVYYS;
}
if(getNappaimenTila(OIKEA2)){
res += KIIHTYVYYS;
}
return res;
} |
1dca40bd-7198-48f5-be14-751a151f569f | 3 | public static void main(String[] args) throws IOException {
String path = "C:/Users/Frede/Desktop/fehler.txt";
String file = readFile(path);
String[] lines = file.split("\n");
for(String line : lines) {
if(line.contains("konnte nicht eingetragen werden.") && line.length() > 0) {
line... |
a4bd70fb-deba-4dcb-8542-f96fdb27a482 | 4 | public SudokuBoard(String inputFile) throws IOException {
BufferedReader in = null;
try {
in = new BufferedReader(new FileReader(inputFile));
String line = null;
//read in rows;
for(int i = 0; i < 9;i++) {
line = in.readLine();
//read in a row
for(int j = 0; j < 9;j++)
{
... |
f92ac905-f5a8-4c87-b6d7-8d0ffba1e8e3 | 3 | public static void lerak( int[][] tabla )
{
b = 1; jatekos = 0;
while( b != 19 )
{
AktualisRajzol.rajzol(tabla);
jatekos = Jatek.melyJatekosKovetkezik(b, jatekos, 0);
sor = sc.nextLine();
if( Ellenor.ellenorLerak(sor) == false )
{
System.out.println( "Rossz formátumban adtál meg értéket... |
0a9fc2aa-28cf-4c65-a8bb-8472ac2fb71d | 7 | public boolean onlyHasSolution (){
int countWeapon =0;
int countPerson=0;
int countRoom =0;
for(Card c: seenCards){
switch (c.getType()){
case WEAPON : countWeapon++;
break;
case PERSON : countPerson++;
break;
... |
54f80a7b-b17a-49c5-95cb-b3f50b8bdb81 | 7 | @Override
public boolean checkGrammarTree(GrammarTree grammarTree,
SyntaxAnalyser syntaxAnalyser) throws GrammarCheckException {
boolean firstLevelIsOk = this.checkFirstLevel(grammarTree);
if (!firstLevelIsOk) {
GrammarCheckException exception = new GrammarCheckException(
"Error: the sentence has mutipl... |
ada8a099-a6aa-47b8-8873-10355a59fa08 | 9 | @Override
public void update() {
if(++updateCount >= REGEN_TIME) {
updateCount = 0;
amount++;
}
if(amount < 0) {
getWorld().removeStructure(this);
} else if(amount > SPREAD) {
Set<Tile> neighbours = new HashSet<Tile>();
Tile temp;
temp = getWorld().getTile(getX()+-1, getY());
neighbours.... |
cf3821e4-c441-4dce-8d97-5aca074413cc | 1 | public final void Init() throws IOException
{
Code = 0;
Range = -1;
for (int i = 0; i < 5; i++)
Code = (Code << 8 | Stream.read());
} |
d93d4531-e672-4299-8e01-6229a698adc7 | 5 | public static MediaCopy getMediaCopyByMediaCopyID(int copyID){
MediaCopy mc = null;
try {
if(conn == null || conn.isClosed()){
conn = DatabaseConnection.getConnection();
}
} catch (SQLException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
try {
... |
172fdfcf-91c9-4e97-9551-0b2ff0948488 | 7 | public File getLocalFile(URI remoteUri)
{
if (baseURL != null)
{
String remote = remoteUri.toString();
if (!remote.startsWith(baseURL))
{
return null;
}
}
StringBuilder sb = new StringBuilder();
String host = remoteUri.getHost();
String query = remoteUri.getQuery();
... |
b184cf83-e3ea-4fdf-baa0-540fb12f64f6 | 1 | private void verifyTargets(final Block block, final Set targets) {
Assert.isTrue(targets.size() == cfg.succs(block).size(), block
+ " has succs " + cfg.succs(block) + " != " + targets + " in "
+ block.tree().lastStmt());
final Iterator iter = targets.iterator();
while (iter.hasNext()) {
final Block t... |
1213e5fb-9add-404c-a5d7-254df4598a4b | 5 | @Override
public void putAll(Map<? extends String, ?> m) {
for (Map.Entry<? extends String, ?> entry : m.entrySet()) {
String key = entry.getKey();
Object value = entry.getValue();
this.put(key, value);
}
} |
7de1083a-0b55-4baa-847d-c2d4c04ca1ff | 5 | public void sort(ArrayList<Integer> arr) {
timeOfSorting = System.currentTimeMillis();
Random rnd = new Random();
while(true) {
boolean sorted = true;
for (int i = 0; i < arr.size()-1; i++) {
compare_count++;
if(arr.get(i) > arr.get(i+1)){
... |
9ce133af-4616-460e-a6ff-c6ff1a1ba310 | 5 | private static final Hashtable createFactoryStore() {
Hashtable result = null;
String storeImplementationClass
= System.getProperty(HASHTABLE_IMPLEMENTATION_PROPERTY);
if (storeImplementationClass == null) {
storeImplementationClass = WEAK_HASHTABLE_CLASSNAME;
}
... |
b26d2aef-0814-4ec6-8faa-7591889258f7 | 5 | private ArithmeticResult factor(Block codeBlock) throws SyntaxFormatException, IOException {
ArithmeticResult designatorResult = designator(codeBlock);
if (designatorResult != null) {
return designatorResult;
}
ArithmeticResult funcCallResult = funcCall(codeBlock);
if (funcCallResult != null) {
return ... |
d19373cc-46a6-455f-a8a1-3148eaa7af8b | 5 | public static boolean verifyPrescription(FillPrescription fillP){
if(DatabaseProcess.getDrugNames().contains(fillP.getDrugName().getText().toLowerCase())){
if(InputChecker.digits(fillP.getQuantity().getText())){
if(InputChecker.digits(fillP.getRefillCount().getText())){
if(InputChecker.dob(fillP.getFil... |
4fbf9004-38ad-412a-b0de-cda8e949c36b | 6 | private void removeFoundNode(TreeNode removingNode) {
TreeNode parentNode;
if (removingNode.left == null || removingNode.right == null) {
parentNode = removingNode;
} else {
parentNode = successor(removingNode);
removingNode.key = parentNode.key;
}
TreeNode childNode;
if (parentNode.left != null)... |
d6b488a1-fb95-4710-bfeb-06c433c08671 | 9 | void ComputeEmissionProbsForDoc(_Doc d) {
for(int i=0; i<d.getSenetenceSize(); i++) {
_Stn stn = d.getSentence(i);
Arrays.fill(emission[i], 0);
int start = 0, end = this.number_of_topics;
if(i==0 && d.getSourceType()==2){ // first sentence is specially handled for newEgg
//get the se... |
1acedc50-4a21-44f2-af21-2fa082007e22 | 3 | public static boolean equals(int[][] actual, int[][] expected) {
boolean equal = true;
for (int i = 0; i < expected.length; i++) {
for (int j = 0; j < expected[i].length; j++) {
if (expected[i][j] != actual[i][j]) {
equal = false;
}
... |
c188628b-077e-49e6-a7dd-eea5fe757c4b | 0 | public void setKind(Integer kind) {
this.kind = kind;
} |
4a4e0d4f-b898-48d1-8404-0505fe9659d3 | 4 | public void update(LineEvent lineEvent) {
int clipIdx = 0;
boolean triggingClipFound = false;
while (triggingClipFound == false && clipIdx < clipAssembly.length) {
if (clipAssembly[clipIdx] == lineEvent.getSource()) {
if (lineEvent.getType() == LineEvent.Type.STOP) {... |
1c767d6d-08b1-4d90-ba2c-a1d0158a34fc | 2 | public void setAnnotations(Annotation[] annotations) {
ByteArrayOutputStream output = new ByteArrayOutputStream();
AnnotationsWriter writer = new AnnotationsWriter(output, constPool);
try {
int n = annotations.length;
writer.numAnnotations(n);
for (int i = 0; ... |
06724139-c443-49fc-9627-8de038b13576 | 8 | public Object invokeMethod(Reference ref, boolean isVirtual, Object cls,
Object[] params) throws InterpreterException,
InvocationTargetException {
if (!isVirtual && cls != null) /* XXX */
throw new InterpreterException("Can't invoke nonvirtual Method "
+ ref + ".");
Method m;
try {
String[] para... |
d9c14c9e-f627-4684-aa75-1360ff10fd8c | 2 | protected String getPokemonName(int i) {
if (getGame().getPlayer().pokeData.isCaught(i) || getGame().getPlayer().pokeData.isSeen(i)) {
return cache[i - 1].name;
}
return "-------------------";
} |
9131cc39-6fba-4b2c-90ef-57e322bca928 | 3 | private static Packet getLoginPacket(String packet) {
Scanner sc = new Scanner(packet);
if(!sc.next().equals(Packet.PACKET_CODES.LOGIN_CMD)) return null;
Packet res = new Packet(Packet.PACKET_CODES.LOGIN_CMD);
HashMap<String, String> data = new HashMap<Strin... |
8e3373e1-9b58-4ef3-bc33-4d68f4e18f8f | 0 | @Override
public void serialize(Date date, JsonGenerator gen, SerializerProvider provider)
throws IOException, JsonProcessingException {
String formattedDate = dateFormat.format(date);
gen.writeString(formattedDate);
} |
ca1abc0c-d514-4ff7-a32c-ad4330ff1c7b | 5 | boolean savetodatabase(String columns[], String items[])
{
boolean errorfound = false;
String builtstatement;
Statement stmt = null;
java.sql.Connection conn = null;
java.sql.ResultSet rs = null;
try
{
//get a connection
Connection.initialize_Connection_SQL();
conn = Connection.getSQLConn();
... |
611256ca-f211-4822-913e-b8ad3b2168de | 4 | @Override
public void startSetup(Attributes atts) {
super.startSetup(atts);
String path = atts.getValue(A_PATH);
URL url_path = null;
if (path == null) {
System.out.println("WARNING: path attribute not provided for HTMLViewerMenuItem: " + getText());
} else if (path.indexOf("://") != -1) {
try {
... |
d82e8a1d-c352-4a0f-9b4f-a125c5522d94 | 3 | @Override
public boolean equals(Object obj) {
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final OutputArCustomer other = (OutputArCustomer) obj;
if (!Objects.equals(this.szCustomerId, other.szCustomerI... |
6d3aa183-f835-464c-8b26-2b11a6c0ff6a | 2 | public List<String> getIDList(String term) {
String query = "select IDList from termidlist where term=\"" + term
+ "\"";
ResultSet rsSet = sqLconnection.Query(query);
List<String> iDList = new ArrayList<>();
try {
while (rsSet.next()) {
String id = rsSet.getString("IDList");
iDList = Arrays.asLis... |
d37ec3f4-7061-4f4c-92b1-9b8bf58d7b74 | 6 | public Stella_Object lookup(Stella_Object key) {
{ KeyValueMap self = this;
{ Stella_Object map = self.theMap;
int crossover = self.crossoverPoint;
if (crossover == 0) {
return (StellaHashTable.stellaHashTableLookup(((StellaHashTable)(map)), key));
}
else {
... |
881d026b-123b-4295-bae5-c6175a177dd1 | 8 | public boolean isInField(Vector2d coord) {
if ((coord.x>=position.x && coord.x<=position.x+widthHeight.x) || (coord.x<=position.x && coord.x>=position.x+widthHeight.x)) {
if ((coord.y>=position.y && coord.y<=position.y+widthHeight.y) || (coord.y<=position.y && coord.y>=position.y+widthHeight.y)) {
return tr... |
e211e6af-8a3b-4dce-8ddf-e737da5cac02 | 6 | public void verify(FileInputStream ciphertext, FileInputStream cleartext) {
int Lp = p.bitLength(); // bitlength of p (512 bit)
int L = (Lp - 1) / 8; // blocksize
// read ciphertext
BigInteger C = readCipher(ciphertext);
BigInteger M = readClear(cleartext, L);
Boolean verified = true;
whil... |
c08052ee-62c5-4ddb-857a-399e6cb22b78 | 5 | public void update(float delta) {
boardTimer += delta / 1000;
if (boardTimer > minSpawnTime) {
Random rng = new Random(System.currentTimeMillis());
int r1 = rng.nextInt();
int spawnTime = maxSpawnTime - minSpawnTime;
if ((int) r1 % spawnTime == 0 || boardT... |
fe566d9b-56cf-4e89-8e69-1082e8c6d628 | 0 | public ArrayIterator(T[] source)
{
this._source = source;
} |
1d73ab56-e358-49c6-9b1a-6024e512111b | 0 | public static void init() {
} |
59d72a96-6490-4e18-8807-77fa2269ad53 | 2 | @Override
public void Borrar(Object value) {
Session session = null;
try {
Equipo equipo = (Equipo) value;
session = NewHibernateUtil.getSessionFactory().openSession();
session.beginTransaction();
session.delete(equipo);
session.getTransa... |
f5baa621-1a1f-426b-ab42-2eb536b5a7f3 | 2 | public void act(List<Actor> newHunters)
{
// Move towards a source of food if found.
Location newLocation = findTarget();
if(newLocation == null) {
// No food found - try to move to a free location.
newLocation = getField().freeAdjacentLocation(getLocation());
}... |
336bea51-e5f8-45b5-82ec-8d7ff2c3a825 | 9 | @Override public boolean getControls(String control){
if(control == "Age"){ return true;}
if(control == "Fade"){ return true;}
if(control == "Mat"){ return true;}
if(control == "Orient"){ return true;}
if(control == "Mirror"){ return true;}
if(control == "Any"){return true;}
if(control == "All"){re... |
e5d3778b-e4bf-4881-adfe-907ae95c9ee5 | 0 | public List<RoomEvent> findRoomEventsByEventBranchId(final Long eventBranchId) {
return new ArrayList<RoomEvent>();
} |
a7d9c005-d1d2-4d08-9cca-9d9fcdfbf7ee | 8 | static float lpc_from_data(float[] data, float[] lpc, int n, int m){
float[] aut=new float[m+1];
float error;
int i, j;
// autocorrelation, p+1 lag coefficients
j=m+1;
while(j--!=0){
float d=0;
for(i=j; i<n; i++)
d+=data[i]*data[i-j];
aut[j]=d;
}
// Generate ... |
f60d93db-f695-4442-b0be-8376948a4a75 | 5 | public void run() {
try {
// loop until thread is terminated
while (!isInterrupted() && processMsg(readInt())) ;
} catch (Exception ex) {
if (parent().isConnected()) {
eWrapper().error(ex);
}
}
if (parent().isConnected()) {
... |
953450e2-6d93-4227-b958-57d87a9b7ace | 7 | private void findCosineSimilarity(double[] activeUser) { // Add Logic to check that not all elements are same otherwise Wau =0
for (int user = 0; user < totalUsers; user++) {
double innerProduct = 0;
double lengthOfActiveUser = 1;
double lengthofUser = 1;
... |
2d38e7e3-6452-407f-93a1-58cad5afec51 | 3 | public int getPendingSaveCount() {
int count = 0;
for (PlayerReinforcement pr : pendingDbUpdate) {
DbUpdateAction action = pr.getDbAction();
if (action == DbUpdateAction.INSERT || action == DbUpdateAction.SAVE) {
++count;
}
... |
333569aa-14c2-4a95-84a8-f3d56603a245 | 8 | public <V> Adapter.Setter<V> makeSetter(String methodName, Class<V> _class) {
try {
final Method method = version.getClass().getMethod(methodName, _class);
return new Adapter.Setter<V>() {
public void call(V value) {
try {
Transaction me = Thread.getTransaction();
... |
180d2141-6ff9-43dd-b475-e89b552ae325 | 6 | public void DeleteAtividade(int IDatividade) throws SQLException {
Connection conexao = null;
PreparedStatement comando = null;
ResultSet resultado = null;
try {
conexao = BancoDadosUtil.getConnection();
comando = conexao.prepareStatement(SQL_DELETE_ATIVIDADE);... |
2ed93008-bf11-442c-a099-48399904f89a | 4 | public AnalyzeProteins() {
//iterate through all dssp files on-hand
int counter = 0;
File dir = new File("C:/Users/Bryn/Documents/CodingProjects/dssp/");
for (File child : dir.listFiles()) {
if (".".equals(child.getName()) || "..".equals(child.getName())) {
continue; // Ignore the self and parent aliases.
... |
b6fbf021-b685-47ef-b60f-fdf37f3cb343 | 4 | public void login(ActionEvent actionEvent){
RequestContext context = RequestContext.getCurrentInstance();
FacesMessage msg = null;
boolean loggedIn = false;
if(usuaCuenta != null && usuaCuenta.equals("admin") && usuaContrasena != null && usuaContrasena.equals("admin")){
... |
84c45f53-288c-4830-9263-80020644c2f5 | 1 | public static Duration available(Duration maximum, Duration current) {
if (current.isLongerThan(maximum)) {
return new Duration(0);
} else {
return maximum.minus(current);
}
} |
a091de13-abb3-4d61-8005-ceb405b64e68 | 6 | @Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Utente other = (Utente) obj;
if (nome == null) {
if (other.nome != null)
return false;
} else if (!nome.equals(other.nome))
return fa... |
dfcf741b-dc4f-4ad6-babc-fd1eb37789f0 | 4 | private void sendMessage(PaneTab selectedTab) {
if (!selectedTab.getMessageField().getText().isEmpty()) {
String message = selectedTab.getMessageField().getText();
if (this.view.tabs.getSelectedIndex() == 0) {
// Public message
int maxPublicMessageLength = this.client.MAX_PACKET_SIZE
- this.client... |
915228ae-1ac0-4871-bb1b-3997278e9aa2 | 3 | private static void validarCPF(String digits) throws ValidacaoException {
try {
boolean isvalid = false;
if (Long.parseLong(digits) % 10 == 0) {
isvalid = somaPonderadaCPF(digits) % 11 < 2;
} else {
isvalid = somaPonderadaCPF(digits) % 11 == 0... |
2e737309-c88a-4724-ab64-244caa3d4fe1 | 8 | private synchronized void readPasswd(final InputStream in) throws IOException {
final BufferedReader din = new BufferedReader(new InputStreamReader(in));
String line;
entries = new HashMap();
while ((line = din.readLine()) != null) {
final String[] fields = new String[7];
final... |
6fa4869a-983a-41c8-a791-96a1641ff592 | 4 | public void RemoveTlv(int tag){
int newlen=0;
if (this.OtherTlvArray != null) {
Tlv[] tmp = new Tlv[OtherTlvArray.length];
for(int i=0;i<OtherTlvArray.length;i++){
if (OtherTlvArray[i].Tag != tag){
tmp[newlen]=OtherTlvArray[i];
newlen++;
}
}
//System.out.println("newlen:"+newlen);
... |
c05457e6-00a5-4170-a94b-680c70618363 | 4 | public static void main(String[] args) {
Connection con = null;//null is used to initialize;
Statement stmn = null;
ResultSet rs = null;
try {
Class.forName("com.mysql.jdbc.Driver");
con = DriverManager.getConnection("jdbc:mysql://localhost/gufran?" + "user=root&password=Mysql786");
... |
c8a3125b-3a4d-4919-942a-76e286f86e42 | 1 | protected void processRequest(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
try {
response.setContentType("text/html;charset=UTF-8");
request.setCharacterEncoding("UTF-8");
ICommand command = RequestHelper.getInst... |
ca92bf69-b6b9-4f2c-ba34-530a56da5c4f | 0 | public List<ParkBoy> getParkBoyList() {
return parkBoyList;
} |
a245ba61-2cbb-4ebb-974b-3be508646108 | 9 | @Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Tuple2 other = (Tuple2) obj;
if (_1 == null) {
if (other._1 != null)
return false;
} else if (!_1.equals(other._1))
return false;
i... |
5eb99554-b232-4b75-8cd9-b78466a95a45 | 9 | @Override
public void run()
{
while(true)
{
Messages.parseForMessages();
DateTime dt = new DateTime();
System.out.println(dt.getHourOfDay()+":"+dt.getMinuteOfHour());
if(counteratlastsecond==-1)
try {
System.out.... |
6fe6984f-ee08-4eca-981d-1a9cc4d77407 | 0 | public void setIdUsuario(Integer idUsuario) {
this.idUsuario = idUsuario;
} |
b8930ae0-75d2-462e-ac76-56fc7bb0aa90 | 6 | public void UpdateAtividade(Atividade atividade) throws SQLException {
Connection conexao = null;
PreparedStatement comando = null;
try {
conexao = BancoDadosUtil.getConnection();
comando = conexao.prepareStatement(SQL_UPDATE_ATIVIDADE);
comando.setString(1... |
7d993a7b-524a-4ba7-9fa8-79ecbc00f9c6 | 4 | public void close()
{
if( blockvec != null )
{
blockvec.clear();
blockvec = null;
}
if( (nextblock != null) && (!nextblock.equals( this )) )
{
nextblock = null;
}
mystore = null;
if( data != null )
{
data.clear();
data = null;
}
} |
b842fae6-fba9-4e8b-8327-f9843ee34364 | 5 | public void delete() {
if (getInstalledDirectory() != null && getInstalledDirectory().exists()) {
try {
FileUtils.deleteDirectory(getInstalledDirectory());
} catch (IOException ex) {
Utils.getLogger().log(Level.SEVERE, ex.getMessage(), ex);
}
... |
453497c0-b43c-4a1e-ac8a-3d4809f6059a | 5 | @Override
public void process(JCas aJCas) throws AnalysisEngineProcessException {
PosTagNamedEntityRecognizer recognizer = null;
try {
recognizer = new PosTagNamedEntityRecognizer();
} catch (ResourceInitializationException e) {
e.printStackTrace();
}
String sentenceText = aJCas.g... |
bfdd9495-2835-4e6d-b1c9-c957ee02da7a | 0 | public void setCtrlCR(CtrlComptesRendus ctrlCR) {
this.ctrlCR = ctrlCR;
} |
5cb1e0e5-e963-4c89-9209-92400588b1a7 | 3 | public PanelFalsaPosicion(){
c1Field = new JTextField(5);
c2Field = new JTextField(5);
expField= new JTextField(5);
c3Field = new JTextField(5);
xaField = new JTextField(5);
xbField = new JTextField(5);
errorField = new JTextField(5);
c1Label = new JLabel("Coeficiente del termino cuadratico");
... |
1372c7a1-8b10-4bea-919d-b7a4f4a2dba2 | 1 | @Test
public void equals_test() {
try{
double []vec1= {1.0,2.0,3.0};
double []vec2= {1.0,2.0,3.0};
boolean result= Vector.equals(vec1, vec2);
Assert.assertTrue(result);
}
catch (Exception e) {
// TODO Auto-generated catch block
fail("Not yet implemented");
}
} |
bdde6816-95b4-4d7f-8ce6-405085fddbe4 | 1 | public void openDevice(int index) { // Opens the device takes in index you
// want to use
deviceIndex = index; // Sets the index to the parameter
try { // beginning of a try catch block
sender = JpcapSender.openDevice(devices[deviceIndex]); // Opens the
// selected
//... |
cf2f8ce9-bfaa-4c67-96b1-e414f78da033 | 4 | public boolean shouldOutputCoords() {
if (this.elementType == ElementType.BLOCK
|| this.elementType == ElementType.IMAGEBLOCK
|| this.elementType == ElementType.TEXTBLOCK
|| this.elementType == ElementType.TEXTLINE) {
return true;
} else {
return false;
}
} |
522b2df2-2f66-44b2-869a-6a2ef9cae55e | 0 | public void setjTextFieldAdresse(JTextField jTextFieldAdresse) {
this.jTextFieldAdresse = jTextFieldAdresse;
} |
028a7d0b-74f0-42af-88c6-1b8bc4e4c8fa | 4 | private void displayUsersTasks(){
//find tasks for user logged in
try {
Project tempProject = null;
ResultSet dbUsersTasks = null;
Statement statement;
statement = connection.createStatement();
dbUsersTasks = statement.executeQuery... |
2bc57ae7-9988-451a-a25c-ecd20150d0cd | 9 | @Override
protected void setUp() throws Exception {
buffy = allocateAlignedByteBuffer(2 * PAGE_SIZE, PAGE_SIZE);
buffy.position(PAGE_SIZE + offset);
buffy.limit(buffy.position() + 32);
buffy = buffy.slice().order(ByteOrder.nativeOrder());
String host = "localhost";
int port = 12345;
final ServerSocketCha... |
58015af1-a10c-4844-b00a-df6d5dfde874 | 8 | private void isolateSubgraph(Subgraph subgraph, Node member) {
Edge edge = null;
for (int i = 0; i < member.incoming.size(); i++) {
edge = member.incoming.getEdge(i);
if (!subgraph.isNested(edge.source) && !edge.flag)
removeEdge(edge);
}
for (int i = 0; i < member.outgoing.size(); i++) {
edge = mem... |
89f3bdd2-95ad-49a7-a58d-b6609b420caa | 7 | public void testMultipleNotifyingFutures() throws Exception {
MethodCall sleep=new MethodCall("sleep", new Object[]{100L}, new Class[]{long.class});
List<CompletableFuture<RspList<Long>>> listeners=new ArrayList<>();
RequestOptions options=new RequestOptions(ResponseMode.GET_ALL, 30000L);
... |
c69b6095-6561-42d6-aef3-8573894b6fc2 | 5 | private String getComponentNameFromInfo(InfoPacket info){
Iterator<Pair<?>> pairIt = info.namedValues.iterator();
Pair<?> pair = null;
String name = null;
while(pairIt.hasNext() && name==null){
pair = pairIt.next();
if(pair.getLabel() == Label.cNme){
name = (String) pair.second();
}
}
return na... |
598bcf26-77fd-4042-a23d-fa8f4e855c9f | 4 | @Override
public boolean containsBooleanArray(String name) {
JOSObject<? , ?> raw = this.getObject(name);
if(raw == null) return false;
if(raw.getName().equalsIgnoreCase(BOOLEAN_ARRAY_NAME)) return true;
return false;
} |
9d58d69c-293b-4052-b21f-3880ee1e2011 | 9 | private void listen() throws IOException, InterruptedException {
reply(200);
String line = null;
while ((line = reader.readLine()) != null) {
StringTokenizer st = new StringTokenizer(line);
String command = st.nextToken().toLowerCase();
int code = 0;
if (command.equals("register-peer")) {
code =... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.