method_id stringlengths 36 36 | cyclomatic_complexity int32 0 9 | method_text stringlengths 14 410k |
|---|---|---|
3c58c2d0-87c7-4b13-8f5f-c2fabc0a44f3 | 0 | public void setInstallDate(String installDate) {
this.installdate = installDate;
setDirty();
} |
47ea8769-7deb-4b5e-8932-09d6cb91ae71 | 8 | private boolean isNumberDouble(String input) {
boolean res = true;
int i = 0;
if(input == null || input.isEmpty() || input.endsWith(".") || !input.contains("."))
res = false;
else{
i = 0;
while(i < input.length() && res){
if(!Character.isDigit(input.charAt(i)) && (input.charAt(i) != '.'))
res... |
5a4359f8-e571-464c-a61c-c9369239d5c1 | 1 | public void playGameAsHost(ArrayList<User> gameUsers, HostGameTask hgt)
throws InterruptedException, IOException, InvalidKeySpecException,
NoSuchAlgorithmException, NoSuchPaddingException,
NoSuchProviderException, InvalidKeyException, BadPaddingException,
IllegalBlockSizeException {
EncryptedDeck encDeck;... |
bafb6567-4b36-4a4d-a4a3-df64ae726553 | 4 | @EventHandler
public void onInventoryClose(InventoryCloseEvent e)
{
if (e.getInventory().getName().equals(Message.REWARD_CLAIM_INVENTORY_NAME.toString()))
{
for (ItemStack itemStack : e.getInventory().getContents())
if (itemStack != null)
e.getPlayer().getWorld().dropItemNaturally(e.getPlayer().getLoc... |
4a157f57-3c0b-45d9-9194-4d4c712988a0 | 0 | @Override
public void clearObservers() {
readers.clear();
} |
2a34df17-4d8f-4f6e-98c9-993f52a03154 | 0 | public void setGoToList(ArrayList<String> goToList) {
this.goToList = goToList;
} |
a034c140-0d39-4c19-baa8-589bce19fb25 | 6 | @Override
public boolean validCapture(Point startPosition, Point endPosition){
Point difference = new Point();
difference.setLocation(endPosition.getX() - startPosition.getX(), endPosition.getY() - startPosition.getY());
if(this.getColor() && (Math.abs(difference.getX()) == 1 && (difference.getY() == 1))){
... |
97d25429-7933-4bb2-a770-d18b7ccc776e | 9 | @Override
public void bindTexture(TextureManager textureManager) {
// If skin changed, or if no skin texture is yet loaded...
if (skinBitmap != newSkinBitmap || textureId < 0) {
synchronized (this) {
if (skinBitmap != newSkinBitmap || textureId < 0) {
... |
1a1e74cb-d978-49f6-86dc-79b2077ae7be | 3 | public void run() {
long time = System.currentTimeMillis();
while ( true ) {
long thisTime = System.currentTimeMillis();
if ( thisTime - time < FPS_TIME ) {
continue;
}
int len = SceneDirector.getLength();
int last = len - 1;
for ( int i = 0; i < len; i++ ) {
Scene sc... |
2e43fcdb-ac0f-4f91-8cb9-a637925c2f39 | 5 | @Override
public int getSamples(byte[] buffer) {
byte[] cvBuffer = null;
provider.getSamples(buffer);
if(attenuationCv != null) {
cvBuffer = new byte[buffer.length];
attenuationCv.getSamples(cvBuffer);
}
int index = 0;
for(int i = 0; i < bu... |
d9e5cd8a-0bd6-47bf-a284-dc79e14de4a0 | 2 | private boolean doConditionalAction(GenericLittleMan<?> littleMan) {
boolean isComplete2 = littleManConditionalAction.doAction(littleMan);
if (isComplete2) {
resetConditionalActionStep();
}
return isComplete2;
} |
43586ed0-f5fb-4996-9404-a487a6eac0ed | 4 | public List<String> getCyclingPeptideStrings(int stringLength, String peptide) {
List<String> peptideMassList = new ArrayList();
for (int i = 0; i < peptide.length(); i++) {
StringBuilder stringBuilder = new StringBuilder();
if ((stringLength + 1) == peptide.length()) {
... |
3681ca2a-f842-47ae-b35b-182c121db61c | 8 | private Component cycle(Component currentComponent, int delta) {
int index = -1;
loop : for (int i = 0; i < m_Components.length; i++) {
Component component = m_Components[i];
for (Component c = currentComponent; c != null; c = c.getParent()) {
if (component == c) {
index = i;
break loop;
}
... |
e68598f6-6441-4833-9e0f-58649411eb33 | 7 | @Override
public void executeMsg(Environmental host, CMMsg msg)
{
if((msg.sourceMinor()==CMMsg.TYP_SPEAK)
&&(!noRecurse)
&&(affected instanceof MOB)
&&(msg.amISource((MOB)affected))
&&(msg.source().location()!=null)
&&(msg.source().charStats().getMyRace().bodyMask()[Race.BODY_MOUTH]>=0))
{
noRecurse=... |
ee9ef829-7f44-48c9-9140-a4a95f8c6cb4 | 0 | @Override
public void reset() {
super.reset();
weight = 0;
gravityForce.set(0, 0, 0);
setTotalForce(gravityForce);
} |
dc500d55-371b-4748-ab9e-5faa2c7f45e2 | 8 | public void doAddUser(){
if( (newName.getText().length() > 0 && newSurname.getText().length() > 0 && newFisCod.getText().length() > 0 &&
newUserName.getText().length() > 0 && newPwd.getText().length() > 0 && confNewPwd.getText().length() > 0) && (confNewPwd.getText().equals(newPwd.getText()) ) ){ //T... |
d9f2a7e4-b860-4bce-810f-3b54f8772407 | 4 | void onFocusOut () {
hasFocus = false;
if (itemsCount == 0) {
redraw ();
return;
}
if (focusItem != null) {
redrawItem (focusItem.index, true);
}
if ((getStyle () & (SWT.HIDE_SELECTION | SWT.MULTI)) == (SWT.HIDE_SELECTION | SWT.MULTI)) {
for (int i = 0; i < selectedItems.length; i++) {
redrawItem (sele... |
e9634cbc-1679-41b5-a1aa-fa66ab3d796a | 1 | public void run() {
if (drawFlames) {
processFlameDrawing();
} else {
super.run();
}
} |
230f2f04-b389-4640-897f-0bf914f6e3c0 | 9 | public void nondeterministicPreCanonicalization(NamedGraph g) throws Exception{
//Get triples
ArrayList<Triple> triples=g.getTriples();
//Get C14N Predicate
String c14n=Ontology.getC14NPredicate();
//Count and substitute blank nodes
substituteBlankNodes(triples);
//Perform a one-step deterministi... |
6ad91d2f-92ff-47fd-8ead-f505499f0c2d | 6 | private void setParam() {
if (anon) {
try {
ctx.init(null, null, null);
} catch(KeyManagementException e) {
throw new AuthFailureException(e.getMessage());
}
} else {
try {
TrustManager[] myTM = new TrustManager[] {
new MyX509TrustManager()
};
... |
5a19ef73-4e7e-4642-917c-5e4dde905ad8 | 6 | public void setRAMBufferSizeMB(double mb) {
if (mb > 2048.0) {
throw new IllegalArgumentException("ramBufferSize " + mb + " is too large; should be comfortably less than 2048");
}
if (mb != DISABLE_AUTO_FLUSH && mb <= 0.0)
throw new IllegalArgumentException(
"ramBufferSize should be > ... |
8e1dc220-26e2-49b1-a2c3-9336c3697a86 | 7 | @Override
@SuppressWarnings({ "nls", "boxing" })
protected void initialize(Class<?> type, Object oldInstance,
Object newInstance, Encoder enc) {
// Call the initialization of the super type
super.initialize(type, oldInstance, newInstance, enc);
// Continue only if initializin... |
d5c08f70-d595-4300-a04a-6cdb5bde4dbe | 5 | public int isMissingMeta(File mp3){
try {
String title, artist, bpm;
AudioFile f = AudioFileIO.read(mp3);
Tag tag = f.getTag();
if(tag == null){
return 9;//No tag what a drag.
}
artist = tag.getFirst(FieldKey.ARTIST);
title = tag.getFirst(FieldKey.TITLE);
bpm = tag.getFirst(FieldKey.BPM);
... |
bb44e54a-9005-4918-862a-2df1ec8cbbd0 | 1 | public static void asm_andwf(Integer befehl, Prozessor cpu) {
Integer w = cpu.getW();
Integer f = getOpcodeFromToBit(befehl, 0, 6);
Integer erg = w & cpu.getSpeicherzellenWert(f);
if(getOpcodeFromToBit(befehl, 7, 7) == 1) {
cpu.setSpeicherzellenWert(f, erg, true);
}
else {
cpu.setW(erg, true);
}
... |
426a077f-a9e8-4515-9a06-55780b4172f5 | 4 | @EventHandler
public void onPlayerLogin(final PlayerLoginEvent event) {
String player = event.getPlayer().getName();
/**
* Check if the player is banned.
*
* Kick with the appropriate message if so.
*/
if (this.plugin.isBanned(player)) {
event... |
88c73377-917a-4560-add1-a0498c8b4447 | 2 | public void paint(Graphics g) {
super.paint(g);
for(int i = 0; i < area.entities.size(); i++) {
area.entities.get(i).render(g);
}
if(area.isEmpty(hold))
hold.render(g);
else
g.drawImage(Images.cross, (int)hold.x - 16 - View.x, (int)hold.y - 16 - View.y, null);
g.setColor(new Color(192, 192, 1... |
eaa1c48d-d5de-40ad-9d70-54f68fce7799 | 4 | public static Rectangle stringToRectangle(String s, Rectangle defaultValue)
{
if (s == null) return defaultValue;
String[] sa = s.split(" +");
if (sa.length != 4) return defaultValue;
int[] ia = new int[4];
for (int i = 0; i < 4; i++)
try
{
ia[i] = Integer.parseInt(sa[i]);
}
catch (NumberF... |
ade5ab7f-71ca-4387-aeed-fe4c7d5f030a | 6 | public boolean equals( Object other ) {
if ( _set.equals( other ) ) {
return true; // comparing two trove sets
} else if ( other instanceof Set ) {
Set that = ( Set ) other;
if ( that.size() != _set.size() ) {
return false; // different sizes, no need ... |
67447bc7-5e1c-4ea3-999f-b51eed9ac79d | 9 | public static void init(){
if(initialized) {System.err.println("Init done"); return; }
//System.err.println("Doing init");
initialized=true;
t = get_t();
// Get OS if that is important
if(isWindows()){
_SYS = OS.WIN;
}else if(isMac()){
_SYS = OS.MAC;
}else if(isUnix()){
_SYS = OS.LIN;
}... |
7692c454-7a39-48a4-89ad-24ff3c76e32b | 2 | protected boolean ready() throws IOException {
if (reader == null) return false; // No reader? then we are not ready
if (nextLine != null) return true; // Next line is null? then we have to try to read a line (to see if one is available)
readLine();
return nextLine != null; // Line was read from the file? Then ... |
2a24f56a-b84e-46aa-9644-2f0a70a6503c | 3 | @Override
public boolean equals(Object obj) {
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final Salesman other = (Salesman) obj;
if (!Objects.equals(this.salesman, other.salesman)) {
return... |
c6bec9e4-0dd9-4767-bfc0-2b4a75381650 | 2 | @Override
public boolean canMove(Board board, Field currentField, Field emptyField) {
return validSetupForMove(currentField, emptyField) && currentField.inDiagonalPathWith(emptyField) && board.clearPathBetween(currentField, emptyField);
} |
60542d4b-3f73-4018-9efd-dce59d1bb148 | 5 | public static ArrayList<Planet> forPlanet(SimulatedPlanetWars simpw){
ArrayList<Planet> asw = new ArrayList<Planet>(2);
// Find the biggest fleet to attack with
int maxShips = 0;
for (Planet p : simpw.MyPlanets()){
if (p.NumShips() > maxShips){
maxShips = p.NumShips();
asw.add(0,p);
}
}
// Fi... |
06345d72-4a0e-496a-a016-bbd8149c49ee | 9 | static void checkMethodDesc(final String desc) {
if (desc == null || desc.length() == 0) {
throw new IllegalArgumentException(
"Invalid method descriptor (must not be null or empty)");
}
if (desc.charAt(0) != '(' || desc.length() < 3) {
throw new Illeg... |
d7a4e1a6-d8b4-4fa6-b1fe-dc7595dd79f7 | 2 | public CourseDatabaseManager() {
try {
Class.forName(driver);
conn = (Connection) DriverManager
.getConnection(url, user, password);
} catch (ClassNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (SQLException e) {
// TODO Auto-generated catch block
e.p... |
e415725f-c347-4233-a36e-fd49d9bfee23 | 6 | @Override
public int compare( Method a, Method b )
{
int c0 = a.getName().compareTo( b.getName() );
if (c0 != 0)
{
return c0;
}
Class<?>[] pa = a.getParameterTypes();
Class<?>[] pb = b.getPa... |
f38c3e6f-4725-4079-8955-ec382382162b | 8 | private void drawSetupMode(Graphics2D g) {
switch (setupMode) {
case 1:
if(!numAIChosen){
drawString(g, "Number of AI: ", 30, 25, 645, Color.BLACK);
}else{
drawString(g, "Number of players: ", 30, 25, 645, Color.BLACK);
}
break;
case 2:
drawString(g, "Player " + (turn + 1), 40, 25, 625, Col... |
8c9a443f-5d67-4ddf-8ad6-b1b8ed2b6baa | 1 | @Override
public void exception(String msg, Throwable t) {
StringBuilder message = new StringBuilder();
message.append("An exception occured in the garbage collector!").append("\r\n");
message.append("\t").append("reason: ").append(msg).append(".");
if (t != null)
log.log(Level.SEVERE, message.toString(), t... |
bf0bf7db-2ace-4a44-8949-ee660b5fcc7c | 4 | public double teaTypeSplitInfo() {
double result = 0.0;
double blackTeaSize = 0.0;
double whiteTeaSize = 0.0;
double greenTeaSize = 0.0;
for (Tea t : trainingSet) {
if (t.getTeaType().equals(Tea.BLACK_TEA)) {
blackTeaSize++;
}
if (t.getTeaType().equals(Tea.GREEN_TEA)) {
whiteTeaSize++;
}
... |
4b97b8ad-e5f6-4d80-ba44-60cc7a80fe1b | 3 | public Gezin(int gezinsNr, Persoon ouder1, Persoon ouder2) {
if (ouder1 == null) {
throw new RuntimeException("Eerste ouder mmag niet null zijn");
}
if (ouder1 == ouder2) {
throw new RuntimeException("ouders hetzelfde");
}
this.gezinsNr = gezinsNr++;
... |
68171b49-5d6e-47e5-a7a1-8b723fbe2fe8 | 9 | @Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Thai thai = (Thai) o;
if (age != thai.age) return false;
if (dumb != thai.dumb) return false;
if (name != null ? !name.equals(thai.name) : thai.name != null) return false;
... |
c7f4b734-d9b3-4370-9cb7-2bf97fda15a0 | 0 | public String getAssignee() {
return assignee;
} |
5e2b9efd-493f-466b-9f48-7fe936b8b6b9 | 5 | private static Move BackwardLeftCaptureForBlack(int r, int c, Board board){
Move backwardLeftCapture = null;
if(r<Board.rows-2 && c<Board.cols-2 && (
board.cell[r+1][c+1].equals(CellEntry.white)
|| board.cell[r+1][c+1].equals(CellEntry.whiteKing)
... |
a8f69de2-bc3d-4f4b-a8df-d24f898c83b8 | 9 | public void setAction(final Action newAction)
{
final Action oldAction = getAction();
if (oldAction != null)
{
removeActionListener(oldAction);
oldAction.removePropertyChangeListener(getPropertyChangeHandler());
final Object o = oldAction.getValue(ActionDowngrade.ACCELERATOR_KEY);
... |
1eb669ae-c9f4-41f4-8578-7985c9d313bd | 7 | public void listen() {
SSLSocket s = null;
SSLServerSocket serverSocket = null;
try {
System.out.println(DropboxConstants.SERVER_PORT);
//serverSocket = new ServerSocket(DropboxConstants.SERVER_PORT);
serverSocket = (SSLServerSocket)this.sslserversocketfactory.createSe... |
43990349-23f8-41c1-961c-15e2b744f2e1 | 3 | public boolean verificationComptabilite(String cheminAccesATester){
boolean aRetourner = false;
try{
Image img = ImageIO.read(new File(cheminAccesATester));
BufferedImage envTest = (BufferedImage)img;
int nbrPixel = envTest.getHeight()*envTest.getWidth();
if( (nbrPixel/3) >= GestionFichier.fichierEnFlux... |
91a38220-0585-4f63-81c8-22b5c0418c15 | 6 | @Override
public XValue invoke(XRuntime runtime, XExec exec, int id, XValue thiz, XValue[] params, List<XValue> list, Map<String, XValue> map) {
switch (id) {
case 0:
return thiz;
case 1:
return add(runtime, thiz, params[0]);
case 2:
return indexOf(runtime, thiz, params[0]);
case 3:
return substr... |
148e29f7-30c7-4741-8c70-5c8a27307040 | 0 | @Override
public void openFrame(JInternalFrame f) {
//System.out.println("openFrame");
super.openFrame(f);
updateDesktopSize(false);
} |
b41706c9-a5ea-47f9-a9d0-0ce707b56d00 | 5 | @Override
public int hashCode() {
int result = id;
result = 31 * result + (begdate != null ? begdate.hashCode() : 0);
result = 31 * result + (begtime != null ? begtime.hashCode() : 0);
result = 31 * result + (enddate != null ? enddate.hashCode() : 0);
result = 31 * result + (... |
98a624ee-96d7-4a06-b3bd-81c462f4a475 | 1 | public String getAttributeEnumeration(String name, String aname)
{
Object attribute[] = getAttribute(name, aname);
if (attribute == null) {
return null;
} else {
return (String) attribute[3];
}
} |
e6d2ca87-26c9-452f-840b-bd4c0ab61f73 | 0 | @Override
public String adiciona(HttpServletRequest request,
HttpServletResponse response) {
HttpSession session = request.getSession();
session.removeAttribute("usuarioLogado");
return "/WEB-INF/paginas/logout.html";
} |
ef687f73-b198-4b62-8997-c33e0f40a2e1 | 3 | @EventHandler(priority = EventPriority.MONITOR)
public void onPlayerChat(PlayerChatEvent e)
{
IrcClient client = Parent.Manager.getCurrentClient();
for(String s : client.getMcEcho_ActiveChannels())
{
try{ client.PrivMsg(s, IrcColor.formatMCMessage(ChatManagerUtils.ParseMessag... |
8cd8a721-21c4-44f5-b865-47d55bffd7b0 | 4 | private static void editInfo() {
MainMenuUI mainMenu = new MainMenuUI();
int option = mainMenu.editInformation();
switch (option) {
case 1:
editProduct();
break;
case 2:
editCategory();
break;
case 3:
editUser();
break;
case 0:
break;
default:
mainMenu.showOptionNotValid();
}
... |
41dae649-51ab-449c-a443-b34e436e45d7 | 2 | private void convertFrequencies() {
for (Entry<Double, Long> ent : frequencies.entrySet()) {
if (freq_s.containsKey(ent.getValue())) {
freq_s.put(ent.getValue(), freq_s.get(ent.getValue())+ent.getKey());
}else{
freq_s.put(ent.getValue(),ent.getKey());
}
}
} |
9ea3c1cb-7b78-4f15-b467-238e2082cd88 | 0 | public static void main(String[] args)
{
System.out.println(HanziToPinYinHead.getFirstLetter("I love u"));
System.out.println(HanziToPinYinHead.getFirstLetter("我爱北京天安门 匡乔顺龙万友谊栾"));
System.out.println(HanziToPinYinHead.getFirstLetter("I love 北京天安门"));
} |
fc0518d0-1a42-43e0-a9b9-fb74f1314385 | 1 | public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int tests = sc.nextInt();
String[] input = new String[tests];
for(int i = 0 ;i<tests;i++){
input[i] = sc.next();
}
solve(input);
sc.close();
} |
8ffd091d-d811-4112-b97c-cf004b622985 | 8 | public static String getTipoVariavel (String ip, String comunidade, String objeto) throws IOException, NoSuchObjectException, NoSuchInstanceException {
// Inicia sessaso SNMP
TransportMapping transport = new DefaultUdpTransportMapping();
Snmp snmp = new Snmp(transport);
transport.listen(... |
52cbd7db-eee3-4ede-aedd-539da15c1deb | 1 | public static void main(String[] args) {
int arr2[]={1,11,111,2,334,45454,56,56,45};
quick n1=new quick();
n1.sort(arr2);
for(int i=0;i<arr2.length;i++)
{
System.out.println(arr2[i]);
}
} |
5de64d70-00b3-4d62-aa90-6f19210c2544 | 5 | @Override
public void rotate(int angle) {
Tile[][] trans;
int xtrans = 0, ytrans = 0;
switch (angle) {
case ROTATE_90:
trans = new Tile[bounds.width][bounds.height];
xtrans = bounds.height - 1;
break;
case ROTATE_180:
... |
e4e34bdd-9256-4e1d-81f8-82ef5672c82e | 0 | public boolean isLive() {
return isLive;
} |
b1b31c23-d18c-42b1-a2a2-eefde3cadf28 | 8 | public String genStream(linkedList add)
{
//Generate the key
String myStream;
myStream = glbKey;
char temp = 0;
//Generate type character
if (blIsBase)
temp = (char) (temp|2);
//Generate server active bit
if(canServer)
temp = (char) (temp|4);
//Generate the willing to connect bit
if(add!= nu... |
112fa0da-295e-4bf1-bdc7-90644f50cf3e | 3 | public void start()
{
mRunning = mGenerate = true;
while (mRunning)
{
while (mGenerate)
generate();
render();
mViewer.repaint();
try
{
Thread.sleep(10);
}
catch (InterruptedException e)
{
e.printStackTrace();
}
}
mViewer.stopWindow();
} |
4193e47f-4cfa-4c20-ac43-87617ac14a3c | 6 | @Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (!super.equals(obj))
return false;
if (getClass() != obj.getClass())
return false;
InternalStorage other = (InternalStorage) obj;
if (capacity != other.capacity)
return false;
if (dataTransferRate != other.dataTransf... |
199cd03e-ec18-4dd6-a7d1-651d4044fbe7 | 9 | public static int getWidth(String s)
{
int curLine = 0;
int maxLine = 0;
char[] chars = s.toLowerCase().toCharArray();
for(char c : chars)
{
if(c == 'i' || c == 'l' || c == 't' || c == 'v')
{
curLine += 7;
}
else if(c == '.' || c == ',')
{
curLine += 2;
}
else if(c == '\n')
{
... |
5b27cefb-b296-4d60-8e6b-7734e6642416 | 3 | public WeaponPanel(String name) {
setSize(new Dimension(585, 300));
setLayout(null);
try {
this.sprite = new EditSprite(System.getProperty("resources") + "/sprites/" + name + ".png");
maxDir = this.sprite.getMaxDir();
maxFrame = this.sprite.getMaxFrame();
} catch(Exception e) {
sprite = null;
}... |
f7350cf8-db00-4faa-b038-e3e1f405d4d0 | 8 | public static void update(String eDatabase, String table,String column, String VALUES, String where){
Connection gCon = null; // general connection to MYSQL
Connection eCon = null; // connection to database
Statement eStatement = null; // statements for the eDatabase
try{
// Register J... |
555e01f9-cf57-423d-8937-c17df45d47e0 | 8 | @Override
public void handleGridEvent(GridEvent e) {
if(e.getSource().equals(builder)) {
if(admode.equals(AddDelMode.Add)){
if(mode.equals(EditorMode.Background)) {
builder.setBackgroundAtSelector(splitter.getSelectorPoint());
} else if(mode.equals(EditorMode.Object)) {
builder.setObjectAtSelect... |
5a765209-14b9-42f8-a2bb-5ca7b01d4b9b | 0 | public DatagramPacket GetPacket()
{
return dPacket;
} |
cee01959-30fe-4644-8824-f84eabd13b00 | 9 | static int process(String line) {
String[] splts = line.trim().split(" ");
int n = Integer.parseInt(splts[0]), m = Integer.parseInt(splts[1]);
long c = Long.parseLong(splts[2]);
if(n == 0 && m == 0 && c == 0)
return 0;
long[] cons = new long[n];
boolean[] state = new boolean[n];
long p = 0;
... |
21e00c5d-b0d4-4a5c-aa3b-30627a4d9f21 | 9 | @Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
ClaveDeReferenciable other = (ClaveDeReferenciable) obj;
if (end == null) {
if (other.end != null)
return false;
} else if (!end.equals(... |
31fdad45-970f-450d-ae43-5f7f9a7a1bc0 | 8 | public static int createTexturedDisplayList(Model m) {
int displayList = glGenLists(1);
glNewList(displayList, GL_COMPILE);
{
glBegin(GL_TRIANGLES);
for (Model.Face face : m.getFaces()) {
if (face.hasTextureCoordinates()) {
glMaterial(G... |
d3cbca5e-a8aa-4f41-b152-0b372e6d90cd | 4 | public static void moveRightText(OutlinerCellRendererImpl textArea, JoeTree tree, OutlineLayoutManager layout) {
Node currentNode = textArea.node;
if (textArea.getCaretPosition() == textArea.getText().length()) {
// Get Next Node
Node nextNode = tree.getNextNode(currentNode);
if (nextNode == null) {
t... |
7a64297d-62d5-4769-b966-51edf5fa474f | 0 | @Before
public void setUp() throws Exception
{
// set up the Players with predefined behaviour.
_paperPlayer = new Player("Paperman");
_paperPlayer.setDrawOutput(Output.Paper);
_rockPlayer = new Player("Rocker");
_rockPlayer.setDrawOutput(Output.Rock);
_scissorP... |
0b60f7ad-43ac-43d9-8e69-dea931fb3713 | 0 | @XmlElementDecl(namespace = "http://www.w3.org/2000/09/xmldsig#", name = "SPKISexp", scope = SPKIDataType.class)
public JAXBElement<byte[]> createSPKIDataTypeSPKISexp(byte[] value) {
return new JAXBElement<byte[]>(_SPKIDataTypeSPKISexp_QNAME, byte[].class, SPKIDataType.class, ((byte[]) value));
} |
5658e4d1-8a0d-44f9-8a06-75479f1bab1a | 6 | private void checkPermissions() {
String name = player.getStatus();
if (name.equals("Create")) {
permitGoverning(false);
permitNationName(false);
permitTravel(false);
permitPropose(false);
permitCoup(false);
permitNewGov(false);
permitJoin(false);
permitVoteTaxe... |
f8e30e21-8d81-4a2a-81be-cd52a11e4180 | 7 | public void paint(Graphics2D g) {
g.setColor(foregroundColor);
g.setFont(xLabelFont);
if (recalculateBounds) {
initializeBounds(g);
}
// if (allowMouseDragSelection && mouseIsBeingDragged) {
// int xStart = round(mouseDragStart.x*xFactor);
// int xEnd = round(mouseDragEnd.x*xFactor);
// int rec... |
5682893b-961b-4c64-bbb4-ce735dfc3a0e | 9 | public void warn(Event event) {
switch (event.getTypeEvent()) {
case BUMP:
if (state == State.START)
state = State.PLUCK_BUMPED;
else
ignore();
break;
case USECLAWS_END:
if (state == State.PLUCK_BUMPED)
state = State.PLUCK_CAUGHT;
else
ignore();
break;
case ROTATE_END:
if (s... |
439d0ac5-9752-4e4d-ad92-e99d8122e5bf | 6 | @Override
public Sentence doProcess(Sentence st) {
String prevTag = null;
boolean changed = false;
Eojeol[] eojeolSet = st.getEojeols();
for (int i = 0; i < eojeolSet.length; i++) {
String[] tags = eojeolSet[i].getTags();
prevTag = "";
changed = false;
for (int j = 0; j < tags.length; j++... |
124d317e-08b6-4e19-bbf4-31b2953ee8e9 | 8 | private double get_w_value(int idx, int label_idx) {
if (idx < 0 || idx > nr_feature) {
return 0;
}
if (solverType.isSupportVectorRegression()) {
return w[idx];
} else {
if (label_idx < 0 || label_idx >= nr_class) {
return 0;
... |
6620a822-64f2-475f-beb4-9ba88bf82d5a | 6 | public static Creature parseFile(File f){
Creature result = null;
try {
Scanner sc = new Scanner(f);
String name = sc.nextLine();
int level = Integer.parseInt(sc.nextLine());
int initiative = Integer.parseInt(sc.nextLine());
int speed = Integer.parseInt(sc.nextLine());
String[] abbs = sc.nextL... |
85309848-1dd6-4836-9233-30c3097a9a8d | 3 | public static String formatTime(long time) {
time /= 1000;
String seconds = Long.toString(time % 60) + "s";
if (time < 60) {
return seconds;
}
String minutes = Long.toString((time % 3600) / 60) + "m ";
if (time < 3600) {
return minutes + seconds;
... |
7de61799-3673-406e-a0b2-c486ecb4fb46 | 7 | public static void insertPrimitiveSuper(Surrogate newsuper, List supers) {
{ boolean foundP000 = false;
{ Surrogate sup = null;
Cons iter000 = supers.theConsList;
loop000 : for (;!(iter000 == Stella.NIL); iter000 = iter000.rest) {
sup = ((Surrogate)(iter000.value));
if (S... |
83a4c369-b86f-4d9a-9c98-3a65f07ceadf | 6 | private int hexDigit(int value){
if(value>='0' && value<='9')
return (value-'0');
else if(value>='a' && value<='f')
return (value-'a')+10;
else if(value>='A' && value<='F')
return (value-'A')+10;
else
return -1;
} |
c90ef79a-7acd-44bb-8993-3d470876200a | 6 | private void parseArgs(String[] args) {
if (args != null && args.length > 0) {
for (String arg : args) {
if (arg.startsWith("-") && arg.lastIndexOf("=") != -1) { // -config="server.config"
arg = arg.substring(1, arg.length());
String[] keyValue... |
af0ffb1e-d5a2-4e2b-a5e1-199048ce3a1c | 2 | @Override
public double getMissingMoney(double priceInEuros) {
if (priceInEuros < 0)
throw new IllegalArgumentException("ERR00034452b");
if (priceInEuros > totalAmountInEuros)
return priceInEuros - totalAmountInEuros;
else
return 0;
} |
02834d6c-0eba-4667-bb69-a6a118b4bac9 | 9 | protected void openDocument() throws XPathException {
if (writer==null) {
makeWriter();
}
if (characterSet==null) {
characterSet = UTF8CharacterSet.getInstance();
}
// Write a BOM if requested
String encoding = outputProperties.getProperty(OutputK... |
9ba9bd38-1abd-4bc7-89b8-9f0e1276e771 | 7 | private static int resolveFirstDayOfWeek(String firstDayOfWeek) {
if (firstDayOfWeek.equalsIgnoreCase("sunday")) {
return SUNDAY;
}
else if (firstDayOfWeek.equalsIgnoreCase("monday")) {
return MONDAY;
}
else if (firstDayOfWeek.equalsIgnoreCase("tuesday")) ... |
85b9c34b-f790-4dad-89f7-880139cbb146 | 4 | private void readParameterAnnotations(int v, final String desc,
final char[] buf, final boolean visible, final MethodVisitor mv) {
int i;
int n = b[v++] & 0xFF;
// workaround for a bug in javac (javac compiler generates a parameter
// annotation array whose size is equal to t... |
86aba103-3a7b-4eef-8011-7488d4f75da3 | 7 | public static Object mlmpVehicleSpawn(int type, World world, double x, double y, double z, Entity thrower, Object currentEntity) throws Exception
{
Class mlmp = getClass("ModLoaderMp");
if (!isMLMPInstalled() || mlmp == null)
{
return currentEntity;
}
Ob... |
fab11f24-3874-43c7-8494-e2f63e753ca6 | 3 | public static void enableEvent(Cuboid c, CuboidEvent event) {
if (c == null || event == null) return;
if (c.getEvents().contains(event)) return;
c.getEvents().add(event);
} |
5aa4060e-bfb3-4db7-9e9e-15a1fe9a444d | 6 | private void storeWrite() { try {
if (localstorefile==null) return;
PrintWriter writer=new PrintWriter(
new FileWriter(new File(localstorefile)) );
for (Enumeration e=localstore.keys(); e.hasMoreElements(); ) {
String k = (String)e.nextElement();
Object o = localstore.get(k);
if (o instanceof Integer)... |
dedfe408-9dfe-4fdb-9f28-cfadc9a9e2c8 | 1 | public boolean isGravityDebugStatus() {
if(frame == null) buildGUI();
return gravityDebugStatus.isSelected();
} |
da7f5ae4-755c-4dc7-beb2-eae0204df822 | 2 | public static ArrayList<Ticket> showAll() {
ArrayList<Ticket> tickets = new ArrayList<Ticket>();
Database db = dbconnect();
try {
db.prepare("SELECT * FROM ticket ORDER BY TID");
ResultSet rs = db.executeQuery();
while(rs.next()) {
tickets.add(TicketObject(rs))... |
6b220699-e769-4383-929a-3a0d40286793 | 4 | public boolean doneCheck(UQuest plugin, Player player){
try{
Quester quester = plugin.getQuestInteraction().getQuester(player);
//gatherObectives(plugin, player, quester);
int doneAmount = 0;
for(Objective objective : this.objectives){
if(objective.doneCheck(player, quester.getTracker(plugin, objectiv... |
398681a3-ae0e-4356-98d0-4b9cc42a9d6c | 1 | protected static Output getInstance() {
if (instance == null) {
new Output();
}
return instance;
} |
340dd8a2-1b8c-4591-a478-87b4be8dd13b | 4 | public String getClassType(int i) throws ClassFormatException {
if (i == 0)
return null;
if (tags[i] != CLASS)
throw new ClassFormatException("Tag mismatch");
String clName = getUTF8(indices1[i]);
if (clName.charAt(0) != '[') {
clName = ("L" + clName + ';').intern();
}
try {
TypeSignature.checkT... |
e8c6cdcf-226b-4d42-bb79-c37d0513625c | 8 | public Response changerEtatDuneAnomalie(String nomProjet,
String sujetAnomalie, Note note, UriInfo uri,String newEtat) throws Exception {
URI uriReponse;
Response reponse;
Projet projet;
Anomalie newAnomalie;
int index;
long idToRemove = -1;
projet = dao.getProjet(nomProjet);
if(projet != null){
i... |
f8100141-14a3-47e4-8099-5dbe6ecbd046 | 8 | @Override
public void actionPerformed(ActionEvent e) {
for(int i=0; i<10; i++){
if(levelItems[i]==e.getSource())
{
canvas.load(i);
break;
}
}
if(reset == e.getSource())
{
canvas.reset();
}
if(load == e.getSource())
{
int returnVal = fc.showOpenDialog(null);
... |
1338262c-c87f-4348-9035-1b5aff283a5b | 0 | public static void main(String[] args) throws SocketException {
instance = new UDPChat();
} |
cd1a0410-20d9-436b-a43f-6f4f90972101 | 9 | @Override
public void dump(Map<String, Object> into) throws IOException {
super.dump(into);
{
StringBuilder request = new StringBuilder(requestHeaders);
request.append(EOL);
if (requestExcerpt != null) {
request.append(new String(requestExcerpt, re... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.