method_id stringlengths 36 36 | cyclomatic_complexity int32 0 9 | method_text stringlengths 14 410k |
|---|---|---|
630f3a9f-3e0a-4218-b014-636ed7116d44 | 7 | public boolean isSimplified(){
if(this.top instanceof Number && this.bottom instanceof Number){
Number top = (Number) this.top;
Number bottom = (Number) this.bottom;
//if they aren't whole numbers or top or bottom is negative
if(top.getDecimal() != null || bottom.getDecimal() != null || !bottom.sign() || ... |
a29b1c49-ecee-4916-9855-a52c83e79fbc | 6 | public double getActionAngle(Instance vision, String angleType) throws Exception {
if (angleType == StringUtil.KICK_ANGLE && kickAngleCls != null) {
return kickAngleCls.classifyInstance(vision);
} else if (angleType == StringUtil.TURN_ANGLE && turnAngleCls != null) {
return turnAngleCls.classifyInstance(visio... |
7f21bcd9-5f55-486e-bb88-b70a2013fc54 | 9 | public static void main(String[] args) {
if (args.length == 5) {
double totalElapsedTime;
StopWatch programRunning = new StopWatch();
DataLoader dl;
Instances data = null;
try {
dl = new DataLoader(args[0]);
data = dl.instancesLoader();
} catch (FileNotFoundException e) {
e.printStac... |
691c4423-90f1-4a49-ad9f-67c269d1b9f4 | 1 | @Override
public void remove(int i) {
for(int j = i; j<=this.size;j++){
this.keys[j] = this.keys[j+1];
}
this.size--;
} |
ddda6d4f-a098-49e1-bf7b-77376a95f31b | 3 | @Override
public String toString() {
String lsAttrs = "";
for (int i = 0; caAttributes != null && i < caAttributes.size(); i++) {
lsAttrs += " " + caAttributes.get(i).toString();
}
StringBuilder builder = new StringBuilder();
builder.append("ROOM [attributeid=");... |
8c48cca7-88c8-4d47-b2ca-0332afc0796a | 8 | public void insert(String table, String name[], String value[]) {
if(name.length != value.length){
String message = "not the same length";
throw new RangeException((short) 0, message);
}
try {
con = DriverManager.getConnection(url, user, password);
String questionMarkStm = "";
String stm = null;
... |
bca7c7d6-c832-4b5b-a72a-24738080fb7d | 1 | public void abort() {
mStarted = 0;
for (File file : mFiles.values()) {
file.delete();
}
mFiles.clear();
} |
6ebe8b3e-8d2a-491c-a8fe-fd84929d4861 | 0 | public void setSolIdElemento(Integer solIdElemento) {
this.solIdElemento = solIdElemento;
} |
03ebbf0a-cb62-4d7a-8d27-a464300a5838 | 7 | @Override
protected void act() {
if(state == State.START) {
Robot.getInstance().getMotion().getPilot().setRotateSpeed(180);
poses.add(new Pose(80, 0, 0));
chaine.add("BlackY");
poses.add(new Pose(30, 0, 0));
chaine.add("BlackY");
poses.add(new Pose(-20, 0, 0));
chaine.add("BlackY");
poses.add... |
8657374f-4083-4e33-b94f-4dffbbcad21f | 3 | private void initializeEconomy() {
if (plugin.getServer().getPluginManager().getPlugin("Vault") == null) {
throw new IllegalStateException("Vault plugin not found!");
}
RegisteredServiceProvider<Economy> provider =
plugin.getServer().getServicesManager().getRegistrati... |
147f1bfe-850f-4ff1-bdf4-391e609081fd | 2 | final public void setHeader(String firstLine, String... additionalLines) {
header.clear();
header.add(firstLine);
if (additionalLines != null) {
for (String line : additionalLines) {
header.add(line);
}
}
onChange();
} |
4f1daaa9-589b-4aec-ba72-4bbd2c134544 | 0 | public SerializedCodec(XMLCodec xmlcodec) {
this.xmlcodec = xmlcodec;
} |
88ff9469-e980-43b8-a531-e717bd507c9d | 1 | @SuppressWarnings("unused")
private static void checkTime() {
long pre = System.nanoTime();
// 計測対象の処理
for (int i = 0; i < 100; i++) {
System.out.println("hello");
}
long post = System.nanoTime();
NumberFormat nf = NumberFormat.getNumberInstance();
System.out.println("[" + nf.format((post - pre)/... |
1ecf3f45-1061-482f-89d9-d200bcc2d33c | 5 | @Override
public boolean keyDown(int keycode) {
if (keycode == Keys.ESCAPE) {
((Game) Gdx.app.getApplicationListener()).setScreen(new MainMenu(
game));
}
switch (keycode) {
case Keys.W:
break;
}
switch (keycode) {
case Keys.S:
break;
}
switch (keycode) {
case Keys.A:
break;
}
s... |
dec35fe3-aee4-497e-b054-3c2c5ce8d432 | 1 | private boolean saveFile(String filename) {
boolean success;
String editorString;
FileWriter fwriter;
PrintWriter outputFile;
try {
fwriter = new FileWriter(filename);
outputFile = new PrintWriter(fwriter);
editorString = editorText.getText();
outputFile.print(editorString);
outpu... |
2cdac8c4-da5d-4cef-8fb1-a39d4cbcebfe | 5 | public DefaultMutableTreeNode getTreeList() {
DefaultMutableTreeNode parent = new DefaultMutableTreeNode(Integer.toString(currentId) + " - " + getType(getInterface().id, getInterface().type), true);
treeModel = new DefaultTreeModel(parent);
if (getInterface() != null) {
if (getInterface().children != null) {
... |
f07293a4-09a0-4e5f-a67c-f2e7ea81df73 | 5 | public static void main ( String[] args )
{
// test default constructor
ArrayLinearList<Integer> x = new ArrayLinearList<>( );
// test size
System.out.println( "Initial size is " + x.size( ) );
// test isEmpty
if( x.isEmpty( ) )
System.out.println( "The list is empty" );
else System.o... |
35376a45-853d-47b2-8aec-ba94ec4aa16c | 9 | private void checkModelFieldExist(Class<?> queryParamsClass,
Class<?> modelClass) throws Exception {
StringBuilder modelFieldErroMsg = new StringBuilder();
for (Field callField : queryParamsClass.getDeclaredFields()) {
QueryCondition conditionAnno = callField
.getAnnotation(QueryCondition.class);
... |
75010b8f-190d-4658-bdea-82a8f7ce5775 | 1 | @Override
public void collideWith(Element e) {
super.collideWith(e);
if (e instanceof IdentityDisc)
dropFlagOnAdjacentPosition(getGrid().getElementPosition(this));
} |
e893ddbf-4962-4186-b16d-a9c23440b7a3 | 9 | public static int[] convert(String s,int len){
//a = 97, A = 65, difference = 32
int defaul[] = {62};
int st[] = new int[len];
for(int i = 0; i < len; i++){
int val = (int)(s.charAt(0));
int value = 0;
if(val>= 65){
if(val < 91);
else if(val < 97){
... |
7683cd53-4933-45f8-8433-74d3468a0108 | 4 | boolean checkValidFeedback(String feedback){
try {
check(feedback.length() == 4);
check(feedback.charAt(1) == 'b');
check(feedback.charAt(3) == 'w');
int b = feedback.charAt(0) - '0';
int w = feedback.charAt(2) -'0';
check(b <= CL && b >= 0);
check(w <= CL && w >= 0);
check(b... |
bda79bd6-440d-4743-b672-939bb34604e9 | 6 | public MyList ownees(String player) {
MyList ownees = new MyList();
if (!(player == null || player.equals("red") || player.equals("blue") ))
return null;
// Iterate over all Hexpos's
Set set = owner.keySet();
Iterator it = set.iterator();
while (it.hasNext()) {
Hexpos hp = (Hexpos) it.next();
if... |
70078df7-0e41-4a83-9747-44342e1d9331 | 7 | public int longestConsecutive(int[] num) {
int n = num.length;
if (n<=1){
return n;
}
HashMap<Integer,Integer> checkBox = new HashMap<Integer,Integer>();
for (int i = 0;i<n;i++) {
checkBox.put(num[i],1);
}
int result = 1;
for (int ... |
b2a6b6fa-6b84-450b-bf39-d2c99105bc26 | 1 | private static <T> ArrayList<T> newArrayList(List<T> values) {
if (values != null) {
return new ArrayList<T>(values) ;
}
else {
return new ArrayList<T>();
}
} |
ee743b1c-fcd7-4041-95c1-7974a9db44a0 | 8 | @Override
public void handle(SocketConnection connection, String[] params, PrintWriter printWriter)
{
try {
int id = Integer.parseInt(params[1]);
if(ServerCore.instance().connections.get(id) != null)
{
printWriter.println("Information on user " + id + ":");
printWriter.println("Username: " + (Serve... |
fc1fc7b9-fd45-44bf-b7af-27e1f25c44eb | 1 | public boolean startNewTourn(final GUI g) {
if (gameTask != null) {
gameTask.cancel(true);
}
gameTask = gameExecutor.submit(new Runnable() {
@Override
public void run() {
winners = runTournament(g);
}
});
return tru... |
2f189e7a-700e-4a86-95df-a67ad7095dd3 | 4 | private Double rankDiffSwapThreeCards() {
Double rankdiff = 0.0;
int bestcardoneindex = 0;
int bestcardtwoindex = 0;
int bestcardthreeindex = 0;
Card bestcardtoswapcardone;
Card bestcardtoswapcardtwo;
Card bestcardtoswapcardthree;
for (int i = 0; i < hand.size() - 2 ; i++)
for (int j = i+1; j... |
aae52ab8-d3fb-4a63-9e0f-c57ffb75390b | 5 | private CodeRunResult runExecuteMethod(Object object, Method method) {
CodeRunResult result = new CodeRunResult();
Runnable runnable = () -> {
try {
result.setFailedTestMessages((List<String>) method.invoke(object));
result.setCompleted(true);
} c... |
1e15e653-9798-4c88-a6a9-7e763beae629 | 6 | protected FlacAudioSubFrame(int predictorOrder, int channelNumber, FlacAudioFrame audioFrame) {
this.predictorOrder = predictorOrder;
this.audioFrame = audioFrame;
this.blockSize = audioFrame.getBlockSize();
// Adjust sample size for channel number, if needed
// TODO Is this the... |
6265b4ea-990a-4008-9075-8d41065a75f4 | 3 | public boolean deleteTracking(Tracking tracking)
throws AftershipAPIException,IOException,ParseException,JSONException{
String parametersExtra = "";
if(tracking.getId()!=null && !(tracking.getId().compareTo("")==0)){
parametersExtra = tracking.getId();
}else {
... |
254bf4f5-a365-499b-ba7d-063bda9f7d2a | 2 | @Override
public boolean hasNext()
{
try
{
if (!resultSet.isLast())
{
return true;
}
}
catch (SQLException e)
{
e.printStackTrace();
}
return false;
} |
f1c75359-365b-4322-99ba-e51e5d4f305a | 3 | public static int climbStairs(int n) {
if (n < 2) return n;
int[] ways = new int[n + 1];
for (int i = 0; i <= n; i++) {
if (i < 2) {
ways[i] = 1;
} else {
ways[i] = ways[i - 1] + ways[i - 2];
}
}
return ways[n];
} |
02df73aa-d3f4-4e35-9770-533554c1ab79 | 6 | public static List<PDBStructure> reloadStructures(CyNetwork network,
CyIdentifiable id, List<CDDHit> hits) {
List<String> structures = getStructures(network, id);
if (structures == null || structures.size() == 0)
return null;
List<PDBStructure> structureList... |
476bb27c-fc37-4867-a9fc-519ab678f2a9 | 1 | private void print(Object o) {
if (logWriter != null) {
System.out.print(o);
}
} |
9b9f501f-f016-4008-9eb9-48a3fb8b850d | 6 | public static SSLContext setupClientSSL(String cert_path, String cert_password, boolean trustAll)
throws SSLConfigurationException {
SSLContext sslContext=null;
try {
kmf = KeyManagerFactory.getInstance("SunX509");
KeyStore ks = p12ToKeyStore(cert_path, cert_password);
kmf.init(ks, cert_password.toC... |
d64b559c-46cc-4f8d-a059-0bf402c84097 | 6 | public SaltAndPepperDialog(final Panel panel) {
setTitle("Salt and pepper");
setBounds(1, 1, 250, 150);
Dimension size = getToolkit().getScreenSize();
setLocation(size.width / 3 - getWidth() / 3, size.height / 3
- getHeight() / 3);
this.setResizable(false);
setLayout(null);
JPanel paramPanel = new JP... |
620a3270-14b6-48db-9fa9-9583cacd5098 | 7 | public void addRestrictionToEvent(String eventIdentifier, String restrictionIdentifier)
{
//Get that restriction
Restriction restrictionToAdd = null;
for(Restriction r: restrictions){
if(r.getIdentifier().equals(restrictionIdentifier))
restrictionToAdd = r;
... |
5bfa50e2-d956-4adf-8e95-dea9ba514ac5 | 2 | public static TableModel createTableModel(final CSTable src) {
final List<String[]> rows = new ArrayList<String[]>();
for (String[] row : src.rows()) {
rows.add(row);
}
return new TableModel() {
@Override
public int getColumnCount() {
... |
10ffaf0f-87a7-45da-8f0b-0e65830f789e | 8 | @Override
public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
if (sender.hasPermission("CreeperWarning.warn")) {
if (args.length >= 2) {
String prefix = CreeperWarningMain.chat.getPlayerPrefix((Player) sender);
prefix = CreeperWarningMain.replaceChatColors(prefix);
... |
4ee98968-e6dd-431d-bf74-45d2ae1d8406 | 0 | public AnObject(int aField1, long aField2, Object internalObject) {
this.aField1 = aField1;
this.aField2 = aField2;
this.internalObject = internalObject;
} |
bbb61346-93a1-4ccc-a23a-3360e3c692ab | 2 | public static Language load(String lang) throws FileNotFoundException, IOException, InvalidConfigurationException, IllegalArgumentException, IllegalAccessException
{
//Create the new language file that will be returned.
Language l = new Language();
//Get the lines of the
String[] lines = readFile(getLangua... |
7eefeffb-3c02-412e-87b3-7f4fa3c9ebcc | 3 | private static int applySpecialScore(String passwd)
{
int specials = 0;
// SPECIAL CHAR
Matcher m = Pattern.compile(".??[:,!,@,#,$,%,^,&,*,?,_,~]").matcher(passwd);
while (m.find()) // [verified] at least one special character
{
specials += 1;
}
if (specials == 1)
{
log.debug("5 points for 1... |
771bf304-f529-45cc-a586-51312b3cd149 | 9 | public boolean newRun()
{
Field f, f2;
if(this.newVal > 0)
{
return false;
}
else{
for(int i = this.fieldSize; i < this.finishindex; i++)
{
f = pole.get(i);
if(f.playerColor == player && f.figure != null)
{
... |
ed788565-9ccd-47e8-9f1a-ac19ae4aad9a | 6 | public BigDecimal getBigDecimal(BigDecimal defaultValue) {
try {
if (isNull()) {
return defaultValue;
}
if (data instanceof Double) {
return BigDecimal.valueOf((Double) data);
}
if (data instanceof Long) {
return BigDecimal.valueOf((Long) data);
}
if (data instanceof Integer) {
re... |
a4db9ec5-9c65-4769-855e-9d83c86297ea | 0 | public static void f() throws MyException {
System.out.println("Throwing MyException from f()");
throw new MyException();
} |
7eb14131-b5aa-43f7-9e6b-2449598dd892 | 9 | public config(){
String settings = fileHandler.readFile("config.jShare");
ArrayList<String> config = new ArrayList<String>();
if(!settings.isEmpty()){
Matcher m = Pattern.compile("\\{([^}]+)\\}").matcher(settings);
while(m.find()) {
config.add(m.group(1));... |
46b4f52d-5b68-41a2-bcfa-b921043621ca | 7 | public void mergeList(int a[], int start1, int end1, int start2, int end2) {
int temp[] = new int[end1 - start1 + end2 - start2 + 2];
int ptr1 = start1, ptr2 = start2, ptrmain = 0;
while (ptr1 <= end1 && ptr2 <= end2) {
if (a[ptr1] < a[ptr2]) {
temp[ptrmain++] = a[ptr... |
48cbcdd9-76ed-4d34-8ed0-6db75f361c07 | 9 | public String escape(String in) {
if (in==null) {
return "";
}
CharSequence collapsed = Whitespace.collapseWhitespace(in);
StringBuffer sb = new StringBuffer(collapsed.length() + 10);
for (int i=0; i<collapsed.length(); i++) {
char c = collapsed.charAt(i);... |
df63da76-c43e-4714-8d01-048ff63fccc2 | 2 | @Override
public String toString() {
StringBuilder sb = new StringBuilder();
for (String genVer : this) {
String name = nameByVersion.get(genVer).replace('_', ' ');
String ref = referenceByVersion.get(genVer);
sb.append("\t" + genVer);
sb.append("\t" + name);
if (ref != null) sb.append("\t" + ref)... |
44654cf8-108c-4e61-a3c3-d53c93d564c8 | 6 | public String toDiffString(String jobId) {
String f1 = "%1$-3.0f";
String f2 = "%1$-3.1f";
float mOUdf = exOU - rmOU;
float xOUdf = exOU - rxOU;
float mNGUdf = exNGU - rmNGU;
float xNGUdf = exNGU - rxNGU;
float xHeapUdf = exHeapU - rxHeapU;
float RSSdf = exHeapU - rxRSS;
float mOUrt = rmOU == 0 ... |
726759d4-1e6e-40f5-ae19-1207045ff330 | 6 | */
void wordExtendBackwards( Variant v )
{
char pc;
int index = v.startIndex;
int offset = v.startOffset;
Pair p = pairs.get( index );
do
{
offset--;
while ( offset < 0 || p.length() == 0 )
{
index = previous( in... |
642c0a5d-3755-46e1-8790-b1344fc0a9b6 | 7 | protected Environmental[] makeTalkers(MOB s, Environmental p, Environmental t)
{
final Environmental[] Ms=new Environmental[]{s,p,t};
Ms[0]=getInvisibleMOB();
if(p instanceof MOB)
{
if(p==s)
Ms[1]=Ms[0];
else
Ms[1]=getInvisibleMOB();
}
else
if(p!=null)
{
Ms[1]=getInvisibleItem();
}
... |
591bc676-9b9c-4cb2-a397-f6e8cf284d45 | 0 | public static void main(String[] args) {
System.out.println("testaticTstatic".intern() == new String("testaticTstatic").intern());
} |
4e8e831b-9e84-4704-8da5-53924e52bf7e | 9 | protected synchronized void doStart()
throws Exception
{
log.info("Version "+Version.getImplVersion());
MultiException mex = new MultiException();
statsReset();
if (log.isDebugEnabled())
{
log.debug("LISTENERS: "+_listeners);
... |
adfb95df-3855-436f-8d43-f59b156b5840 | 0 | public static void main(String[] args) {
w = new Worker();
} |
b41b6e92-97a5-4676-831b-c101ff495b3c | 4 | private boolean inside( int posX, int posY ){
if(posX>=this.posX && posX<=this.posX+this.width){
if(posY>=this.posY && posY<=this.posY+this.height){
return true;
}
}
return false;
} |
56a59413-d937-426b-8b56-52212733f31c | 7 | private void flushSessions() {
if (flushingSessions.size() == 0)
return;
for (;;) {
DatagramSessionImpl session = flushingSessions.poll();
if (session == null)
break;
session.setScheduledForFlush(false);
try {
... |
3fc5e395-e201-4755-b04b-efaa782cd180 | 3 | public void handleRemoveInputAlphabetButton() {
Object alphabet = startView.getInputAlphabetList().getSelectedValue();
if(startView.getInputAlphabetList().getSelectedIndex() != -1){
startView.getInputAlphabetItems().removeElement(alphabet);
if(startView.getTapeAlphabetItems().contains(alph... |
1f2f9235-28d4-4faa-914a-c226d4390d95 | 5 | public boolean duplicateEntrySection(int x, int y, String entry) {
boolean duplicate = false;
int sx = (x/size)*size, sy = (y/size)*size;
for (int i=sx; i < sx+size && !duplicate; i++) {
for (int j=sy; j < sy+size && !duplicate; j++) {
duplicate = (sudokuGrid[i][j].equals(entry) ? true : false);
}
... |
96999795-c66b-4703-8a3a-b89a15d4d2dc | 8 | public void updurgency(HWindow wnd, int level) {
if ((wnd == awnd) && vc.c)
level = -1;
if (level == -1) {
if (wnd.urgent == 0)
return;
wnd.urgent = 0;
} else {
if (wnd.urgent >= level)
return;
wnd.urgent... |
4aa3369a-7066-4a61-996d-c259f4353bfe | 8 | public static void main(String[] args) {
Scanner s = new Scanner(System.in);
int[][] numbers = new int[2][5];
int[] counters = new int[2];
for(int i = 0; i < 15; i++){
int x = s.nextInt();
int ind = Math.abs(x) % 2 == 1 ? 0 : 1;
numbers[ind][coun... |
9129486e-88b0-4c5d-a309-fbcfed07c6a6 | 8 | public void key(KeyEvent e, int s) {
int Key = e.getKeyCode();
if (s == KEY_PRESS) {
boolean rep = false;
for (int i=0; i <= keys.size()-1; i++) {
if (keys.get(i) == Key) {
rep = true;
}
}
if (keys.size()... |
823e2f29-809b-45a6-883e-f74254e3b234 | 8 | static String toUnsignedHex8String(long pValue)
{
String s = Long.toString(pValue, 16);
//force length to be eight characters
if (s.length() == 0) {return "00000000" + s;}
else
if (s.length() == 1) {return "0000000" + s;}
else
if (s.length() == 2) {return "000000" + s;}
else
if (s... |
ee7fc572-9db0-43ab-b5c5-4d8dcb5aeddd | 9 | private void subMenu(String sub) {
this.clear();
StringBuilder sb = new StringBuilder();
sb.append(sub.charAt(0)).append(sub.substring(1).toLowerCase());
System.out.println("=========== " + sb + " MENU ============");
System.out.println("\t1. Add " + sb);
System.out.println("\t2. Update " + sb);
System... |
ee846079-707d-4aec-8b6e-9c7f29a2b892 | 7 | @Override
public void run() {
count++;
if(automaticCars < 40) {
Car c = new AutomaticCar(id++);
c.setSpeed(45);
c.setReceiveBehavior(new AutomaticReceive(c));
c.setSendBehavior(new AutomaticSend(c));
towerChannel.registerCar(c);
automaticCars++;
}
if(manualCars < 50) {
Car ... |
5829473b-c06c-453e-aa55-83ec5b18ba06 | 2 | @Override
public void visitRow(Row row) {
List<UiGlyph> glyphs = row.getUiGlyphs();
for (UiGlyph uiGlyph : glyphs) {
this.uiGlyphs.add(uiGlyph);
uiGlyph.getGlyph().accept(this);
}
/* This checking is required for last word. */
if (this.currentWord.length() > 0) {
this.spellCheck();
}
} |
f2e8981f-8fab-4d51-9a74-68c3c3c6183c | 7 | public void onAction(String name, boolean isPressed, float tpf) {
if (isPressed) {
if (name.equals(KeyMapper.SHOW_PLAYER_LIST)) {
togglePlayerList(true);
} else if (name.equals(KeyMapper.SHOW_CHAT)) {
if (!chat) {
toggleChat(true);
... |
d8f06f4a-e08d-47dc-adb2-410843ae2d70 | 2 | public void modificarAudio(int id, ArrayList datos)
{
// Cambiamos todos los datos, que se puedan cambiar, a minúsculas
for(int i = 0 ; i < datos.size() ; i++)
{
try{datos.set(i, datos.get(i).toString().toLowerCase());}
catch(Exception e){}
}
bibliotec... |
4f7f6594-1de4-4a9d-9fe4-05a89c76dc5c | 6 | @Override
public boolean placeResearvation(int rowNum, Column column, Passenger passenger) throws ClassCastException, IndexOutOfBoundsException, IllegalArgumentException, NullPointerException {
if (!isInitialized) {
throw new NullPointerException("Passenger List has not been initialized");
... |
493acb00-5fb8-43ce-b808-a04c7f14e44c | 6 | private List<Integer> shrinkHeap(List<Integer> list) {
for (int n = list.size() - 1; n >= 0; n--) {
appUtil.swap(list, 0, n);
int parent = 0;
while (true) {
int leftChild = 2 * parent + 1;
if (leftChild >= n) break;
int rig... |
1f45b07e-eca2-40d5-8a38-7608f736476a | 4 | public void keyTyped(KeyEvent e) {
char key = e.getKeyChar();
System.out.println("KEY TYPED: " + key);
switch(key) {
case 's':
//System.out.println("About to smooth!");
if(_wps.getSmoothPath().size() > 2) _wps.smoothWeighted(_tolerance);
update();
repaint();
break;
... |
9c292290-a3c9-4e73-acde-71b99f17c295 | 2 | public void back() throws JSONException {
if (this.usePrevious || this.index <= 0) {
throw new JSONException("Stepping back two steps is not supported");
}
this.index -= 1;
this.character -= 1;
this.usePrevious = true;
this.eof = false;
} |
a8c7c4ff-b533-490b-9a74-8d98e7467d75 | 2 | public void initSamples() {
for( int ns = 0; ns < numberOfSamples; ns++ )
for( int i = 0; i < n; i++ ) {
samples[ns][i] = i + 1;
rankSum[ns][i] = 0;
}
} |
7621b078-062b-4f68-b4f4-088fd90671c9 | 8 | public static void startupHttpServerImpl() {
{ Object old$Module$000 = Stella.$MODULE$.get();
Object old$Context$000 = Stella.$CONTEXT$.get();
try {
Native.setSpecial(Stella.$MODULE$, Stella.getStellaModule("/HTTP/SUN", Stella.$STARTUP_TIME_PHASE$ > 1));
Native.setSpecial(Stella.$CONTEX... |
789746b2-eb57-4b94-9888-046373ad4b6c | 9 | public MapGeneratorOptionsDialog(FreeColClient freeColClient, GUI gui,
OptionGroup mgo, boolean editable,
boolean loadCustomOptions) {
super(freeColClient, gui, editable);
if (editable && loadCustomOptions) {
loadCust... |
0b036625-1b3b-4a47-bbb8-ea373fbd3a81 | 7 | @SuppressWarnings("resource")
public static void main(String[] args) {
// Record the starting timestamp and set the thread name for debugging
// purposes
serverStartTime = (new Date()).getTime();
Thread.currentThread().setName("Main Thread");
// Read the port from t... |
cb60b0b3-5b87-4a73-9aab-c4beac8c5bcc | 0 | public SaveAsFileMenuItem(FileProtocol protocol) {
setProtocol(protocol);
addActionListener(this);
} |
ffebac21-c3e6-4bee-a486-cc4ad4520bf4 | 9 | public Object getEncodedDestination() {
// write out the destination name
if (namedDestination != null) {
return namedDestination;
}
// build and return a fector of changed valued.
else if (object instanceof Vector) {
Vector<Object> v = new Vector<Object>(... |
5b43d38e-83c6-4fc7-9250-20dd8bb8ae3f | 1 | @Override
public boolean equals(Object activity) {
if (this.getName().compareTo(((Activity) activity).getName()) == 0) {
return true;
} else
return false;
} |
e0ea791f-8226-41fd-98dc-d8767cb412e4 | 9 | public boolean pass(int[] bowl, int bowlId, int round,
boolean canPick,
boolean musTake) {
int bowlScore = 0;
double expectedScore=0;
if(strategy == 0 || (strategy==1 && round==1)){
//System.out.println("Strategy: "+strategy+"\t"+"Round: "+round);
bowlScore = bui... |
6f2d36f8-6259-4fb7-b103-fb2fbfba904b | 0 | public void setId(String value) {
this.id = value;
} |
3d307221-3515-4a25-b069-a78738ae8b3b | 9 | public static String getMiniIconName(int miniIconNumber)
{
// Hardcoded in MM6.exe file
// These icon names are contained in icon.lod
switch(miniIconNumber)
{
case 0:
return "NO SYMBOL";
case 1:
return "castle";
case... |
5b027715-0b23-4ddc-9ada-71c8a71346b4 | 5 | @Test
public void testPolar() {
System.out.println("Polar");
assertEquals(Complex.NaN, Complex.Polar(Double.NaN, Double.NaN));
assertEquals(Complex.NaN, Complex.Polar(Double.NaN, 1.0));
assertEquals(Complex.NaN, Complex.Polar(1.0, Double.NaN));
assertEquals(Complex.Infinity... |
b79153fe-a7e5-4af7-a1c8-7b6f606f375a | 2 | private void render(float interpol) {
Graphics2D g = null;
try {
g = (Graphics2D)bs.getDrawGraphics();
g.setRenderingHint(RenderingHints.KEY_ANTIALIASING,RenderingHints.VALUE_ANTIALIAS_ON);
// Profiler.lapRestart("Obtain Graphics");
draw(g,interpol);
// Profiler.lapRestart("Draw Content");
if (!bs.c... |
94d3e13c-c969-4b27-9ef0-bb85ea812059 | 3 | protected Color getHeaderBackground()
{
Color c = UIManager
.getColor("SimpleInternalFrame.activeTitleBackground");
if (c != null)
return c;
if (LookUtils.IS_LAF_WINDOWS_XP_ENABLED)
c = UIManager.getColor("InternalFrame.activeTitleGradient");
r... |
f466cbc5-9798-4643-85a8-0afff2686356 | 2 | private void paintAreasBoundaries(Graphics2D g2d) {
if (drawAreaBoundaries) {
g2d.setColor(Color.GRAY);
final float dash1[] = { 4.0f };
final BasicStroke dashed = new BasicStroke(1f, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER, 5.0f, dash1,
0.0f);
... |
2fce5477-7ef5-4d78-88bd-59434dd860d9 | 3 | private void incAsset(String as, int inc){
if ("Pork Bellies".equals(as)){
pb = pb+inc;
}
else if ("Frozen Orange Juice Concentrate".equals(as)){
oj = oj+inc;
}
else if ("Soybeans".equals(as)){
sb = sb+inc;
}else throw new Error("No suc... |
41d4b6cc-8136-4d5a-b56a-eeb641ff9078 | 4 | @Override
public String getAsString(FacesContext facesContext, UIComponent component, Object object) {
if (object == null
|| (object instanceof String && ((String) object).length() == 0)) {
return null;
}
if (object instanceof Detallecotizacion) {
Deta... |
7504836e-ac13-42db-b20e-4a8252cbc5b2 | 3 | public static void main(String args[])
{
/*//Trying for perfum
Perfume[] pf = PerfumeFactory.getAllPerfume();
//Setting the training desired value for the class
pf[0].setDesiredValue(1);
for(int i = 1; i < pf.length; i++)
{
pf[i].setDesiredValue(-1);
}
Perceptron<Perfume> p = new Perceptron<Perfume>... |
751c72f9-bbbb-4900-ac94-20360bcbb461 | 1 | private String arrayToString(ArrayList<Path> array) {
String s = "";
for(Path path : array)
s += path.toString()+"\n";
return s;
} |
134cdeca-04b0-455e-be6e-862a0270aa39 | 5 | public static String getExceptionMessage(final Throwable e) {
if (e.getCause() != null) {
String msg = getExceptionMessage(e.getCause());
if (!msg.equalsIgnoreCase(e.getClass().getName())) {
return msg;
}
}
if (e.getLocalizedMessage() != null)... |
2850c85c-a792-4ec6-a839-75ea7597fc16 | 7 | public void update() {
if(GameManager.getGames().size()!= games)
getInventory();
for(ItemStack item: menu.getContents()) {
if(item!= null && item.getType()!= Material.MAGMA_CREAM) {
ItemMeta im = item.getItemMeta();
String name = ChatColor.stripColor(im.getDisplayName().split(" ")[0]);
Game game =... |
3af89a8d-ec69-4831-aa31-191678b81a31 | 7 | protected void checkSingleParameters(OAuthMessage message) throws IOException, OAuthException {
// Check for repeated oauth_ parameters:
boolean repeated = false;
Map<String, Collection<String>> nameToValues = new HashMap<String, Collection<String>>();
for (Map.Entry<String, String> para... |
790c6af3-b597-469e-bad3-faf36a41f1b5 | 9 | public Object getColumnValue(UserColumns column)
{
switch (column)
{
case ID:
return id;
case COMMENT:
return comment;
case CREATE_TIME:
return createTime;
case DN:... |
b3acd488-c86d-4383-9dbf-85a788416c57 | 0 | public Medico getMedico() {
return medico;
} |
667eed87-58c6-4297-91dd-369b3e23d90c | 0 | private ArrayList<Entry<String, Integer>> sortByValue(TreeMap<String, Integer> keywords){
ArrayList<Entry<String,Integer>> list = new ArrayList<Entry<String,Integer>>(keywords.entrySet());
Collections.sort(list, new Comparator<Map.Entry<String, Integer>>(){
@Override
public int compare(Entry<String, Integer... |
7bb16af3-f1e6-4f2e-a09c-6caa39911d3b | 0 | public static void main(String[] args) {
IHello hello = new HelloSpeaker();
StaticHelloProxy proxy = new StaticHelloProxy(hello);
proxy.hello("Laud");
} |
6c0ea107-6c2b-46e5-871e-da606099bb42 | 4 | private void createPropertyFile(String fileName, String query, String time, String dbName) {
Properties prop = new Properties();
ByteArrayOutputStream arrayOut = new ByteArrayOutputStream();
FileOutputStream out = null;
File file = new File("src/main/resources/properties");
if(!file.exists()) {
file.mkdir(... |
1cebf68d-81d0-460c-89f0-51d560949169 | 6 | private void jTextField1KeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jTextField1KeyReleased
// TODO add your handling code here:
if (jRadioButton1.isSelected()) {
try {
ResultSet rs = DB.myConnection().createStatement().executeQuery("select * from author wher... |
e4f8eacd-fe0f-4ed8-95dd-f23699395207 | 1 | private File createDataFile(String data) throws IOException {
File tempDir = makeTempDir();
File tempFile = new File(tempDir, "tzdata");
tempFile.deleteOnExit();
InputStream in = new ByteArrayInputStream(data.getBytes("UTF-8"));
FileOutputStream out = new FileOutputStream(temp... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.