text stringlengths 14 410k | label int32 0 9 |
|---|---|
public static void main(String[] args) {
System.out.println("Loading configuration file");
loadComputeNodeConfig();
System.out.println("Connecting to master");
try {
cServer = new CommunicationServer(Integer.parseInt(node_config.get("port")));
cServerThread = new Thread(cServer);
cServerThread.start();... | 5 |
private double[] test(List<List<String>> tokenizedTestTweets) {
int[] classCounts = { 0, 0, 0, 0 };
double fullCount = 0.0;
double[] decision = new double[4];
int idx = 0;
for (List<String> tweet : tokenizedTestTweets) {
/** tweetenként nézzük **/
for (int i = 0; i < 4; i++) {
decision[i] = Math.l... | 8 |
public void redo(){
if (this.canRedo()){
current++;
this.commands.get(current).execute();
}
} | 1 |
public String getLabel(TreeNode node) {
return (String) labels.get(node);
} | 0 |
@Override
public boolean invoke(MOB mob, List<String> commands, Physical givenTarget, boolean auto, int asLevel)
{
MOB target=mob;
if((auto)&&(givenTarget!=null)&&(givenTarget instanceof MOB))
target=(MOB)givenTarget;
if(target.fetchEffect(this.ID())!=null)
{
mob.tell(target,null,null,L("<S-NAME> <S-IS-... | 9 |
public static Animation loadAnimationFile(String animationFilename) {
try {
Scanner reader = new Scanner(new FileReader("Resources/Animations/" + animationFilename));
String spritesPath = reader.next().substring(1);
int width = reader.nextInt();
int height = reader.nextInt();
int nbOfSupportedStates = ... | 4 |
@Override public void finishPopulate()
{
} | 0 |
public int[][] getStatesOfTrans(String transcription) {
String phonems = FilesLoader.getPhonemsOfTrans(transcription);
int states[][];
int indexFirst = 0;
System.out.println("Phonem sequence : "+phonems);
String phonemsArray[]= phonems.split(" ");
int noOfTriPhones = phonemsArray.lengt... | 5 |
public static void main(String[] args) {
Map<String, Pet> petMap = new HashMap<String, Pet>();
petMap.put("My Cat", new Cat("Molly"));
petMap.put("My Dog", new Dog("Ginger"));
petMap.put("My Hamster", new Hamster("Bosco"));
System.out.println(petMap);
Pet dog = petMap.get("My Dog");
System.out.println(dog... | 0 |
@Test
public void multiThreadedTest() throws InterruptedException {
final AtomicBoolean failed = new AtomicBoolean(false);
final LastAccessTimeCounter c = new LastAccessTimeCounter();
final AtomicLong index = new AtomicLong(0);
ArrayList<Thread> threads = new ArrayList<Thread>();
for (int i = 0; i < 10; ... | 7 |
private double checkDistribution_nextBoolean(RandomGenerator randGen) {
int[] count = new int[2] ;
int total = FAST_TEST ? 1000000 : 10000000 ;
double totalD = total ;
for (int i = 0; i < total; i++) {
int n = randGen.nextBoolean() ? 0 : 1 ;
count[n]++ ;
}
double distribution = totalD / co... | 7 |
protected Class getClass(final Type t) {
try {
if (t.getSort() == Type.ARRAY) {
return Class.forName(t.getDescriptor().replace('/', '.'),
false, loader);
}
return Class.forName(t.getClassName(), false, loader);
} catch (ClassNotFoundException e) {
throw new RuntimeException(e.toString());
}
... | 2 |
public BookTicketsServlet() {
super();
// TODO Auto-generated constructor stub
} | 0 |
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Group other = (Group) obj;
if (name == null) {
if (other.name != null)
return false;
} else if (!name.equals(other.name))
return fals... | 6 |
protected void updateRange(double delta, AABB range) {
Set<Entity> entities = structure.queryRange(new HashSet<Entity>(),
range);
Iterator<Entity> it = entities.iterator();
while (it.hasNext()) {
Entity current = (Entity) it.next();
current.update(delta);
}
} | 1 |
public void binaryFilter(float cutOff, float value) {
for(int i=0; i < data.length; i++) {
float[] block = data[i];
for(int j=0; j < block.length; j++) {
block[j] = (block[j] >= cutOff ? 1.0f : 0.0f) * value;
}
}
} | 3 |
private static int calcMinValueNeeded(int curActiveFrame,int minAValueNeeded,int minBValueNeeded, Map<PII, Integer> imActiveFrame, boolean optimizeA) {
int minValueNeeded = (optimizeA ? minAValueNeeded : minBValueNeeded);
for(Entry<PII, Integer> e : imActiveFrame.entrySet())
if(curActiveFrame > e.getValue() && (... | 6 |
private void drawCurve(double[] intervalT) {
if ( intervalT == null)
return;
double s = ( maxY + minY)/ canvasHeight;
double m = Math.max( Math.max( Math.abs(derivativeY(intervalT[0])), Math.abs(derivativeY(intervalT[1]))),
Math.max( Math.abs(derivative... | 6 |
@XmlElementDecl(namespace = "http://www.w3.org/2001/04/xmlenc#", name = "CipherReference")
public JAXBElement<CipherReferenceType> createCipherReference(CipherReferenceType value) {
return new JAXBElement<CipherReferenceType>(_CipherReference_QNAME, CipherReferenceType.class, null, value);
} | 0 |
public void schemeEditorAddContact() {
if(ce_circuit2.getSelectionIndex() == -1 || ce_drain.getSelectionIndex() == -1) return;
String circuitName = ce_circuit2.getText();
String contactName = ce_drain.getText();
scheme.getCircuits().get(circuitName).getContacts().add(new Contact... | 2 |
public WheresMyBusServer( int numThreads, int queueSize, String query ) {
bq = new ArrayBlockingQueue<>( queueSize );
twitter = TwitterFactory.getSingleton();
tweetProcWorkers = new ArrayList<>( numThreads );
for ( int i = 0; i < numThreads; i++ ) {
tweetProcWorkers.add(
... | 1 |
private void close() {
try {
if (statement != null) {
statement.close();
}
if (conn != null) {
conn.close();
}
} catch (SQLException e) {
throw new RuntimeException("Erro ao fechar conexão!");
}
} | 3 |
public void run() {
try {
Thread.sleep(5000);
} catch (InterruptedException e) {
e.printStackTrace();
}
// This thread simulate the network. It allows the program to send or
// receive messages from another site.
System.out.println("-- Starting Network's thread --- \n ");
System.out.println(" ... | 8 |
private boolean readZipFile(String flName) throws IOException {
boolean success = false;
ZipFile zipFile = null;
try {
BufferedReader reader = null;
// ZipFile offers an Enumeration of all the files in the file
zipFile = new ZipFile(flName);
Enume... | 4 |
@Override
public Weapon calculateWeapon() {
Weapon calculatedWeapon;
weapons = CPUThrower.getWeapons();
if (round <= 4) {
calculatedWeapon = NCalculateWeapon(2);
} else if (round <= 6) {
calculatedWeapon = NCalculateWeapon(3);
} else if (round <= 8) {
... | 3 |
public void zero_old(int[][] matrix) {
if(matrix == null)
return;
int m = matrix.length;
if(m == 0)
return;
int n = matrix[0].length;
boolean[] row_zero = new boolean[m];
boolean[] col_zero = new boolean[n];
for(int i = 0; i < m; i++)
for(int j = 0; j < n; j++)
{
if(matrix[i][j] == 0)
... | 9 |
public boolean checkOptimization(int[] rightCuts, int index){
final int opt=index+1;
if(opt==1){//no opt
return true;
} else if(opt==2){//2-opt check
//d(t 1 ,t 2 ) > d(t 2 ,t 3 )
int t1=rightCuts[0];
int t2=Help.circleIncrement(rightCuts[0], tour.length());
// int t3=rightCuts[1];
int t3=Help.ci... | 3 |
public void addPatient(Patient newPatient) {
if (nextPatient == null) {
nextPatient = newPatient;
nextPatient.previousPatient = this;
} else {
nextPatient.addPatient(newPatient);
}
} | 1 |
private void selectImage(){
// Identify computer
String computerName = null;
try{
InetAddress localaddress = InetAddress.getLocalHost();
computerName = localaddress.getHostName();
}
catch(UnknownHostException e){
System.err.println("Cannot det... | 9 |
public static void assertElementWithTextPosition(MyElement myElement, String elementText, int expectedPosition, WebDriver driver) {
log.info("enter to function assertElementWithTextPosition with element '" + myElement.getName() + "'");
options.setDriver(driver);
options.setMyElement(myElement);
options.setTe... | 4 |
public void saveBoard(Board b){
FileWriter fichero = null;
PrintWriter pw = null;
try{
fichero = new FileWriter("savedBoard.txt");
pw = new PrintWriter(fichero);
for (int i = 0; i < 8; i++){
for (int j = 0; j < 8; j++){
... | 5 |
public Updater(Plugin plugin, int id, File file, UpdateType type, boolean announce) {
this.plugin = plugin;
this.type = type;
this.announce = announce;
this.file = file;
this.id = id;
this.updateFolder = plugin.getServer().getUpdateFolder();
final File pluginFile... | 9 |
@Override
public void loadConsole() throws DataLoadFailedException {
ConfigurationSection sec = getData(specialYamlConfiguration, "console");
YamlPermissionBase permBase = new YamlPermissionConsole(sec);
load(PermissionType.CONSOLE, permBase);
} | 0 |
@Override
public boolean equals(Object object) {
// TODO: Warning - this method won't work in the case the id fields are not set
if (!(object instanceof Atividade)) {
return false;
}
Atividade other = (Atividade) object;
if ((this.id == null && other.id != null) |... | 5 |
private String eFormatString(double x,char eChar) {
boolean noDigits=false;
char[] ca4,ca5;
if (Double.isInfinite(x)) {
if (x==Double.POSITIVE_INFINITY) {
if (leadingSign) ca4 = "+Inf".toCharArray();
else if (leadingSpace)
ca4 = " Inf".toCharArray();
e... | 7 |
private static Double[][] initializeWeight(mxAnalysisGraph aGraph, Object[] nodes, Object[] edges, Map<Object, Integer> indexMap)
{
Double[][] weight = new Double[nodes.length][nodes.length];
for (int i = 0; i < nodes.length; i++)
{
Arrays.fill(weight[i], Double.MAX_VALUE);
}
boolean isDirected = mxGrap... | 4 |
private DefaultTableModel resultSetToTableModel(DefaultTableModel model, CachedRowSetImpl rowSet) throws SQLException {
ResultSetMetaData rsMetaData = rowSet.getMetaData();
if(model == null){
model = new DefaultTableModel();
}
String columnLabels[] = new String[rsMetaData.getColumnCount() + 1];
columnLabel... | 4 |
public static final int gcd(int x1,int x2) {
if(x1<0 || x2<0) {
throw new IllegalArgumentException("Cannot compute the GCD "+
"if one integer is negative.");
}
int a,b,g,z;
if(x1>x2) {
a = x1;
b = x2;
} else {
a = x2;
b = x1;
}
if(b==0) return 0;
g = b;
while (g!=0) {... | 5 |
public int getPixel(int x, int y) {
if (x < 0 || x >= width || y < 0 || y >= height)
return -1;
return pixels[x + y * width];
} | 4 |
@Test
public void minDoesNotRemoveValuesWhenCalled() {
h.insert(v);
h.min();
assertFalse(h.isEmpty());
} | 0 |
private static void editarCliente()
{
boolean salir;
String nombre, dni;
Integer idCliente;
Cliente cliente;
do
{
try
{
System.out.print( "Introduce el Id del Cliente: ");
idCliente = Integer.parseInt( scanner.nextLine());
if ((cliente = Cliente.buscar( idCliente)) == null)
{... | 5 |
private String getEdges(Vertex<Text, Text, NullWritable> vertex) {
StringBuilder sb = new StringBuilder();
for (Edge<Text, NullWritable> edge : vertex.getEdges()) {
sb.append(sb.length() > 0 ? ", " : "");
sb.append(edge.getTargetVertexId());
}
return sb.toString()... | 2 |
public boolean func_73085_a(EntityPlayer par1EntityPlayer, World par2World, ItemStack par3ItemStack)
{
int i = par3ItemStack.stackSize;
int j = par3ItemStack.getItemDamage();
ItemStack itemstack = par3ItemStack.useItemRightClick(par2World, par1EntityPlayer);
if (itemstack != par3Ite... | 7 |
private int getChunkSize()
throws IOException
{
if (_chunkSize<0)
return -1;
_trailer=null;
_chunkSize=-1;
// Get next non blank line
org.openqa.jetty.util.LineInput.LineBuffer line_buffer
=_in.readLineBuffer();
while(... | 7 |
public Iterator<T> iterator() {
return new Iterator<T>() {
private int pos, knownMod = modCount;
{
iteratorCount++;
}
public boolean hasNext() {
boolean hn = false;
for(int a = pos; a < size(); a++) {
if(get(a) != null) {
hn = true;
break;
}
}
if... | 8 |
public static void main(String args[]) {
/* Set the Nimbus look and feel */
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
/* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
* For details see http://down... | 6 |
public static String replace(String inString, String oldPattern, String newPattern) {
if (!hasLength(inString) || !hasLength(oldPattern) || newPattern == null) {
return inString;
}
StringBuilder sb = new StringBuilder();
int pos = 0; // our position in the old string
int index = inString.indexOf(oldPattern... | 4 |
public static void main(String[] args) {
PairManager pman1 = new PairManager1(), pman2 = new PairManager2();
testApproaches(pman1, pman2);
} | 0 |
public TreeRow getFirstSelectedRow() {
if (!mSelectedRows.isEmpty()) {
for (TreeRow row : new TreeRowViewIterator(this, mRoot.getChildren())) {
if (mSelectedRows.contains(row)) {
return row;
}
}
}
return null;
} | 3 |
private double getCost(int nextLevelCalls, int[][] newBoard) {
double cost = Double.NEGATIVE_INFINITY;
if (nextLevelCalls == 0) {
cost = evaluator.evaluate(newBoard);
} else {
for (int i = 0; i < newBoard.length; i++) {
for (int j = 0; j < newBoard[i].leng... | 4 |
public void handlePut(HttpServletRequest request, HttpServletResponse response, String pathInContext, Resource resource) throws ServletException, IOException
{
boolean exists = resource != null && resource.exists();
if (exists && !passConditionalHeaders(request, response, resource))
retu... | 9 |
void checkClose () {
if ( this.closedInputStream && this.closedOutputStream ) {
// close();
}
} | 2 |
public void renderSheet(int xp, int yp, SpriteSheet sheet, boolean fixed) {
if (fixed) {
xp -= xOffset;
yp -= yOffset;
}
for (int y = 0; y < sheet.HEIGHT; y++) {
int ya = y + yp;
for (int x = 0; x < sheet.WIDTH; x++) {
int xa = x + xp;
if (xa < 0 || xa >= width || ya < 0 || ya >= height) conti... | 7 |
public static int dehexchar(char c) {
if (c >= '0' && c <= '9') {
return c - '0';
}
if (c >= 'A' && c <= 'F') {
return c - ('A' - 10);
}
if (c >= 'a' && c <= 'f') {
return c - ('a' - 10);
}
return -1;
} | 6 |
@Override
public void render(float interpolation) {
if(!isEnabled)
return;
int xPos = x+width/2-titledim[0]/2;
int yPos = y+height/2-titledim[1]/2;
if(isSelected)
Renderer.drawRect(new Vector2(x,y), new Vector2(width,height), 1, 0.6f, 0.6f, 1);
Fonts.get("Arial").drawString(title, xPos, yPos, 20... | 7 |
public boolean checksums()
{
if (h_protection_bit == 0) return true;
else return false;
} | 1 |
public AntiAliasingLine(Excel ex1, Excel ex2) {
begin = ex1;
end = ex2;
setColoredExes();
} | 0 |
private <T extends GMResponseBase> T _GET(URL url, GMRequestBase request, Class<T> responseType)
throws GongmingConnectionException {
RestTemplate restTemplate = new RestTemplate();
ResponseEntity<T> responseEntity;
T response = null;
try {
responseEntity = restTemplate.getForEntity(
... | 2 |
@Override
public void mousePressed(MouseEvent e) {
int x = e.getX();
int y = e.getY();
if (x >= this.x && y >= this.y && x <= this.x + this.width && y <= this.y + this.height)
setState(ButtonState.ACTIVE);
} | 4 |
public void loadFromFile(String file) throws IOException{
File f= new File(file);
FileReader fr= new FileReader(f);
BufferedReader bf= new BufferedReader(fr);
String line= bf.readLine();
double K=0;
int vars=Integer.parseInt(line);
line= bf.readLine();
double[] W= new double[vars];
double[] P=new doub... | 9 |
public void setPriorMap(HashMap<String, Double> priorMap) throws LangDetectException {
this.priorMap = new double[langlist.size()];
double sump = 0;
for (int i=0;i<this.priorMap.length;++i) {
String lang = langlist.get(i);
if (priorMap.containsKey(lang)) {
... | 5 |
public void moveRow(int start, int end, int to)
{
if (start < 0)
{
String message = "Start index must be positive: " + start;
throw new IllegalArgumentException( message );
}
if (end > getRowCount() - 1)
{
String message = "End index must be less than total rows: " + end;
throw new IllegalArgume... | 7 |
private static String encode_base64(byte d[], int len)
throws IllegalArgumentException {
int off = 0;
StringBuffer rs = new StringBuffer();
int c1, c2;
if (len <= 0 || len > d.length)
throw new IllegalArgumentException ("Invalid len");
while (off < len) {
c1 = d[off++] & 0xff;
rs.append(base64_co... | 5 |
private static boolean checkIsPrime(long n) {
if (n == 1) {
return false;
} else if (n < 1) {
return false;
} else if (n < 4) {
return true;
} else if (n % 2 == 0) {
return false;
} else if (n < 9) {
return true;
} else if (n % 3 == 0) {
return false;
}
long maxLoop = (long) (Math.sqrt... | 9 |
public Object readForthNode( File f, LoadContext<?> parentContext ) throws ScriptError, IOException {
final HashMapLoadContext<Object> ctx = new HashMapLoadContext<Object>(parentContext);
Interpreter interp = new Interpreter();
SafeProcedures.register(interp.wordDefinitions);
interp.wordDefinitions.put("incl... | 7 |
public boolean stem() {
int v_1;
int v_2;
int v_3;
int v_4;
// (, line 157
// do, line 159
v_1 = cursor;
lab0:
do {
// call prelude, line 159
if (!r_prelude()) {
break lab0;
}
} while (fal... | 8 |
protected static HostConfiguration getHostConfiguration(URL serviceURL) {
HostConfiguration hostConfig = new HostConfiguration();
// apply proxy settings:
String host = System.getProperty("http.proxyHost");
String port = System.getProperty("http.proxyPort");
String nonPr... | 9 |
static String describeWar(int warLength) {
switch (warLength) {
case 0:
return "warless battles";
case 1:
return "wars";
case 2:
return "double wars";
case 3:
return "triple wars";
case 4:... | 9 |
public void handleRequest(Session Session, EventRequest Message) throws Exception
{
if (Message.GetHeader() == 4000)
{
String SWFBUILD = Message.GetBodyString().replace("{0}", "");
if (!SWFBUILD.contains(Grizzly.HabboBuild) && !SWFBUILD.contains("Cracked"))
{
Grizzly.WriteOut("Build Mismatch; May ... | 7 |
@Override
public ByteBuffer encode(Message message) {
switch (getSession().getState()) {
case CONNECTED:
case LOGGING_IN:
return loginEncoder.encode(message);
case UPDATING:
// TODO: Update encoder.
break;
case LOGGED_IN:
// TODO: Game stream encoding.
break;
}
return null;
} | 4 |
private static void writePrimitiveSetBestIdentifierValueForSelect(final CodeVisitor mw,
final Class returnType,
final int psIdx,
... | 8 |
void txtTable() {
System.out.println(String.format("%-60s\t%-60s\t%-10s\t%s", "Genome", "Organism", "Status", "Database download link"));
System.out.println(String.format("%-60s\t%-60s\t%-10s\t%s", "------", "--------", "------", "----------------------"));
for (String genomeVer : genVerSorted) {
String name ... | 2 |
public void getExits() {
if (getNExit() == null && getSExit() == null && getEExit() == null && getWExit() == null) {
System.out.println("There are no exits!");
}
else {
String sExits = "";//the string of exits
if (oneExit() == true) {
System.ou... | 9 |
@Override
@SuppressWarnings("unchecked")
public MaterialPattern read(Object value) {
if (value == null) {
logger.warning("Unknown material (null value)");
return null;
} else if (value instanceof Map) {
Map<Object, Object> structure = (Map<Object, Object>) va... | 9 |
public ArrayList<String> getSoundPaths() {
return SoundPaths;
} | 0 |
public void showFirmwareReadme() {
try {
// seems odd that there isn't a cross platform way to do this!
if (os == OS.WINDOWS)
Runtime.getRuntime().exec("cmd.exe /c start firmware/readme.txt");
if (os == OS.MAC)
Runtime.getRuntime().exec("open firmware/readme.txt");
// this seems cheezy, but I don... | 4 |
private void initializeProfile() {
System.out.println("Initializing the file");
File file = new File("../src/saveData/saveFile.json");
try {
writer = new PrintWriter(file);
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
writer.flush();
writer.clos... | 1 |
private static void createDisplay() {
try {
Display.setDisplayModeAndFullscreen(new DisplayMode(1600, 900));
Display.setFullscreen(false);
Display.setVSyncEnabled(true);
Display.setResizable(false);
Game.WIDTH = Display.getDisplayMode().getWidth();
Game.HEIGHT = Display.getDisplayMode().getHeight()... | 2 |
private int getAmicableNumberSumUnder(int limit) {
Map<Integer, Integer> map = new LinkedHashMap<>(limit - 1);
for (int i = 1; i < limit; i++) {
map.put(i, getSumOfFactors(i));
}
int total = 0;
for (Map.Entry<Integer, Integer> entry : map.entrySet()) {
int... | 5 |
public void iterativeInOrder(TreeNode root) {
if (root == null) {
return;
}
Stack<TreeNode> stack = new Stack<TreeNode>();
TreeNode currentNode = root;
while (currentNode != null) {
if (currentNode.getLeft() != null) {
stack.push(currentNode);
currentNode = currentNode.getLeft();
} else {
... | 5 |
public void start(MapleCharacter c, int npc) {
if ((autoStart || checkNPCOnMap(c, npc)) && canStart(c, npc)) {
for (MapleQuestAction a : startActs) {
a.runStart(c, null);
}
if (!customend) {
final MapleQuestStatus oldStatus = c.getQuest(this);
final MapleQuestStatus newStatus = new MapleQuestStatu... | 5 |
synchronized public static org.omg.CORBA.TypeCode type ()
{
if (__typeCode == null)
{
__typeCode = org.omg.CORBA.ORB.init ().create_interface_tc (BankHelper.id (), "Bank");
}
return __typeCode;
} | 1 |
public static void main(String[] args)
throws UnspecifiedErrorException, IOException, InvalidHeaderException {
// Attach the shutdown hook to do any necessary cleanup
Runtime.getRuntime().addShutdownHook(new Thread() {
@Override
public void run() {
in.close();
}
});
// Setup the logger
C... | 7 |
@Override
public void setName(String name) {
super.setName(name);
} | 0 |
Module removeSubModule(Module module) {
if (null == this.subModules || null == module) {
return this;
}
if (this.subModules.remove(module) && this.subModules.isEmpty()) {
this.subModules = null;
}
return this;
} | 4 |
@Test
public void testForAssignments() {
for(int i = 6; i <= 10; i++) {
for(int j = 1; j <= 7; j++ ) {
try {
assertNotNull("Assesment Getter returns assignment: " + i + " " + j, AssesmentGetter.getAssignment(i, j));
} catch (ClassNotFoundException e) {
fail("Assignment " + i + " " + j + " does ... | 3 |
private void btnExcluirActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnExcluirActionPerformed
if (estaModoEdicao() && exclusaoConfirmada()) {
try {
excluir();
} catch (ValidacaoException ex) {
_unitOfWork.rollback();
J... | 3 |
public static ServiceTime getServiceTime(Address srcAddr, Address dstAddr) {
ServiceTime serviceTime = new ServiceTime();
serviceTime.setSrcAddr(srcAddr);
serviceTime.setDstAddr(dstAddr);
String url = "http://www.sf-express.com/dwr/call/plaincall/ServiceTimeManager.getServiceTime_omp.dwr";
List<NameValuePair>... | 8 |
public double getAttackMultiplier() {
if (onPrayersCount == 0)
return 1.0;
double value = 1.0;
// normal
if (usingPrayer(0, 2))
value += 0.05;
else if (usingPrayer(0, 7))
value += 0.10;
else if (usingPrayer(0, 15))
value += 0.15;
else if (usingPrayer(0, 25))
value += 0.15;
else if (using... | 9 |
public int access_x_coordinate(int x) {
if (x < 0) {
return 0;
} else if (x >= height) {
return height - 1;
} else {
return x;
}
} | 2 |
public JLabel getPlayer2Piece() {
boolean test = false;
if (test || m_test) {
System.out.println("Drawing :: getPlayer2Piece() BEGIN");
}
if (test || m_test)
System.out.println("Drawing:: getPlayer2Piece() - END");
return m_player2Piece;
} | 4 |
public void draw(Graphics2D g) {
g.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_OFF);
bg.draw(g);
g.drawImage(title, 105, 25, null);
g.drawImage(up, 290, 188, null);
g.drawImage(down, 310, 188, null);
g.drawImage(enter, 80, 188, null);
if (currentChoice == 0)... | 4 |
private static void addQueryResults(List<ConstraintViolation> results, QueryOrTemplateCall qot, Resource resource, boolean matchValue, List<SPINStatistics> stats, SPINModuleRegistry registry) {
QuerySolutionMap arqBindings = new QuerySolutionMap();
String queryString = ARQFactory.get().createCommandString(qot... | 9 |
public FineGUI(){
screenSize = Toolkit.getDefaultToolkit().getScreenSize();
screenMax = Toolkit.getDefaultToolkit().getScreenInsets(fineDialog.getGraphicsConfiguration());
taskbarSize = screenMax.bottom;
screenWidth = (int)screenSize.getWidth();
screenHeight = (int)screenSize.getHeight() - taskbarSize;
/... | 7 |
@Override
public void startSetup(Attributes atts) {
super.startSetup(atts);
addActionListener(this);
} | 0 |
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.");
... | 7 |
public static void printArgumentConstraint(OutputStream sql, Stella_Object argument, RelationColumnInfo column) {
{ NamedDescription columntype = column.columnType;
Surrogate argname = Logic.objectSurrogate(argument);
Module argmodule = ((argname != null) ? ((Module)(argname.homeContext)) : ((Module)(nu... | 8 |
private double calculateScore(ArrayList<seed> seedlist) {
double total = 0.0;
for (int i = 0; i < seedlist.size(); i++) {
double score = 0.0;
double chance = 0.0;
double totaldis = 0.0;
double difdis = 0.0;
for (int j = 0; j < seedlist.size(); j++) {
if (j != i) {
totaldis = totaldis
... | 9 |
public String toString() {
if (x!=0 && y>0) {
return x+" + "+y+"i";
}
if (x!=0 && y<0) {
return x+" - "+(-y)+"i";
}
if (y==0) {
return String.valueOf(x);
}
if (x==0) {
return y+"i";
}
// shouldn't get... | 6 |
@Override
public boolean activate() {
return Game.isLoggedIn() && Players.getLocal() != null && Players.getLocal().isOnScreen()
&& !Widgets.get(1252, 1).visible() && !Widgets.get(1234, 10).visible();
} | 4 |
Subsets and Splits
SQL Console for giganticode/java-cmpx-v1
The query retrieves a limited number of text entries within a specific length range, providing basic filtering but minimal analytical insight.