method_id stringlengths 36 36 | cyclomatic_complexity int32 0 9 | method_text stringlengths 14 410k |
|---|---|---|
311c57bf-9e97-40a8-bfbd-19912301bdc4 | 4 | public ArrayList<Change> collectChanges(CourseModel courseModel,
int tooOldInDays) {
// Build a date before which we do not remove offerings
Date tooOld = new Date(new Date().getTime() - 24 * 3600000l
* tooOldInDays);
System.out.println("Will keep all offerings older than " + tooOldInDays
+ " days: " +... |
074a6aac-d45a-4429-b65c-ed5985bf94a9 | 7 | private static int runToNextInputFrameHiLoR(Gameboy gbL, Gameboy gbR, DualState initial, int limit) {
int joypadInputFirst = Math.min(gbR.rom.readJoypadInputHi, gbR.rom.readJoypadInputLo);
int joypadInputLast = Math.max(gbR.rom.readJoypadInputHi, gbR.rom.readJoypadInputLo);
if (!gbR.onFrameBoundaries)
... |
2ef7f8fe-5d34-4949-8ccf-e0ef9e6dc547 | 5 | public String[] toFile(TimedTextObject tto) {
//first we check if the TimedTextObject had been built, otherwise...
if(!tto.built)
return null;
//we will write the lines in an ArrayList
int index = 0;
//the minimum size of the file is double the number of captions since lines are double spaced.
Arr... |
385cdba8-0444-45a0-809e-9fe806e5e6e7 | 1 | public void decrypt(String line){
//Show Status
indicator.setText("Decrypting");
indicator.setForeground(Color.RED);
//Remove message
String subc;
subc = line.substring(8);
//Remove sender
String subm;
int pos;
pos = subc.indexOf(":") + 2;
subm = subc.substring(pos);
//decrypt Message
... |
c6d5398f-41aa-437a-aaea-b40f5a7775fe | 5 | @Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Score score1 = (Score) o;
if (score != score1.score) return false;
if (!user.equals(score1.user)) return false;
return true;
} |
60e42207-1b34-4555-9762-1ec5805feb73 | 3 | private void printGene(Gene gene){
for(int i = 0;i<allelesCount;i++){
//differeing strategies to deal with superfluous alleles - modulo n favours some numbers,
//but presumably so would any other scheme
int allele = gene.getAllele(i)%travelingSalesman.n;
if(i%2 == 0){
System.out.print("(");
} ... |
2cf4f128-119e-4832-887f-6bacfd14cfa5 | 2 | public static byte[] compression(byte[] fluxACompresser){
byte[] aRetourner = null;
try{
GestionFichier.fluxEnFichier("fichierTemporaire/fichierACompresserTemporaire",fluxACompresser);
Runtime.getRuntime().exec("gzip -9 fichierTemporaire/fichierACompresserTemporaire");
//attente de compression
while(! (... |
8fa95edc-7ec4-4fbe-ab1e-125b71dbc566 | 2 | @Override
public Position getNextPosition() {
Position pos = super.getNextPosition();
if(Configuration.useMap){
// anything else than white is considered an obstacle
while(!Tools.getBackgroundMap().isWhite(pos)){
pos = super.getNextPosition();
}
}
return pos;
} |
1d958746-2456-4e8e-9cd0-74538eeaf82b | 8 | @Override
public boolean okMessage(final Environmental myHost, final CMMsg msg)
{
if((affected!=null)
&&(affected==msg.source())
&&(msg.amITarget(msg.source().location()))
&&((msg.targetMinor()==CMMsg.TYP_LOOK)||(msg.targetMinor()==CMMsg.TYP_EXAMINE)))
{
final Room R=room(msg.source().location());
if(... |
254a2fe4-fc0b-4bc4-965f-abf87dcc275e | 1 | private void searchPropietarioTextActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_searchPropietarioTextActionPerformed
cList = taller.searchClientes(searchPropietarioText.getText());
clientsModel.clear();
for(int i=0; i<cList.size(); ++i){
clientsModel.addElement(c... |
5e7e2e09-c3c8-4e84-8241-349afc84ea87 | 0 | public String getId() {
return id;
} |
41e23335-50cd-43a0-a109-a4a5657ddc3c | 5 | public HashMap<String, String> getRow(String testcase,String ...sheetName) {
HashMap<String,String> testData = new HashMap<String,String>();
String testSheetName;
if (sheetName.length == 1){
testSheetName = sheetName[0];
}else{
testSheetName = getTestSheetName(testcase);
}
HSSFSheet testSheet... |
26c04b65-dfb1-43e2-9ac9-5eb31fdaad7b | 2 | public String getColumnName(int column) {
if (column == 0)
return " ";
if (column > terminals.length)
return variables[column - 1 - terminals.length];
return terminals[column - 1];
} |
50a897d6-45de-4e86-84fd-126d194f3cc9 | 6 | @Override
public void drawLive(Fragment fragment, Graphics2D g, AffineTransform inMat)
{
g.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
AffineTransform mat = new AffineTransform(inMat);
textBuffer.setLength(0);
textBuffer.append... |
e51ac474-416b-48df-b0e8-ddf86db83ed6 | 5 | private static void saveParameter(FileWriter out,ParameterCode code) throws Exception {
out.write(code.toString() + " ");
switch (code) {
case WINDOWED:
out.write(WINDOWED+"");
break;
case DOT_COLOR:
out.write(color2String(DOT_COLOR));
break;
case LINE_COLOR:
out.write(color2String(LINE_COLOR))... |
5e76363c-6ca5-4a3a-b1e1-f23edd97a4b6 | 2 | public void run() {
try {
while(!Thread.interrupted()) {
System.out.println(this + " thinking");
pause();
System.out.println(this + " take right");
right.take();
System.out.println(this + " take left");
l... |
64f51500-0262-4e9c-b839-45b8d7829bc5 | 4 | public String getLineStyle() {
// check for border style
if (borderStyle != null) {
return borderStyle.getBorderStyle();
}
// check the border entry, will be solid or dashed
else if (border != null) {
if (border.size() > 3) {
return BorderS... |
ee3a6d5e-c2cc-4c97-8987-5af7a8a2a11e | 9 | @Test
public void testDuplicate(){
//2: Get a list of misused words, for learners
//b: British English
String input = "d\n2\nb";
System.setIn(new ByteArrayInputStream(
input.getBytes()));
ByteArrayOutputStream outContent = new ByteArrayOutputStream();
System.setOut(new PrintStream(outCo... |
120d9d81-6be7-449a-8fe7-3ebad1081f62 | 7 | public void draw(Object obj, Component comp, Graphics2D g2)
{
Color color;
if (obj == null)
color = null;
else
color = (Color) getProperty(obj, "color");
String imageSuffix = (String) getProperty(obj, "imageSuffix");
if (imageSuffix == null)
... |
6c8685ab-3ef2-41c2-94ff-00a55126e2e6 | 7 | public static void main(String[] args) throws Exception {
snzipExecutable = TestUtil.findSnzipExecutable();
if(snzipExecutable == null) {
throw new IllegalStateException("No executable snzip file found in bin directory");
}
testdataDirectory = TestUtil.directoriesToFile("resources", "testdata");
if(!t... |
61bba1ba-e9b5-42f8-ad34-01ab691fbc88 | 0 | public String getPhoneM() {
return phoneM;
} |
514d64ce-7373-4937-ab34-651a648641ee | 6 | private int win() {
boolean draw = true;
for (int i = 0; i < 8; i++) {
int sum = 0;
for (int j : ways[i]) {
sum += j;
}
if (sum == 3) {
return 1;
} else if (sum == 15) {
return 5;
}
... |
6b1fc3ae-297d-4893-9d1b-f5e11b8217d2 | 5 | public static boolean wasKeyReleased(char c) {
if (!keyrCheckInitiated) {
keyrCheckInitiated = true;
keyrLastUpdate = System.currentTimeMillis();
}
if (keyrLastUpdate + TIMEOUT < System.currentTimeMillis()) {
app.keysReleased.clear();
}
Character n = new Character(c);
try {
... |
009036f2-3fab-420b-8b96-d250a26a1aa9 | 9 | @Override
public BankInfo getBankInfo(Bank bank) throws DAOException {
BankInfo bankInfo = new BankInfo();
BaseDAO baseDAO = new BaseDAOImpl();
try (Connection conn = baseDAO.openConnection()) {
PreparedStatement stmtClientsNum = conn.prepareStatement("SELECT COUNT(ID) AS TOTAL FROM CLIENTS");
PreparedSta... |
e9f222d8-1938-45d4-ba5f-139117f19896 | 3 | public Stat produceStat() {
Stat stat = new Stat(name, new Date());
try {
T value = collector.getStat();
stat.setStoredValueAsString(value.toString());
for (StatValidator validator: validators) {
ValidationResult res = validator.validate(value);
... |
a434ae31-fdb3-48ed-97e9-26850008bd09 | 1 | public boolean isInSphere( int level, SphereCollider sphere, QuadTree node )
{
return node.depth < level && sphere.intersect( ( (Chunk) node.object ).getCenter() ) != null;
} |
2c843921-f4d0-4fd5-826f-209413ef38f5 | 4 | public static void main(String[] args){
List<Integer> priceListStr = new ArrayList<Integer>();
for(int i = 0; i < 10; i++){
priceListStr.add(i);
}
int maxPriceSize = 5;
if(priceListStr.size() < maxPriceSize){
maxPriceSize = priceListStr.size();
}
Integer[] priceList = new Integer[maxPriceSi... |
fb2ac1c8-269d-40c8-a1d3-b75c25f6e279 | 5 | public int getMossaMinNEF(){
int nefmin = 12;
if(desmosse!=null)
//Trovo il minimo tra i vmax
for(DescrittoreMossa dm : desmosse)
if(dm!=null && dm.getNumEF() < nefmin)
nefmin = dm.getNumEF();
//Restituisco il vmin se è valido
return nefmin!=12?nefmin:-1;
} |
5c4db2c3-4272-49dd-abdc-ddb2d1082da5 | 4 | private List<ReducerEstimatedJvmCost> estimateReducersMemory(List<Reducer> eReducers, InitialJvmCapacity gcCap) {
int fReducerNum = finishedConf.getMapred_reduce_tasks();
if(fReducerNum == 0)
return null;
List<ReducerEstimatedJvmCost> reducersJvmCostList = new ArrayList<ReducerEstimatedJvmCost>();
Re... |
f7fcb03a-c31e-4bb3-a2a9-0654ec8ea7cb | 0 | public Iterator<Integer> getIDIterator(){
return cityMap.keySet().iterator();
} |
a74db883-fa27-4551-a867-b76edd5fa3bb | 2 | public void actionPerformed(ActionEvent e)
{
if (e.getSource() instanceof JMenuItem)
{
JOptionPane finalMess = new JOptionPane();
String fina = finalMess.showInputDialog("Any final words, coward?");
out.println("/disconnect "+fina);
}
else if (e.g... |
e0d4132b-6920-4531-a2b5-e36e78eb54b2 | 9 | public void addAllFactories() {
try {
File packageDirectory = new File("src/gameObjects");
String[] packageFiles = packageDirectory.list();
for (int i = 0; i < packageFiles.length; i++) {
// only get .class files
if (packageFiles[i... |
1526b6ae-7f0b-409b-9cb4-1860ee7bc8e8 | 6 | @Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
// Entering a sub-command without parameters is assumed to be a request
// for information. So display some detailed help.
if (args.length == 0) {
sender.sendMessage(plugin.t... |
31d98041-f50e-4228-80cd-838ca182496a | 0 | @SuppressWarnings( "deprecation" )
public void actionPerformed(ActionEvent e)
{
System.out.println("Test Ok !");
System.out.println( "Action Command :" + e.getActionCommand());
System.out.println( "Action the event type. :" + e.getID());
long milliseconds = e.getWhen();
Date date = new Date(milliseconds);... |
e73e6471-0ed2-492a-b478-90c143192932 | 7 | public static void main (String[] args) {
PriorityQueue<Integer> H = new PriorityQueue<>(32, new Comparator<Integer>() {
@Override
public int compare(Integer o1, Integer o2) {
return o1.compareTo(o2);
}
});
PriorityQueue<Integer> L = new PriorityQueue<>(32, new Comparator<Integer>() {
@Overri... |
4bf7e7a3-3c0d-4874-9353-0137e3a2a8c3 | 9 | public ArrayList<Team> makeTeams(){
int counter = 0;
int direction = 1;
boolean flipped = true;
//Makes initial teams, should be relatively fair based on snaking pattern
for(Person person : people){
teams.get(counter).addMember(person);
if ((counter == num... |
ed2921d0-8681-49b2-8849-bc7a418dc1a4 | 2 | @Override
public void visitChar(Char character) {
if (Character.isAlphabetic(character.getCharacterCode())
|| Character.isDigit(character.getCharacterCode())) {
this.currentWord.append(character.getChar());
this.currentGlyphs.add(character);
} else {
this.uiGlyphs.remove(this.uiGlyphs.size() - 1);
... |
06449672-c5c4-4767-8901-c2dc27d786c8 | 9 | public void encode(){
int k = 0;
int i = 1; //start of plaintext in audioBytes
int pt;
byte pb;
System.out.println("Hiding the ciphertext in AU file ...");
// First encode the length of the plaintext
pt = cipherbuff.length;
for (int j=1; j<=32; j++) {
if ((pt & 0x80000000... |
3811cb80-2b4c-463f-94d9-cc1ffd57d447 | 3 | @Override
public List<String> logInSeller(String name, String passwd) {
loggerMediator.info("Log in seller " + name);
List<String> serviceList;
stateMgr.setSellerState();
serviceList = stateMgr.getServiceList(name);
if (serviceList!= null && !serviceList.isEmpty())
if (!logInUser(name, passwd, UserTypes... |
f0e68e40-bc65-48dc-b6aa-7b7a4edb0f36 | 6 | private void operandStart() {
startTokenPos = pos;
while (pos < numRead) {
if (isDelimiter(buf[pos])) {
break;
}
pos++;
}
if (pos < numRead && pos > startTokenPos) {
Operator operand = OperatorFactory.getOperator(buf, startT... |
fd9642ba-5128-4f03-a940-d37c21356c77 | 2 | void updatemap() {
for (int i=0; i<size; i++) {
for (int j=0; j<size; j++) {
updatePoint(grid[i*size+j]);
}
}
} |
d0e7b112-508e-4990-b001-65303315ced1 | 0 | public UnmatchDimensionException(String message) {
super(message);
} |
7e8ada38-409d-4e56-9b45-d6efdcb9ccbe | 5 | public <T extends Node> void getNaapurit(T solmu) {
int x = solmu.getX() - 1;
int y = solmu.getY() - 1;
for (int i = 0; i < 3; i++) {
for (int j = 0; j < 3; j++) {
if (pikselit[y + i][x + j] != -16777216 && (i != 1 || j != 1)) {
naapuri = maaritaNa... |
cf9c49b0-cc50-4156-9a5c-224c4e63e0d0 | 4 | @Override
public void Input(float delta)
{
float movAmt = m_speed * delta;
if(Input.GetKey(m_forwardKey))
Move(GetTransform().GetRot().GetForward(), movAmt);
if(Input.GetKey(m_backKey))
Move(GetTransform().GetRot().GetForward(), -movAmt);
if(Input.GetKey(m_leftKey))
Move(GetTransform().GetRot().GetL... |
a7694df3-bfc1-4c88-9988-5428ef1ab71c | 4 | public int getBottomCenterX(Container parent, Component component) {
LinkedList<Component> components = new LinkedList<Component>();
LinkedList<Integer> locations = new LinkedList<Integer>();
for (int index = 0; index < parent.getComponentCount(); index++) {
components.add(parent.getComponent(index));
}
in... |
bc9d0811-b2ea-454e-9755-a65d2dc32a69 | 9 | public static CurrentUsageData getCurrentUsageData(final String login) {
Issue currentIssue;
List<Issue> issues;
Set<String> commitFiles;
Set<String> commitImports;
issues = new ArrayList<Issue>();
commitFiles = new HashSet<String>();
commitImports = new HashSet<String>();
try {
// Gather work data... |
711bd3ff-1772-4cd5-9fa5-5a96c8810511 | 3 | public void initialization() {
int x = (int) (Math.random() * (3 + 1));
int y = (int) (Math.random() * (3 + 1));
int r = (int) (Math.random() * 2);
this.set(x, y, r==0 ? 2 : 4);
r = (int) (Math.random() * 2);
while (this.get(x, y) != 0) {
x = (int) (Math.random() * (3 + 1));
y = (int) (Math.rand... |
1b225462-bbb4-4e26-a40b-c9a6a5066846 | 2 | @Override
public int doStartTag() throws JspException {
User user = (User) pageContext.getSession().getAttribute(JSP_USER);
if (user != null) {
ClientType type = ClientTypeManager.clientTypeOf(user.getRole().getRoleName());
if (type == ClientType.ADMIN) {
retu... |
157f868a-11f5-4933-b065-d2ecc35fc993 | 6 | @Override
public List<GenericState> getNextStates() {
int row = this.position.getRow();
int col = this.position.getCol();
List<GenericState> nextStates = new ArrayList<>();
for (int i = 0; i < Main.MOVES.length; i++) {
Position newPos = new Position(row + Main.MOVE_Y[i], ... |
20f474f6-51a3-4be8-939a-4d5f56a5fc63 | 4 | private void addCadenaLetra(JButton button) {
if (INICIO) {
if (maxCaracteres()) {
String string = button.getText();
if (!string.isEmpty()) {
if (cadenaCalculo.isEmpty()) {
cadenaCalculo = string;
} else ... |
26601c6a-587c-41c6-9d1f-517f7fe4e769 | 6 | public static GsPlaylist[] parsePlaylist(String data,Gs parent) {
Pattern re=Pattern.compile("\\{result:\\[(.*)\\]");
Matcher m=re.matcher(data);
GsPlaylist[] res=new GsPlaylist[1];
if(!m.find()) {
res[0]=null;
return res;
}
String realData=m.group(1);
int size=0;
int pos=0;
for(;;) {
int ... |
5c50188f-cb6f-4c5c-8c58-5adef98a285f | 6 | @Override
public void execute(CommandSender sender, String[] arg1) {
if (!CommandUtil.hasPermission(sender, PERMISSION_NODES)) {
sender.sendMessage(plugin.NO_PERMISSION);
return;
}
if (arg1.length < 2) {
sender.sendMessage(ChatColor.RED + "/" + plugin.message + " (player) (message)");
return;
}
... |
7cc7269a-c63d-47de-855f-b78754d69690 | 5 | static void NewSettings (String inputlocation) //Settings taken from 'input location'
//throws java.io.FileNotFoundException
{
//byte assemblyIndex = 0;
//short saveto = 0;
short fileIndex = 0;
short cacheSpace = 50; //Array space allocated at start of method.
boolean indexIsValid = true; //Tracks if the... |
8408c810-bb05-4346-bbb5-efbee50a6fce | 5 | private boolean pieceCanBeDropped() {
// check not at bottom
if (currentPiece.getCoord().getY() >= (TANK_HEIGHT - currentPiece.getHeight())) {
return false;
}
// check not blocked
Block[][] layout = currentPiece.getLayout();
for (int x = 0; x < layout.length;... |
427c1bb8-62e8-40de-b240-d70d70252c71 | 6 | @Override
public Screen respondToInput(KeyEvent key) {
switch (key.getKeyCode()) {
case KeyEvent.VK_1:
return new StartGameScreen(1);
case KeyEvent.VK_2:
return new StartGameScreen(2);
case KeyEvent.VK_3:
return new StartGameScreen(3);
case KeyEvent.VK_4:
return new StartGameScreen(4);
case Key... |
8b2acebc-458b-4f04-ba05-2041c8ceac08 | 9 | public static void multipartUploadObejctByMultithreading(KS3Client client,InputStream inputstream,
int offset,String bucketName,String objectKey,String mimeType) throws Exception{
// 偏移量不能为负数
if (offset < 0)
throw new IllegalArgumentException("Illegal offset.");
// 处理偏移量
try {
inputstream.skip(o... |
ae8c6090-1b2e-481a-86c5-6c05c3176645 | 7 | public static void main(String[] args) {
int BITS_PER_LINE = 16;
if (args.length == 1) {
BITS_PER_LINE = Integer.parseInt(args[0]);
}
int count;
for (count = 0; !BinaryStdIn.isEmpty(); count++) {
if (BITS_PER_LINE == 0) {
BinaryStdIn.readBoolean();
continue;
} else if (count != 0 && count % ... |
f7a5472d-998a-4de3-b5e6-0a1e1207eade | 3 | public void onBlockRedstoneChange(BlockRedstoneEvent e) {
CBlock conBlock = null;
if (parent.getConfig().getBool(Option.QuickRedstoneCheck) == true) {
conBlock = parent.getCBlock(e.getBlock().getRelative(BlockFace.DOWN).getLocation());
}
if (conBlock == null) return;
// TODO: All this below is munging the ... |
54f8eca6-2921-4856-a9d2-c30c7132c9e5 | 3 | public static Tree readFileContentForTree(String filename)
{
Tree input = new Tree();
try
{
FileReader fr = new FileReader(filename);
BufferedReader buffreader = new BufferedReader(fr);
String line;
while ((line=buffreader.readLine()) !... |
0f2eb648-968d-453d-b698-c40f1b5962ec | 9 | public static int pick_cpu(int[] cpunum, int[] cycles, double end) //shadow note cpunum and cycles are reference so pass a table
{
int cpu = last_activecpu;
/* look for a CPU that isn't suspended and hasn't run its full timeslice yet */
do
{
/* wrap around */
cpu += 1;
if ... |
781784e7-af83-452a-a234-8af1b8dfb900 | 0 | public VueVisiteurs(CtrlAbstrait ctrlA) {
super(ctrlA);
initComponents();
} |
bc3a876b-b03a-44e3-be0d-916b9ff9324b | 5 | @Override
public Message decode(ByteBuffer buffer) {
Message message = null;
switch (getSession().getState()) {
case CONNECTED:
message = handleServiceRequest(buffer);
break;
case UPDATING:
message = updateDecoder.decode(buffer);
break;
case LOGGING_IN:
message = loginDecoder.decode(buffer);
... |
d2ffad0c-e13e-4581-b5b5-7e8489a8b163 | 4 | @Override
public void callAction(String args) {
GraphViz gv = new GraphViz();
gv.addln(gv.start_graph());
String perceptronName;
System.out.print("Name of perceptron to dump: ");
perceptronName = ui.inputToString();
Perceptron perceptron = ds.getPerceptron(perceptronName);
if (perceptron == null) {
... |
554fe560-0650-4fbd-b871-64996b0acd0c | 1 | @Override
public boolean canDiagonalize(Diagonalizable that) {
if(that instanceof Player) {
return that.canDiagonalize(this);
} else {
return that != this;
}
} |
7ffdc045-b467-472d-96c2-205c8a44257d | 2 | public FontField(Color bg, String fieldTitle, String initialFont, int initialSize, Color initialColor, boolean bold, boolean underline,
boolean shadow) {
if (initialColor == null) {
initialColor = Color.GREEN;
}
if (fieldTitle == null) {
fieldTitle = "";
... |
69865173-2a4e-45e8-b3a7-23078250ca57 | 6 | private boolean Primary()
{
begin("Primary");
if (Name())
{ sem.Resolve(); return accept(); }
if (Primary_0())
{ sem.Pass2(); return accept(); }
if (ANY())
{ sem.Any(); return accept(); }
if (StringLit())
{ sem.Pass(); return accept(); }
if (Range())
... |
2c445fcb-263c-4168-bf80-51cd458ede01 | 7 | public static void main(String[] args) throws IOException {
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
String line = "";
StringBuilder out = new StringBuilder();
char[] ns = in.readLine().trim().toCharArray();
char[] ss = in.readLine().trim().toCharArray();
while ((line = in.r... |
137c3d12-de0b-4aeb-9835-397cd5370a5c | 2 | private void action() {
String s1 = "";
StringBuilder sb = new StringBuilder();
Iterator<String> iterator = students.keySet().iterator();
Student student, tStudent;
//build list to reverse
ArrayList<Student> studentsToSort = new ArrayList<Student>();
while (iterator.hasNext()) {
student = s... |
ca3a7e50-9ad8-45ba-a30e-699a90f33050 | 4 | public Double getRoleProbability(List<String> featureTypes, FeatureVector featureVector) throws Exceptions.FeatureTypeNotFoundException {
if (featureTypes == null)
return smoothingValue;
double probability = 0.0;
for (String featureType : featureTypes) {
String fullFeatureType = Const.roleTypeIdentifier ... |
555e1040-4670-4b1b-b9c2-ed1f74731116 | 8 | public int setup(String argv, ImagePlus imp){
this.imp = imp;
try{
stack = imp.getStack();
}
catch(Exception e){
IJ.showMessage("A stack must be open.");
return DONE;
}
String ErrorMessage = new String("One of your values was not properly formatted.\nThe default values will be used.");
GenericDia... |
ed354a2d-2b75-4033-97cf-24bc87970a0f | 1 | public static void main(String[] args) throws Exception {
InputStream dec = new VorbisDecoder(new FileInputStream(args[0]));
byte[] buf = new byte[4096];
int ret;
while((ret = dec.read(buf)) >= 0)
System.out.write(buf, 0, ret);
} |
7004c043-61f1-40b0-b3c9-0f0ad67d21c4 | 3 | private static float calculateDividend(String ticker) {
//DIVIDEND DUPLICATE COUNT NEEDS FIX HERE
ArrayList<Float> dividends = new ArrayList<Float>();
float sum = 0;
float dividend = 0;
int dividendId = 82;
for (Entry<Float,Float> ent : Database.DIVIDEND_HISTORY.get(ticker).entrySet()) {
sum+=ent.getValue... |
0fd32ca2-4369-4875-89f6-735872225340 | 3 | public static String translateAlternateColorCodes(char colorChar, String text)
{
char[] chars = text.toCharArray();
for (int i = 0; i < chars.length - 1; i++)
{
if ((chars[i] != colorChar) || (CHARS.indexOf(chars[(i + 1)]) <= -1))
{
continue;
... |
09ceea55-d89f-4a18-8453-67dbec2f7827 | 7 | @Override
public void executeMsg(final Environmental myHost, final CMMsg msg)
{
super.executeMsg(myHost,msg);
if((affected!=null)
&&(affected instanceof MOB)
&&(msg.amISource((MOB)affected)||msg.amISource(((MOB)affected).amFollowing())||(msg.source()==invoker()))
&&(msg.sourceMinor()==CMMsg.TYP_QUIT))
{
... |
96c82a33-329f-4350-b463-7354e386cd01 | 8 | public static void main(String[] args) throws Throwable {
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
StringBuilder sb = new StringBuilder();
for (String ln; (ln = in.readLine())!=null; ) {
StringTokenizer st = new StringTokenizer(ln);
int a = Integer.parseInt(st.nextToken());
... |
84250f27-8a43-4d60-976b-9fe9ea5c5d32 | 8 | private void playMenu() {
int choice = this.menus.run(MainMenu.IDENTIFIER);
if (choice == MainMenu.ANALYZE) {
String grammar = this.getGrammar();
if (!this.validateGrammar(grammar))
return;
this.analyze(grammar);
} else if (choice == MainMenu.TRANSFORM) {
String grammar = this.getGrammar(... |
a84e7956-72a6-4873-9d68-75f9356188d1 | 1 | public void updateSubTypes() {
for (int i = 0; i < subExpressions.length; i++)
subExpressions[i].setType(Type.tUInt);
} |
74935997-63b5-4f04-9f30-964f068870a7 | 4 | private void clearPosition() {
StreamsterApiInterfaceProxy proxy = new StreamsterApiInterfaceProxy();
Position[] positions = new Position[0];
try {
positions = proxy.getPositions();
} catch (RemoteException ex) {
Logger.getLogger(JobTradeUp.class.getName()).log(Le... |
f7b335d8-84ee-4922-ad68-fd18600105b4 | 3 | public PluginLogin(Comando comando) {
super("Login no sistema");
setLayout(new FlowLayout());
setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
setSize(280, 140);
setResizable(false);
s = Sistema.getInstance();
user = new JLabel("Usuário: ");
add(user);
... |
4513e9e5-a2d4-47a7-b9cd-fd0c6128f7e7 | 4 | public int regOrMem(){
if (isBranch()){
alterPC = true;
}
if (ins instanceof StoreInstruction){
return 0;
}
else if (ins instanceof JALRInstruction || !isBranch()){
return 1;
}
else return 2;
} |
d9a7cc4b-2760-40ad-8864-2600ec89bd73 | 6 | final void method951(r var_r, int i, int i_0_, int i_1_) {
anInt1619++;
r_Sub2 var_r_Sub2 = (r_Sub2) var_r;
i += ((r_Sub2) var_r_Sub2).anInt10489 - -1;
i_0_ += ((r_Sub2) var_r_Sub2).anInt10484 + 1;
int i_2_ = ((Class104) this).anInt1624 * i_0_ + i;
int i_3_ = 0;
int i_4_ = ((r_Sub2) var_r_Sub2).anInt10487;
int ... |
8d639239-fe52-4628-8775-e0c72ce4af36 | 5 | public boolean contains(Vec3D var1) {
return var1.x > this.x0 && var1.x < this.x1?(var1.y > this.y0 && var1.y < this.y1?var1.z > this.z0 && var1.z < this.z1:false):false;
} |
36cde48d-592d-4dca-8553-8fd26369a68a | 3 | protected synchronized void forciblyUnblockAllWaitingWorkers(Exception e) {
Iterator iter = waitingReplyThreads.values().iterator();
if (e == null) {
e = new CfaslInputStreamClosedException("Communications terminated with Cyc.");
}
while (iter.hasNext()) {
WaitingWorkerInfo waitingWorkerInfo... |
358e7abf-1206-4dbc-a49c-66190e04126e | 9 | public boolean skipPast(String to) throws JSONException {
boolean b;
char c;
int i;
int j;
int offset = 0;
int length = to.length();
char[] circle = new char[length];
/*
* First fill the circle buffer with as many characters as are in the
... |
686dd100-c515-43c7-81e7-27e6a0ed4579 | 1 | public void workComplete (Worker worker) {
worker.setSocket(null);
AsynchronousSocketChannel socket = requests.poll();
if (socket == null) {
workers.add(worker);
}
else {
worker.setSocket(socket);
worker.notify();
}
} |
0a82e28f-3f87-4151-a525-dd7ea5727574 | 1 | public void leaveChannel(Channel channel) {
synchronized (channels) {
channels.remove(channel);
if (channels.isEmpty()) { // logged out
saveStats();
Server.get().removeClient(name);
sendHello();
}
}
} |
4ed948bf-faf0-41ae-b9d3-83c750a9b9a8 | 8 | @Override
public AuthenticationProvider parseValue(String authProviderClassName) throws GuacamoleException {
// If no property provided, return null.
if (authProviderClassName == null)
return null;
// Get auth provider instance
try {
Object obj = GuacamoleC... |
becb9efb-7d49-4286-9d0d-b22b95e4f855 | 7 | @Override public ByteChunk getChunk(String urn, int maxSize) {
try {
// TODO: Extract this out to somewhere.
// Why do we even have this method?
ByteBlob blob = getBlob(urn);
if( blob == null ) return null;
if( blob.getSize() > maxSize ) return null;
byte[] dat = new byte[maxSize];
InputStrea... |
2b14029e-9741-4a47-843d-73b6f76adc6d | 1 | public static void main (String[] args) throws IOException {
// Show what command line arguments to use
if (args.length == 0) {
System.err.println("Usage: java ArithmeticDecompress InputFile OutputFile");
System.exit(1);
return;
}
// Otherwise, decompress
File inputFile = new File(args[0]);
File... |
43e1ea29-32b4-4f32-95dc-99c2154269fc | 4 | public void addBox(int x, int y) {
Piece box = new Box(x, y);
if (this.numberOne==null && this.numberTwo==null) {
this.numberOne=box;
} else if (numberOne!=null && numberTwo==null){
this.numberTwo=box;
}
} |
f07883c6-2887-4a7f-a48c-a8d9da96e688 | 5 | private void applyTransition(Transition transition) {
System.out.println("[DBQueryHandler] Handling transition " + transition.getTransitionId());
try {
if(TransitionState.ACKNOWLEGED.equals(transition.getTransitionState())) {
this.transitionQueue.removeTransition(transition);
} else if(TransitionState.PEN... |
4a369814-8da4-4f09-b35b-91b9a2fd3678 | 4 | public BigInteger getPathCount() {
if (pathCount == null) {
pathCount = new BigInteger("0");
if (left != null) {
pathCount = pathCount.add(left.getPathCount());
}
if (above != null) {
pathCount = pathCount.add(above.getPathCount());
}
if (pathCount.equals(new BigInteger("0"))) {
pathCo... |
5461e6a1-1369-4630-b903-40bcd4256c81 | 8 | @Override
public boolean add(T e) {
if (e == null)
throw new RuntimeException("Does not permit nulls");
int code=System.identityHashCode(e);
int hash =hash(code);
int hash2 = hash2(code);
int hash3 =hash3(code);
hash =hash & mask;
hash2 =hash2 & mask;
hash3 =hash3 & mask;
//inlining for performanc... |
d5b3abf3-3192-40f5-8598-5a14a5f8a385 | 1 | @Override
public boolean getMouse(int button) {
return glfwGetMouseButton(inputSource, button) == GL_TRUE ? true
: false;
} |
e7f65fa5-51e2-4aaf-abf0-2c366a8ddf31 | 7 | private boolean isPassTimeCheck(Task task, String start, String end) {
if (start.isEmpty() && end.isEmpty()) {
return true;
}
String taskStart = task.getValue(Keyword.START);
String taskEnd = task.getValue(Keyword.END);
if (Keyword.getMeaning(task.getValue(Keyword.TYP... |
298712a2-e204-4650-a07b-157a14d0e0b0 | 6 | public void playSound(String par1Str, float par2, float par3, float par4, float par5, float par6)
{
if (loaded && this.options.soundVolume != 0.0F)
{
SoundPoolEntry var7 = this.soundPoolSounds.getRandomSoundFromSoundPool(par1Str);
var7 = ForgeHooksClient.onPlaySound(this, var... |
d27130d5-2eb7-48d4-8f2c-d65ad0abcdbb | 0 | public void setSauce(String sauce) { this.sauce = sauce; } |
0f7c9d48-c584-4bb5-88d7-291c9491e579 | 8 | public boolean fetchEnvironmentDetails() {
try {
//int iVersion = -1;
int iEnvironment = -1;
boolean bFlag = false;
/*//Get the Column Index for the VERSION Column
iVersion = fGetColumnIndex(Environment.get("ENVIRONMENTXLSPATH"), "ENVIRONMENTS", "VERSION");
//Check if t... |
eaf1e517-e871-4f07-aee8-9b0546f3f03b | 8 | @Override
public Locations[] moveLocations(Locations pos) {
int row = pos.getRow();
int column = pos.getColumn();
Locations[] list = new Locations[64];
for (int i = 1; i <= 8; i++) {
list[i] = new Locations(row + i, column);
}
for (int i = 1; i <= 8; i+... |
fdaf92d1-498a-49d8-a632-4fdd3f8e2ef7 | 8 | public List<String> print() {
String header = "ColumnNames S[T]ack ";
for (int i = 1; i <= NUM_COLUMNS; i++) {
header += "[" + i + "] ";
}
for (char s : Suit.getValidInputs()) {
header += "[" + s + "] ";
}
String separator = "";
f... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.