method_id stringlengths 36 36 | cyclomatic_complexity int32 0 9 | method_text stringlengths 14 410k |
|---|---|---|
672e49ca-c8b7-4334-ab40-13afdc007973 | 9 | public Vector getMatchingFiles() {
String dir;
String filter;
// #################################################
// Initialising Absoulute Directory:
// Windows : getAl�bsolutePath
// Unix-Linux-OS : $HOME directory
String absDir;
Strin... |
ae3f8a71-fc45-4e45-8661-4345655555e4 | 3 | public int getLow(int symbol) {
checkSymbolInRange(symbol);
int low = freqTable.getLow (symbol);
int high = freqTable.getHigh(symbol);
int total = freqTable.getTotal();
if (!(0 <= low && low <= high && high <= total))
throw new IllegalStateException("Symbol low cumulative frequency out of range");
ret... |
18cab1a8-fea5-4c97-9fe6-07d1a911944b | 6 | @Override
public List<Double> transform(List<Double> in) {
if (in.size() != values.size()) {
throw new MLException(String.format(
"Unexpected in-vector size. Expected: %d, Got: %d", values.size(), in.size()));
}
List<Double> out = new ArrayList<Double>();
... |
c1885fda-3dfb-40ef-a4f1-4e13eb843eea | 5 | public void layout () {
if (sizeInvalid) {
computeSize();
if (lastPrefWidth != prefWidth) {
lastPrefWidth = prefWidth;
invalidateHierarchy();
}
}
SnapshotArray<Actor> children = getChildren();
float groupHeight = getHeight();
float x = 0;
float y = getHeight();
float maxWidth = 0;
for (... |
20ba0a5e-39a6-4e7a-8632-32ec5754a1f7 | 7 | public boolean hasTheSameParameters(final Method method, final Method candidate) {
final Class<?>[] methodParameters = method.getParameterTypes();
final Class<?>[] candidateParameters = candidate.getParameterTypes();
if (methodParameters.length != candidateParameters.length) {
retur... |
cf52aa3f-1b71-4958-a8bb-b6c82909d315 | 6 | @Override
public Map<String, UUID> deleteNamesAndReturn(final String... names) {
Map<String, UUID> map = new HashMap<>();
List<String> lowercaseNames = new ArrayList<>();
// Convert names to lowercase
for (int i = 0; i < names.length; i++) {
lowercaseNames.add(i, names[i... |
a997dfb2-d265-474e-9618-49b2679cacdb | 4 | protected void encodeFields(mxCodec enc, Object obj, Node node)
{
// LATER: Use PropertyDescriptors in Introspector.getBeanInfo(clazz)
// see http://forum.jgraph.com/questions/1424
Class<?> type = obj.getClass();
while (type != null)
{
Field[] fields = type.getDeclaredFields();
for (int i = 0; i < fi... |
b084e091-be39-43e0-83b3-48f7a6515114 | 2 | public void add(Identificador id, int nivel) throws IdentificadorJaDefinidoException{
verificarIdPrograma(id);
if(!tabela.containsKey(nivel))
tabela.put(nivel, new HashMap<String, Identificador>());
HashMap<String, Identificador> tabelaNivel = tabela.get(nivel);
if(tabelaNivel.containsKey(id.getNome... |
6cee887d-866a-4998-94f7-4b251103f8b6 | 0 | public InformationForm(int x, int y, int width, int height, int widthDest, int heightDest, String texture, StarSystem world) {
super(x, y, width, height, widthDest, heightDest, texture);
setNameGameWorld(world.toString());
this.world = world;
createForm();
} |
beeaee23-6f06-43ee-81f7-9a0aa5380d24 | 2 | public T cerca(T x) {
AlberoBin<T> tmp = cercaNodo(x);
if (tmp == null || !tmp.val().equals(x)) return null;
return tmp.val();
} |
8a40540b-3790-4047-8b97-15cc3141cbb7 | 4 | public void deleteChannel(String channel){
for(String data:plugin.getChannel(channel).members){//set online players to new channel
ChatPlayer cp = plugin.getChatPlayer(data);
cp.removeChannel(channel);
if (plugin.globalDefault) {
cp.setCurrentChannel(plugin.getChannel("Global"));
} else {
ChatChan... |
3e382dee-2224-4c9b-85e9-9d02e76fe413 | 8 | public void update(Object changedObject){
ArrayList<String> fields;
ArrayList<String> values;
HashMap<String, String> map;
String table = changedObject.getClass().getSimpleName();
switch(table){
case "User":
User user = (User) changedObject;
... |
a6eab970-bad6-429d-abc0-660eecafbfcc | 0 | @Override
public void method1(String str) {
} |
9a42da11-d415-423f-906a-7b9f7b42fbef | 4 | public boolean equals(Object other) {
if (this == other)
return true;
if (other instanceof Vector) {
Vector vec = (Vector) other;
return this.x == vec.x && this.y == vec.y && this.z == vec.z;
}
return false;
} |
a1d479ed-e825-496a-b7a9-22cb306d9ecb | 0 | public Point2D.Double getPos()
{
return myBottomLeft;
} |
331ab8d6-936d-479f-8b01-ed0dfab76882 | 1 | public void addAccount(BankAccount account) throws IllegalArgumentException {
if (! canHaveAsAccount(account))
throw new IllegalArgumentException();
accounts.add(account);
} |
35344d0d-53e8-43e6-b79d-ed4b82d774eb | 1 | public boolean isStart() {
return isDoubled() && "".equals(name);
} |
b90c70ca-cca0-4af1-8cfa-4c324589615e | 3 | private boolean isAllZero() {
for (int i = 0; i < this.kmap.getRow(); i++) {
for (int j = 0; j < kmap.getColumn(); j++) {
if (kmap.getCellValue(i, j)) {
return false;
}
}
}
return true;
} |
f393adf0-335d-4bc5-ad31-d242f3cef14c | 5 | private void getXMLElement() throws MiniXMLException {
MiniXMLToken oMiniXMLToken;
boolean bEnd = false;
String attrName, attrValue;
MiniXMLAttrElement element = new MiniXMLAttrElement(0, "?xml");
// System.out.print("<?xml");
do {
oMiniXMLToken = oTokenParser.getToken();
switch (oMiniXMLToken.getType... |
ad1ee231-8e43-4812-87b9-33bfc1853272 | 2 | public boolean closeToGround(int currentX, int currentZ, int width, int hight) {
boolean closeToGround = false;
for(int x = currentX; x < currentX + width; x++) {
if(currentZ+hight-10 > ground[x]) {
closeToGround = true;
}
}
return closeToGround;
... |
2ccb9b0c-626a-4dcd-b290-1ba127f3af0f | 1 | public int get(int symbol) {
checkSymbolInRange(symbol);
int result = freqTable.get(symbol);
if (result < 0)
throw new IllegalStateException("Negative symbol frequency");
return result;
} |
a4c7ec06-a45d-4412-8717-afa1546000a0 | 1 | private boolean LoadImage(TextureFormat _format, String _file) {
fileName = _file;
String _texFormat = getFormatString(_format);
try {
texture = TextureLoader.getTexture(_texFormat, ResourceLoader.getResourceAsStream(_file));
} catch (IOException e) {
System.err.print("RoyalFlush: Texture2D.LoadImage - F... |
2687c883-20cb-4bbf-ade2-d252f567317f | 7 | public Direction hitObj(GameObj other) {
if (this.willIntersect(other)) {
double dx = other.pos_x + other.width /2 - (pos_x + width /2);
double dy = other.pos_y + other.height/2 - (pos_y + height/2);
double theta = Math.atan2(dy, dx);
double diagTheta = Math.atan2(height, width);
if ( -diagTheta <= ... |
5c97e783-d990-4428-b9e9-782ca38804aa | 1 | public void Draw(Graphics2D g2d)
{
this.Update();
// Checks if show delay is over.
if(this.timeOfAnimationCration + this.showDelay <= System.currentTimeMillis())
g2d.drawImage(animImage, x, y, x + frameWidth, y + frameHeight, startingXOfFrameInImage, 0, endingXOfFrameInI... |
1beca68d-0b91-4e91-83c4-0a6bf6b45256 | 5 | private void modifyLinkParser(String input){
Scanner inputscanner = new Scanner(input);
inputscanner.next(); //take away command
Node source = getNodeFromName(inputscanner.next());
Node dest = getNodeFromName(inputscanner.next());
Link link = getLink(source, dest);
while(inputscanner.hasNext()){... |
8683f68c-74f9-46fc-bc66-62f85aaae40b | 5 | @Override
public String getPlotString() {
String dataString = "";
String plotString = "set terminal png\n";
plotString += "set title \"Link " + lastLinkInfo.sourceNode + "->" + lastLinkInfo.destinationNode + "\"\n";
plotString += "set xrange [-25:15]\n set yrange [0:10]\n";
... |
5c2fc9bd-6832-4fe2-9fdd-686507fc99ce | 4 | public static String getLocationTitle(Users users, String locationId) {
JSONArray locations = users.getLocations();
if (locations.length() > 0) {
String locationTitle;
try {
for (int i = 0; i < locations.length(); ++i) {
JSONObject location = l... |
2de90e14-7a80-437f-995b-f48c4599c1f2 | 4 | public void setPlayer2Piece(JLabel label) {
boolean test = false;
if (test || m_test) {
System.out.println("Drawing :: setPlayer2Piece() BEGIN");
}
if (test || m_test)
System.out.println("Drawing:: setPlayer2Piece() - END");
m_player2Piece = label;
} |
af41893c-9861-47b1-8b49-f3667d6d0133 | 3 | @EventHandler
public void onPlayerMove (final PlayerMoveEvent event){
if (!plugin.isEnabled()) return;
if (event.isCancelled()) return;
if (frozen.contains(event.getPlayer())){
event.setCancelled(true);
}
} |
5615ba29-1174-4cc3-96a8-a1c2bedc22d0 | 8 | public final GalaxyXDefinitionParser.assignment_statement_return assignment_statement() throws RecognitionException {
GalaxyXDefinitionParser.assignment_statement_return retval = new GalaxyXDefinitionParser.assignment_statement_return();
retval.start = input.LT(1);
int assignment_statement_Start... |
a8cf65a5-e1b5-42b1-811a-cf1a87081807 | 2 | @Override
public void update ( GameContainer cont, int delta ) throws SlickException {
//long st = System.nanoTime();
if ( input == null ) {
input = cont.getInput();
}
if ( input.isKeyPressed( Input.KEY_F12 ) ) {
long millis = System.currentTimeMillis();
String ssname = "/tmp/" + milli... |
ef3440b1-7c3b-428d-925c-94fe5c1ce12a | 1 | protected void demo13() throws IOException, UnknownHostException, CycApiException {
Log.current.println("Demonstrating isQueryTrue api function.\n");
CycFormulaSentence gaf = cycAccess.makeCycSentence("(#$likesAsFriend #$BillClinton #$JimmyCarter)");
CycFort mt = cycAccess.getKnownConstantByName("PeopleData... |
aafcdac4-13b3-4ba4-9216-903019a908b6 | 0 | @Override
public String getServletInfo() {
return "Short description";
}// </editor-fold> |
b66ef3d1-e7ea-4896-b055-806708803b31 | 1 | private static void dehoist_all(OutlinerDocument doc) {
try {
TextKeyListener.dehoist_all(doc.tree.getEditingNode());
} catch (Exception e) {
System.out.println("Exception: " + e);
}
} |
b75a8517-f214-4a21-ae62-96ac7e2eeb74 | 6 | public void setData(Object data) {
if(data instanceof Byte){
this.data = new byte[]{(Byte)data};
return;
}
if(data instanceof Short){
this.data = new short[]{(Short)data};
return;
}
if(data instanceof Integer){
this.data = new int[]{(Integer)data};
return;
}
if(data instanceof Long){
... |
2ebcb1aa-a619-486d-a895-4fc4f79c7b3a | 8 | public static void mouseClicked(MouseEvent mouseEvent) {
Iterator<PComponent> it = components.iterator();
while(it.hasNext()) {
PComponent comp = it.next();
if(comp == null)
continue;
if (shouldHandleMouse) {
if (comp.shouldHandleMouse(... |
f6ed75bc-41d6-44e6-a237-b331058f8477 | 9 | private int getThreshold(BigLong2ShortHashMap hm) {
if (maximalBadFrequency.get() != null) {
return maximalBadFrequency.get();
}
long totalKmers = 0;
int[] stat = new int[STAT_LEN];
Iterator<MutableLongShortEntry> it = hm.entryIterator();
while (it.hasNext())... |
d815acb8-5163-49dd-88e1-53f6bc3eb4fc | 9 | private Location findFood(Location location)
{
Field field = getField();
List<Location> adjacent = field.adjacentLocations(getLocation(), 1);
Iterator<Location> it = adjacent.iterator();
while(it.hasNext()) {
Location where = it.next();
Object animal = field.g... |
f8526ba1-3f37-41e7-ab59-4ecd59e83084 | 7 | public Rules(String file) {
String[] aux; // Auxiliar para parsear las lineas
String temp = null; // Temporal para recoger las lineas
String rule, tags;
File f = null;
FileReader fr = null;
BufferedReader br = null;
try
{
f = new File(file);
fr = new FileReader(f);
br = ne... |
8d47031d-72e5-4787-98bd-3612e811e357 | 5 | public float getJaroWinklerMetric(String string1, String string2) {
List<String> lstCommonChar1 = getCommonCharacters(string1, string2);
List<String> lstCommonChar2 = getCommonCharacters(string2, string1);
//check for zero in common
if (lstCommonChar1.size() == 0 || ls... |
efbe21d2-9a8a-4ded-9995-fcf3f9f1cd63 | 0 | public int calculate(int a, int b)
{
return a * b;
} |
2beed609-ee19-4567-b8df-a809fa8d0ad6 | 1 | public Spawner(InitialJFrame application)
{
super("Spawner");
this.application = application;
patient = new SimulatedPatient();
patient.activate();
PatientFrame patientFrame = new PatientFrame(patient);
patientFrame.activate();
title = new JLabel(" Spawner");
title.setFont(new Font("Aria... |
05245a0a-2e83-4487-80df-479dcc91e34e | 5 | private void checkIfValidBooking(BookingRequestTo bookingRequestTo) throws BookingException {
if (bookingRequestTo == null) {
throw new BookingException("No booking request received.");
}
if (bookingRequestTo.getTripId() == null) {
throw new BookingException("No trip id p... |
7e0443c8-e18b-4d92-ae90-9b0e2ef4a481 | 6 | private float getAngle(float hyp, float cX,float cY)
{
double angle = Math.acos(cX/hyp);
if(cY < 0 && cX > 0)
angle = -angle;
else if(cY < 0 && cY < 0)
angle = -angle;
else if(cX == 0 && cY < 0)
angle = -angle;
return (float)(angle);
} |
ab236e28-87e6-40df-9960-11143c69eb47 | 2 | public ScheduleServer() {
//create the channel holding the commands
channel = new LinkedBlockingQueue<>();
//create the thread unsafe lists
actions = Multimaps.newListMultimap(new EnumMap<>(DAY_PHASES.class),
LinkedList::new
);
//create map of effects
... |
cbcfe0b4-e311-4c5b-a77d-e83c5931bcb6 | 2 | public Collection<Equipa> values(String cod_competicao){
try {
Collection<Equipa> col = new HashSet<Equipa>();
Statement stm = conn.createStatement();
ResultSet rs = stm.executeQuery("SELECT Equipa.* FROM Equipa,EquipaCampeonato where EquipaCampeonato.cod_equipa=Equipa.cod_e... |
6e06007f-d617-4c33-b1c0-ef9f56392232 | 2 | private void givePoints(int homeGoals, int guestGoals, Match results) throws SQLException
{
int homeTeamID = results.getHomeTeamId();
int guestTeamID = results.getGuestTeamId();
/*
* Point giving for HomeTeam.
*/
if (homeGoals > guestGoals)
{
int... |
be0b4acb-9181-469d-b182-e0d5a0669495 | 8 | public Mesh parseStream(BufferedReader stream) throws IOException
{
String line = null;
ScanData sd = new ScanData();
MeshData md = new MeshData();
Mesh currentMesh = new Mesh();
int lineindex = 0;
stream.mark(10000000);
boolean marked = false;
// First read all the vertexData
while((line = stream.re... |
c1a62991-399c-4caf-8b7f-dcf50c95af34 | 4 | public FieldVisitor visitField(
final int access,
final String name,
final String desc,
final String signature,
final Object value)
{
if (computeSVUID) {
if ("serialVersionUID".equals(name)) {
// since the class already has SVUID, we won't ... |
c9642553-f8cb-4596-ba24-e18a9bf167c4 | 5 | private long mul(long a, long b) {
long result = 0;
a %= mod;
b %= mod;
if (a > b) {
long tmp = a;
a = b;
b = tmp;
}
while (a != 0) {
if (a % 2 != 0) {
result += b;
if (result >= mod) result -... |
a7211d83-9a88-49eb-9f43-f2cfc011e27d | 3 | public void go_right(){
if( this.direction != Tank.direction_right){
this.direction = Tank.direction_right ;
}else{
if(this.location_x + this.speed <= this.active_area_x - this.getWidth() && ifCanWalkInThisDirection())
{
this.location_x += this.speed ;
ifGetProps();
}
}
} |
41422098-1cf8-4194-b0bb-6ed5af446d1b | 4 | private static boolean miller_rabin_pass(BigInteger a, BigInteger n) {
BigInteger n_minus_one = n.subtract(BigInteger.ONE);
BigInteger d = n_minus_one;
int s = d.getLowestSetBit();
d = d.shiftRight(s);
BigInteger a_to_power = a.modPow(d, n);
if (a_to_power.equals(BigInteger.ONE)) retur... |
0b4bb57c-b963-43f3-b527-566884ea02c4 | 0 | public manufacturerPart(String id){
super(id);
} |
858d19fa-3917-4778-9b22-357263756532 | 9 | public String[][] agendaMedico (String id_medico, String mes,String ano ){
String sql_consult;
String fecha_ini, fecha_fin;
String [] [] resultado = null;
String dia_final;
int mes_entero = Integer.parseInt(mes);
switch (mes_entero)
{
case 2 : dia_fin... |
5fd58e57-6e51-4fc7-b194-8ae564684b85 | 8 | private boolean hasNullElements(SimulationConfiguration config) {
return config.getEnvironment() == null || config.getHuman() == null
|| config.getHumanZombieInteraction() == null || config.getPopulation() == null
|| config.getResources() == null || config.getZombieEpidemic() == n... |
2ca89758-1b8e-4d8d-a161-267561739c3a | 0 | public String getNomeUser() {
return nomeUser;
} |
ad4874d6-91b0-4f83-946d-136c9e729ce7 | 4 | public void mouseReleased(MouseEvent me) {
if(closeUnderMouse(me.getX(), me.getY())){
boolean isToCloseTab = tabAboutToClose(selectedTab);
if (isToCloseTab && selectedTab > -1){
String tab = tabbedPane.getTitleAt(selectedTab);
if (tab.contains("Error"))
GrooveJaar.results.remove(tab);
... |
2ef2df1d-8333-4c8b-9473-54c67b84edc0 | 1 | @Override
public void onUsersChanged(Users users) {
if (users == null) {
userInfoLabel.setText("");
GuiUtils.clearTestInfo(testIdComboBox);
return;
}
userInfoLabel.setText(users.toString());
} |
99749d59-4169-4072-a53b-59b4b91f74d3 | 4 | public void close() {
if (networkClient != null && networkClient.isConnected()) {
System.out.println("CLIENT: Closing connection.");
networkClient.close();
}
running = false;
boolean retry = true;
while (retry) {
try {
join(... |
a15fb134-4c41-4a16-92ea-07d5d97530c6 | 2 | private void getDataFromSectionTable () {
try {
connection = DriverManager.getConnection(Utils.DB_URL);
statement = connection.createStatement();
resultSet = statement.executeQuery("SELECT id, name FROM Section");
while (resultSet.next()) {
sectio... |
eb1aef1e-f243-469c-8db3-1a10e945d071 | 9 | public static List<String> removeLineComments(List<String> lines) {
for (int i = 0; i < lines.size(); i++) {
String string = lines.get(i);
String newLine = "";
boolean abortRead = false;
char[] chars = string.toCharArray();
if(chars.length == 0 || ch... |
9cd21e11-fdc6-4dd5-b2d2-607649bf1ac0 | 6 | public static void main(String args[])
{
Scanner sc = new Scanner(System.in);
String str = "Happy birthday to you Happy birthday to you Happy birthday to Rujia Happy birthday to you";
StringTokenizer strTokenizer = new StringTokenizer(str," ");
String[] array=new String[17];... |
900dd3f0-078b-4fda-bec6-0d6263c6b65a | 6 | private static int partition(Comparable[] a, int lo, int hi)
{ // Partition into a[lo..i-1], a[i], a[i+1..hi].
int i = lo, j = hi + 1; // left and right scan indices
Comparable v = a[lo]; // partitioning item
while (true)
{ // Scan right, scan left, check for scan complete, and exchange.
while (SortHelper.l... |
c80da61e-545b-400a-a49e-2dcdc434fac3 | 5 | boolean isOdd(int num){
// int oddCount=0;
// int evenCount=1;
//
// while(isOdd!=true && num>=0){
// evenCount++;
// isOdd=true;
// num--;
// }
//
// while(isOdd && num>=0){
// oddCount++;
// isOdd=false;
// num--;
// }
//
// System.out.println(oddCount);
// System.out.println(evenCount);
//
// if(oddCount... |
749b7e2b-0e82-4cfc-b060-500b9eaf5cbd | 1 | public static DamagePackage onHit(PassiveWeaponEnchant type, int power) {
switch (type) {
case FIRE_BONUS:
return new DamagePackage(5 * power, DamageType.ELEMENT_FIRE);
}
return new DamagePackage(0, DamageType.SLASHING);
} |
d51b61f2-a9dc-43f7-b801-3e05451e1ef7 | 6 | public void propertyChange(PropertyChangeEvent event) {
if (!(event.getPropertyName().equals(PropertiesDB.kName)))
return;
Context.updateFont();
fFont = Context.getFont();
if (fFont == null)
return;
synchronized(fFontListenerList) {
for (FontListener l: fFontListenerList)
... |
bbf3da42-b16c-4bd7-bf79-980a11732d7d | 1 | @Test
public void branchInstrBR_testInvalidTargetRef() { //Checks instr. not created with invalid memory ref.
try {
instr = new BranchInstr(Opcode.BRE, 100);
}
catch (IllegalStateException e) {
System.out.println(e.getMessage());
}
assertNull(instr);
} |
120480b7-2e7e-416f-8856-8efd0b2d29bd | 5 | public static void run(byte[] bytecode, String className) {
try {
JavaBytecodeRunner bytecodeRunner = new JavaBytecodeRunner();
Class newClass = bytecodeRunner.defineClass(className, bytecode, 0, bytecode.length);
Method[] methods = newClass.getMethods();
for (Met... |
650b8c97-a0ac-4edb-b704-ec6896c2a9b2 | 6 | public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
{
MovingObjectPosition var4 = this.getMovingObjectPositionFromPlayer(par2World, par3EntityPlayer, false);
if (var4 != null && var4.typeOfHit == EnumMovingObjectType.TILE)
{
... |
b16ece79-615d-467d-b7d1-6888e3d08b99 | 0 | public void setSkillName(String skillName) {
this.skillName = skillName;
} |
75ad29d0-8362-4f05-9bc1-e7408bf3bf80 | 7 | public int get(int i){
switch (i) {
case 1:
return bnu1;
case 2:
return bnu2;
case 3:
return bnu3;
case 4:
return bnu4;
case 5:
return bnu5;
case 6:
return bnu6;
case 7:
return bnu7;
default:
return -1;
}
} |
66f57c48-8615-4394-9121-cb04cdc9031e | 5 | public boolean execute(CommandSender sender, CommandArgs args) throws Throwable
{
try
{
Object result = this.method.invoke(this.commandContainer, sender, args);
if (result instanceof Boolean)
{
return ((Boolean)result).booleanValue();
}... |
daf2b4eb-60e5-44ba-9e56-a59a0cb835b2 | 0 | public Word(String eWord, String rWord){
this.rWord = rWord;
this.eWord = eWord;
} |
99395737-0caa-4320-a0b0-b7902f6fcc47 | 5 | private boolean isToken(ItemStack itemStack) {
if(itemStack == null)
return false;
if(! itemStack.getType().equals(Material.FLOWER_POT_ITEM))
return false;
if(itemStack.getItemMeta() == null)
return false;
if(itemStack.getItemMeta().getDisplayName() == null)
return false;
if(! itemStack.getItemMet... |
2de3ed85-7fec-4b56-921a-a627a6700512 | 7 | public void update(long dt) {
if (Config.use_wasd) {
Coord newWASD = APXUtils.updateWASD();
if (!newWASD.equals(lastWASD)) {
lastWASD = newWASD;
map_click_ntf(lastWASD.x, lastWASD.y, 1, 0);
}
}
Gob pl = glob.oc.getgob(playergob... |
88abade9-9661-47c5-8003-3c79f1e63999 | 2 | public static Character getCharacter(ByteBuf packetPDU) {
byte value = packetPDU.readByte();
if (0x2F == value) {
return null;
}// else read the separator and return the value
if (0x2F != packetPDU.readByte()) {
throw new IllegalArgumentException("0x2F expected after a character field");
}
return (... |
78f5795a-5250-4fbc-9dce-0df523042b29 | 7 | protected boolean isKeyInTable(String tableName,
ResultProducer rp,
Object[] key)
throws Exception {
String query = "SELECT Key_Run"
+ " FROM " + tableName;
String [] keyNames = rp.getKeyNames();
if (keyNames.length != key.length) {
throw new Exception("Key names and key values of... |
4edad640-f007-408a-9b62-e1c2d8ff8d49 | 5 | public static List<MorrisBoard> generateHopping(MorrisBoard crtBoard) {
List<MorrisBoard> possibleBoard = new ArrayList<MorrisBoard> ();
for (int indexFrom = 0; indexFrom < MorrisBoard.TOTALPOS; indexFrom++) {
MorrisIntersection posFrom = crtBoard.getIntersection(indexFrom);
if (posFrom.isWhite()) {
fo... |
800acd6c-ed2d-48a9-8e8f-7169cda0751c | 6 | private Object handleMedi(Object tos) {
if (tos instanceof Source && ((Source)tos).getMediaType() == null) {
return new FieldRef(tos, "MediaType");
}
// move medi tag out from under caln in a repository ref
else if (tos instanceof FieldRef && ((FieldRef)tos).getTarget() instanceof Repos... |
9dba6d6c-2f0d-460e-bfbe-58040cc2716a | 7 | protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
// TODO Auto-generated method stub
// Retrieving the form POST data
//int account_number = Integer.parseInt(request.getParameter("account_number"));
//int total_purchaseCost= Integer.pars... |
c976b9d2-ee7b-4810-be8e-70310c3cc117 | 6 | public static void main(final String[] args) {
final PrintWriter out = new PrintWriter(System.out, true);
final PrintWriter err = new PrintWriter(System.err, true);
final BloatContext context = new CachingBloatContext(
new ClassFileLoader(), new ArrayList(), false);
final List types = new ArrayList();
... |
5f36b70b-a28d-42ce-b9c9-452bcda88d1a | 3 | private void handlePanels() {
pnlDays.setVisible(cbClerk.isSelected() || cbCallWorker.isSelected() || cbMuseumEducator.isSelected());
pnlHours.setVisible(cbCallWorker.isSelected() || cbPartTime.isSelected());
pnlVacationPercentage.setVisible(cbCallWorker.isSelected());
} |
11412b2f-27e9-48cf-8248-e3cd39709136 | 0 | public VorbisField(Property property, PropertyTree parent) {
super(property, parent);
} |
089a7891-04d1-4ca7-bfc9-243283c5f6b7 | 7 | public static Cons walkUndefinedSlotTree(Cons tree, StandardObject firstargtype, boolean warnP, Object [] MV_returnarray) {
{ Cons cursor = tree.rest.rest;
Surrogate type = StandardObject.typeSpecToBaseType(firstargtype);
Symbol operatorname = ((Symbol)(tree.value));
while (!(cursor == Stella.NIL... |
01d27b6a-5235-4984-bc56-5053c7949435 | 0 | @AfterTest
public void teardown() {
//
} |
bb2dddcd-5b1b-4432-b167-4a6d5ed71fef | 7 | public static void testValidity(Object o) throws JSONException {
if (o != null) {
if (o instanceof Double) {
if (((Double)o).isInfinite() || ((Double)o).isNaN()) {
throw new JSONException(
"JSON does not allow non-finite numbers.");
... |
9e552f66-6610-4aa2-99a7-4a2727507055 | 1 | public void addAuthor(Author author) {
if(!getAuthors().contains(author)){
getAuthors().add(author);
}
} |
37ef945d-c179-4093-a29e-1ccfcea00ef9 | 2 | @Override
protected String determineTargetUrl(HttpServletRequest request, HttpServletResponse response) {
String targetUrl = this.getDefaultTargetUrl();
targetUrl = (String) request.getAttribute(this.targetUrlAttribute);
if (StringUtils.hasText(targetUrl)) {
try {
targetUrl = URLDecoder.decode(targetU... |
c7cdb465-0804-4de4-b2dc-982e4f3bf87f | 4 | private String valueOrNull(Node item, String tag) {
Node node = item.getFirstChild();
while (node != null) {
if (tag.equals(node.getNodeName())) {
String txt = node.getTextContent();
if (txt == null || txt.isEmpty())
return null;
return txt;
}
node = node.getNextSibling();
}
return nul... |
fdb3c819-f3ec-4fdd-9a8f-2d7c551ddc01 | 8 | private static char getChar(final int i) {
if (i >= 0 && i <= 25) {
return (char) (65 + i);
}
if (i >= 26 && i <= 51) {
return (char) (97 + (i - 26));
}
if (i >= 52 && i <= 61) {
return (char) (48 + (i - 52));
}
if (i == 62)... |
36f2ea50-d1f6-4c75-b408-bcff0c4a315d | 0 | @Override
public Node getNode() {
return node;
} |
f42f7d97-1a27-42fe-becf-70ded6892a05 | 6 | private Analyzer getAnalyzer(final String file) {
Document dom = null;
DocumentBuilderFactory dbf = DocumentBuilderFactory.
newInstance();
dbf.setNamespaceAware(true);
try {
// Ia din factory o noua instanta de document builder.
DocumentBuilder db = dbf.newDocumentBuilder();
// Parseaza pentru a ... |
d56bac72-5dba-4629-84ef-9f07c772cfef | 1 | public Font getPrintFont() {
if (printFont == null) {
printFont = new Font (fontFamily, fontStyle, fontSize);
}
return printFont;
} |
ad918ccf-7491-47b5-baf3-c9b6d8e17d58 | 3 | @Override
public boolean onCommand(CommandSender sender, Command cmd, String commandLabel, String[] args) {
if(commandLabel.equalsIgnoreCase("rq")){
if (args.length > 0) {
sender.sendMessage("Too many arguments!");
return false;
}
if (sender instanc... |
125eeee5-2cae-4064-97f4-6935613060cc | 9 | static final public AuxiliaryTree TreeRoot(boolean requiresFoot) throws ParseException {
/*@bgen(jjtree) TreeRoot */
SimpleNode jjtn000 = new SimpleNode(JJTTREEROOT);
boolean jjtc000 = true;
jjtree.openNodeScope(jjtn000);Tree t;
try {
t = TreeNode();
jjtree.closeNodeScope(jjtn000, true);
jj... |
ea66189e-cdd4-4e10-8f59-db01df870721 | 1 | public ArrayList<LineaAerea> getLineasAereas() throws SQLException{
Statement stm = getConnection().createStatement();
String sql = "SELECT * FROM operad WHERE ciata IS NOT NULL ";
ArrayList<LineaAerea> lineas = new ArrayList();
ResultSet rs = stm.executeQuery(sql);
while (rs.nex... |
b6757e25-d14d-43f8-814d-9470419a8e48 | 6 | @Override
public void run() {
// connect to traffic server
try {
socket = new Socket(hostname,port);
input = new BufferedReader(new InputStreamReader(socket.getInputStream()));
}
catch (IOException e) {
System.out.println("ERROR: Can't connect to server");
return;
}
// update traffic data
... |
0a330671-ccb6-4d33-8092-0767cf2e706b | 3 | public static double[] linearReg(double[] xData, double[] yData) {
sameArrayLen(xData, yData);
double sumX = 0;
double sumY = 0;
double prod = 0;
int nstat = xData.length;
double[] regCoef = new double[3]; //(intercept, gradient, r2)
double meanYValue = mean(yDat... |
616bc397-a762-4f64-90f3-89260334310b | 0 | public void setClientId(long clientId) {
this.clientId = clientId;
} |
11dd505e-e207-4f25-8594-4c4e4b64a44a | 0 | private void setVictims(Scanner scanner) {
numberVictims = Input.getPositiveNumber(scanner,
"Enter the number of victims:");
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.