method_id stringlengths 36 36 | cyclomatic_complexity int32 0 9 | method_text stringlengths 14 410k |
|---|---|---|
b50fd33d-73a6-4f99-8f17-eb8ae0331204 | 0 | public int getFileRenamedMask() {
return JNotify.FILE_RENAMED;
} |
f7884cbb-9141-4d1b-b5a5-198601037f5e | 6 | public static void main(String[] args) throws InterruptedException {
final LinkedBlockingQueue<Integer> queue = new LinkedBlockingQueue<>();
List<Thread> consumers = new ArrayList<>();
List<Thread> producers = new ArrayList<>();
// start 20 consumers
for(int i =0; i< 20; i++) {... |
1e02b6cd-34b7-4ec4-ad51-8c424d297237 | 6 | @Override
public void actionPerformed(ActionEvent ae) {
String transportProtocol = "";
String resultado;
if (telaLeitora.getBtConectar().getText().equals("Conectar")) {
Enumeration<AbstractButton> elements = telaLeitora.getPcscProtocolTransportGroup().getElements();
... |
4b30b911-ceaa-43ba-8a12-ec2805c0f931 | 0 | public void setAccountName(String accountName) {
this.accountName = accountName;
} |
ae74e2bc-08ba-4f2e-9af2-3e06a912a0e3 | 8 | @EventHandler(priority = EventPriority.HIGHEST)
public void OnLogin(PlayerLoginEvent event) {
if (!prekick.config.GetBoolean("PreKick.Enabled") || event.getResult() != PlayerLoginEvent.Result.ALLOWED)
return;
int reason = prekick.whitelist.IsPlayerOnWhitelist(event.getPlayer().getName(), event.getAddress().get... |
b5085886-2f82-4f1e-b9ee-3237b46d44ee | 1 | public void delleteProduct(Product product) {
try {
beginTransaction();
session.delete(product);
session.getTransaction().commit();
} catch (Exception e) {
e.printStackTrace();
} finally {
closeSesion();
}
} |
fca9e3e3-c115-4ddf-ba0e-7fbde5146223 | 2 | int[] gjFromFixed(long date) {
int year = gjYearFromFixed(date);
long priorDays = date - fixedFromGJ(year, 1, 1);
long correction;
if (date < fixedFromGJ(year, 3, 1)) {
correction = 0;
} else if (isLeapYear(year)) {
correction = 1;
} else {
... |
93739bf2-7e20-468c-9d4c-5c548436bebc | 7 | private void validate() throws RrdException {
boolean ok = true;
if(x.length != y.length || x.length < 3) {
ok = false;
}
for(int i = 0; i < x.length - 1 && ok; i++) {
if(x[i] >= x[i + 1] || Double.isNaN(y[i])) {
ok = false;
}
}
if(!ok) {
throw new RrdException("Invalid plottable data suppli... |
8fbc063f-469d-4fce-b62e-ffb9627e98f2 | 9 | public void renderAbsolute(int xp, int yp, Sprite sprite) {
if (sprite == null) sprite = Sprite.rock;
for (int y = 0; y < sprite.HEIGHT; y++) {
int ya = y + yp;
int ys = y;
for (int x = 0; x < sprite.WIDTH; x++) {
int xa = x + xp;
int xs = x;
if (xa < -16 || xa >= width || ya < 0 || ya >= heigh... |
aaadf433-cfd3-4ddf-b1a9-83bac2deb376 | 2 | public boolean isAuthorised (String user, String target) {
int userRank = activeUsers.get(user).rank.getCode();
if (!checkActiveUser(target)) {
return false;
}
int targetRank = activeUsers.get(target).rank.getCode();
if (userRank > targetRank)
return tru... |
2202f6f0-c9e5-4c48-8189-b4dc293613d3 | 5 | void zoom() {
if( getTilesize()==50)
{
setTilesize(25);
// offx = 0;
// offy = 0;
}
else
{
setTilesize(50);
}
if(this.offy<0) offy=0;
if(this.offx<0) offx = 0;
if(... |
6154fb35-d9d4-4892-b02c-3badcd97314c | 5 | private String getTime() {
StringBuilder time = new StringBuilder("");
elapsedTime = System.currentTimeMillis() - startTime;
long elapsedSecs = elapsedTime / 1000;
long elapsedMins = elapsedSecs / 60;
long hours = elapsedMins / 60;
long mins = elapsedMins % 60;
lo... |
bd50c0f7-eb92-4563-9743-19b279fae67d | 1 | public void run(){
Polygon poly = new Polygon();
for(int i = 0; i < points.length; i++){
poly.add(new Point(points[i]));
}
poly.setColor(org.jzy3d.colors.Color.BLUE);
System.out.println("Polygon Size:" + poly.size());
System.out.println("Length of Points: " + points.length);
... |
d47fac29-17b6-454b-8b7e-057c1d84352a | 3 | @EventHandler (priority = EventPriority.HIGHEST)
public void onJoin(PlayerJoinEvent e) {
Player p = e.getPlayer();
// Only ops or those with proper permissions get update messages.
if (!p.hasPermission("hunger.update") && !p.isOp())
return;
if (!plugin.update)
return;
plugin.tell(p, "&e" + plugin... |
d09c99bc-e9e5-4d51-814e-8b51d97bec67 | 9 | public static void setActivity (Description description, Activity activity) {
if (description instanceof ActedOnBehalfOf) {
((ActedOnBehalfOf) description).setActivity (activity);
}
if (description instanceof WasAssociatedWith) {
((WasAssociatedWith) description).setRespo... |
4d20ae5e-dcf2-406b-8ea7-14afb435b03c | 3 | private void waitForThread() {
if ((this.thread != null) && this.thread.isAlive()) {
try {
this.thread.join();
} catch (final InterruptedException e) {
e.printStackTrace();
}
}
} |
f54ae157-ea11-4e29-9ba1-65f03c50cbc7 | 8 | @Test
public void testaaEttaTallennetaanTiedostoonPelaajanTiedotKunPeliLoppuu() {
try {
pelaaja = PelaajatIO.lataaPelaaja(pelaaja.getNimi());
} catch (IOException e) {
fail("Pelaajan lataus epäonnistui.");
} catch (ClassNotFoundException e) {
fail("Pelaaja... |
34949366-c0ce-4409-a013-c7d777c593a3 | 6 | final void method611(int i, int i_74_,
Class348_Sub42_Sub17 class348_sub42_sub17) {
anInt1126++;
if ((i ^ 0xffffffff) != 0) {
method622();
if (!NA())
method621();
else {
Class4 class4 = (((Class348_Sub42_Sub17) class348_sub42_sub17)
.aClass4Array9673[i]);
Class348_Sub33 class348_sub33
... |
2c93bc22-52d9-4a73-9c06-1322c2d9bd17 | 1 | public static void main(String[] args) {
Scanner s = new Scanner(new RandomWords(10));
while (s.hasNext())
System.out.println(s.next());
} |
83b8ed23-d116-4b6a-b724-336e6297a3a4 | 6 | public ObjectenOpslag(Group root, File file) {
this.children=root.getChildren();
try {
JAXBContext jc = JAXBContext.newInstance(World.class);
if(file == null){
w = (World) jc.createUnmarshaller().unmarshal(ObjectenOpslag.class.getResource("Wereld.xml"... |
0f18ae3f-dc7d-4002-9750-ccaa48b857d4 | 2 | public int biSearch(int[] numbers, int start, int end, int target) {
// while(start <= end){
// int mid = (start + end) >> 1;
// if(numbers[mid] == target){
// return mid;
// }else if(numbers[mid] > target){
// end = mid - 1;
// }else {
// start = mid + 1;
// }
// }
// return -1;
for (int i = st... |
18d2a6ac-3a73-4e1f-8822-710c9c1da070 | 0 | public long getElapsedTime()
{
return elapsedTime;
} |
b680f660-9b0e-485e-a255-bd3f1a13f296 | 8 | @Override
public boolean invoke(MOB mob, List<String> commands, Physical givenTarget, boolean auto, int asLevel)
{
final MOB target=this.getTarget(mob,commands,givenTarget);
if(target==null)
return false;
if(!super.invoke(mob,commands,givenTarget,auto,asLevel))
return false;
final boolean success=prof... |
cbf88fbf-e37e-416c-839d-82d795dfbe8d | 1 | public void banUser(String name, String reason) {
User user = getByName(name);
if (user.isBlank())
return;
banList.put(user.getUserID(), reason);
} |
c86af61f-3e9d-4650-b3f5-bc20690b23d2 | 4 | public void process(JCas aJCas) throws AnalysisEngineProcessException {
int MAX_N_BEST_CHUNKS = 5; // the number of most similar words
JCas jcas = aJCas;
String Str = jcas.getDocumentText();
String line = Str.substring(0, 14); // extrate the lineID
char cha[] = Str.toCharArray();
ConfidenceChunk... |
c3aae122-cd6c-4b4d-9569-481f14e8abb4 | 8 | public int read(char[] buffer,
int offset,
int size)
throws IOException
{
int charsRead = 0;
if (this.atEndOfData) {
return -1;
}
if ((offset + size) > buffer.length) {
size = buffer.length - offset;
}
while (c... |
c6ed839a-bcbe-4570-aef6-7ba6ff1110f6 | 7 | public Integer processCommand( int command ) {
Integer result = new Integer( ROGER );
int answer = 0;
String resignMessage = null;
System.out.println( "Entered processCommand." );
// If a draw offer is recieved, fire off an action event to inform the
// GUI.
... |
a40087fe-760d-4842-a5a8-2bfd72b15494 | 4 | @Override
public void visit(MethodDeclaration method, Object arg) {
KoanExecution koanExecution = (KoanExecution)arg;
if(method.getName().equals(koanExecution.getMethod().getName())){
List<Comment> comments = method.getAllContainedComments();
for(Comment... |
8269fad9-3cbb-4343-8323-fe31ab84a1f7 | 4 | public JSONObject toJSONObject(JSONArray names) throws JSONException {
if (names == null || names.length() == 0 || this.length() == 0) {
return null;
}
JSONObject jo = new JSONObject();
for (int i = 0; i < names.length(); i += 1) {
jo.put(names.getString(i), this.... |
a19cfd06-4262-4796-b982-8cbf43708bb7 | 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... |
73957828-faf8-4864-9193-2e25127429ea | 8 | public byte mixWt(String fileName) throws IOException {
FileInputStream is = null;
DataInputStream dis = null;
BufferedWriter br = new BufferedWriter(new FileWriter("mixWt_bin.txt"));
NumberFormat formatter = new DecimalFormat();
formatter = new DecimalFormat("0.000E00");
try {
is = new FileInputStre... |
4a73cde5-1dfa-4db9-8f15-10d6458e4f6f | 7 | protected Input() {
System.out.println("Starting input...");
// keyboard events
for (Field f : KeyEvent.class.getDeclaredFields()) {
try {
if (java.lang.reflect.Modifier.isStatic(f.getModifiers()) && (f.getType() == int.class || f.getType() == short.class) && f.getName().startsWith("V... |
7cc713b3-847a-46ce-b3a5-5dd8c387a303 | 1 | public void writeCDATA(String content) throws IOException {
if (bStartTagOpen) {
w.write(">" + newLine);
bStartTagOpen = false;
}
writeIndent();
w.write(content + newLine);
} |
a294918b-7c43-4016-9e44-ddf619ffe5a4 | 0 | public void setName(String name) {
this.name = name;
} |
f71735ed-c614-481d-9a83-fa742dcd555e | 2 | void setSize(int width, int height) {
if (this.width != width) {
this.width = width;
walls.remove(xAxisWall);
walls.add(xAxisWall = new Wall(1, 0, width, Display.HORIZONTAL));
}
if (this.height != height) {
this.height = height;
walls.remove(yAxisWall);
walls.add(yAxisWall = new Wall(0, 1, heig... |
82e4d3ee-92ce-47ef-9c24-e42c8aed34fb | 9 | private synchronized void initialize() throws TorqueException {
log.debug("initialize()");
if (isInit) {
log.debug("Multiple initializations of Torque attempted");
return;
}
if (conf == null || conf.isEmpty()) {
throw new TorqueException(
"Torque cannot be initialized without... |
220caba8-7636-42c1-82da-6cbadffe78ca | 2 | @Override
public void render() {
Iterator<IScreenItem> it = screenItems.descendingIterator();
while(it.hasNext()) {
IScreenItem item = it.next();
if(item.isVisible()) {
item.render();
}
}
} |
0ff1dbd3-cf44-4972-88e6-6129b2f1affa | 4 | public static void iceManipulation(Player player) {
int radius = 25;
List<Entity> entities = player.getNearbyEntities(radius, radius, radius);
for (Entity entity : entities) {
if (entity.getLocation().distanceSquared(player.getLocation()) > radius)
continue;
if (entity instanceof Player) {
((Playe... |
daf12e74-0595-4cfd-a718-c43408a31ff3 | 6 | @Override
public Query parse() {
if(!this.prepared) {
this.prepared = true;
StringBuilder sB = new StringBuilder();
sB.append("CREATE TABLE ");
sB.append(this.t.replace("#__", this.db.getPrefix()));
sB.append("\n");
sB.append(" (\n");
int i = 0;
for(Column f : this.fL) {
if(i ... |
ab6b32c4-d25f-41e9-8c02-6fd588e3bb0e | 1 | public HashMap<String, Disc> asHash() {
LOGGER.log(Level.INFO, "Generating hash representation for bag " + this.hashCode());
HashMap<String, Disc> hash = new HashMap<String, Disc>();
Iterator<Disc> i = discs.iterator();
while (i.hasNext()) {
Disc disc = i.next();
hash.... |
e0a067f3-99b4-4c34-93af-9c468bac45ea | 2 | public int removeFirst()
{
if(isEmpty())
throw new ArrayIndexOutOfBoundsException();
int temp = ListArray[0];
for(int i = 0; i < size; i++)
ListArray[i] = ListArray[i+1];
size--;
System.out.print("Removed Element: " + temp + "\n");
System.out.println(" ");
return temp;
} |
fb249b83-f7fd-4dda-ace5-42215ad3d660 | 0 | @Override
public void documentAdded(DocumentRepositoryEvent e) {} |
b4d78be7-2a85-4cd4-9811-596b4cb97098 | 9 | @Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (!(obj instanceof Edge))
return false;
Edge other = (Edge) obj;
if (u == null) {
if (other.u != null)
return false;
} else if (!u.equals(other.u))
return false;
if (v == null) ... |
b1030766-c32b-47cb-b8e4-9138b8eebc4f | 3 | private boolean isFillField() {
if(getLogin().isEmpty() || getPassword().isEmpty() || getConfirmPassword().isEmpty()) {
setMessage("Fill all field.");
return false;
} else {
return true;
}
} |
c2c0da72-3f62-4042-a459-ab8dc968a067 | 6 | @EventHandler
public void CreeperResistance(EntityDamageByEntityEvent event) {
Entity e = event.getEntity();
Entity damager = event.getDamager();
String world = e.getWorld().getName();
boolean dodged = false;
Random random = new Random();
double randomChance = plugin.getCreeperConfig().getDouble("Creeper.R... |
30f21fc7-6f26-485b-8daa-8f3b0f8eb81b | 1 | public ApiDemo() {
Log.makeLog();
Log.current.println("Initializing Cyc server connection, and caching frequently used terms.");
try {
cycAccess = new CycAccess();
}
catch (Exception e) {
Log.current.errorPrintln(e.getMessage());
Log.current.printStackTrace(e);
}
cycAccess.... |
bd9bd600-75b4-4c0e-b324-7d4e70285cd3 | 2 | public static void quit() {
// Store List of Open Documents and close documents
if (!saveOpenDocumentList()) {
return;
}
// Store current window position
Dimension size = Outliner.outliner.getSize();
Point location = Outliner.outliner.getLocation();
Preferences.getPreferenceInt(Preferences.MAI... |
7e5123c9-3a82-4ab6-8854-95c955720422 | 8 | public int getTotalLogins(String playerName) {
int totalLogins = 0;
if (helper.isNotEmpty(playerName)) {
try {
ResultSet rs = _sqLite.query("SELECT count(time_login) "
+ "AS total_logins "
+ "FROM player, login "
+ "WHERE player.playername = '" + playerName + "' "
... |
cd9ee826-b9f6-43ea-a292-2dc04c611fd6 | 6 | public void emb(byte[] byte2emb) throws IOException {
// 获得Y的colorid
Integer colorid = (Integer) mImg.getColorIDs().toArray()[0];
// 获得Y的color unit
JPEGDataUnits dataUnits = mImg.getDataUnits();
List<int[]> YUnits = dataUnits.getColorUnit(colorid);
// 打乱数据顺序
try ... |
11a2467b-3db9-4161-b0e2-a20e00423d79 | 8 | public void doGet(final HttpServletRequest servletRequest, final HttpServletResponse servletResponse)
throws ServletException, IOException {
final String commandName = servletRequest.getParameter("command");
System.out.println("COMMAND NAME " + commandName);
if (commandName != null && !commandName.isEmpty()... |
07267316-97d8-4bf7-b013-fb188f9a4b21 | 6 | private String getMime(String extension) {
String mime = "";
switch (extension) {
case ".pdf":
mime = "application/pdf";
break;
case ".png":
mime = "image/png";
case ".css":
... |
cd476343-11fa-4217-8b66-78c047e739c3 | 1 | @Override
public void request() {
if (mRealSubject == null) {
mRealSubject = new RealSubject();
}
mRealSubject.request();
} |
9a672ead-3ba4-4cc7-b331-4749020e7cf0 | 9 | public boolean doInputParenthesesMatch(ArrayList<Character> parenPairsArray, String stringWithParens) {
StringBuilder stringBuilderWithParens = new StringBuilder(stringWithParens);
Stack<Character> parensStack = new Stack<Character>();
// Look at each character in the string and individually h... |
40d52211-b19b-460e-b1e4-5c28c747ba0f | 8 | private Instruction matchInstruction() {
dispatchEvent(ParserEvent.BEGAN_PARSING_NON_TERMINAL_SYMBOL, "Instruction");
Instruction instruction = null; // TODO Invalid instruction.
if (SyntacticValidator.getInstance().isNextToken(ProductionRule.REQUIRED, Token.Type.IDENTIFIER, Reserved.Keyword.IF, Reserved.Keyword... |
198448e3-ada6-456b-b56a-e1427b8a7d21 | 5 | public <T> ObjectConstructor<T> get(TypeToken<T> typeToken) {
final Type type = typeToken.getType();
final Class<? super T> rawType = typeToken.getRawType();
// first try an instance creator
@SuppressWarnings("unchecked") // types must agree
final InstanceCreator<T> typeCreator = (InstanceCreator<... |
8a2fb292-0798-46b6-b8df-30033451e315 | 4 | public void bet() {
try {
bet = Integer.parseInt(JOptionPane.showInputDialog(this,
"Place a bet: "));
} catch (NumberFormatException e) {
JOptionPane.showMessageDialog(this, "Please enter a valid number");
return;
}
if (bet > player.getMoney()) {
JOptionPane.showMessageDialog(this,
"You do... |
1e4ab3b3-1bbf-493b-b7e3-a7477713b5ff | 6 | static URL parse(String expr) {
URL url = new URL();
String host = expr;
short port = 80;
String path = "";
String tokens = "";
String auth = "";
String protocol = "http";
String error = "";
int pos;
// Expr can be on the form "http://... |
c45c4979-b5c3-46bf-9248-18f6b61dc25d | 4 | @Override
public EntityInfo getFileMetaData(String path) throws PathNotFoundException {
File file = getFile(path);
if (!file.exists())
throw new PathNotFoundException(path);
EntityInfo info = null;
if (file.isDirectory())
info = new DirectoryInfo(translateFilePath(file));
if (file.isFile())
info... |
94158951-9777-4224-89e9-40227f6ba38c | 0 | public DataSet(int id, String naam)
{
this.id = id;
this.naam = naam;
this.categories = new ArrayList<Category>();
} |
5e1df76d-67d0-4e73-bd21-6bd179697094 | 9 | @Override
public void run()
{
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String str;
DatagramSocket datagramSocket = null;
try {
datagramSocket = new DatagramSocket();
while ((str = br.readLine()) != null) {
sentCount++;
byte[] buffer = (processId ... |
ab1b6c50-9af7-442a-a4ce-835e2d92f8fb | 5 | @SuppressWarnings("rawtypes")
public static SingleColumnComparator createLongComparator(NumberName numberName, boolean ascending, String defaultString) throws Exception
{
final String type="long";
if (ascending)
{
if (defaultString.equals(""))
{
return new SingleColumnComparator(numb... |
54a1736d-bbc6-4c49-bd85-f1d30faed77b | 3 | @EventHandler
public void onPlayerInteract(PlayerInteractEvent event) {
ItemStack clickIcon = this.getClickItem();
if (clickIcon != null) {
ItemStack itemStack = event.getItem();
if (itemStack != null && itemStack.isSimilar(clickIcon)) {
this.show(event.getPla... |
746c78a2-3abf-4e94-afdc-e7c82fa689a1 | 4 | private void playlistMenu() {
System.out.println(" Playlists Menu ");
System.out.println("1. |Show all playlists |");
System.out.println("2. |Show songs in a playlist |");
System.out.println("3. |Edit playlists |");
System.out.pri... |
8d63dea2-9141-4296-805a-0054ceef7f87 | 0 | public void setReferRequestWrapper(RequestWrapper referRequestWrapper) {
this.referRequestWrapper = referRequestWrapper;
// this.referRequestWrapper.getCallback().setResponseWrapper(this);
} |
103779d4-ea31-4117-87c0-01935ce034bc | 4 | public int addBuddy(String username, String buddyname){
try {
String host = "localhost";
socket = new Socket(host, 2001);
in = new BufferedReader(new InputStreamReader(socket.getInputStream()));
out = new PrintWriter(socket.getOutputStream(), true);
... |
cc749fa7-27e0-4b00-9e31-668802fc66d6 | 7 | public synchronized static PixelMap getImagePixels(String imageName,
final String DIRECTORY) {
PixelMap pixels;
try {
File file;
switch (DIRECTORY) {
case STATUS:
file = new File(String.format("%s%s%s%s%s%s%s", R, S, UI, S,
STATUS, S, imageName));
break;
case PLAYER:
file = new File... |
611d85f6-d08d-489e-9170-f2c8ed2859a5 | 8 | private void playButton() throws IOException {
final java.net.URL imageURL = AnimationPane.class.getResource("images/play.png");
final java.net.URL imageGreenURL = AnimationPane.class.getResource("images/playGreen.png");
final java.net.URL image05URL = AnimationPane.class.getResource("images/05.png");
final ja... |
c2eb7254-af9e-4157-ba6f-45d21a288a7d | 1 | private void redispatchMouseEvent(MouseEvent event) {
Point glassPanePoint = event.getPoint();
Point containerPoint = SwingUtilities.convertPoint(mGlassPane, glassPanePoint, mCaptureComponent);
Component component = SwingUtilities.getDeepestComponentAt(mCaptureComponent, containerPoint.x, containerPoint.y);
if ... |
37a3e3b6-f760-4276-846d-42a618817588 | 2 | @Override
public void run() {
while (alive) {
try {
sleep(random.nextInt(300));
} catch (InterruptedException ex) {
}
synchronized (field) {
Position[] neighbors = getNeighbors(position);
field.moveItem(this, pos... |
d60bb623-a19d-4719-9aea-f1d20cc1e427 | 6 | public static void menu(BufferedReader inp) throws IOException
{
String userInput = null;
loop:while(true)
{
try
{
LoginBean loginBean = new LoginBean();
System.out.println("Enter the following details");
System.out.println("UserName[String]");
loginBean.setUserName(inp.readLine());
... |
1552d4de-a29d-44f5-810b-5206b5dce29b | 7 | public boolean isSymmetric(TreeNode root) {
// Start typing your Java solution below
// DO NOT write main() function
if (root == null)
return true;
Queue<TreeNode> p = new LinkedList<TreeNode>(); // 可用stack替换
Queue<TreeNode> q = new LinkedList<TreeNode>();
p.offer(root.left);
q.offer(root.right);
whi... |
b06c8b34-8b6c-4467-8c84-80e77e0ed2b0 | 3 | public Identifier getIdentifier(String name) {
if (loadOnDemand) {
Identifier ident = loadClass(name);
return ident;
}
int index = name.indexOf('.');
if (index == -1)
return (Identifier) loadedClasses.get(name);
else {
PackageIdentifier pack = (PackageIdentifier) loadedClasses.get(name
.subst... |
2cd041b2-6737-4fa2-8a76-27b63c152091 | 6 | public static void connect2(TreeLinkNode root) {
if (root == null)
return;
if (root.left != null) {
root.left.next = root.right;
connect2(root.left);
connect2(root.right);
}
// if (root.left != null && root.left.right != null) {
// root.left.right.next = root.right.left;
// connect(root.left);
//... |
4c438750-6500-4972-a88a-a9814ea0294e | 7 | public ConnexionBuffers(){
arrayy=new ArrayList<String>();
geomms=new ArrayList<String>();
arrayy.clear();
geomms.clear();
Connection con = null;
try{
Class.forName("org.postgresql.Driver");
con = DriverManager.getConnection("jdbc:postgresql://"+ConnexionBaseDonnees.getHote()+":"+ConnexionBaseDo... |
15b8fcf5-fa0c-425f-927c-cbf3250dbaba | 1 | public void deleteTag(StatusTag tag) {
if (this.tags != null) {
this.tags.remove(tag);
}
} |
78fb0ef9-824e-492e-9ce2-78f7c9131613 | 0 | private FileUtil(){} |
09fcc8c2-cb05-4e34-a289-f6c69b89c679 | 5 | public void addTablesToJoin(ObjectStack stack)
{
// add the actual representation
ObjectRepresentation actual = stack.getActualRepresentation();
this.joinRepresentations.add(actual);
if (actual.isArray())
{
addTableToJoin(NameGenerator.getArrayTablename(adapter), actual.getAsName());
}
else
{
add... |
e2191908-d55e-498a-9f4f-ff02a4b8810f | 1 | Item newFloat(final float value) {
key.set(value);
Item result = get(key);
if (result == null) {
pool.putByte(FLOAT).putInt(key.intVal);
result = new Item(index++, key);
put(result);
}
return result;
} |
07102543-ba92-4da3-a1ab-e9070c0c42a5 | 7 | private JSONWriter append(String string) throws JSONException {
if (string == null) {
throw new JSONException("Null pointer");
}
if (this.mode == 'o' || this.mode == 'a') {
try {
if (this.comma && this.mode == 'a') {
this.writer.write('... |
f2026cc7-5190-4690-a0c2-81f39998ad80 | 8 | static final void method2460
(float f, int i, float f_100_, int i_101_, int i_102_, float f_103_,
Class186 class186, int i_104_, byte i_105_, int i_106_, float f_107_,
byte[] is, int i_108_, float f_109_) {
do {
try {
anInt10559++;
int i_110_ = i_102_ * i_106_;
float[] fs = new float[i_110_];
for (in... |
173671b1-76fa-4c9e-9bca-f008ef2bbc66 | 3 | public void preencherTabela() throws Exception
{
ArrayList<String> colunas = new ArrayList<String>();
colunas.add("id");
colunas.add("nome");
Object linhas[][] = new Object[list.size()][];
int i = 0;
for (InstituicaoSubmissao instituicaosubmissao : list)
{
linhas[i] = formatoTabela(instituicaosubmissa... |
6999dedb-3ae9-46d7-9190-22ea275f2e83 | 9 | @Override
public void execute() throws MojoExecutionException, MojoFailureException {
if (!outputDirectory.exists()) {
getLog().debug("Creating the output resource directory.");
outputDirectory.mkdirs();
}
if (inputFile == null) {
throw new MojoExecutionE... |
978ac3ed-5ce7-4bb7-9e21-0e7f4a730c14 | 9 | public static String normalizePath(String path) {
String[] comps = path.split("/");
String[] ap = new String[comps.length];
int j = 0;
boolean absolute = comps[0].length() == 0;
for (int i = 0; i < comps.length; ++i) {
String s = comps[i];
if (s.equals("... |
fc164e87-c791-4b82-87c6-26884af539f8 | 7 | public Object nextValue() throws JSONException {
char c = this.nextClean();
String string;
switch (c) {
case '"':
case '\'':
return this.nextString(c);
case '{':
this.back();
return new JSONObject(this);
... |
004b8744-01aa-4801-998f-2ba65496133e | 6 | public void register(Listener l){
for(Method m: l.getClass().getDeclaredMethods()){
if(true){
if(m.isAnnotationPresent(EventHandler.class)){
if(m.getParameterTypes().length==1){
if(map.containsKey(m.getParameterTypes()[0])){
//if map has this object listed
if(map.get(m.g... |
d6dd2de6-48a8-4a75-a6e7-85dba2126b11 | 9 | private JMenuItem startNewGame(){
JMenuItem startNewGameItem = new JMenuItem("New Game");
startNewGameItem.addActionListener(new ActionListener(){
private JButton submitButton;
@Override
public void actionPerformed(ActionEvent arg0) {
final Window mainWindow = SwingUtilities.windowForComponent(menuIt... |
255d9d12-b0dc-45ef-bec3-f6faa6652e07 | 3 | public static String getIframeSrc(String iframe)
{
iframe = iframe.toLowerCase(Locale.getDefault());
int srcIndex = iframe.indexOf("src=");
// 如果不存在src=
if (srcIndex < 0)
{
return null;
}
// 截取掉src前的所有字符
String indefiniteSrc = iframe.substring(srcIndex + 5);
String symbol = iframe.substring(sr... |
86550676-c70f-4be5-b76d-28045d4cb589 | 1 | @Override
public String getValue(String paramName) {
Object o = messages.get(paramName);
return o == null ? "" : o.toString();
} |
908a10c3-b1cf-4d69-bf11-738053ec12c3 | 3 | private void projectRow(BasicMatrix data, BasicMatrix ret, int row) {
Vector r = data.get(row);
synchronized (this) {
r.map(new VectorMapper() {
@Override
public void map(int index, float value) {
if (!NumberUtils.isZero(value) && NumberUti... |
ab5a8786-728b-47c9-b0f3-c7b95dbdc2d0 | 6 | @EventHandler
public void IronGolemRegeneration(EntityDamageByEntityEvent event) {
Entity e = event.getEntity();
Entity damager = event.getDamager();
String world = e.getWorld().getName();
boolean dodged = false;
Random random = new Random();
double randomChance = plugin.getIronGolemConfig().getDouble("Iro... |
456ce3a3-f297-4da7-94dd-21f3461e9158 | 0 | @Override
public void endSetup(Attributes atts) {
super.endSetup(atts);
} |
931c4daa-e7e2-4e73-9b5f-1a2c89a83e97 | 9 | @Override
public boolean invoke(MOB mob, List<String> commands, Physical givenTarget, boolean auto, int asLevel)
{
if(!CMLib.flags().isAliveAwakeMobileUnbound(mob,false))
return false;
if((!auto)&&(!(CMLib.flags().isGood(mob))))
{
mob.tell(L("Your alignment has alienated your god from you."));
return ... |
2adf3dec-192a-4d42-91d1-47347dbd0098 | 4 | public Vec3D position(Vec3D v) {
if (v == null) v = new Vec3D() ;
super.position(v) ;
if (type == TYPE_SECTION) v.z += 1.33f ;
else if (type == TYPE_TOWER ) v.z += 2.50f ;
else if (type == TYPE_SQUARE ) v.z += 1.00f ;
return v ;
} |
bd6e5a76-31f8-469b-9704-23afb1f82018 | 8 | @Override
public JsonElement serialize(RemoteClass src, Type typeOfSrc, JsonSerializationContext context) {
JsonObject object = new JsonObject();
if (src.getName() != null) {
object.addProperty("name", src.getName());
}
if (src.getDoc() != null) {
object.addProperty("doc", src.getDoc())... |
a1f9c6cb-3cd2-415f-be90-ae67c48db25d | 0 | @Test
public void pacmanMode() {
x = 4;
y = 4;
rule = new RuleSet("23/3");
grid = new Grille(x, y, rule);
grid.setWrap(true);
boolean[][] originalValue = {{false,false,false,false}, {true,false,true,false}, {true,false,false,true}, {false,true,false,false}};... |
4445aef8-0f95-4ecb-98ff-6bbc03807271 | 7 | protected boolean computeCell(int col, int row) {
// Compute whether this cell is alive or dead in the next generation
// using "countNeighbours"
boolean liveCell = getCell(col, row);
int neighbours = countNeighbours(col, row);
boolean nextCell = false;
if (neighbours < ... |
e06fca4d-4827-4e90-a638-8f0fd4d27578 | 2 | public Object invoke(Object proxy, Method method, Object[] args)
throws Throwable {
System.out.println("**** proxy: " + proxy.getClass() + ", method: "
+ method + ", args: " + args);
if (args != null)
for (Object arg : args)
System.out.println(" " + arg);
return method.invoke(proxied, args);
} |
5fe9ba34-1de6-4f31-a215-f422dcccc75b | 7 | private void generateValidIslandsRecursive(FixedCell fixedCell, Set<Cell> requiredCells,
Set<Cell> currentCells, Set<Set<Cell>> currentCellsSeen,
Map<Cell, Set<Cell>> validNeighborsCache, Set<Set<Cell>> result) {
if (fixedCell.getNumber() == currentCells.size()) {
// potential valid island
i... |
321dbf69-38bc-4bf6-bfbd-d182129373a4 | 5 | @Override
public boolean processPageOfData(List<Object> pageOfData) throws Exception {
// If this is the first page of data we've received,
// and log the start of the job
if (!this.running) {
// Set this.running = true so we know this step has been
// started, even if start() has not been called yet.
t... |
c05cc0df-0dee-423a-969d-cbb43970a93f | 9 | public static void crearVenta(HashMap<Integer, Ventas> tablaVentas)
{
int idCliente = 0;
int idMusica = 0;
boolean entradaCorrecta = false;
int error = 0;
Scanner entrada = null;
if (Clientes.getNumClientes() == 0) // Miramos si hay clientes en el sistema
{
error = 1;
System.out.println("No ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.