method_id stringlengths 36 36 | cyclomatic_complexity int32 0 9 | method_text stringlengths 14 410k |
|---|---|---|
44993a2c-2547-469d-9ba5-1ffd8fceeef8 | 6 | public static Queue<Token> infixToPostfix(Queue<Token> infix) {
Queue<Token> postfix = new LinkedQueue<Token>();
Stack<Operator> operatorStack = new LinkedStack<Operator>();
//Begin expression token
operatorStack.push(new Operator("S"));
while (!infix.empty()) {
Tok... |
56eaf862-b4ba-4344-ac86-f6844a40d8f6 | 0 | public int getMaxHealth() {
return maxHealth;
} |
1d536032-2901-4887-ad72-4bf8cbec3ae1 | 2 | @Override
public boolean reachesDestination(Packet p) {
if(p.edge != null)
etxLink = ((WeightEdge) p.edge).getEtx();
float r = (float) ud.nextSample();
//System.out.println("De node="+p.origin.ID+" Para Node="+p.destination.ID);
//System.out.println("r = "+String.format("%.2f", r)+", extLink = "+S... |
81c7a592-58df-4aec-aa28-f9b6f7fa59ca | 1 | public StructuredBlock appendBlock(StructuredBlock block) {
if (outer instanceof ConditionalBlock) {
IfThenElseBlock ifBlock = new IfThenElseBlock(
((ConditionalBlock) outer).getInstruction());
ifBlock.moveDefinitions(outer, this);
ifBlock.replace(outer);
ifBlock.moveJump(outer.jump);
ifBlock.setT... |
5c04b37e-c6e4-42ae-8989-3f30b540dd11 | 5 | public boolean equals( Object other )
{
Variant otherV = (Variant)other;
return this.versions.equals(otherV.versions)
&& this.startIndex == otherV.startIndex
&& this.endIndex == otherV.endIndex
&& this.startOffset == otherV.startOffset
&& this.mvd == otherV.mvd
&& this.equalsContent(otherV);
} |
21e91369-1019-49f5-a321-0e9e96ee679d | 8 | private boolean findActivityInAndBlock(Activity prevAct, ActivityNode actNode, AndSplit andSplit, ProcessModel model) {
List<ProcessNode> differentBranchNodes = new ArrayList<ProcessNode>();
for (ProcessEdge edge : model.outgoingEdgesOf(andSplit)) {
List<ProcessNode> branchNodes = new ArrayList<ProcessNode>();
... |
360d5961-ee63-4859-b445-2ca5fff80fe4 | 4 | public final Program mutate() {
final int mutationRate = Parameter.MUTATION_RATE.getValue();
if (Parameter.getNextRandomInt(Parameter.PERCENT) >= mutationRate) {
return new Program(commands);
}
/* mutation! */
final Vector<Command> newCommands = new Vector<Command>(c... |
5989360d-8be4-4b0c-92c8-e8287a5167e2 | 7 | @Override
public String webServiceRequest(String[] reqArgc) {
String rspXMl = null;
Service service =new Service();
Call call;
String urlStr = reqArgc[1];
try {
if (urlStr.indexOf("https")>=0 && urlStr.endsWith("?wsdl"))
urlStr = urlStr.replaceAll("\\?wsdl$", "");
log.debug("url = "+urlStr)... |
87e25932-ffdb-4bb9-8f06-a656310bc0e9 | 0 | public void prepareUserDetailsView(String name) {
setUserName(name);
setLoginField(name);
setTitle(name);
setVisible(true);
} |
94cf0980-9e17-4c1f-afd7-31438dc50a6f | 0 | public JButton getjButtonNext() {
return jButtonNext;
} |
64d39acb-998e-40ed-9d04-f1442d2587b8 | 0 | public static void main(String []args)
{
ConfigFile tst = new ConfigFile();
System.out.println(tst.GetConfig("router","pulse"));
} |
5cceb6ff-929d-48db-aa0c-66d023f64ca3 | 5 | public void createSelectionListener() {
selectionListener = new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent event) {
Widget widget = event.widget;
if (widget == addButton) {
addPressed();
... |
db0b7938-f5f9-4b3e-8f36-38afe7a81ec0 | 7 | public boolean findInBucket(long hash, byte[] k, SearchResult out){
final int startSubIdx = subIdxForHash(hash);
for(int offset = 0; offset < recordsPerBucket; offset++){
final int subIdx = (startSubIdx + offset) % recordsPerBucket;
final long subPos = subPosForSubIdx(pos, subIdx);
final RecordPt... |
ad46177c-be3a-4959-9128-ca146555474b | 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 Diagnostico)) {
return false;
}
Diagnostico other = (Diagnostico) object;
if ((this.idDiagnostico == null && ot... |
aa1691f9-56cc-4a9c-ba38-f1dc4170e1db | 0 | public void setCtrIdElemento(int ctrIdElemento) {
this.ctrIdElemento = ctrIdElemento;
} |
7a4991db-91de-481f-95c1-35951e64564b | 0 | public Producto getProducto() {
return producto;
} |
a39ea289-3919-4bf4-a3dc-cf5e75448b07 | 5 | static void checkConstant(final Object cst) {
if (!(cst instanceof Integer) && !(cst instanceof Float)
&& !(cst instanceof Long) && !(cst instanceof Double)
&& !(cst instanceof String)) {
throw new IllegalArgumentException("Invalid constant: " + cst);
}
} |
64c11003-461b-4f12-ba5e-f283c3a535d3 | 4 | public void body()
{
Sim_event ev = new Sim_event();
// wait for shutdown message from all users.
// NOTE: this can cause GridSim to be hanged if numUser_ doesn't match
// with number of user entities given during GridSim.init().
for (int i = 0; i < numUser_; i++) {
... |
6cb0a31e-d698-4d12-aaae-ab7c7f2ffb61 | 0 | private void initComponents() {
this.setPrefHeight(AppSettings.getIntegerValue("header.min.height"));
this.setMinHeight(AppSettings.getIntegerValue("header.min.height"));
this.setMaxHeight(AppSettings.getIntegerValue("header.min.height"));
Region spacer = new Region();
HBox.setHgrow(spacer, Priority.ALWAYS)... |
8c8f69ea-39bb-40af-ac84-8ef06018efb0 | 7 | public boolean isPojo() {
if (isPrimitive()) {
return false;
}
if (isLikeString()) {
return false;
}
if (isDatetime()) {
return false;
}
if (isArray() || isIterable() || isIterator() || isMap()) {
return false;
}
return true;
} |
32db1d0f-9932-4c3a-88dd-7ea0f587ba95 | 2 | public int getNumUnpinnedBuffers()
{
int numBuffers = mgr.getNumBuffers();
int answer = 0;
for ( int index=0; index < numBuffers; ++index )
if ( (mgr.frameTable())[index].pin_count() == 0 )
++answer;
return answer;
} |
7d79e2ae-83e3-40ca-80e0-e13c7644724e | 4 | @Override
public void onUnitCreate(Unit unit) {
// Find the request the unit fulfills.
StartedBuildRequest started = null;
for (StartedBuildRequest request : startedRequests) {
if (request.getRequest().getUnit().equals(unit.getType())) {
started = request;
break;
}
}
// Remove the request
i... |
75d80a78-ea9f-4923-a5be-a1783f0e6433 | 5 | private Node getIntersectingNode( Node u, Arc a ) throws Exception
{
Node v;
Arc b = unattached.getIntersectingArc( a );
if ( b != null )
{
if ( b.isHint() )
{
v = b.from;
if ( unattached.removeEmptyArc(b,a.versions) )
nArcs--;
}
else
v = u;
}
else
{
v = u;
Iterator<Nod... |
a2023bcf-718b-43c1-b24f-a15dad20ef35 | 8 | public void decode() {
//First check if this file contains the magic number(Is compressed with this algorithm)
try {
if(iFile.readChar() == 'H' && iFile.readChar() == 'C') {
boolean bit;
head = new HuffmanNode();
HuffmanTree.buildHuffmanTree(iFile, head); //Rebuild serialized tree
if(head.i... |
a1e3ce40-4654-4356-85dc-8cd01c80f94f | 9 | public Integer getElementCount(Class<? extends State> state) {
// Initialize a temporary counter
//
Integer count = 0;
// Process the special case of a null parameter
//
if (state == null) {
for (Element[] w : population) {
for (Element e : w)... |
548a4b95-43b2-4f3c-9bef-9d030d800df7 | 0 | private Axis(String value) {
_value = value;
} |
b9cf2143-32b4-4066-9beb-7faf70820909 | 4 | private static boolean isPosMessage(AisMessage aisMessage) {
switch (aisMessage.getMsgId()) {
case 1:
case 2:
case 3:
case 18:
return true;
default:
return false;
}
} |
2c6a755d-86f2-4d39-91db-e7098d0c895b | 8 | public boolean execute(){
//execute master_node. waiting for input and choose a slave to do the command.
Scanner sca = new Scanner(System.in);
try {
String local = InetAddress.getLocalHost().getHostAddress();
System.out.println(local);
} catch (UnknownHostException e) {
e.printStackTrace();
}
... |
c25a3d18-cdf0-4303-92a2-e1ebbb1cc427 | 3 | public LabeledGenome<LabelGene> merge(LabeledGenome<LabelGene> other) {
if(size()!=other.size()){
throw new IllegalArgumentException("Sizes of genomes mismatch");
}
int splitPoint = new Random().nextInt(this.size());
double splitGeneLocation = this.get(splitPoint).getGeometry().getCentroid().getX();
Labele... |
62212351-eec7-4373-83ce-1505c1083186 | 2 | public Player(Grid grid, int playerNumber, Position beginPosition) {
super(grid);
if (beginPosition == null || playerNumber <= 0)
throw new IllegalArgumentException("The given arguments are invalid!");
this.playerNumber = playerNumber;
this.beginPosition = beginPosition;
} |
aeae462c-9962-424c-8e15-fb98e36e2029 | 3 | private boolean isValidTeleporterCoverage(Grid grid) {
int teleportCount = 0;
for (Element e : grid.getElementsOnGrid())
if (e instanceof Teleporter)
teleportCount++;
if (teleportCount * 100 / grid.gridSize() <= 3)
return true;
return false;
} |
8f70a6e4-42f8-49c9-bfe2-46549fd79481 | 1 | @SuppressWarnings("unchecked")
public List<T> findByNamedQuery(String queryName, Map<String, Object> queryParams) {
String[] params = new String[queryParams.size()];
Object[] values = new Object[queryParams.size()];
int index = 0;
for (String s : queryParams.keySet()) {
... |
4715ed65-0c16-41c0-8c51-b94fcf651aa7 | 5 | public MessageR oplus(NodeFunction sender, NodeVariable x, FunctionEvaluator fe, LinkedList<MessageQ> messagelist) {
HashMap<NodeVariable, MessageQ> modifierTable = new HashMap<NodeVariable, MessageQ>();
Iterator<MessageQ> iterator = messagelist.iterator();
while (iterator.hasNext()) {
... |
9ac9d6ba-ed91-4339-a4f7-2afc8110591c | 7 | public void testLargeRetransmission() throws Exception {
a.setReceiver(new MyReceiver());
b.setReceiver(new MyReceiver());
c.setReceiver(new MyReceiver());
List<Integer> la=((NAKACK_RetransmitTest.MyReceiver)a.getReceiver()).getList();
List<Integer> lb=((NAKACK_RetransmitTest.MyR... |
adeed246-a479-4992-9b9c-5165deba52a1 | 2 | private void readProperties() {
try {
this.properties = new Properties();
File propertiesFile = new File(this.pathToJar + File.separatorChar + CONFIG_NAME);
if (!propertiesFile.exists()) {
try (FileOutputStream propertiesOut = new FileOutputStream(propertiesF... |
b4feabbf-508b-4711-9f2f-e4029230cfa0 | 4 | public static int[] shellSort(int array[]){
int incr,i,temp,j;
int num = array.length;
for (incr = num / 2; incr > 0; incr /= 2){
for (i = incr; i < num; i++){
temp = array[i];
for (j = i; j >= incr; j -= incr){
if (temp < array[j - incr]) {
array[j] = array[j - incr];
}
... |
31616a3a-f2a1-4667-9d3a-67dbcd4c8828 | 9 | void loadCustomConfig() {
getPayedCmd = config.getString(GETPAYED_CMD);
helpOption = config.getString(HELP_OPTION);
getPayedCmdDescription = config.getString(GETPAYED_CMD_DESCRIPTION);
getPayedCmdPermDescription = config.getString(GETPAYED_CMD_PERM_DESCRIPTION);
displayHelpMessage = config.getString(DISPLAY_... |
399bbee0-8f2c-4c2f-a1b2-e67f435a634c | 3 | public void checkBlockSelect() {
if(list.getSelectedValue().contains("@Choice:") || list.getSelectedValue().contains("@Condition:")) {
String prefix = "";
for(int x = 0; list.getSelectedValue().startsWith(" ", x); x++) {
prefix += " ";
}
list.setSelectionInterval(list.getSelectedIndex(), listModel.ind... |
c9a563c9-3313-47c8-a1e2-e4a13f3343ca | 5 | private void checkTerminator()
throws ScriptException {
if (input.getTokenType() != ScriptTokenizer.TYPE_SYMBOL) {
if (input.hasMoreTokens())
scriptError("too many arguments");
else
scriptError("Script ends without a terminator");
}
el... |
1cc9d270-3000-45c0-8e0a-693fa9a37a9f | 9 | @Override
public boolean equals(Object obj)
{
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Device other = (Device) obj;
if (houseCode == null)
{
if (other.houseCode != null)
return false;
} else if (!houseCode.equals( other.... |
2e932450-a1a8-46ac-9d8e-d974a473a8e7 | 8 | public DecisionTreeBuilder(List<Map<String, Object>> ds) {
sourceDataSet = ds; sourceParams = new HashMap<String, ArrayList<String>>();
HashMap<String, ArrayList<String>> paramsDn = new HashMap<String, ArrayList<String>>();
for(Map<String, Object> sourceData : sourceDataSet) {
for(M... |
2e4c86a2-d412-4377-8269-640ebc606bc8 | 9 | private int jjMoveStringLiteralDfa2_0(long old0, long active0)
{
if (((active0 &= old0)) == 0L)
return jjStartNfa_0(0, old0);
try { curChar = input_stream.readChar(); }
catch(IOException e) {
jjStopStringLiteralDfa_0(1, active0);
return 2;
}
switch(curChar)
{
case 101:
... |
76dd595c-0077-41b3-a7af-d7f157d939bc | 4 | public static Shape parse(HtmlElement element, String str){
switch(str){
case "rect":
return RECT;
case "circle":
return CIRCLE;
case "poly":
return POLY;
default:
case "default":
return DEFAULT;
}
} |
6b995b7e-6f66-44a7-ae37-8819cbfb0ded | 8 | public void printClusterEntryExit(StringBuilder sb, StringBounder stringBounder) {
// final List<? extends IShapePseudo> entries = getShapesEntryExit(EntityPosition.ENTRY_POINT);
final List<Shape> shapesEntryExitList = getShapesEntryExit(EntityPosition.ENTRY_POINT);
final double maxWith = getMaxWidthFromLabelForE... |
5b1eb915-a818-4462-aac4-625a06976b69 | 9 | @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 flank!"));
return false;
}
MOB target=mob.getVictim();
if(target.getVictim()==mob)
{
mob.tell(L("You can't flank someone ... |
5372c770-3f24-445f-a9d6-78d7af35ba4c | 5 | private void knapsack(int n, int capacity, int w[], int v[])
{
for (int c = 1; c <= capacity; c++) // From the smallest subproblem to
// the
// biggest
{
int max = 0;
for (int i = 0; i < n; i++)
{
if (capacity - w[i] >= 0 && c - w[i] >= 0)
if (v[i] + knap[c - w[i]] > max)
... |
61d66528-403d-4118-b977-3a38395cbde1 | 9 | public SaveLoader(File f)
{
file = f;
players = new ArrayList<MapObjectPlayer>();
back = new ArrayList<String>();
try
{
NBTInputStream inStream = new NBTInputStream(new FileInputStream(f));
CompoundTag root = (CompoundTag)((CompoundTag)inStream.readTag... |
e81b78ed-1391-4c22-aca8-78c7dddfbcac | 3 | @Test
public void testRunStartServerDuplicateSpots()throws Exception{
AccessControlServer server = new AccessControlServer(1934);
server.start();
SpotStub spot = new SpotStub("139",1934);
spot.start();
sleep(100);
SpotStub spot2 = new SpotStub("139",1934);
spo... |
3bea963a-361e-415a-a1eb-1380c239a9e4 | 2 | public void setNodeHighlighted(Node n, boolean highlighted){
if(highlighted){
nodesToHighlight.add(n);
}
else if(nodesToHighlight.contains(n)){
//if this is highlighted node, dis-highlight it.
nodesToHighlight.remove(n);
}
} |
5bfa9ff1-6e38-452e-9bef-1024ac61b76b | 7 | private void paintPlayers(Graphics g)
{
Graphics2D g2D = (Graphics2D) g;
for (PlayerLocation location : locations) {
String imageName = "/images/" + location.getImageName() + ".png";
int x = location.getX();
if (x > (columns - 3) * pixels) {
... |
f0684635-5b00-473e-bdab-93db9fc1f884 | 2 | public void buildCity() {
Player p = playerList.getCurrentPlayer();
if(selected.owner == p && selected.getTile().getCity() == null)
{
music.toCity();
thread.interrupt();//playing battle button
City city = new SmallCity();
p.addCity(cit... |
b8e72827-61f6-4fcc-b27c-bbf21b17075f | 7 | public void update_config(Graphics2D g2) {
// we got here because one of the settings has been changed
// clear the flags
this.resized = false;
this.reconfig = false;
// anti-aliasing
this.rendering_hints.put(RenderingHints.KEY_ANTIALIASING, preferences.get_anti_alias(... |
7a168e48-d867-4580-a3c7-4718a933287e | 1 | public IntBTNode removeRightmost( )
{
if (right == null)
return left;
else{
right = right.removeRightmost( );
return this;
}
} |
1e60ef81-7d5d-4992-83af-532373cc0a86 | 0 | public void setActive(Boolean active) {
this.active = active;
} |
c24e4153-f3cd-4406-b72d-09b0e218f631 | 8 | final String getBindyName(final MOB mob)
{
switch(to)
{
case CHARACTER:
return mob.Name();
case GROUP:
{
final Set<MOB> grp = mob.getGroupMembers(new HashSet<MOB>());
final List<String> grpMemberNames = new ArrayList<String>();
for(MOB M : grp)
grpMemberNames.add(M.Name());
return CMParms.... |
8867db11-ddcf-4420-b3bb-468427c64b5e | 9 | public void layout() {
if (tableTree == null || tableTree.isDisposed())
return;
if (item == null || item.isDisposed())
return;
Table table = tableTree.getTable();
int columnCount = table.getColumnCount();
if (columnCount == 0 && column != 0)
return;
if (columnCount > 0 && (column < 0 || column >= c... |
05ac947f-46ec-4875-ba4c-b190df385586 | 3 | public static ArrayList<Method> getGetters(Class theClass){
Method[] methods=theClass.getMethods();
ArrayList<Method> getters = new ArrayList<Method>();
if(methods==null)
return getters;
for(int i=0;i<methods.length;i++){
if(isGetter(methods[i].getName()))
getters.add(methods[i]);
}
return getters... |
1906a532-bd7d-42bc-ac56-c19eef1d4e15 | 2 | public double findSupport(ItemSet itemSupport) {
Timer timer = new Timer();
timer.startTimer();
double supportCount = 0;/*keep track of the count for support of an itemSet*/
int num = this.transactionSet.size();
for (int i = 0; i < num; i++) {
if (this.transactionSet.get(i).getTransaction().containsItemSe... |
7b783b07-fdf9-47ba-af24-41aa465c6a59 | 1 | @Override
public void setText(String text) {
String t = text == null ? null : text + " ";
super.setText(t);
} |
c08761da-8eee-42e1-9dcc-bb37168187f4 | 3 | private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton3ActionPerformed
Transferable clipboardContent = getToolkit().getSystemClipboard().getContents(this);
if ((clipboardContent != null)
&& (clipboardContent.isDataFlavorSupported(DataFlavor.strin... |
7628eca9-f589-43e5-a8d6-0c4ee625ed15 | 7 | private static void test1_1() throws FileNotFoundException {
String test1 = "quit\n"+"yes\n";
HashMap<Integer, String> output = new HashMap<Integer, String>();
boolean passed = true;
try {
in = new ByteArrayInputStream(test1.getBytes());
System.setIn(in);
out = new PrintStream("testing.txt");
S... |
f7c2b7d7-044b-4747-b519-ba910570ef3b | 8 | public void onSpinEnd(Wool winningColor, Block spinningBlock) {
int tableId = FancyRoulette.instance.tableManager.getTableId(spinningBlock);
ArrayList<SerializableLocation> tableTiles = FancyRoulette.instance.tableManager.getTableTiles(tableId);
for(int i = 0; i < tableTiles.size(); ++i) {
Location tileLocatio... |
5e740756-3bca-4c7b-b5ca-6fae17f92cc1 | 6 | @Override
public void render(float delta) {
this.rulesView.render(delta, currentSlide);
timeElapsed += delta;
float x = Gdx.input.getX();
float y = Gdx.graphics.getHeight() - Gdx.input.getY();
if (Gdx.input.justTouched() && timeElapsed >= 1) {
if (this.continueButton.getBoundingRectangle().contains(x, y)... |
d0063781-d9fc-4b52-b4cf-5041630e3488 | 4 | @Override
public void changeProductionInCityAt(Position p, String unitType)
{
City c = getCityAt(p);
if(getPlayerInTurn().equals(c.getOwner())){
if(unitType == GameConstants.ARCHER || unitType == GameConstants.LEGION
|| unitType == GameConstants.SETTLER){
CityImpl city = (CityImpl) c;
city.setPro... |
6e875cdf-c860-496f-b3c2-7c7e8debb385 | 8 | @Override
public Object getTransferData(DataFlavor flavor) throws UnsupportedFlavorException {
if (DATA_FLAVOR.equals(flavor)) {
return mRows;
}
if (DataFlavor.stringFlavor.equals(flavor)) {
if (mCache == null) {
StringBuilder buffer = new StringBuilder();
if (mRows.length > 0) {
int count = ... |
fc3c7cbe-9a9d-4987-9265-b6f360114ad6 | 9 | public void paintComponent(Graphics g){
try {
Integer x0=788;//828;
Integer y0=828;
Integer jvar=300;
Integer ivar=300;
Integer xrapport=x0/(8700/ivar);
Integer yrapport=y0/(4465/jvar);
Image img = ImageIO.read(new File("map.pn... |
8389679c-74f0-4063-a07f-0449934f6510 | 8 | private int approcher_rafiner() throws Exception {
// double totalPendingIter;
int j, k;
int result;
result = 0;
while (this.totalPendingIter > 0) {
result = this.section.poincareMap();
if (result != 0) {
break;
}
if (Math.abs(this.section.poincareEndVector[1]
- this.aproxEndBodyDistance)... |
d6b94dec-a588-462a-8111-1f079124328e | 3 | public void mouseUp(MouseEvent event) {
if (event.button != 1) {
resetSession(); // abort if right or middle mouse button pressed
return;
}
if (! dragInProgress) return; // spurious event
dragInProgress = false;
if (anchorPosition.x == -1) return; // spurious event
getPaintSurface().commitRubberban... |
b9d80a74-ab1d-4d5a-a06c-467feee61ac7 | 1 | @Override
public Object getValueAt(int row, int col) {
try {
return data[row][col];
} catch (java.lang.NullPointerException e) {
return data[1][1];
}
} |
2cddb853-a34e-49ef-8159-79a7c9986d55 | 2 | public static Apples fromByteArray(byte[] array){
try{
ByteArrayInputStream bis = new ByteArrayInputStream(array);
ObjectInput in = null;
in = new ObjectInputStream(bis);
Object o = in.readObject();
try{
bis.close();
in.close();
}catch(Exception e){System.out.println("A Memory Leak Has Happ... |
3aa55472-ab4e-4abd-92ac-e3eaed0e33f5 | 9 | @SuppressWarnings("boxing")
static Double[][] makeChannelArray(BufferedImage image, Channel channel)
{
int width = image.getWidth();
int height = image.getHeight();
Double colors[][] = new Double[width][height];
switch(channel)
{
case RED:
for (int i = 0; i < width; i++)
{
for(int j = 0; j <... |
4d612f88-b63f-4be2-ab67-cda1f7449517 | 8 | public static double normal(double x)
{
int sn;
double R1, R2, y, y2, y3, y4, y5, y6, y7;
double erf, erfc, z, z2, z3, z4;
double phi;
if (x < -UPPERLIMIT) return 0.0;
if (x > UPPERLIMIT) return 1.0;
y = x / SQRT2;
if (y < 0) {
y = -y;
sn = -1;
} else
sn = 1;
y2 = y *... |
1aeca273-1860-45d3-9236-066070367d8c | 9 | private static void drawScanLine(int dest[], int destOff, int loops, int startX, int endX) {
int color;
if (Rasterizer.edgeRestricted) {
if (endX > Graphics2D.endX) {
endX = Graphics2D.endX;
}
if (startX < 0) {
startX = 0;
}
}
if (startX >= endX) {
return;
}
destOff += startX;
color... |
b44a8bde-29f0-4dc1-97a9-b508c191ddd3 | 6 | private void ParseTerrain(String info) {
if (info.length()>Game.map.width) {
Game.error.ShowError("Terrain at row " + terrain + " is corrupt. (Too Long)");
}
else if (info.length()<Game.map.width) {
Game.error.ShowError("Terrain at row " + terrain + " is corrupt. (Too Short)");
}
if (terrain>=Game.map.h... |
a6c99e28-5677-42eb-acc7-f1c3b663a227 | 4 | public boolean isOptOut() {
synchronized (optOutLock) {
try {
// Reload the metrics file
configuration.load(getConfigFile());
} catch (IOException ex) {
if (debug) {
Bukkit.getLogger().log(Level.INFO, "[Metrics] " + ex.g... |
c4a8b227-be97-459e-98f0-5b3beede9323 | 0 | public boolean isFullscreen() {
return this.fullscreen;
} |
ef6bf73f-7e5c-4627-8dca-ad092d417602 | 0 | @Override
public int delete(Integer idMetier) throws Exception {
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
} |
c826c937-ddc3-4edc-83ef-b207c85d57c2 | 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 SiteBoundaryType)) {
return false;
}
SiteBoundaryType other = (SiteBoundaryType) object;
if ((this.id == null &... |
184ac6db-42d1-429e-bf88-15336909a8af | 6 | public void actionPerformed(ActionEvent e) {
JMenuItem source = (JMenuItem) (e.getSource());
boolean needRepaint = !mode.equals(source.getText());
mode = source.getText();
switch (mode) {
// case "None":
// drawPanel.setVisible(false);
// break;
// case "Single":
// outCoupler.jitterMode(false);
// ... |
534c482f-e566-4915-a284-0cc96346a650 | 5 | public List<Named> getAll(String typeEntity){
ArrayList<Named> list = new ArrayList<>();
ResultSet rs = this.getResultsOfQuery("SELECT * FROM entity WHERE typeEntity='"+typeEntity+"'");
try {
while (rs.next())
{
switch (typeEntity){
... |
22dcf93b-0e90-4ca0-aa81-937d28668a89 | 7 | public double weightedStandardDeviation_of_ComplexImaginaryParts() {
boolean hold = Stat.nFactorOptionS;
if (nFactorReset) {
if (nFactorOptionI) {
Stat.nFactorOptionS = true;
} else {
Stat.nFactorOptionS = false;
}
}
boolean hold2 = Stat.nEffOptionS;
if (nEffReset) {
if (nEffOptionI) {
... |
a39b670b-49e8-4efd-b031-732d62094053 | 1 | public void delete (Trip t) {
if (t == null)
return;
trips.remove(t);
isDataChanged = true;
} |
29092940-40bb-449a-89fa-1b7e2e2d81fd | 0 | public Set<String> getEntrypointClasses() {
return entrypoints;
} |
879c9735-a8b1-4401-9047-f00d65f3768a | 1 | @Override
public void addClickListener(ClickListener listener) {
if (listener != null) this.clickListeners.add(listener);
} |
972da600-d937-43b0-9368-a50a10611e1c | 1 | public boolean areAdjacentTo(Field otherField) {
return Math.abs(this.distanceBetweenFile(otherField)) <= 1 && Math.abs(this.distanceBetweenRank(otherField)) <= 1;
} |
735162fa-c5e8-4d81-81fc-e298bb9c7642 | 4 | public boolean sendUseItem(EntityPlayer var1, World var2, ItemStack var3) {
int var4 = var3.stackSize;
ItemStack var5 = var3.useItemRightClick(var2, var1);
if(var5 == var3 && (var5 == null || var5.stackSize == var4)) {
return false;
} else {
var1.inventory.mainInventory[var1.in... |
3ae1a26d-f1ba-4c68-ae6e-a25b6f59be70 | 5 | public CheckResultMessage check32(int day) {
int r1 = get(39, 5);
int c1 = get(40, 5);
int r2 = get(43, 5);
int c2 = get(44, 5);
BigDecimal b = new BigDecimal(0);
if (checkVersion(file).equals("2003")) {
try {
in = new FileInputStream(file);
hWorkbook = new HSSFWorkbook(in);
b = getValue(r2 +... |
3bebe778-0cbf-4a85-b566-8b138d324375 | 2 | public Person getPerson(String ID) {
Person temp = null;
for (int i = 0; i < PersonApplications.size(); i++) {
if ((PersonApplications.get(i).getPerson().getID().equals(ID))) {
temp= PersonApplications.get(i).getPerson();
// setCantPerson(CantPerson-1);
}
}
return temp;
} |
bfdc5014-88a4-43b5-9d6c-2eeb378c7713 | 4 | public byte[] HaveVisions(int[] inTargets){ // 1 means innocent, 2 means wolf, and 0 means an input of zero, i.e.
// player having vision cannot be seer.
byte[] output = new byte[NumPlayers];
for(int n = 0; n < NumPlayers; n++){
int TargetID = inTargets[n];
if(TargetID == 0){
output[n] = 0;
} else {... |
fce073f1-5224-465d-8db8-ba890e95cee9 | 4 | public static void main(String args[]) {
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
try {
UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
new JanelaLogin().setVisible(true);
... |
03b7d2ed-8b50-4080-843d-7b9558093dee | 5 | public final SymbolraetselASTNormalizer.start_return start() throws RecognitionException {
SymbolraetselASTNormalizer.start_return retval = new SymbolraetselASTNormalizer.start_return();
retval.start = input.LT(1);
CommonTree root_0 = null;
CommonTree _first_0 = null;
CommonTre... |
56e72456-b44b-4887-9238-1c99b7d616b5 | 9 | public void RemoveGreen_3(BufferedWrapper before, float Ratio)
{
BufferedWrapper bw = new BufferedWrapper();
bw.img = BufferedWrapper.CloneImg(before.img);
Filters.GaussianBlurStatic(bw);
Filters.MeanBlurStatic(bw);
Filters.GaussianBlurStatic(bw);
Filters.GaussianBlurStatic(bw);
Color c;... |
be6b2aba-1e54-4e22-868f-215dab05f0c4 | 2 | private static float[][] generateWhiteNoise( int width, int height, long seed )
{
Random random = new Random( seed );
float[][] noise = new float[width][height];
for ( int i = 0; i < width; i++ )
{
for ( int j = 0; j < height; j++ )
noise[i][j] = (float) random.nextDouble() % 1;
}
return noise;
} |
9217a14f-bddb-4ec3-96ec-0d183040dc58 | 3 | public AccesoServidores(List<String> urlDSpace, List<String> nombresDSpace, List<String> urlOlib, List<String> nombresOlib, List<String> epersonDSpace, List<String> usuariosDSpace) {
this.urlDSpace = urlDSpace;
this.nombresDSpace = nombresDSpace;
this.urlOlib = urlOlib;
this.nombresOlib ... |
fd5082b6-8acc-4e3b-99fa-d9d57be5b968 | 2 | private void shiftRowsDown(int start) {
for (int rowNum = start; rowNum < maxHeight - 1; rowNum++) {
if (start == height - 1) {
widths[start] = 0;
}else {
copyRow(rowNum, rowNum + 1);
}
}
falsifyRow(maxHeight - 1);
widths[maxHeight - 1] = 0;
} |
45293cd1-ff41-4759-b3e8-c408eb50dbca | 1 | private void alustaLista() {
File hlo = new File(henkilonTiedot);
if (!hlo.exists()) {
henkilot.add(new Henkilo(01, "Jaakko", "Mäkelä", 1959, "Suomi", "Ohjaaja"));
tallenna();
}
else {
lue();
}
tulosta();
} |
b51c1f65-5d6e-456f-9ef7-80a088bf0cf7 | 1 | public void testConstructor_invalidObject_Chronology() throws Throwable {
try {
new DateMidnight(new Object(), GregorianChronology.getInstance());
fail();
} catch (IllegalArgumentException ex) {}
} |
8b5f4e38-bd13-42f3-8f4b-d7b550edf436 | 3 | public void run(String[] args){
int rows = 0;
int columns = 0;
String errorMsg;
if (args.length != 3){
errorMsg = messages.getString("invalidViewerParametersNumber");
System.out.println(errorMsg);
}else{
//Ge... |
bad109e2-9338-41f2-9fbe-a9e01c8fe7f6 | 8 | public void atualizarInterface() {
Posicao posicao;
if (partida.getJogador1().getRobos()[0].isAtiva()) {
telaPrincipal.getPontosMovimentoJog1_1().setText(partida.getJogador1().getRobos()[0].getMovimento() + "");
} else {
telaPrincipal.getPontosMovimentoJog1_1().setText("X... |
0cce1101-31f3-404c-bd2e-43ed74902397 | 8 | public static void main(String[] args) {
ConsistentGlobalProblemSetInitialisation starter = new ConsistentGlobalProblemSetInitialisation();
starter.initLanguage(new char[] { '0', '1' }, 10, "(0|101|11(01)*(1|00)1|(100|11(01)*(1|00)0)(1|0(01)*(1|00)0)*0(01)*(1|00)1)*");
int solutionFoundCounter = 0;
int noSolut... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.