method_id stringlengths 36 36 | cyclomatic_complexity int32 0 9 | method_text stringlengths 14 410k |
|---|---|---|
a4552a51-af03-45a9-a0c4-960a44e3f1df | 2 | @Override
public AbstractConnection toItem( ConnectionData data, DefaultUmlDiagram diagram ) {
AbstractConnection connection = connection( data.getConnectionType(), data.getKey(), diagram );
DefaultBox<?> source = diagram.getDefaultBox( data.getSource() );
DefaultBox<?> target = diagram.getDefaultBox( data.ge... |
a47a11a7-1351-4eaa-b6af-6fc6643947a2 | 7 | public void correr(JLabel min, JLabel seg, JLabel seg2, float dt) {
segundos2 = (int) dt;
if (segundos2 != segundosViejo) {
segundosViejo = segundos2;
segundos2Cambio = true;
}
if (segundos2 - valorCambioSeg == 10) {
segundos++;
segundos2 = 0;
segundosViejo = 0;
valorCambioSeg += 10;
segun... |
79a7ba40-22f5-4671-8fe4-9c399735843a | 5 | private void eat() {
//eat a character
if (state == State.END) {
return;
}
matchFound = false;
if (state == State.EAGER) {
int curStrPosition = strPosition;
int curPtnPosition = ptnPosition;
strPosition++;
ptnPosition... |
3c4a03d5-8c0a-44c1-8600-17688ac4f344 | 8 | protected void handleCommandResultWithoutWaitingForACommand(String commandResult) {
if (commandResult != null) {
if (!resultExpected.get() ) {
if (proxyInjectionMode) {
// This logic is to account for the case where in proxy injection mode, it is possible
// that a page ... |
8c9abbf7-eb72-48ac-b975-910f8fad8759 | 2 | public Account getAccount(int index) {
if (index < 0 || index >= accounts.length) {
throw new IllegalArgumentException("Cannot retrieve account #"
+ index);
}
return accounts[index];
} |
b95f78b8-769f-467f-9131-e4e509d17dc3 | 7 | public Double[] getConsumption()
{
ArrayList<Double> temp = new ArrayList<Double>();
int times = getOuterN();
if (times == 0)
times = 2;
// Number of repeats
for (int i = 0; i < times; i++) {
// System.out.println("Time: " + i);
// Number of patterns in each repeat
for (int j = 0; j < getPattern... |
87b6d7c8-0e20-487b-b236-6a11d6995141 | 8 | private <T> PlaybackOperation generateOperation(Action<T> action) {
switch (action.type) {
case BGPALETTE:
return new WriteBgPaletteDirect(action.position, (Palette)action.value, true);
case OBJPALETTE:
return new WriteObjPaletteDirect(action.position, (Palette)action.value, true);
case HRAM... |
7658859a-4b67-41d7-aa32-396cacc4b858 | 5 | private static boolean isPrimitiveOrString(Object target) {
if (target instanceof String) {
return true;
}
Class<?> classOfPrimitive = target.getClass();
for (Class<?> standardPrimitive : PRIMITIVE_TYPES) {
if (standardPrimitive.isAssignableFrom(classOfPrimitive)) {
return true;
... |
5ab7c133-d2a1-46c3-b6d2-8316b012737d | 7 | public CheckResultMessage checkTotal2(int i) {
int r1 = get(6, 5);
int c1 = get(7, 5);
int r2 = get(8, 5);
BigDecimal sum = new BigDecimal(0);
if (checkVersion(file).equals("2003")) {
try {
in = new FileInputStream(file);
hWorkbook = new HSSFWorkbook(in);
for (int j = 1; j < r2 - r1; j++) {
... |
db028613-e119-459b-9826-5b4ae2012456 | 8 | @Override
protected void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
response.setContentType("text/html;charset=UTF-8");
PrintWriter out = response.getWriter();
Connection conn = null;
Statement stmt = null;
... |
c9bdd99f-3bc3-402d-9be3-2148c35f5ca6 | 1 | public void printContacts(Set<Contact> returnContacts) {
Iterator<Contact> it = returnContacts.iterator();
while (it.hasNext()) {
Contact holder = it.next();
System.out.print("ID: ");
System.out.print(holder.getId());
System.out.print(" Name: ");
System.out.print(holder.getName());
System.out.pri... |
145ca990-5b7d-42c6-a4c7-9ef8b9c4a02c | 6 | @Override
public void run() {
while (this.isRunning()) {
Socket sckt;
try {
sckt = ssckt.accept();
//Check if only local connections are allowed and whether this is a local one or not
if ((this.conMan.getHot... |
a709c507-b9d1-4fa6-8ff2-b3e401603f5c | 7 | */
public int getBulletType() {
Element[] elem = getSelectedParagraphs();
if (elem == null || elem.length == 0)
return -1;
StyledDocument doc = getStyledDocument();
Element head = null;
Icon[] icon = new Icon[elem.length];
for (int i = 0; i < elem.length; i++) {
head = doc.getCharacterElement(elem[i]... |
484d16a5-a6bd-419e-bf6a-5336f9c855a0 | 4 | private PlayerSelectFrame(String prompt, String[] players) {
super("Quantum Werewolves");
this.getContentPane().setLayout(new BoxLayout(this.getContentPane(), BoxLayout.Y_AXIS));
this.setDefaultCloseOperation(EXIT_ON_CLOSE);
this.setLocationRelativeTo(null);
this.players = players;
this.label = new JL... |
38920cfb-8c52-4d8f-bf03-2f5d4d35f064 | 1 | public AnnotationVisitor visitAnnotationDefault() {
AnnotationVisitor av = mv.visitAnnotationDefault();
return av == null ? av : new RemappingAnnotationAdapter(av, remapper);
} |
f577d76c-f956-435f-97fe-4e69fac940e3 | 0 | public Object get(int index) {
return vertices.get(index);
} |
085eb0de-e556-4d10-a8d2-9a7779703b80 | 6 | private boolean numberInUse() {
if (tfEmployeeNumber.getText().isEmpty() || !Utils.isNumeric(tfEmployeeNumber.getText())) {
lblNumberInUse.setVisible(false);
return true;
} else {
Employee existingEmployee = RoosterProgramma.getInstance().getEmployee(Integer.parseInt(... |
b52611ca-d4eb-4a24-9e68-04ad99eb480e | 9 | @Override
public Object getValueAt(Object node, int column){
if (column == 0) return node;
else
{
DefaultMutableTreeTableNode ttNode = (DefaultMutableTreeTableNode) node;
if (ttNode.getUserObject() instanceof Job)
{
Job job = (Job) ttNode.getUserObject();
switch (column) {
case 1:
retur... |
fcfda91f-2861-4ec9-b95f-53b6c34d8742 | 0 | public synchronized EquationBTreeNode getParent() {return parent;} |
cf0f8b41-90c8-49d5-9951-ea7e696d8cac | 2 | public void setTool(int i) {
tool = i;
if (tool == 3)
l2 = 0;
if (tool == 2)
l = 0;
} |
d8f6ef20-118f-438a-9bfa-c83100f27a16 | 2 | public boolean isAlive() {
if (getShip().isDead() || getShip().getId() == null) {
status = PlayerStatus.DEAD;
getShip().die();
ship = null;
shipId = null;
}
return status == PlayerStatus.ALIVE;
} |
80d46c3f-919b-478a-b1e9-a3297a01fbd9 | 3 | public static boolean ignoreSQLException(String sqlState) {
if (sqlState == null) {
//System.out.println("The SQL state is not defined!");
return false;
}
// X0Y32: Jar file already exists in schema
if (sqlState.equalsIgnoreCase("X0Y32")) {
return true... |
4e655758-521d-4ee6-8c94-ace1293838e1 | 2 | void open() {
// File parameters
dirName = Gpr.dirName(fastqFile);
ext = Gpr.extName(fastqFile);
baseName = Gpr.baseName(fastqFile, "." + ext);
// Open files
try {
file = new File(fastqFile);
if (!file.canRead()) error("Cannot read file '" + fastqFile + "'");
raf = new RandomAccessFile(file, "r");... |
4a404db9-48d7-4893-ade1-250c68370d15 | 1 | public void setGuardAngle(float angle) {
if(angle < 0) {
guardAngle = angle + MathUtil.PI * 2;
}
else {
guardAngle = angle;
}
} |
9a259720-32a0-43f4-a542-8dc1674bf9fe | 1 | public void renderObjects(){
for (GameObject gameObject : objectList) {
gameObject.render();
}
} |
05679bcd-41db-489c-9b21-9622c100a6b2 | 3 | public void setLogLevel(final String name) {
Level level;
try { level = Level.parse(name); } catch (final Exception e) {
level = CustomPlugin.DEFAULT_LOG;
this.getLogger().warning("Log level defaulted to " + level.getName() + "; Unrecognized java.util.logging.Level: " + name + ";... |
62204b5c-76e4-4702-9330-4dba49c2d928 | 0 | public Builder published(Date published) {
this.published = published;
return this;
} |
b49183c8-c04a-4ce1-9a9a-5f320f24f6c7 | 0 | protected void initialize() {
Robot.tilter.moveDown();
} |
c12d2203-414f-48d8-96d5-5b7abbdb3d1f | 3 | public void testSimulate(){
DebicccdGA g = new DebicccdGA("");
g.generateInitialPopulation(6);
g.printPopulation();
g.simulatePopulation("");
g.generateNextPopulation("roulette");
System.out.println();
for(Double d : g.fitness)
System.out.print(d + " : ");
for(int i = 0; i < 1000... |
ad3ceaf0-f419-4f60-998c-09e3cc5db124 | 2 | public Socket close() {
EventThread.exec(new Runnable() {
@Override
public void run() {
if (Socket.this.readyState == ReadyState.OPENING || Socket.this.readyState == ReadyState.OPEN) {
Socket.this.onClose("forced close");
logger.fin... |
a3b7a75a-a53a-4b10-a578-9244b634397b | 9 | public StraightTrajectory(Lane lane)
{
fLane = lane;
Point2D p1 = lane.getStart().getPosition();
Point2D p2 = lane.getEnd().getPosition();
double deltaX = p2.getX() - p1.getX();
double deltaY = p2.getY() - p1.getY();
if (deltaX != 0)
{
fA = (deltaY) / (deltaX);
fB = p1.getY() - fA * p1.getX();
... |
10077062-13c6-4565-b792-fd6ce234ee17 | 5 | public void draw(Graphics2D g) {
for(
int row = rowOffset;
row < rowOffset + numRowsToDraw;
row++) {
if(row >= numRows) break;
for(
int col = colOffset;
col < colOffset + numColsToDraw;
col++) {
if(col >= numCols) break;
if(map[row][col] == 0) continue;
... |
97586285-1e89-483d-b71b-fa1ca172765e | 0 | @Test
public void runTestHashMapAccess1() throws IOException {
InfoflowResults res = analyzeAPKFile("ArraysAndLists_HashMapAccess1.apk");
Assert.assertEquals(0, res.size());
} |
797b000b-5b9f-43d2-ad71-a14cd242a8b7 | 7 | public final boolean equals(Object o)
{
if (!(o instanceof Entry)) return false;
Entry e = (Entry)o;
Object k1 = Long.valueOf(getKey());
Object k2 = Long.valueOf(e.getKey());
if ((k1 == k2) || ((k1 != null) && (k1.equals(k2)))) {
Object v1 = getValue();
Object v2 = e.ge... |
b07ff022-717a-4dd2-a77d-a9ede36ec6c5 | 1 | public void testSetIntoIntervalEx_Object_Chronology2() throws Exception {
MutableInterval m = new MutableInterval(-1000L, 1000L);
try {
StringConverter.INSTANCE.setInto(m, "/", null);
fail();
} catch (IllegalArgumentException ex) {}
} |
8a6444b0-b9b6-4c6e-a745-cfdacfcbe088 | 8 | protected String fetch(String url, String caller, boolean write) throws IOException
{
// check the database lag
logurl(url, caller);
do // this is just a dummy loop
{
if (maxlag < 1) // disabled
break;
// only bother to check every 30 seconds
... |
cdd7e4d1-b66e-449b-bb32-8b852f8fe78f | 7 | public MergerView(Console consoleStream, DefaultListModel currentModel) {
super("CWRC Data Merger");
this.setSize(1024, 768);
this.consoleStream = consoleStream;
this.currentListModel = currentModel;
//Add the console output
console = new JTextArea();
consoleSt... |
7f4e263c-e869-4dc2-bb86-e87598c460e0 | 2 | public MetricsLite(Plugin plugin) throws IOException {
if (plugin == null) {
throw new IllegalArgumentException("Plugin cannot be null");
}
this.plugin = plugin;
// load the config
configurationFile = getConfigFile();
configuration = YamlConfiguration.loadConfigura... |
22a81dc4-3722-46e4-8d72-bbc998877b81 | 4 | @Override
public O_5x_AbstractDataType deserialize(ByteBuf bb) {
String adc = Serialization.getString(bb);
String oadc = Serialization.getString(bb);
String ac = Serialization.getString(bb);
Character nrq = Serialization.getCharacter(bb);
String nadc = Serialization.getString(bb);
Character nt = Serializat... |
f97b8309-aac4-4088-b668-0e408522b643 | 0 | public void mouseEntered(MouseEvent e) {
mouseMoved(e);
} |
b5a14fb3-5ce8-435d-a133-0092ed061833 | 1 | protected void regraph() {
if( site != null ) {
site.regraph();
}
} |
bfbb4bf2-8ab8-458b-82c7-b0ef47c96c63 | 6 | @Override
public String saveAnswer(Question question) {
if(question == null){
return "Не передан объект вопроса";
}
if (question.getIdTest() == null){
return "В переданом объекте отсутствует ссылка на тест";
}
if (question.getIdQuestion() == null){
... |
c3dafb47-465f-407b-b37d-9b9b4d19d1db | 5 | public void saveGameState(ArrayList<InfoPacket> packets, String fileName)
{
String output = new String();
Iterator<InfoPacket> packetIter = packets.iterator();
InfoPacket pckt = null;
while(packetIter.hasNext())
{
pckt = packetIter.next();
Iterator<Pair<?>> namedValueIter = pckt.namedValues.iter... |
8104d731-976f-4408-a800-ec066725ead3 | 9 | public void ObtainPHPFileVariables(DatabaseAccess JavaDBAccess, String TargetPHPFileSelected) {
int TARGET_PHP_FILES_ID = 0;
PreparedStatement ps = null;
String PHPFileText = "", PHPFileTextClean = ""; //The text of the PHP file where we want to inject the vulnerabilities
String[] RegEx... |
994c68e4-c846-4374-92fd-460f166a3c7c | 6 | public static int readPackInt(DataInput br) throws IOException {
int prefix = br.readUnsignedByte();
int bytes, value;
if ((prefix & 0x78) == 0x78) {
bytes = 4;
value = (prefix & 0x7) << 32;
} else if ((prefix & 0x70) == 0x70) {
bytes = 3;
... |
699df9de-5a78-4537-9be8-dc9811d4d674 | 5 | private void displayValidationErrorDialog(boolean creationAttempted,
List<Invalid> errors) {
if (!errors.isEmpty()) {
JPanel content = new JPanel(new BorderLayout(0, 8));
JLabel label = new JLabel(
(creationAttempted ? "Your game could not be created due to the following "
: "Your game has the f... |
642f45c6-3979-47ce-9b28-4693821a1cb7 | 0 | @Override
public Station[] getStations() {
return this._stations;
} |
6a607eff-60d4-40a8-a576-6ea0a847f6c6 | 2 | @Override
protected void paintComponent(Graphics g) {
super.paintComponent(g);
Graphics2D g2d = (Graphics2D) g;
g2d.setColor(getBackground());
g2d.fillRect(0, 0, getWidth(), getHeight());
if(list != null && list.size() > 0){
drawList(g2d, list);
}
} |
a049b4fd-093d-44a2-a566-a99c3d10326b | 2 | public List<Fleet> MyFleets() {
List<Fleet> r = new ArrayList<Fleet>();
for (Fleet f : fleets) {
if (f.Owner() == 1) {
r.add(f);
}
}
return r;
} |
3030dee2-3e93-4c88-8da6-6321d61c7988 | 6 | @Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Event other = (Event) obj;
if (eventType == null) {
if (other.eventType != null)
return false;
} else if (!eventType.equals(other.eventT... |
e9c5c120-2a37-43de-9898-e38a3a65cf18 | 0 | public void setValidatorRHS(Validator<T> validatorRHS) {
this.validatorRHS = validatorRHS;
} |
3b2d1d1c-4918-4df4-9420-1f849dd71a51 | 7 | public static void paint(Ocean sea) {
if (sea != null) {
int width = sea.width();
int height = sea.height();
/* Draw the ocean. */
for (int x = 0; x < width + 2; x++) {
System.out.print("-");
}
System.out.println();
for (int y = 0; y < height; y++) {
System... |
ad98906f-ac06-483f-8c31-5a0ee2ee3d62 | 7 | public static void testValidity(Object o) throws JSONException {
if (o != null) {
if (o instanceof Double) {
if (((Double) o).isInfinite() || ((Double) o).isNaN()) {
throw new JSONException(
"JSON does not allow non-finite numbers.");
... |
93f664b1-f662-4fb4-ab74-7f5a55a6e319 | 0 | @Override
public void documentAdded(DocumentRepositoryEvent e) {} |
cd3100ca-f2a4-47a5-817f-0bd9aabd73bc | 8 | public static void main(String[] args) {
int counter = 0;
for (int firstCard = 2; firstCard <= 14; firstCard++) {
for (int secondCard = 2; secondCard <= 14; secondCard++) {
if (secondCard == firstCard)
continue;
for (int firstSuit = 1; firstSuit <= 4; firstSuit++) {
for (int secondSuit = firstS... |
0427ad71-a5bb-4373-b0f9-76db48a505fe | 8 | public MainUserWindow(int a) {
cn = getContentPane();
cn.setLayout(null);
accno = a;
header = new JLabel("CUSTOMER", JLabel.CENTER);
footer = new JLabel("Logged in with Account No : " + accno,
JLabel.LEFT);
bCheck = new JButton("View Customer Profile");
bView = new JButton("View Transactions");
bPa... |
500744d6-5b72-45f0-a43f-af5cae9cdc0b | 7 | public Object[] list() {
ArrayList<Object> ret = new ArrayList<Object>();
while(true) {
if(off >= blob.length)
break;
int t = uint8();
if(t == T_END)
break;
else if(t == T_INT)
ret.add(int32());
else if(t == T_STR)
ret.add(string());
else if(t == T_COORD)
ret.add(coord());
... |
c6c63ff2-3f01-494c-b24a-d18229be5884 | 5 | @Override
public void create(String name, String author, String website, Path img) throws IOException {
if ((name == null) || name.equals("")) {
IllegalArgumentException iae = new IllegalArgumentException("Name is null or empty!");
Main.handleUnhandableProblem(iae);
}
... |
cb390f0b-ad01-4862-8ed7-c34c837213d6 | 4 | public void food(int count, int recursive, int length) {
while(recursive < 3) {
if(foodSpaceClear == true) {
for(int i = 0; i < length; i++) {
world[randRow+count][i+randCol].setFood(true); //Creates the line in the centre and the lines
world[randRow+count][i+randCol].setFoodAmount(5); //above the... |
edd126eb-09ea-41b1-9a61-0794b03d5b11 | 3 | public static void main(String[] args) {
double x=0,y=0;
boolean entra=false;
do{
try{
System.out.print("Valor x => ");
x=Double.parseDouble(stdin.readLine());
System.out.print("Valor y => ");
y=Double.parseDouble(stdin.readLine());
entra=false;
}catch(Exception e){
System.out.println("Valor... |
75d24dc6-9376-4063-92f4-76f7634f8f23 | 7 | @Override
public QL factor(DenseMatrix A) {
if (Q.numRows() != A.numRows())
throw new IllegalArgumentException("Q.numRows() != A.numRows()");
else if (Q.numColumns() != A.numColumns())
throw new IllegalArgumentException(
"Q.numColumns() != A.numColumns()"... |
a40f666a-f1e4-4180-9aaf-1b2b5aaa7774 | 4 | public Document toDOM(java.io.Serializable structure) {
LSystem lsystem = (LSystem) structure;
Document doc = newEmptyDocument();
Element se = doc.getDocumentElement();
// Add the axiom.
se.appendChild(createComment(doc, COMMENT_AXIOM));
se.appendChild(createElement(doc, AXIOM_NAME, null,
listAsString(l... |
29deef9b-2711-4fc3-8ac3-039540898831 | 0 | public void setRXAxisDeadZone(float zone) {
setDeadZone(rxaxis,zone);
} |
a8f4fb21-f116-468f-8da8-2e1c053ac21d | 4 | public static final String toRoman(int number) {
if (number < 1) {
throw new IllegalArgumentException("Number must be greater than 0"); //$NON-NLS-1$
}
String text = "I"; //$NON-NLS-1$
int closest = 1;
for (int i = 0; i < ROMAN_VALUES.length; i++) {
if (number >= ROMAN_VALUES[i]) {
closest = ROMAN_V... |
b020443e-c931-417d-b7c6-89ee7352c594 | 8 | public MCTSNode UCTSelectChild() {
MCTSNode selected = null;
double best = -1;
for (MCTSNode node : children){
if (node.getMove().getType().equals(MoveType.PASS) && selected == null){
selected = node;
} else {
//disincentivize playing on the edges
double ratio;
if (node.getMove().getX()==0 |... |
0f052565-da80-43a0-b9a6-c17a45179342 | 3 | public static int PovSwitch(int pov, int playerID) {
if (pov < 0)
return playerID;
if (playerID == pov)
return 1;
if (playerID == 1)
return pov;
return playerID;
} |
82b0010c-1e65-42e9-a904-ed2918b50e87 | 4 | private void airfieldJListSelectionChanged(ListSelectionEvent listSelectionEvent)
{
if(airfieldJList.getSelectedIndex() >= 0){
try{
Airfield theAirfield = (Airfield)airfieldJList.getSelectedValue();
currentData.setCurrentAirfield(theAirfield);
cur... |
a64d4d0d-f037-486e-847a-4b45f7fa09cc | 2 | private static String readField(FileInputStream in) throws IOException {
String str = "";
for (char c = (char)in.read(); !Character.isWhitespace(c) && c != '\n'; c = (char)in.read())
str = str.concat(String.valueOf(c));
return str;
} |
063ef84e-f1df-4ef6-b668-d33a10cc1ad2 | 7 | public void receiveAcceptRequest(int uniqueId,BallotNumber proposal, double value) {
if(value>0)
senders.add(uniqueId);
if(acceptedValues.containsKey(value)){
acceptedValues.put(value, acceptedValues.get(value)+1);
} else {
acceptedValues.put(value,1);
}
if(acceptedValues.get(value) >= quo... |
efccf498-3a51-4c1d-815a-920fc245e839 | 7 | @Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Category category = (Category) o;
if (colorCode != category.colorCode) return false;
if (id != category.id) return false;
if (headLine ... |
25fc878a-0c1c-4b74-8768-4d84693f14d0 | 2 | @Override
protected List<ByteBuffer> onRelease()
{
List<ByteBuffer> dump = new ArrayList<ByteBuffer>();
ByteBuffer buffer;
// For each pool of buffers...
for (int i = 0; i < pool.length; i++) {
// Pop every buffer off the current stack and add it to the list.
while ((buffer = pool[i].pop()) != null)... |
fb2470d4-354e-4cde-b99e-f9f475b2e0eb | 1 | public Collection pdomChildren(final Block block) {
if (domEdgeModCount != edgeModCount) {
computeDominators();
}
return block.pdomChildren();
} |
afb77d7b-bcbf-457f-8bbe-cf1b380c6aa8 | 2 | public int getCellAddress(int n) throws Exception {
if(n >= numSpillCells || n < 0) {
throw new Exception("Invalid spill cell");
}
return freeAddress + (n * Type.getWordSize());
} |
5926f265-9862-47eb-9704-3c905dc5210a | 9 | public double associationClassesAttribute(double[][] counts){
List<Integer> supportSet = new ArrayList<Integer>();
List<Integer> not_supportSet = new ArrayList<Integer>();
double separability = 0;
int numValues = counts.length;
int numClasses = counts[0].length;
int total = 0;
double[]... |
79702402-045f-427e-9ada-8445bdc57361 | 2 | @Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((message == null) ? 0 : message.hashCode());
result = prime * result + ((source == null) ? 0 : source.hashCode());
return result;
} |
94da6970-485e-47a1-af6c-473e570176b9 | 5 | @EventHandler(ignoreCancelled = true)
public void reloader(ChunkLoadEvent event)
{
Chunk c = event.getChunk();
int x = c.getX();
int z = c.getZ();
String world = c.getWorld().getName();
Location loc;
net.minecraft.server.v1_7_R1.World notchWorld;
V10Dragon v10dragon;
for(LivingEntity d: RideThaDragon.dragon... |
d203844d-e31e-45d4-b848-77eb32d51b24 | 3 | public void getAllGenes() throws FileNotFoundException, IOException{
System.out.println("getting all genes from " + bed12Fname);
allTranscr = new ArrayList();
geneLengths = new HashMap<String, Integer>();
TextFile bed12 = new TextFile(bed12Fname, false);
String[] els = bed12.r... |
21d67546-b453-4a31-a810-c150f0ac11ac | 1 | @Override
public IEmailKontakt last() throws NoEmailKontaktFoundException {
EmailKontaktList emailContacts = readContacts();
if (emailContacts.getContactList().size() == 0) {
throw new NoEmailKontaktFoundException("Kein Kontakt gefunden!");
} else
return emailContacts.getContactList().get(
emailContac... |
9a6065e6-95ef-46d9-88e0-10ee2a05e2c8 | 3 | public static Map<String, PropertyDescriptor> getPropertyDescriptors(Class<?> clazz) throws IntrospectionException {
Map<String, PropertyDescriptor> propertyDescriptors = PROPERTY_DESCRIPTOR_CACHE.get(clazz);
if (propertyDescriptors == null) {
BeanInfo beanInfo = Introspector.getBeanInfo(clazz);
propertyDesc... |
ce80a243-de14-49c9-ba3b-67368bfe4d14 | 4 | void sortDescent (int [] items) {
/* Shell Sort from K&R, pg 108 */
int length = items.length;
for (int gap = length / 2; gap > 0; gap /= 2) {
for (int i = gap; i < length; i++) {
for (int j = i - gap; j >= 0; j -= gap) {
if (items [j] <= items [j + gap]) {
int swap = items [j];
items [j] = items ... |
7dce7392-16a4-4fec-8bdb-f66931931788 | 1 | public synchronized boolean remover(int i)
{
try
{
new InstituicaoCooperadoraDAO().remover(list.get(i));
list = new InstituicaoCooperadoraDAO().listar("");
preencherTabela();
}
catch (Exception e)
{
return false;
}
return true;
} |
51b7c074-ffb0-4a81-b36c-507558a45584 | 0 | public void set(Set productions, String variable, String lookahead) {
int[] r = getLocation(variable, lookahead);
entries[r[0]][r[1]].clear();
entries[r[0]][r[1]].addAll(productions);
} |
6c7dbb73-26bb-485b-b63e-ac8da4e0495c | 4 | public void nextMove()
{
int direction = getDirection();
if (isMove && isAValidDirection(direction)) {
progress(PIXELS);
nextPhotogram();
}
if (!isAValidDirection(direction) && nextDirection != direction) {
setDirection(nextDirecti... |
08e4fdd9-3b0d-4b27-94e7-aa5c0f7b1d10 | 1 | @Override
public void endElement(String uri, String localName, String qName) throws SAXException {
if (qName.equalsIgnoreCase("candy")) System.out.print("end candy");
} |
590779a6-4ad0-465a-ac3c-c6e016e8fcfa | 2 | public void add(String tableName, List<String> args) throws DBUnavailabilityException,
DataBaseRequestException, DataBaseTableException {
if (args.isEmpty()) {
throw new DataBaseRequestException("zero args in request list");
}
String key = args.get(0);
if (key ==... |
c3427a91-c6b7-4a46-ba53-f6a906acd895 | 1 | @Override
public void actionPerformed(ActionEvent event) {
try {
commitEdit();
} catch (ParseException exception) {
invalidEdit();
}
} |
9dfb76ce-bc6f-4514-9e04-423653a91a2f | 3 | @SuppressWarnings("unchecked")
private static List<Operation> messageToOperationList(Object operationMessagesObj) {
List<?> operationMessages = (List<?>) operationMessagesObj;
List<Operation> operations = new ArrayList<>();
for (Object operationMessage : operationMessages) {
operations.add... |
de80373d-f6de-4c73-bbe1-293e37a0e90e | 3 | public static String trimLeadingWhitespace(String str) {
if (!hasLength(str)) {
return str;
}
StringBuilder sb = new StringBuilder(str);
while (sb.length() > 0 && Character.isWhitespace(sb.charAt(0))) {
sb.deleteCharAt(0);
}
return sb.toString();
} |
23ff3051-575f-4ca0-ab32-e70ba2033361 | 5 | public void darBajaUsuario(String nick){
try {
String queryString = "DELETE FROM Usuarios WHERE nick=?";
connection = getConnection();
ptmt = connection.prepareStatement(queryString);
ptmt.setString(1, nick);
ptmt.executeUpdate();
System... |
45497829-e1da-4b0a-b051-340082b761d7 | 6 | public boolean start() {
synchronized (optOutLock) {
// Did we opt out?
if (isOptOut()) {
return false;
}
// Is metrics already running?
if (task != null) {
return true;
}
// Begin hitting the s... |
d6dc7213-4bff-424a-9caf-ac4114c52281 | 7 | void doStand() {
if (gameInProgress == false) {
message = "Click \"New Game\" to start a new game.";
repaint();
return;
}
gameInProgress = false;
while (dealerHand.getBlackjackValue() <= 16 && dealerHand.getCardCount() < 5)
dealerHand.addCard( deck.dea... |
664ecb77-b8d9-4128-b793-91e0ccec4e47 | 4 | @Override
public void mouseDragged(MouseEvent evt) {
if (!SwingUtilities.isRightMouseButton(evt)) {
return;
}
Point current = evt.getPoint();
double x = viewer.getCenter().getX() - (current.x - prev.x);
double y = viewer.getCenter().getY() - (current.y - prev.y);... |
4e7dbc75-5e47-46a3-a117-1a66a11ecc11 | 8 | void generateTree(int nNodes) {
boolean [] bConnected = new boolean [nNodes];
// start adding an arc at random
int nNode1 = random.nextInt(nNodes);
int nNode2 = random.nextInt(nNodes);
if (nNode1 == nNode2) {nNode2 = (nNode1 + 1) % nNodes;}
if (nNode2 < nNode1) {int h = nNode1; nNode1 = nNode2; ... |
6138695e-394c-4690-bd23-0900584f5ba5 | 1 | public int getX(int index) {
if(index <= this.index)
return line[index][0];
else
return -1;
} |
b9f8f83b-3b08-411f-9a57-39cc0a457de8 | 0 | public void setReferenceList(ReferenceList value) {
this.referenceList = value;
} |
db27fb8f-02fa-47e4-b4de-d7c50850e068 | 8 | public SOM(GridType gridType, int[] gridParams, Node.CostMethod costMethod, Node.UpdateMethod updateMethod,
Node.NeighborhoodFunction neighborFunction, double initialLearningRate, DistanceFunction distFunction,
double initialRadius, double timescale, int nIterations, TwoMomentEnsemble ensemble, String variableNam... |
2991209f-7df9-4d09-b70b-6c3db752ae7f | 2 | @Override
public void processEntity(Entity entity) {
// Ensure that we also remove any children entites owned by the parent
Children childrenComponent = entity.getComponent(Children.class);
if (childrenComponent != null) {
for (Entity child : childrenComponent.children) {
entityManager.removeEntity(child)... |
628e3dd9-4332-4bd3-99f4-5d419518199a | 9 | public static int solution(int[] A) {
if(A.length == 0)
return -1;
int[] temp = new int[A.length];
for(int i = 0; i < A.length; i++)
temp[i] = A[i];
Arrays.sort(temp);
for(int i = 0; i < A.length; i++) {
int index = binarySearch(temp, 0, temp... |
c4da5560-e656-4a03-80f7-e26a0aaf21b4 | 9 | protected List<EmoteObj> parseEmotes()
{
if(emotes!=null)
return emotes;
broadcast=false;
emoteType=EMOTE_TYPE.EMOTE_VISUAL;
emotes=new Vector<EmoteObj>();
String newParms=getParms();
char c=';';
int x=newParms.indexOf(c);
if(x<0){ c='/'; x=newParms.indexOf(c);}
if(x>0)
{
final String oldParm... |
9fad878e-158c-4b45-90c6-0c56e1a3da27 | 9 | public static Keyword oldInterpretOrScores(ControlFrame frame, Keyword lastmove) {
if (lastmove == Logic.KWD_DOWN) {
{ PartialMatchFrame pmf = frame.partialMatchFrame;
if (pmf == null) {
ControlFrame.createAndLinkPartialMatchFrame(frame, Logic.KWD_OR);
}
else {
{
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.