method_id stringlengths 36 36 | cyclomatic_complexity int32 0 9 | method_text stringlengths 14 410k |
|---|---|---|
b4a80a07-52c6-4d7d-b3ca-d9545acbd2be | 7 | public static boolean languageDetected(String eadfile, String language, String langCode)
throws XMLStreamException, FactoryConfigurationError, IOException {
FileInputStream fileInputStreamEAD = new FileInputStream(eadfile);
XMLEventFactory eventFactory = XMLEventFactory.newInstance();
... |
4258eb37-0407-4201-8660-40dd6b4d69ff | 8 | public BalancedTreeNode<E> insert(BalancedTreeNode<E> node, E value) {
if(node == null) {
return new BalancedTreeNode<E>(value);
}
if(value.compareTo(node.value) < 0) {
node.left = insert(node.left, value);
if(height(node.left)-height(node.right) > 1) {
if(va... |
7b8882bd-a844-4188-b58f-f9eb143dc925 | 0 | public String getDestinationStation() {
return this._destinationStation;
} |
4294ad8e-d73b-4e5f-a970-4097a88e4c83 | 4 | public Queue getQueue(int queueId) throws QueueGetException, QueueDoesNotExistException {
try {
_out.writeInt(8); //Size
_out.writeInt(Response.MSG_QUEUE_GET);
_out.writeInt(queueId);
_out.flush();
int messageType = _in.readInt();
if(messa... |
cb395b8c-7d28-458d-b1b0-452d480483dd | 9 | public void setCellImages(Graphics g) {
Integer oilTemp[];
Integer gasTemp[];
LinkedList<Bid> bidQ;
LinkedList<SeismicRequest> seismicQ;
BufferedImage img = null;
//Graphics g = this.getGraphics();
//g.fillRect(5,5,100,100);
Grid grid = request.operator.getGrid();
bidQ = request.operator.getBidQueue(... |
6b20f263-ffcb-4258-82ee-9d14ec94579e | 8 | private void createNewClusters()
{
firstResultingCluster = new OrdinaryCluster(graph, this.firstResultingPIn,
this.firstExpectedSize);
secondResultingCluster = new OrdinaryCluster(graph, this.secondResultingPIn,
this.secondExpectedSize);
/*
* Save intra-cluster edges of initial cluster.
* As the ite... |
08c60a9d-3a8e-4e89-9a40-850df534b9ae | 7 | */
public void spaceHorizontal(FastVector nodes) {
// update undo stack
if (m_bNeedsUndoAction) {
addUndoAction(new spaceHorizontalAction(nodes));
}
int nMinX = -1;
int nMaxX = -1;
for (int iNode = 0; iNode < nodes.size(); iNode++) {
int nX = getPositionX((Integer) nodes.elementAt(iNode));
if (nX ... |
09cc4e60-227c-4ea8-97a0-122972dbfc45 | 9 | private void searchGoodChoice(List<String> choices) {
if(choices != null && !choices.isEmpty()) {
List<Keyword> keywordList = dictionary.getKeywordList();
int priority = -1;
float distance = 1;
int elementId = -1;
int elementIdRegardingDistance = 0;
for(int i = 0; i < choices.size(); i++) {
... |
2d696e51-705d-4f74-aab8-85b9717186d5 | 6 | public boolean checkDuplicateLoan(String memberID, String loantype)
{
String query = "";
if(!loantype.equals("A")) {
query = "select * from loan_hdr where memberid="+memberID+" and status='ACTIVE' and loantype='"+loantype+"'";
}
else
query = "select * from cas... |
1c412fec-a83d-488f-b1d2-88a5074588b1 | 8 | @Override
public String runMacro(HTTPRequest httpReq, String parm, HTTPResponse httpResp)
{
final java.util.Map<String,String> parms=parseParms(parm);
final String last=httpReq.getUrlParameter("DOMAIN");
if(parms.containsKey("RESET"))
{
if(last!=null)
httpReq.removeUrlParameter("DOMAIN");
return "";... |
480d53be-75cd-467c-a18f-c58609345340 | 9 | protected float calcDNode(LASTNode node) {
int prevNumeratorSum = 0;
int prevDenominatorSum = 0;
int nextNumeratorSum = 0;
int nextDenominatorSum = 0;
int communicationTime = 0;
for (List<LASTNode> group : groups) {
for (LASTNode prevNode : group) {
... |
3f44be15-dfb9-4b08-a860-39b0a4b9be08 | 0 | public void setUserId(String userId) {
this.userId = userId;
} |
87d0a073-20cc-49c1-94d5-ff08cad88551 | 1 | public void workWeek() {
for (int i=0; i<5; i++)
{
this.takeOrder();
this.deliverShake();
}
this.earnPaycheck();
this.setEffMult(1);
} |
2ae13199-6a04-467c-b3ab-c5e7d71378bd | 6 | private void printUpgradeTowerDef(Graphics g){
gui.print(g, selectedTowerDef.name, TEXT_HEIGHT_1);
gui.print(g, "upgrade cost: " + selectedTowerDef.cost, TEXT_HEIGHT_1);
gui.print(g, "level : " + selectedTowerDef.level, TEXT_HEIGHT_1);
gui.print(g, "damage : " + getComparingString(selectedTowerDef.damage, sele... |
6069d6e7-44ec-4c6b-bdac-c42785dfc2c5 | 7 | public void setOptions (String[] options)
throws Exception {
String optionString;
resetOptions();
optionString = Utils.getOption('R', options);
if (optionString.length() != 0) {
setRaceType(new SelectedTag(Integer.parseInt(optionString),
TAGS_SELECTION));... |
6c08c1ed-88b0-4f36-a2b5-c2a12613111c | 7 | public static void main(String argv[]) throws IOException, InterruptedException
{
//These variables should input from the GUI
int port = 8080;
String hostname = "localhost";
String sharedKey = "thequickbrownfox"; // length 16
UI ui = new UI();
ui.setState(0);
try
{
while(ui.getStart() == 0)
{... |
907404a6-c250-4c91-a96e-8dca5e02d1af | 1 | @Override
public void draw(Graphics page) {
planeImage.drawImage(page, xLocation, yLocation);//Draws the plane on the component
//Draws the collision Border
if(this.getBorderVisibility())
{
drawCollisionBorder(page,xLocation,yLocation,planeImage.getWidth(),planeImage.getHeight());
}
} |
93a8c50e-5cfd-4b73-bb43-0a659aac90e0 | 1 | public static void main(String[] args) {
System.out.print("Connecting to sql server...");
if(!Data.sqlConnect()) {
System.out.println("[failed]");
return;
}
System.out.println("[ok]");
System.out.print("Starting notification daemon...");
Notification.start_daemon();
System.out.println("[ok]");
Sys... |
3f92edc0-b103-46b2-b862-9242e097f352 | 9 | @Override
@ForceInline
public Stream<T> filter(Predicate<? super T> predicate) {
int op = OP_FILTER;
Object lambda = predicate;
int op0 = this.op0;
Object lambda0 = this.lambda0;
int op1 = this.op1;
Object lambda1 = this.lambda1;
int op2 = this.op2;
Object lambda2 = this.lambda2;
... |
96122aec-d866-4375-9d15-88aa952bb00a | 0 | public final void ReleaseStream()
{
Stream = null;
} |
6c740ffe-fb56-47a1-bf6b-01b33952a98d | 8 | @Override
public int compare(T o1, T o2) {
if (o1 == o2) {
return 0;
} else if (o1 == null || o2 == null) {
return o1 == null ? 1 : -1;
}
Class<?> o1c = o1.getClass();
Class<?> o2c = o2.getClass();
if (o1c == o2c) {
return compareSa... |
9819aed9-56f3-4465-a326-72bf9ad28368 | 3 | public boolean pelletAt(int x, int y) {
for (Pellet p : pellets) {
if (p.x == x && p.y == y) return true;
}
return false;
} |
43b0c0ae-d1cc-4e61-bcfb-2705ea3e5a84 | 7 | @Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null || this.getClass() != obj.getClass()) {
return false;
}
PngPixel other = (PngPixel) obj;
if (this.alpha != other.alpha || this.blue != other.blue || this.green != other.green || this.red != other.red) {
... |
21f1edb1-cab3-450c-a3a9-df7370467507 | 1 | private boolean isHorizontalEndOfBoard(long binPosition){
if( (binPosition & 0x81_81_81_81_81_81_81_81l) != 0 )
return true;
else
return false;
} |
058bf09b-0851-4f06-9525-b2948d824ea1 | 4 | private PodcastModel[] readResult() {
try
{
logger.info("Enter readResult(): "+numberOfResults);
PodcastModel[] podcastModels = new PodcastModel[numberOfResults];
for (int i = 0; i < numberOfResults; i = i + 1)
{
if (!res.next()) break;
... |
5020c5fa-74cd-4010-ad42-bc96520e3ec2 | 3 | public void run() {
while(true) {
byte data[]=new byte[1024];
DatagramPacket packet=null;
packet=new DatagramPacket(data,data.length,group,port);
try {
socket.receive(packet);
String message=new String(packet.getData(),0,packet.getLength()); //ȡݱе
inceAr.setText("ڽܵݣ\n"+message);
inced.app... |
3a1a6dae-91c2-4ebf-a71d-6c7e7b4964d2 | 0 | public final void show() {
stage.show();
} |
40c0b01d-a464-41fb-b2cd-b0a2c1a9067e | 6 | public int numberOfFailedSubgoals() {
{ WhynotPartialMatch self = this;
{ Justification proof = ((Justification)(KeyValueList.dynamicSlotValue(self.controlFrame.dynamicSlots, Logic.SYM_LOGIC_JUSTIFICATION, null)));
{ MemoizationTable memoTable000 = null;
Cons memoizedEntry000 = null;
... |
b238bf68-429a-4e04-8e64-b6edb8fbd5fe | 0 | private void okButtonActionPerformed(ActionEvent e) {
setVisible(false);
} |
3184d51d-f328-4f84-ab74-197806064e3e | 6 | private void parse(List<String> input) {
String token = input.remove(0);
if ("n".equals(token)) {
token = input.remove(0);
} else {
throw new IllegalArgumentException("Relation must start with 'n'.");
}
if ("mod".equals(token)) {
mod = Integer.parseInt(input.remove(0));
token = input.remove(0);... |
97ed5e21-9c85-4192-b271-38c61e037daf | 6 | public void keyPressed(KeyEvent e) {
int key=e.getKeyCode();
if(key==KeyEvent.VK_UP)
dy=-SPEED;
if(key==KeyEvent.VK_DOWN)
dy=SPEED;
if(key==KeyEvent.VK_RIGHT)
dx=SPEED;
if(key==KeyEvent.VK_LEFT)
dx=-SPEED;
if(key==KeyEvent.VK_SPAC... |
534f84e0-9518-4fcf-96a2-6d798bb0594e | 6 | private void disableNewFolderButton(Container c) {
int len = c.getComponentCount();
for(int i=0; i<len; i++) {
Component comp = c.getComponent(i);
if(comp instanceof JButton) {
JButton b = (JButton)comp;
Icon icon = b.getIcon();
if(... |
4bc09f68-488a-42f9-b3e8-273e181ec308 | 1 | public void testCompareTo() {
Duration test1 = new Duration(123L);
Duration test1a = new Duration(123L);
assertEquals(0, test1.compareTo(test1a));
assertEquals(0, test1a.compareTo(test1));
assertEquals(0, test1.compareTo(test1));
assertEquals(0, test1a.compareTo(test1a));... |
2144adef-e317-4e13-8a62-fc0aff167403 | 0 | public void keyTyped(KeyEvent e){
} |
028207df-8464-49f3-adaf-4ca5d5cd9cf2 | 4 | @Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Klas other = (Klas) obj;
if (id != other.id)
return false;
return true;
} |
4c4d5a6b-feed-4205-9631-ea4975f0a157 | 7 | public void updateWeightDataset(int step) {
if (datasetWeight == null) {
datasetWeight = new DefaultTableXYDataset();
weightSeries = new HashMap<>();
for (Double weight = 0d; weight < bpgHistory.maxApplicationSize; weight++) {
weightSeries.put(weight, new XYSe... |
1bd6e2e4-c476-4094-9e61-6842b46f7299 | 1 | @Override
public View<?> getView() {
return null;
} |
b30644bd-cf91-468d-8e62-66d0f38250a5 | 1 | public static void createGame()
{
try
{
AppGameContainer app = new AppGameContainer(new GameFrame());
app.setDisplayMode(viewW, viewH, false);
app.setVSync(true);
app.start();
}
catch (SlickException e)
{
e.printStac... |
33225bac-1faf-404e-92e7-9882b243e1f5 | 6 | @SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
jScrollPane1 = new javax.swing.JScrollPane();
forumTable = new javax.swing.JTable();
jLabel1 = new javax.swing.JLabel();
CancelButton = new javax.... |
5b81c56e-4f1c-4c60-9b49-0f7a8be12b46 | 4 | public static String getPropertyName( int index )
{
switch(index)
{
case 0 : return "russian" ;
case 1 : return "chinese" ;
case 2 : return "japanese" ;
case 3 : return "arabic" ;
}
return "?" ;
} |
527de535-8605-47f7-89a9-54313ff945d4 | 5 | private TreeExpansionListener createTreeExpansionListener() {
return new TreeExpansionListener() {
public void treeExpanded(TreeExpansionEvent event) {
onExpandedOrCollapsed(event, true);
}
public void treeCollapsed(TreeExpansionEvent event) {
... |
9c6fca20-29eb-4b60-bd27-8c5c22ded80e | 6 | public static final boolean isRecoveryIncSkill(final int id) {
switch (id) {
case 1110000:
case 2000000:
case 1210000:
case 11110000:
case 4100002:
case 4200001:
return true;
}
return false;
} |
848b545b-0fb9-4f90-a258-9d6e77b2e87c | 2 | @Override
public synchronized boolean isValid(final Gene[] genes, final Supergene supergene) {
subset.clear();
int previous = -1;
for (final Gene gene : genes) {
final int element = (Integer) gene.getAllele();
if (element <= previous) {
// force incre... |
d9f85228-42a4-4663-b74f-1921a2db1301 | 2 | @Override
protected Client tryAccept() throws IOException
{
packet.clear();
InetSocketAddress address = (InetSocketAddress)channel.receive( packet );
UdpServerClient newClient = null;
if (address != null)
{
UdpServerClient c = clientMap.get( ... |
9f343b83-f27d-4de8-bbad-4c39dcef5d70 | 0 | public void saveFunctionArgs(List<Integer> functionArgList) {
savedArgs = functionArgList;
} |
40d0c530-fecf-420b-86bf-e17bcd5d7a74 | 1 | public void visitInnerClass(String name, String outerName,
String innerName, int access) {
super.visitInnerClass(remapper.mapType(name), outerName == null ? null
: remapper.mapType(outerName), innerName, // TODO should it be
// changed?
access);
} |
0bd27d82-88e1-4f05-81c5-14c01fcf5baa | 5 | public JSONObject increment(String key) throws JSONException {
Object value = opt(key);
if (value == null) {
put(key, 1);
} else if (value instanceof Integer) {
put(key, ((Integer)value).intValue() + 1);
} else if (value instanceof Long) {
put(key, ((L... |
6deadb8d-3df7-4d74-ad39-95564aeea1ac | 4 | public SimulationResults startSimulation() throws InterruptedException {
this.timeParameters = new TimerParameters(this.configuration);
AutomatonTestRunner runner = new AutomatonTestRunner(loadScripts(timeParameters));
this.timer.scheduleWithFixedDelay(runner, 0 , this.timeParameters.getDelay(), TimeUnit.MILLISEC... |
c8fcb753-1c15-4d22-abf7-31ddf2c0d331 | 3 | public List<Booking> findStudentBookingsByMonthAndYear(Student student,
Calendar date) {
List<Booking> b = new ArrayList<Booking>();
Iterator<Booking> iter;
iter = student.getBookings().iterator();
while (iter.hasNext()) {
Booking booking = iter.next();
if ((booking.getDate().get(Calendar.MONTH) == dat... |
54dd9c5f-51cc-4b44-b564-9675493e79a2 | 1 | public void updatePeopleComboBox() {
peopleProjectComboBox.removeAllItems();
String[] people_projName_strArray = projectTableController.getProjNameComboBoxesData();
for(String str : people_projName_strArray) {
peopleProjectComboBox.addItem(str);
}
} |
467c47bd-8f2d-4c27-bf15-0e8c903ad715 | 5 | private final String getChunk(String s, int slength, int marker)
{
StringBuilder chunk = new StringBuilder();
char c = s.charAt(marker);
chunk.append(c);
marker++;
if (isDigit(c))
{
while (marker < slength)
{
c = s.charAt(marker... |
8e719386-c7ef-4985-8ce6-b828d62ddd5f | 1 | public void enableCards(boolean s) {
for (Card value : View.cards.values()) {
value.btn.setEnabled(s);
}
} |
34af009e-7546-4e8e-98bf-dc51839281f6 | 8 | public void backtrack(int i) {
if (i>=sets.size())
return;
if (Solve.size() < bestSolve.size()) {
Solve.add(i);
if (!Check(Solve)) {
backtrack(i + 1);
} else {
if (Solve.size() <= bestSolve.size()) {
best... |
123f1948-4528-4e46-ac53-e9722cdf735d | 6 | public static Cons cppTranslateMethodCodeSignature(Cons signature) {
{ Cons translatedreturntypes = Stella.NIL;
Cons translatedparametertypes = Stella.NIL;
StringWrapper translatedobjecttype = StandardObject.cppTranslateTypeSpec(((StandardObject)(signature.rest.value)));
{ Stella_Object returntyp... |
616567a8-c7b4-40d6-9a34-e928b04e600b | 3 | private void secredMessage(ServerClient activeclient, Msg nextCMD)
{
for (ServerClient soth : connectedClients)
{
if (soth.getNickname().equals((String) nextCMD.getObject()))
{
soth.getSt().writeMsg(soth.getClientsocket(), soth.getOut(), new Msg((String) nextCMD.getContent(), activeclient.getNickname(), ... |
870f6aa0-30ca-4269-8861-ffa7222ae80b | 7 | public void Swap(Node a, Node b,Lista lista){
if(a.getPrev()==null && b.getNext()==null){
Node tmp= a.getNext();
a.setNext(null);
a.setPrev(b.getPrev());
b.getPrev().setNext(a);
b.setPrev(null);
b.setNext(tmp);
tmp.setPrev(b);
... |
579c18aa-b6f9-4e39-a970-915877ff8e72 | 7 | public void testValid3() {
setTree(new TreeNode("dummy"));
TreeNode root = new TreeNode("root", 1);
TreeNode subtree = new TreeNode("subtree", 1);
TreeNode leaf = new TreeNode("leaf");
root.branch[0] = subtree;
subtree.branch[0] = leaf;
Map tree = Collections.sync... |
f5c130d5-5da3-4b16-bc73-4fdd46572fe4 | 5 | public synchronized String getListOfAllUsers(boolean online){
StringBuilder userList= new StringBuilder();
for (User userFound : _users.values()){
String username= userFound.getUsername();
if ((online) && (userFound.isLoggedIn())){
if (!username.equals("server"))
userList.append(use... |
dce96ec9-4b51-4cf9-9af9-abb105a7f19a | 5 | private long toDays() {
switch (type) {
case SECONDS:
return value / (3600 * 24);
case MINUTES:
return value / (60 * 24);
case HOURS:
return value / 24;
case DAYS:
return value;
case MILLI... |
ec61c97f-034c-47a6-81a7-a39589fdb528 | 2 | @Override
public long[] allSimilarItemIDs(long arg0) throws TasteException {
FastIDSet allSimilarItemIDs = new FastIDSet();
LongPrimitiveIterator allItemIDs = movieMap.keySetIterator();
while (allItemIDs.hasNext()) {
long possiblySimilarItemID = allItemIDs.nextLong();
double score = ite... |
59b5633e-3121-4cb7-8be8-0628e78f52a9 | 0 | public void setThickness(int thickness) {
this.thickness = thickness;
} |
63f47a20-7f6d-4b35-bd4e-d0171723844b | 4 | public boolean eq(Matrix B) {
Matrix A = this;
boolean isEqual = false;
if (B.M != A.M || B.N != A.N) throw new RuntimeException("Illegal matrix dimensions.");
for (int i = 0; i < M; i++)
for (int j = 0; j < N; j++)
isEqual = A.data[i][j] == B.data[i][j];
... |
7c3adbce-a7cf-42c3-818f-117a305819d1 | 7 | public ArrayList<SlaveVM> requestVMs(int count) {
ArrayList<SlaveVM> vms = new ArrayList<SlaveVM>();
if (vmsInUse.size() >= maxVMs)
return null;
if (vmsAvailable.size() > count) {
for (int i = 0; i < count; i++) {
vms.add(getAvailableVM());
}
} else {
try {
for (int i = 0; i < (count - avail... |
2c878ee4-ff80-469a-8762-ca9958fc7a56 | 9 | private void checkCollisions() throws IOException {
// On va se servir des rectangles pour définir si oui ou non on a
// collision
Rectangle r1 = vaisseau.getBounds();
// Collision entre VAISSEAU - MOUTON
for (int j = 0; j < mouton.size(); j++) {
Mouton a = (Mouton) mouton.get(j);
Rectangle r2 = a.get... |
7018ac3a-4685-4d2b-a867-d881771515d5 | 1 | public void testWithFieldAdded_DurationFieldType_int_3() {
LocalTime test = new LocalTime(10, 20, 30, 40);
try {
test.withFieldAdded(null, 6);
fail();
} catch (IllegalArgumentException ex) {}
} |
f73da1c3-3fa8-45d3-8972-06746b8d7641 | 1 | public void toggleMasterHUD() {
HUD hud = null;
for (int i = (huds.size() - 1); i >= 0; i--) {
hud = huds.get(i);
hud.toggleMasterHUD();
}
checkRestoreCuror();
} |
1beba0f1-ceca-497b-a9be-289c2be5f238 | 1 | public void uimsg(String msg, Object... args) {
if(msg == "chnum") {
setlabel((Integer)args[0], (Integer)args[1], (Integer)args[2]);
} else {
super.uimsg(msg, args);
}
} |
460f8c42-2d62-424c-839b-9976fa2176cb | 2 | public String getNodes() {
String nodes = "";
String[] nodeArray = getProperty(NODES_PROPERTY).split(",");
for (int i = 0; i < nodeArray.length; i++) {
if (i != 0)
nodes += ",";
nodes += "http://" + nodeArray[i] + ":8091/pools";
}
return no... |
bb2b4eb5-af48-4a86-ae39-f52851d60417 | 0 | @Override
public void writeExternal(ObjectOutput out) throws IOException {
} |
631007ce-1460-4b75-80ff-e34fcda9a42e | 0 | @Required
public void setMainWindowModel(MainWindowModel mainWindowModel) {
this.mainWindowModel = mainWindowModel;
this.dataModel = new DataModel();
this.dataModel.setMainWindowModel(this.mainWindowModel);
addModel(this.mainWindowModel);
mainWindowModel.setDefaults();
} |
b289db08-8ea4-4691-86bb-7de0248f44f0 | 3 | public Integer[] getAllUserFormIds(int userId) {
try {
String q = "select * from form where ownerid = ?";
PreparedStatement st = conn.prepareStatement(q);
st.setInt(1, userId);
ResultSet rs = st.executeQuery();
conn.commit();
ArrayList <Inte... |
81107b5c-6f83-4501-852a-304150add6c2 | 4 | public static LinkedList createRate(String filename, double[] percentage)
{
if (percentage == null) {
return null;
}
LinkedList routerList = null;
try
{
// check whether the total percentage is greater than 100%
double total = 0;
... |
706dbc02-d403-4672-9790-53c18f54c897 | 5 | public void setFileName( String fn )
{
this.fileName.setText( fn ); //set filename
//determine file type
int index = fn.indexOf(".");
fn = fn.substring( index+1 );
if( fn.equalsIgnoreCase( "bmp" ) )
this.fileType.setText( "Bitmap (.bmp)" );
else if( fn... |
547fd618-6920-4392-8101-a12f27cc905d | 6 | private ArrayList<Action> findPathsFromActionMap(
int goalRowID, int goalColID, int goalDrcID) {
//int startRowID,int startColID,int startDrcID) {
ArrayList<Action> actions = new ArrayList<>();
//Find the action min distance
int rowID = goalRowID;
int colID = goalColID;
int drcID = goalDrcID;
wh... |
343298d8-57e6-4be1-9657-56a2dc04c7ad | 2 | public Value newValue(final Type type) {
if (type == Type.VOID_TYPE) {
return null;
}
return new SourceValue(type == null ? 1 : type.getSize());
} |
a0e92e7d-2974-45a8-acef-72d7b6df411c | 8 | public ImagePanel(ImageBrowser2DGui g, Image i, int x, int y, int width, int height) {
super(true);
this.gui = g;
this.image = i;
Dimension d = new Dimension(width, height);
setSize(d);
setMaximumSize(d);
setMinimumSize(d);
setPreferredSize(d);
setForeground(Color.white);
setBackground(Color.bla... |
15a91cfc-3415-4e08-b0be-d52b929634a4 | 1 | @Override
public void evaluateLabels(Map<String, Integer> labelValues, int position)
throws TokenCompileError {
lastKnownWordCount = 0;
for(UnresolvedData data : dataList) {
data.evaluateLabels(labelValues, position+lastKnownWordCount);
lastKnownWordCount += data.word... |
f1c8ed04-8aa9-4660-b99e-90b3fb650908 | 6 | public void loadPermission()
{
if(Bukkit.getPluginManager().isPluginEnabled(pex))
{
this.activePermissions = "PermissionsEx";
}
else if(Bukkit.getPluginManager().isPluginEnabled(gm))
{
this.activePermissions = "GroupManager";
}
else if(Bukkit.getPluginManager().isPluginEnabled(pb))
{
this.acti... |
487ff5c0-b4ce-49a1-84b5-9749441ae614 | 0 | public EntityListener(TotalPermissions p) {
plugin = p;
} |
1817071b-f041-4d0d-8826-6012e4e2bad9 | 7 | public static <N, E> double dijkstra(Graph<N, E> g, N startNode, N targetNode) {
// get list of all nodes
Collection<N> nodes = g.getNodes();
// preconditions
// make sure nodes exist
assertTrue(nodes.contains(startNode));
assertTrue(nodes.contains(targetNode));
... |
6159e10f-4246-4fd2-8389-33a4ff0102e0 | 0 | public String getName() {
return name;
} |
ce0ad888-31a6-497a-b1ec-7ba388b2b41c | 9 | @Override
public void run() {
String line;
Scanner in = new Scanner(System.in);
while (true) {
System.out.print("> ");
line = in.nextLine().trim().toLowerCase();
Iterator<String> tokens = Arrays.asList(line.split("\\s+")).iterator();
String command = tokens.next();
if (command.startsWith("exit")) ... |
ee780b8d-642a-4dc9-a772-c226240e6519 | 3 | @Override
public void action() {
parentAgent = (HospitalAgent)this.myAgent;
ACLMessage msg = this.parentAgent.blockingReceive(MessageTemplate.MatchPerformative(ACLMessage.REQUEST));
ACLMessage reply;
int allocation = 0;
for (int i = 1; i <= this.parentAgent.getNumAppointment(); i++){
if(this.parent... |
4c8b2fb8-2604-4118-9663-8bb969132ce7 | 6 | public static List<X509Certificate> extractX509CertChainFromKeyInfo(
KeyInfo keyInfo) {
List<X509Certificate> chain = new ArrayList<X509Certificate>();
List<?> keyInfoContent = keyInfo.getContent();
for (Object o : keyInfoContent) {
if (o instanceof X509Data) {
X509Data x509Data = (X509Data) o;
Lis... |
d978c0f6-2a26-43f9-9e1a-8d8752e7ca5c | 1 | @Override
public String format(Date fromObject) {
try{
return forFormatting.format(fromObject);
}
catch(Exception e){
}
return null;
} |
eade2acd-cd02-43d6-853d-d2a62851198c | 3 | public void setPreserved() {
if (!preserved) {
preserved = true;
Identifier ptr = this;
while (ptr != null) {
ptr.setSinglePreserved();
ptr = ptr.left;
}
ptr = right;
while (ptr != null) {
ptr.setSinglePreserved();
ptr = ptr.right;
}
}
} |
24a03740-9f7b-4099-bf32-3cd9846ae798 | 0 | public String getNombreRol() {
return nombreRol;
} |
5a409402-a9ff-4444-9591-d123189755e6 | 5 | @Override
public boolean equals(Object obj) {
if (this == obj) return true;
if (obj == null || getClass() != obj.getClass()) return false;
RomanSymbol that = (RomanSymbol) obj;
return value == that.value && !(symbol != null ? !symbol.equals(that.symbol) : that.symbol != null);
... |
b08a1b3d-e45b-4287-a6c5-37cfcff60437 | 6 | public static boolean canCastleRight(GameBoard board, int color, int col, int row)
{
if (col + 2 >= GameBoard.WIDTH) // out of bounds
return false;
if (!allowedCastling(board, color, col, row, true)) {
return false;
}
if (board.isEmpty(Position.get(col + 1, row)) && board.isEmpty(Position.get(col +... |
f92c6515-927f-4451-b3e8-c0eea59c04b6 | 7 | static final void method3141(boolean bool, byte i) {
if (Class348_Sub40_Sub8.gameConnection != null) {
Class348_Sub40_Sub8.gameConnection.method1700((byte) 36);
Class348_Sub40_Sub8.gameConnection = null;
}
anInt9437++;
Class225.anInt2955 = 0;
Class348_Sub18.method2938((byte) 87);
Mob.method2433();
if (... |
4148ac61-016b-4b49-8724-72e4f0c4f1b1 | 6 | public int smithXP(int barType, int barAmount) {
if (barType == 2349) return barAmount*29;
if (barType == 2351) return barAmount*25;
if (barType == 2353) return barAmount*38;
if (barType == 2359) return barAmount*50;
if (barType == 2361) return barAmount*75;
if (barType == 2363) return barAmount*75;
setAnimation... |
218286c1-5700-4737-8944-f3063b869526 | 2 | public void makePayment(long id) {
Query q = em.createQuery("SELECT t from BookingEntity t");
for (Object o : q.getResultList()) {
BookingEntity p = (BookingEntity) o;
if (p.getId() == id) {
p.setStatus("paid");
}
}
} |
23cade11-5b10-4d96-bf59-588197754b66 | 7 | @Override
public void visitMethodInsn(final int opcode, final String owner,
final String name, final String desc) {
boolean itf = opcode == Opcodes.INVOKEINTERFACE;
Item i = cw.newMethodItem(owner, name, desc, itf);
int argSize = i.intVal;
// Label currentBlock = this.cur... |
ad51975f-e776-4144-bf1d-53906392f607 | 0 | public int availableCount()
{
return availableConnections.size();
} |
ca557107-07ad-4ba5-9863-2027c111dfdc | 5 | final void L(int i, int i_226_, int i_227_) {
for (int i_228_ = 0; i_228_ < aClass167Array7480.length; i_228_++) {
Class167 class167 = aClass167Array7480[i_228_];
((Class167) class167).anInt2192 = i & 0xffffff;
int i_229_ = ((Class167) class167).anInt2192 >>> 16 & 0xff;
if (i_229_ < 2)
i_229_ = 2... |
6250c3bf-8e84-4ae2-b64f-7242a01ec99f | 0 | public void saveFunctionAddress(int address) {
savedFunctionAddress = address;
} |
24a13d11-b946-4514-9f72-45e0658d9648 | 1 | public static void main(String[] args) {
for (int i = 0; i < 5; i++)
new SimpleThread();
} |
5bc39249-ce68-4e94-8f28-1b1996d8f6ee | 5 | public static void main(String[] args){
Scanner in = new Scanner(System.in);
int n=in.nextInt();
int m = in.nextInt();
int[] ori = new int[n];
int[] points = new int[n];
int[] color = new int[101];
for(int i=0;i<n;i++){
ori[i]=in.nextInt();
points[i]=ori[i];
}
for(int i=0;i<101;i++) color[... |
abd522f2-991d-42cf-a097-867d547bc767 | 6 | public static void DoTurn(PlanetWars pw) {
double score = Double.MIN_VALUE;
Planet source = null;
Planet dest = null;
// We try to simulate each possible action and its outcome after two turns
// considering each of my planets as a possible source
// and each enemy planet as a possible destinatio... |
f6c504ab-44e5-4ed4-9cda-11085e1b3929 | 7 | @Override
public String makeMobName(char gender, int age)
{
switch(age)
{
case Race.AGE_INFANT:
case Race.AGE_TODDLER:
return name().toLowerCase()+" puppy";
case Race.AGE_CHILD:
switch(gender)
{
case 'M':
case 'm':
return "boy " + name().toLowerCase() + " puppy";
case 'F':
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.