method_id stringlengths 36 36 | cyclomatic_complexity int32 0 9 | method_text stringlengths 14 410k |
|---|---|---|
3a1d8cfc-8400-48ed-9e2d-57aea551c1c3 | 1 | public int lastSelectedIndex() {
int index = mSelection.length() - 1;
return index < mSize ? index : -1;
} |
55317292-03bc-448e-ab51-e154a5b47bdf | 5 | public static ParentInfo getParentInfo(Map<String, Set<String>> graph) {
Set<String> allParents = new HashSet<String>();
for (Set<String> parents : graph.values()) {
allParents.addAll(parents);
}
Set<String> unseenParents = new HashSet<String>();
unseenParents.addAll... |
390dc25c-862a-4849-9865-617773efdcf6 | 4 | private Document httpGetXmlContent(String queryString) {
try {
URIBuilder builder = new URIBuilder();
builder.setScheme("http");
builder.setHost(this.endpointUri);
builder.setPath("/sparql");
builder.setParameter("query", queryString);
buil... |
ed96f922-8de6-461d-98fb-e30556329f08 | 8 | @Override
public void run()//GameLoop
{
while (marioWorld.getWhatcha() != Doing.EXIT)
{
if ((System.currentTimeMillis() - gameTimer) > GAMESPEED)
{
gameTimer = System.currentTimeMillis();
marioWorld.doLoopAction();
switch (m... |
36465abb-098b-4bc0-8191-12b6c6399ff6 | 2 | public LocalInfo findSlot(int slot) {
for (int i = 0; i < count; i++)
if (locals[i].getSlot() == slot)
return locals[i];
return null;
} |
6af337cf-116c-4610-b4d9-a677b2ad0615 | 1 | public synchronized void addReceivedPacketHistoryToOutgoingPacket(Packet packet) {
if(packet != null) {
packet.setLastReceivedSequenceNumber(lastReceivedPacketSequenceNumber);
packet.setReceivedPacketHistory(receivedPacketHistoryInt);
}
} |
0b6c1cfb-4f53-493f-969d-651143290427 | 7 | private void btn_submitActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btn_submitActionPerformed
if ((cbx_backTrouble.getSelectedIndex() == 0) || (cbx_heartTrouble.getSelectedIndex() == 0) || txt_heightInput.getText().isEmpty()) { // if no options were chosen
txt_output.setText("Please an... |
b0b16384-db2a-485c-8483-79eef5c12b09 | 4 | @Override
public void run() {
try {
while(!Thread.interrupted()) {
synchronized(this) {
while(restaurant.meal != null) {
wait(); // ... for the meal to be taken
}
}
if(++count == 10) {... |
b67878f6-d123-4d81-848d-188eb6aef529 | 8 | public int ramainQuantity(String cou_name){
Connection conn = null;
PreparedStatement pstmt = null;
ResultSet rs = null;
String sql = "";
int result = 0;
try{
conn = getConnection();
sql = "select cou_name,count(*) as quantity from coupon where cou_name=? ans cou_usage=1";
pstmt = conn.prepareState... |
f5693ed8-68dc-45ee-b000-2bb0da82b52f | 5 | public void minHeapify_top_down(int index) {
int small;
if (index * 2 + 1 >= heap.size())
return;
else if (2 * index + 2 == heap.size()) {
if (heap.get(2 * index + 1).compareTo(heap.get(index)) < 0) {
Type temp = heap.get(2 * index + 1);
heap.set(2 * index + 1, heap.get(index));
heap.set(index, ... |
f8129145-1aea-46d8-85b6-3f7127eee49f | 3 | static Constructor getDeclaredConstructor(final Class clazz,
final Class[] types)
throws NoSuchMethodException
{
if (System.getSecurityManager() == null)
return clazz.getDeclaredConstructor(types);
else {
try {
... |
257415eb-4580-4a41-ac3c-9af0fdadf480 | 9 | public void start() {
try {
Display.setFullscreen(true);
Display.create();
} catch (LWJGLException e) {
e.printStackTrace();
System.exit(0);
}
GL11.glDisable(GL11.GL_DEPTH_TEST);
GL11.glMatrixMode(GL11.GL_PROJECTION);
GL11.glLoadIdentity();
GL11.glOrtho(0, Display.getWidth(), 0, Display.get... |
5a868ad6-86a6-4ad9-b876-9508bc77a322 | 6 | public double getMeleeDefence(Client o) {
double level = c.playerLevel[1];
double levelMultiplier = 1.00;
if (c.prayerActive[2])
levelMultiplier *= 1.05;
else if (c.prayerActive[7])
levelMultiplier *= 1.1;
else if (c.prayerActive[15])
levelMultiplier... |
50d5a98c-d120-4797-9d74-d56f26edcb0b | 9 | private void writePostData(OutputStream out, PostData postData)
throws IOException
{
InputStream in = postData.getInputStream();
int contentLength = -1;
if (mHeaders != null) {
Integer i = mHeaders.getInteger("Content-Length");
if (i != null) {
... |
6220ede5-859f-4cd1-a9fd-1ac84b486353 | 7 | void processMouseMoved(MouseEvent e) {
if (!hasFocus())
return;
int x = e.getX();
int y = e.getY();
getModel().runMouseScript(MouseEvent.MOUSE_MOVED, x, y);
if (energizerOn) {
if (energizer != null) {
if (x >= energizer.x) {
energizer.mouseEntered(x, y);
} else {
energizer.mouseExited(... |
05d17142-6756-4612-8fbd-d51e5149ed9d | 3 | public int isGemCollision(int x, int y, ArrayList gems)
{
Gem tempGem;
int number;
for (int i = 0; i < gems.size(); i++)
{
tempGem = (Gem) gems.get(i);
if(tempGem.x == x && tempGem.y == y)
{
number = i;
... |
a76c3bdb-5de0-4315-8ed2-5c139602744b | 9 | public void Check() {
if( ((this.x >= p.x-p.w && this.x < p.x+p.w) && (this.y >= p.y-p.l && this.y < p.y+p.l)) ){
Game.stuff.update();
p.kill();
}
for(Enemy A: Game.Enemies){
if( ((this.x >= A.x-A.w && this.x < A.x+A.w) && (this.y >= A.y-A.l && this.y < A.y+A.l)) ){
this.xSpeed = -this.xSpeed;
th... |
d95148b1-0902-44c8-8a81-6c887d72a179 | 6 | public void upgrade(T snap) {
Transaction me = Thread.getTransaction();
Locator oldLocator = this.start.get();
T version = (T) oldLocator.fastPath(me);
if (version != null) {
if (version != snap) {
throw new SnapshotException();
} else {
return;
}
}
ContentionM... |
95199b46-609c-44df-997a-4652f4b1535d | 4 | void addWithArgument( AbstractOptionSpec<?> spec, String argument ) {
detectedSpecs.add( spec );
for ( String each : spec.options() )
detectedOptions.put( each, spec );
List<String> optionArguments = optionsToArguments.get( spec );
if ( optionArguments == null ) {
... |
dd867c42-6660-4979-811a-de8ef6c2fe0a | 5 | @Override
@Command
public MessageResponse upload(String filename) throws IOException
{
File f = new File(directory, filename);
if(f.exists())
{
BufferedReader br = new BufferedReader(new FileReader(f));
try
{
StringBuilder sb = new StringBuilder();
String line = br.readLine();
while (line... |
0b301049-ef93-423e-8530-51d6168a7987 | 0 | protected int getBreedingAge()
{
return breeding_age;
} |
f3d6ec2e-4335-4d55-af12-2f6579b66b01 | 9 | public NullInfoRegistry add(NullInfoRegistry other) {
if ((other.tagBits & NULL_FLAG_MASK) == 0) {
return this;
}
this.tagBits |= NULL_FLAG_MASK;
this.nullBit1 |= other.nullBit1;
this.nullBit2 |= other.nullBit2;
this.nullBit3 |= other.nullBit3;
this.nullBit4 |= other.nullBit4;
if (other.extra != null) {
if ... |
4d2fedf6-6551-40fe-8be2-53905a709c4f | 6 | private void serverConnectionAction(ActiveUser activeUser, String msg) {
if(activeUser.getUsername()==null) {
try {
activeUser.setUsername(Xmlhandle.extractUsername(msg));
} catch (DocumentException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
try {
xmlHandle.perform... |
938d491e-93d2-4096-af79-3dffeabb447c | 0 | public void setCoefiente(int coefiente) {
this.coefiente = coefiente;
} |
e1126b56-1a35-4852-a187-176ee70a9499 | 5 | int[] kmpTable(String needle) {
if (needle.length() == 0)
return null;
if (needle.length() == 1) {
int[] T = new int[1];
T[0] = -1;
return T;
}
int[] T = new int[needle.length()];
int pos = 2; // the current position we are computing in T
int cnd = 0; // current candidate substring
T[0] = -1... |
99a416f9-4c56-4416-8764-d31f61270971 | 6 | @PUT
@Path("/{isbn}")
@Timed(name = "update-book")
public Response updateBook(@PathParam("isbn") long isbn, @QueryParam("status") String status) throws Exception {
try{
if(!status.equalsIgnoreCase("avialable") &&
!status.equalsIgnoreCase("lost") &&
!status.equalsIgnoreCase("checked-out") &&
... |
76c3e332-c157-4de9-9ae7-df1cdc80286c | 3 | public static String[] jobSearch(String inJob) {
String[] userInfo = new String[5];
Connection c = null;
Statement stmt = null;
try {
Class.forName("org.sqlite.JDBC");
c = DriverManager.getConnection("jdbc:sqlite:Restuarant.db");
c.setAutoCommit(false);
System.out.println("Opened database successful... |
9d23391b-3701-4624-a791-98cd7ce12be2 | 8 | public Object set(Context cx, Object value)
{
switch (type) {
case SPECIAL_NONE:
return ScriptRuntime.setObjectProp(target, name, value, cx);
case SPECIAL_PROTO:
case SPECIAL_PARENT:
{
Scriptable obj = ScriptRuntime.toObjectOrNull(cx, val... |
30935626-2fb9-4bbd-b5fd-ad6e10f301d5 | 1 | @Override
protected CycNaut toCycTerm(final Money obj) throws ParseException {
ensureCurrencyMapInitialized();
final CycFort functor = lookupCycCurrencyTerm(obj.getCurrency());
if (functor == null) {
throwParseException("Cannot find Cyc UnitOfMoney for currency code " + obj.getCurrency().getCurrency... |
14aa65d7-226d-4541-ab06-c6f2c6ed129a | 1 | protected void doGet(HttpServletRequest request,
HttpServletResponse response) throws ServletException, IOException {
try {
Library library = new Library();
request.setAttribute("bookResults",
library.getBooks("", "Title", "Title", 0));
} catch (SQLException e) {
e.printStackTrace();
}
request.... |
df846c9e-1dc4-482d-a793-760319fb6368 | 2 | public static void setHost(String host) {
if (host.length() > 0 && !host.substring(host.length() - 1).equals("/")) {
host += "/";
}
getInstance().host = host;
} |
b23fba12-b0f1-47cc-839e-df5bbfacb515 | 7 | public boolean equals(Object y) {
if (y == this) return true;
if (y == null) return false;
if (y.getClass() != this.getClass()) return false;
SET<Key> that = (SET<Key>) y;
if (this.size() != that.size()) return false;
try {
for (Key k : this)
i... |
ead8d0a8-213f-46e8-8e13-6cc94b9b61cd | 2 | public void pushPreferences() {
try {
if (rpcURL == null) {
preferences.put("rpcurl", "");
} else {
preferences.put("rpcurl", rpcURL.toString());
}
preferences.putLong("updateinterval", updateInterval);
preferences.put("... |
ac86894d-c1bc-47b3-accf-297e8d11a5f3 | 4 | @Override
public boolean execute(AdrundaalGods plugin, CommandSender sender, String... args) {
// Grab the argument, if any.
String arg1 = (args.length > 1 ? args[0] : "");
if(arg1.isEmpty()) {
plugin.saveConfigs();
plugin.saveDataFiles();
Messenger.sendMessage(sender, ChatColor.GRAY+"All fil... |
d9005a71-6cea-4f70-91cf-580a8a7daf69 | 3 | public String dibujarMuneco(){
String m = "";
if(nivel.equals("Basico")){
m = munecoBasico();
}
if(nivel.equals("Intermedio")){
m = munecoIntermedio();
}
if(nivel.equalsIgnoreCase("Avanzado")){
m = munecoAvanzado();
}
return m;
} |
fcb33d88-a00c-4b9b-b49b-fea1e36839b0 | 3 | private int medianOf3(int[] array, int left, int right){
int center = (left+right)/2;
if( array[left] > array[center] )
swap(array,left, center);
if( array[left] > array[right] )
swap(array,left, right);
if( array[center] > array[right] )
swap(array, center, right);
swap(arr... |
445cc619-5450-4970-b201-a926dd7aceef | 0 | public int getNumEntries() {
return numEntries;
} |
e62e0791-c13c-4cd4-859c-13a1119782d8 | 7 | private void arrayList(JsonArray array) {
if(currTok.getType() == STR || currTok.getType() == NUM || currTok.getType() == LBRACE ||
currTok.getType() == LBRACKET || currTok.getType() == BOOL || currTok.getType() == NULL) {
array.addValue(value());
arrayListTail(array);
... |
1f9c3c06-841e-4537-b0ab-ceb72d7d9594 | 7 | @Override
public boolean equals(Object o){
if(o instanceof Pair){
Pair<?, ?> p = (Pair<?, ?>) o;
if(getValueOne().equals(p.getValueOne()) && getValueTwo().equals(p.getValueTwo())){
return true;
}
}
return false;
} |
618b31d6-75db-443d-ab9d-61d69e46e6c7 | 3 | public void attemptClose(Dockable dockable) {
if (dockable instanceof CloseHandler) {
if (mDockables.contains(dockable)) {
CloseHandler closeable = (CloseHandler) dockable;
if (closeable.mayAttemptClose()) {
closeable.attemptClose();
}
}
}
} |
359129c7-c3b7-4a7f-b97c-0df1b337003d | 6 | private void copyRGBtoBGRA(ByteBuffer buffer, byte[] curLine) {
if(transPixel != null) {
byte tr = transPixel[1];
byte tg = transPixel[3];
byte tb = transPixel[5];
for(int i=1,n=curLine.length ; i<n ; i+=3) {
byte r = curLine[i];
by... |
80c4dc98-d3d0-4ed4-9ff5-28ed7cc8c156 | 5 | double getKth(int[] a, int[] b, int k) {
int m = a.length;
int n = b.length;
if (n == 0)
return a[k - 1];
if (m == 0)
return b[k - 1];
if (k == 1)
return Math.min(a[0], b[0]);
// divide k into two parts
int p1 = Math.min(k / 2, m);
int p2 = Math.min(k - p1, n);
if (a[p1 - 1] < b[p2 - 1])
... |
10e2dc88-9456-475c-b15d-3e81b617bf01 | 0 | public static CarJsonConverter getInstance() {
return instance;
} |
bcca8b96-cc64-496c-90e3-accc29d44e2b | 7 | public static void main(String[] args) throws Exception
{
for( int x=1; x < NewRDPParserFileLine.TAXA_ARRAY.length; x++)
{
System.out.println(NewRDPParserFileLine.TAXA_ARRAY[x]);
File inFile = new File(ConfigReader.getTopeSep2015Dir() + File.separator +
"spreadsheets" + File.separator +
NewRDP... |
d31635cd-d2c3-424f-8e14-d27f4c372cbe | 6 | public void notifyPatternTableToBeModified(int pageNum, int index) {
if (editorRegion != null) {
byte b[] = editorRegion.getTileMask();
int byteOffset = index * 16;
System.arraycopy(b, 0, modelRef.getCHRModel().patternTable[pageNum], byteOffset, 16);
}
if (su... |
a725ce91-7261-453b-8e0f-3c7fbb6d5b92 | 3 | public static boolean isServerUp() {
Map<String, String> connParams = getServerConnectionParams(serverId);
try {
System.setProperty("java.rmi.server.hostname",
connParams.get("serverIP"));
Registry registry = LocateRegistry.getRegistry(
connParams.get("serverIP"), serverPort);
server = (ServerInt... |
51d6a6c8-654b-4572-ba62-0c56d255e01d | 3 | public void visitTableSwitchInsn(final int min, final int max,
final Label dflt, final Label[] labels) {
buf.setLength(0);
for (int i = 0; i < labels.length; ++i) {
declareLabel(labels[i]);
}
declareLabel(dflt);
buf.append("mv.visitTableSwitchInsn(").append(min).append(", ")
.append(max).append(", ... |
4f802e0a-6c13-4b55-b617-2934cb2b2011 | 8 | void getValue() {
String methodName = "get" + nameCombo.getText();
getText.setText("");
Widget[] widgets = getExampleWidgets();
for (int i = 0; i < widgets.length; i++) {
try {
java.lang.reflect.Method method = widgets[i].getClass().getMethod(methodName, (Class<?>)null);
Object result = method.invoke... |
1c054822-9461-4596-991d-9595cd3dbec5 | 3 | @Override
public List<Categoria> listAll() {
Connection conn = null;
PreparedStatement pstm = null;
ResultSet rs = null;
List<Categoria> categorias = new ArrayList<>();
try{
conn = ConnectionFactory.getConnection();
pstm = conn.prepareStatement(LIST);
... |
fda9321f-e1b2-4e2b-87a4-c84d59fc3095 | 8 | public boolean Shift(int amt)
{
int i;
if(amt < 0)
{
/* right-shift: discarding digits */
/* get positive magnitude */
amt *= -1;
if(amt >= this.size)
{
/* discarding all digits -- set to zero */
this.SetToNative(0);
}
else
{
/* copy digits down, and update size ... |
76ddb58e-2c6d-4bcc-8785-7f3e3d85e22f | 0 | public String toString() {
String affiche = "message intelligence";
return affiche;
} |
676b885c-2a41-4f3c-b492-554587146d6b | 4 | public static void main(String args[]){
/*for(int x=0;x<16;x++){
for(int y=0;y<4; y++){
System.out.printf("%b\t", lookUp[x][y]);
}
System.out.printf("\n");
}
}*/
for( int x = 0; x < 256; x++){
String bin = Integer.toBinaryString(x);
if(bin.leng... |
9d97ff84-c9bb-4c94-ba3c-0c8360cae961 | 9 | public void loadHeatSources() {
try {
plugin.heatSources.clear();
try {
for (String tempSource : GlobalConf.getConfigurationSection("HeatSources").getKeys(false)) {
if (Material.getMaterial(tempSource) != null) {
if (!GlobalConf... |
6d8b1ddf-5ba5-4b92-949e-d1fc182013f1 | 2 | public static Dao getInstance() {
if (Dao.instance == null) {
if (useJpa) Dao.instance = new JpaDao();
else Dao.instance = new ListDao();
}
return Dao.instance;
} |
44189a4f-ae8c-459c-99ee-734d67db17a6 | 8 | public void run() {
try {
boolean eos = false;
while (!eos) {
OggPage op = OggPage.create(source);
synchronized (drainLock) {
pageCache.add(op);
}
if (!op.isBos()) {
... |
c5cbb5b5-c5f4-419c-8c0d-46efa86a2de2 | 6 | public int[] getClosestClusters(){
int []arr = new int[2];
arr[0]=0;
arr[1]=0;
double largestSimilarity = -100;
for (int i = 0; i < numberOfDocuments; i++) {
for (int j = 0; j < numberOfDocuments; j++) {
if( i>=j || !clustersExists.get(i) || !clustersExists.get(j) ) continue;
if(similairtyMatrix[i]... |
932f2b24-0198-41e0-b998-b79bb8abf8f2 | 2 | public void startGame() {
// Start the game.
mode = ZombieMode.PLAYING;
maxLevel = level.houseList.size() - 1;
levelNum = 0;
score = 0;
initialScore = 0;
zombieLevel = new ZombieLevel(level.houseList.get(levelNum));
house = zombieLevel.getHouse();
... |
09d52835-655e-4083-82d7-fe8cb49fc802 | 6 | public static String slowEncrypt(String msg, String password) {
// KeyGenerator keyGenerator = null;
// try {
// keyGenerator = KeyGenerator.getInstance("DESede");
// } catch (Throwable e1) {
// e1.printStackTrace();
// }
// if (keyGenerator == null)
// return "";
// keyGenerator.init(168);
SecretKey secr... |
5d6f3fa3-b417-4706-b6c9-102426742a06 | 8 | private void sliderock(Map m, int i, int j) {
if( m.map[i+1][j+1]==Pos.EMPTY || prev!=null && (m.map[i+1][j+1]==Pos.ROCK && prev.map[i+1][j+1]==Pos.EMPTY)){
m.map[i+1][j+1]=Pos.ROCK;
m.map[i][j]=Pos.EMPTY;
}
else if( m.map[i+1][j-1]==Pos.EMPTY || prev!=null && (m.map[i+1][j-1]==Pos.ROCK && prev.map[i+1]... |
2d2fa4c2-39af-4afd-ad77-28ddb810a105 | 8 | public void move(int dGameX, int dGameY) {
if (getState() == State.MOVING)
return;
if (!canMove(dGameX, dGameY))
return;
if (dGameX == 0 && dGameY == 0)
return;
setNScreenX(getScreenX());
setNScreenY(getScreenY());
if (dGameX != 0) {
setNScreenX(getScreenX() +
dGameX * ... |
f5b7a6e9-334e-4eeb-980e-0ab7fc4ac3da | 0 | public String getFname() {
return fname;
} |
bd4f864c-df22-4534-8e00-d35a4c7591c1 | 9 | public Props getStats(StatType tp) {
if (tp == null) {
tp = StatType.FULL;
}
Props p = new Props();
int nsp = sps.length();
if (tp == StatType.FULL || tp == StatType.PAIRTABLE) {
p.put("date", (new Date()).toString());
String desc = String.for... |
f4bade96-2ae9-4298-9183-b6466ea58d11 | 0 | @XmlElementDecl(namespace = "http://www.w3.org/2000/09/xmldsig#", name = "DigestMethod")
public JAXBElement<DigestMethodType> createDigestMethod(DigestMethodType value) {
return new JAXBElement<DigestMethodType>(_DigestMethod_QNAME, DigestMethodType.class, null, value);
} |
8faa46f6-0f7e-42a9-9765-6c19b39fc14f | 7 | static final void method3254(int i, int i_2_, int i_3_,
Class318_Sub1_Sub4 class318_sub1_sub4,
Class318_Sub1_Sub4 class318_sub1_sub4_4_) {
Class357 class357 = Class348_Sub46.method3321(i, i_2_, i_3_);
if (class357 != null) {
((Class357) class357).aClass318_Sub1_Sub4_4406
= class318_sub1_sub4;
((... |
231176af-b35d-49df-8310-f5e9982c07c1 | 2 | @Override
public List<Tour> load(Criteria criteria, GenericLoadQuery loadGeneric, Connection conn) throws DaoQueryException {
int pageSize = 10;
List params = new ArrayList<>();
StringBuilder sb = new StringBuilder();
StringBuilder sbw = new StringBuilder();
Boolean f1 = fo... |
57941d94-2d62-48d8-83d6-411965ac70e3 | 9 | private <T, E extends LangElem> void addAnnotatedClass(Class<T> clazz) throws MappingException {
AnyMapping<T, ?> mapping;
if (clazz.isAnnotationPresent(DefAtom.class)) {
mapping = createAtomMapping(clazz);
} else if (clazz.isAnnotationPresent(DefTerm.class)) {
... |
a223f274-80da-409b-9856-c9c720c001f6 | 8 | @Override
public Vector solveLinearEquationsSystem(Matrix equationMatrix, Vector results) {
isValid(equationMatrix);
if (equationMatrix.getRows() != equationMatrix.getColumns()) {
throw new MathArithmeticException("Cannot solve linear equations system for nonsquare matrix.");
}... |
5ee204e3-75e9-4208-9cda-65cb280f9a0a | 3 | public EncryptableObject decrypt(Key key) throws Exception{
String Algrithem;
if(key instanceof PrivateKey){Algrithem = "RSA";}
else{Algrithem = "AES";}
if(encrypted == null) return null;
Cipher decrypt = Cipher.getInstance(Algrithem);
decrypt.init(Cipher.DECRYPT_MODE, key);
ByteArrayInputStream bais... |
c7068640-84bc-4729-a43b-ce1ef902355b | 9 | public SingleGuide(DependencyParserConfig configuration, GuideHistory history, GuideMode guideMode) throws MaltChainedException {
this.configuration = configuration;
this.guideMode = guideMode;
final FeatureEngine system = new FeatureEngine();
system.load("/appdata/features/ParserFeatureSystem.xml");
syste... |
bee89a2c-52d5-4a72-b17f-3432c042269c | 0 | @Override
public void execute() {
} |
474cdbaa-b83e-44b2-9cad-3bf306990b6a | 8 | public void run() {
checkTimestamp();
if (RealTimeOrdersSingleton.instance.getLoopStatus()) {
ServiceArgs loginArgs = new ServiceArgs();
loginArgs.setUsername(splunk_username);
loginArgs.setPassword(splunk_password);
loginArgs.setHost(splunk_hostname);
loginArgs.setPort(splunk_serviceport);
try {... |
e7d1a998-4b37-4e92-88e7-ae376140332e | 5 | public void aff_plateau(List<Coup> coups) {
String[][] tab = new String[plateau.getLigne()][plateau.getColonne()];
String newLine = System.getProperty("line.separator");
for (int i = 0; i < plateau.getLigne() ; i++) {
for (int j = 0; j < plateau.getColonne() ; j++) {
tab[i][j] = "*";
}
}
... |
d9b68cbb-a5bb-407f-8186-290a4fce9d31 | 6 | final void method415(int i, int j, int k) {
if (k != 0) {
int l = anIntArray2815[k];
int k1 = anIntArray2807[k];
for (int j2 = 0; j2 < anInt2818; j2++) {
int i3 = yPositions[j2] * l + xPositions[j2] * k1 >> 16;
yPositions[j2] = yPositions[j2] *... |
e2401bff-7ba0-4966-a361-06d3a02e40e3 | 1 | public static void main(String[] args) throws IOException {
// AuctionService as = new AuctionService();
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
try(
Socket client = new Socket("localhost", 10000);
BufferedReader file = new BufferedReader(new InputStreamReader(client.getInput... |
5c0c4389-fd58-4400-8f7f-771d08ac95a9 | 8 | @Override
public List<Administrador> Buscar(Administrador obj) {
// Corpo da consulta
String consulta = "select f from Administrador f WHERE f.ativo = 1 AND f.id != 0 ";
// A parte where da consulta
String filtro = " ";
// Verifica campo por campo os valores que serão fil... |
6ff43dbf-d054-4b04-82f5-88b8abba39b2 | 2 | private void defineVariables() {
spawnWorld = Bukkit.getWorld(getConfig().getString("SBB World"));
for (String s : getConfig().getConfigurationSection("Arenas").getKeys(false)) {
try {
Integer.valueOf(s);
} catch (Exception e) {
continue;
}
String[] redSpawn = getConfig().getString("Arenas." + s... |
ecb6d069-abba-424f-913d-fba0189b2650 | 9 | public void SetDest(int antiPredict)
{
String type=this.instruction.type;
if(type.equals("LW")||
type.equals("ADD")||
type.equals("NAND")||
type.equals("ADDI")||
type.equals("MUL")||
type.equals("DIV")||
type.equals("JALR"))
this.dest=this.instruction.Rd;
if(type.equals("SW"))
... |
acc61a68-78a0-43d0-b04e-b5bbf299c330 | 7 | public static HLinkedList getSortedLinkedList(HLinkedList list){
/* If the list is null, return a null list. */
if (list.getHeadNode() == null) {
return new HLinkedList();
}
/* If the list root is the only node, return the same list. */
if (list.length() == 1){
return new HLink... |
f310e1d3-fa86-448d-9d44-4aa90595f316 | 8 | public void stratify(int numFolds) {
if (numFolds <= 0) {
throw new IllegalArgumentException("Number of folds must be greater than 1");
}
if (m_ClassIndex < 0) {
throw new UnassignedClassException("Class index is negative (not set)!");
}
if (classAttribute().isNominal()) {
//... |
567fdebd-f284-47cb-a0d9-625a4036aacf | 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 User)) {
return false;
}
User other = (User) object;
if ((this.userid == null && other.userid != null) || (this... |
3268bb93-44fb-45f7-b44f-655f8d553017 | 3 | private void put(final Item i) {
if (index + typeCount > threshold) {
int ll = items.length;
int nl = ll * 2 + 1;
Item[] newItems = new Item[nl];
for (int l = ll - 1; l >= 0; --l) {
Item j = items[l];
while (j != null) {
... |
9a57dbba-5cec-4aae-aae7-efc9e1af7ec6 | 2 | public static Couleur parseCouleur(char codeCouleur)
{
for (Couleur couleur : Couleur.values())
if (couleur.colorChar == codeCouleur)
return couleur;
return null;
} |
04a93bb2-cec5-4a62-bd0d-05da90715e1b | 8 | private void enableThisDrag() {
final Delta dragDelta = new Delta();
thisShape.getEllipse().setOnMousePressed(new EventHandler<MouseEvent>() {
@Override public void handle(MouseEvent mouseEvent) {
// record a delta distance for the drag and drop operation.
String curAction = MainContro... |
724952e6-f56d-4a14-8c67-e14dd9cb03c0 | 9 | public void run(int i) {
while(sim40.memory[i] != -1) {
switch(sim40.memory[i]) {
/* stop */
case 0: return;
/* print, printb, printch */
case 1: case 2: case 3:
this.stdStream.getOutput().add(result(i));
++i;
break;
default:
/* jump, comp, xcomp, ycomp, jineg, jipos, jizero, ji... |
1554ec6b-dc82-4afd-a7c0-680871dcaeec | 4 | public void init() throws IOException{
if(basicInfos == null){
try {
initBasicInfoFromInternet();
} catch (JsonSyntaxException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (ClientProtocolException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} ca... |
3ae066ea-b7fc-4439-b065-4b6b6e53a843 | 2 | private void handleMessage() {
AbstractTab tab = InputHandler.getActiveTab();
if (tab == null) {
InputHandler.showNotConnectedError();
return;
} else if (tab instanceof ServerTab) {
tab.appendError("Nelze odeslat zprávu. Toto není chatovací místnost!");
... |
d65db709-ace7-4e95-8205-33503fd625a7 | 5 | public Solution(Environment env) {
environment = env;
assignmentMap = new TreeMap<String, Assign>(environment.getFixedAssignments());
numLectures = environment.getLectureList().size();
TreeSet<Session> sessionList = environment.getSessionList();
for (Session session : sessionList) {
currentRoomCap... |
ed961ff3-2721-4e88-a54e-0eff97d9f0eb | 4 | @Override
public boolean containsShort(String name) {
JOSObject<? , ?> raw = this.getObject(name);
if(raw == null) return false;
if(raw.getName().equalsIgnoreCase(SHORT_NAME)) return true;
return false;
} |
7f5254b6-23c3-4944-b6f4-4f2cb07b8dd1 | 9 | @SuppressWarnings("unchecked")
public void updateLocalWords() {
RestWrapper restRep = new RestWrapper();
Map<String, Serializable> fileSnapshot = restRep.getFileSnapshot();
String requestPrefix = (String) fileSnapshot.get("request_prefix");
Map<String, String> newFileMap = (Map<String, String>) fileSnapshot
... |
3ea00f55-53fa-45d5-aff6-abaf7d4db364 | 8 | @Override
public boolean invoke(MOB mob, List<String> commands, Physical givenTarget, boolean auto, int asLevel)
{
if(!mob.isInCombat())
{
mob.tell(L("You must be in combat to do this!"));
return false;
}
if(mob.rangeToTarget()>0)
{
mob.tell(L("You can't do that from this range."));
return false... |
7f863502-0bfe-4b28-b5b9-41a42c09709f | 2 | private void dragColumnDivider(int x) {
int old = mDividerDrag.getWidth();
if (x <= mColumnStart + DIVIDER_HIT_SLOP * 2) {
x = mColumnStart + DIVIDER_HIT_SLOP * 2 + 1;
}
x -= mColumnStart;
if (old != x) {
adjustColumnWidth(mDividerDrag, x);
}
} |
bd133e9e-74e5-486f-9aa1-d7ea05e81af6 | 8 | public boolean equals( Object other ) {
if ( ! ( other instanceof TObjectShortMap ) ) {
return false;
}
TObjectShortMap that = ( TObjectShortMap ) other;
if ( that.size() != this.size() ) {
return false;
}
try {
TObjectShortIterator ite... |
42b8a93f-fe06-4edd-b54a-5fd5ab116115 | 6 | @Override
public String getDescription(Hero hero) {
int height = (int) SkillConfigManager.getUseSetting(hero, this, "Height", 3, false);
int width = (int) SkillConfigManager.getUseSetting(hero, this, "width", 2, false);
int maxDist = (int) SkillConfigManager.getUseSetting(hero, this, Setting.MAX... |
56b59438-c667-4cbb-bb6e-95645162a358 | 6 | public synchronized int hashCode() {
if (__hashCodeCalc) {
return 0;
}
__hashCodeCalc = true;
int _hashCode = super.hashCode();
if (getAirlineName() != null) {
_hashCode += getAirlineName().hashCode();
}
if (getEmployeeId() != null) {
... |
c14c99df-0345-4c61-a72b-d29b37114500 | 9 | private void jComboBox2actionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jComboBox2actionPerformed
// TODO add your handling code here:
if (this.jComboBox2.getSelectedIndex() == 0) {
return;
}
int ptr = this.jComboBox2.getSelectedIndex() - 1;
String str = "The select event --- ... |
16cae002-7da8-4578-bea4-e81f0d1ab4a6 | 8 | /* */ public void start() {
/* 74 */ if (this.applet != null) {
/* 75 */ this.applet.start();
/* 76 */ return;
/* */ }
/* 78 */ if (this.gameUpdaterStarted) return;
/* */
/* 80 */ Thread t = new Thread() {
/* */ public void run() {
/* 82 */ Launcher.thi... |
71ded6a7-b240-4fb3-af49-81dc8a66caac | 1 | public static Object trapWrite(Object[] args, String name) {
Metalevel base = (Metalevel)args[0];
if (base == null)
_classobject.trapFieldWrite(name, args[1]);
else
base._getMetaobject().trapFieldWrite(name, args[1]);
return null;
} |
2a2775ae-a160-4d26-ad2c-801e8e232a9a | 8 | public void combine(String IP_PORT, String apiKey){
DBService dbService = new DBService();
HashMap data = null;
FileService fileService = new FileService();
if(this.link.contains("haitao.smzdm")){
PageHaitao pageHaitao = new PageHaitao();
data = pageHaitao.getInfo... |
da42216e-bbc8-4478-a76c-c983839244f3 | 3 | private String getResponse(HttpURLConnection conn) {
String xml = "";
try {
BufferedReader reader = new BufferedReader(new InputStreamReader(conn.getInputStream()));
String next = null;
while ((next = reader.readLine()) != null)
xml += next.equals("") ? next : next + "\n";
} catch (IOExcept... |
993be944-8b00-4fcc-805b-f95c5ba1315b | 0 | public void setStatus(Status status) {
this.status = status;
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.