text stringlengths 14 410k | label int32 0 9 |
|---|---|
private static String getClassName(String tester, Path path, String pkgName) {
StringBuilder sb = new StringBuilder();
boolean isLast = true;
for (int i = path.getNameCount() - 1; i >= 0; i--) {
String string = path.getName(i).toString();
if (Objects.equals(tester, string)) {
break;
}
if (isLast) ... | 3 |
public static void save() {
FileWriter out = null;
try {
createParameterFilePath();
out = new FileWriter(new File(parameterFilePath));
ParameterCode[] codes = ParameterCode.values();
for (int i = 0; i < PARAMETER_COUNT; i++) {
saveParameter(out,codes[i]);
if (i != PARAMETER_COUNT-1)
out.wri... | 4 |
public static void rezeptInhaltAusgeben(Rezept rezept){
// Ausgaben Allgemeine Informationen
System.out.println();
System.out.println("Rezeptname: " + rezept.getRezeptname());
System.out.println("------------------------------");
System.out.println("Kategorie: " + rezept.getKategorie());
if(re... | 9 |
public boolean pressedOnce(int keycode) {
boolean isPressed = pressed(keycode);
boolean wasCheckedBefore = oncepressedSet.contains(keycode);
if (isPressed)
oncepressedSet.add(keycode);
return isPressed && !wasCheckedBefore;
} | 2 |
public static void setupmidi() {
// This sets up the sequencer,
// populates the list of instruments available
// on the synthesizer, and does the initial
// tuning of the synthesizer.
// The synthesizer is set up when we create kbPanel
// in createGUI().
try{
// For now we'll just use the default
// s... | 7 |
public void work(){
if(!isDragged){
if(!isUnderGroundLevel()){
velocity.y += (termVelocity-velocity.y)*acceleration;
}
else if(isUnderGroundLevel()){
velocity.y *= -1*bounceFactor.y;
position.y = Constants.ScreenY - 2*radius;
... | 5 |
public String ls() {
File folder = new File(currentDirectory);
File[] list = folder.listFiles();
StringBuilder builder = new StringBuilder();
for(File x : list) {
builder.append(" ");
builder.append(x.getName());
}
if (list.length != 0) {
... | 4 |
@Override
protected final void enter(boolean enter) {
if (enter) {
this.state.object = this.object;
if (this.object != this.state.dragging) {
mark(enter);
}
} else {
this.state.object = null;
if ((this.state.dragging == null)
|| (this.state.dragging != this.object)) {
mark(false);
}
... | 4 |
public static DNA createDNAFrom35Strand(String dna) {
if (dna == null)
return null;
StringBuffer sb = new StringBuffer();
for (int i = 0; i < dna.length(); i++) {
char n = dna.charAt(i);
if (n == ' ')
continue;
if (n == 'N') {
int nt = (int) Math.round(4 * Math.random());
switch (nt) {
... | 8 |
private static Socket parseArgs(String[] args) {
if (args != null && args.length == 2) {
String host = args[0];
int port = -1;
try {
port = Integer.parseInt(args[1]);
if (port < 0 || port > 65535) {
throw new NumberFormatException();
}
} catch (NumberFormatException ex) {
System.out.f... | 6 |
@Override
public void shuffle(){
} | 0 |
public static void main(String[] args) {
// 1 Retrieve a LdapContextSource
ContextSource ldapContextSource = null;
try {
ldapContextSource = LdapContextSourceFactory.getLdapContextSource();
} catch (Exception e) {
System.out.println("Impossible to get a LdapContextSource.... | 3 |
public void fileReplicationTransfer(ArrayList<String> fileList)
{
synchronized(fileList)
{
try
{
for(String file : fileList)
{
File f = fileManager.getSystemFile(file);
try
{
if(f.isFile())
{
Node ownerNode;
try
{
NodeManagerInter... | 7 |
public void init(Bilgisayar b){
lblMasaAdi.setText(b.getMasaAdi());
pnlSureEkle.setVisible(false);
if(b.getAcilisSaati()!=null){
if(b.getSureSiniri()!=0){
lblKalanSure.setText(Long.toString(b.getSureSiniri() - b.gecenDakikaHesapla())+" dk");
... | 3 |
public static ErrorCode parse(byte[] data) throws MessageAttributeParsingException {
try {
if (data.length < 4) {
throw new MessageAttributeParsingException("Data array too short");
}
byte classHeaderByte = data[3];
int classHeader = Utility.oneByteToInteger(classHeaderByte);
if ((classHeader < 1) ... | 7 |
public boolean[] annoutate(double[] docConcept) {
boolean[] fired = new boolean[concepts];
PriorityQueue<State> waiting = new PriorityQueue<SpreadingActivation.State>();
for (int i = 0; i < docConcept.length; i++)
if (isFired(docConcept[i]))
waiting.add(new State(docConcept[i], i));
while (!waiting.is... | 8 |
public Coord size() {
if (res.get() != null) {
Tex tex = res.get().layer(Resource.imgc).tex();
if(tex == null)
return new Coord(1, 1);
else
return tex.sz().div(30);
} else {
return new Coord(1, 1);
}
} | 2 |
public void bestPages(String query){
DecimalFormat fmt = new DecimalFormat("0.00");
double [] common = new double [docCount];
double [] docSpecific = new double [docCount];
double [] simValues = new double [docCount];
double queryWeights=0;
double tfidf = 0;
Query search = new Query(termIndex);
for (Ter... | 9 |
@Override
public String execute() {
IUnitOfWork unitOfWork = (IUnitOfWork) commandParameter.getSessionAttribute(ApplictionResources.getTransactionTokenKey());
String firstName = (String) commandParameter.getRequestAttribute(CONTACT_FIRST_NAME_ATTRIBUTE);
String lastName = (String) commandParameter.getRequ... | 1 |
void close() {
try {
// Close if already closed yet.
if (raf != null) {
raf.close();
raf = null;
}
file = null;
} catch (IOException e) {
throw new RuntimeException(e);
}
} | 2 |
private synchronized int count_consoles(int servers) {
int consoles = 1;
if (servers > 15) {
consoles = servers / 15;
if (servers % 15 > 0) {
consoles++;
}
return consoles;
} else {
return consoles;
}
} | 2 |
public void work2(int v,int destnation){
boolean used[]=new boolean [nodelen];
//every site pass this route's cost
int price[][]=new int[nodelen][routelen];
int pre[]=new int[nodelen];
for(int i=1;i<nodelen;i++){
used[i]=false;
pre[i]=0;
}
used[v]=true;
pre[v]=v;
for(int i=1;i<=nodelen;i++)if... | 9 |
public void recevoir(Information<Float> information) {
informationRecue = information;
if (information.iemeElement(0) instanceof Float) {
int nbElements = information.nbElements();
float[] table = new float[nbElements];
for (int i = 0; i < nbElements; i++) {
table[i] = information.iemeElement(i);
}
... | 5 |
public void remove(Course[][] courses)
{
System.out.println();
System.out.print("Enter semester to remove: ");
int semester = scan.nextInt();
System.out.print("Enter course to remove: ");
int course = scan.nextInt();
if( semester > courses.length || course > courses[semester].length || courses[semester][co... | 3 |
@Override
public void actionPerformed(ActionEvent e)
{
JButton buttonPressed = (JButton) e.getSource();
String id = buttonPressed.getText();
switch (id)
{
case "Sound Off":
soundButton.setIcon(soundOff);
soundButton.setText("Sound On");
soundButton.setToolTipText("Sound On");
... | 7 |
public void renderScreenImage(Graphics g, Dimension size, Rectangle clip) {
if (isTainted || getSlabEnabled())
setModelVisibility();
isTainted = false;
if (size != null)
setScreenDimension(size);
setRectClip(null);
int stereoMode = getStereoMode();
switch (stereoMode) {
case JmolConstants.STEREO_DOU... | 9 |
private void mergeManagement(List<Dependency> target, List<Dependency> management) {
resolveVersions(target, management);
nextParentDep: for (Dependency parentDep: management) {
for (Dependency dependency: target) {
if (dependency.equalsIgnoreVersion(parentDep)) {
... | 3 |
protected boolean isMine(Environmental host, Rideable R)
{
if(host instanceof Rider)
{
final Rider mob=(Rider)host;
if(R==mob)
return true;
if(mob.riding()==null)
return false;
if(mob.riding()==R)
return true;
if((((Rider)R).riding()==mob.riding()))
return true;
if((((Rider)mob.ri... | 7 |
public void keyPressed(int k){
if (k == KeyEvent.VK_S){
bgm.stop();
player.setDirectionsFalse();
gsm.setState(GameStateManager.SAVESTATE);
}
if (k == KeyEvent.VK_M){
Globals.setGameMuted(!Globals.getGameMuted());
if (!Globals.getGameMuted()){
bgm.loop();
}
else{
bgm.stop();
}
... | 8 |
public void crawl(int levelsNumber) throws IOException {
if (levelsNumber < 1) {
System.out.println("----------------------------------------------------------------------------------------------------------------------------");
return;
}
BufferedReader input = null;
try {
URL url = new URL(this.a... | 5 |
public static Set<String> getMissingSteps(String featurePath, String stepPath, String... otherStepPaths) {
// This function greatly ressembles the method-implementing one, except that
// instead of actually implementing the methods, we simply collect the steps
// that they would implement
... | 3 |
public void addUniform(String uniform) {
int uniformLocation = glGetUniformLocation(program, uniform);
if (uniformLocation == 0xFFFFFFFF) {
System.err.println("Error: Could not find uniform: " + uniform);
new Exception().printStackTrace();
System.exit(1);
}
... | 1 |
private void loadID3v2(InputStream in)
{
int size = -1;
try
{
// Read ID3v2 header (10 bytes).
in.mark(10);
size = readID3v2Header(in);
header_pos = size;
}
catch (IOException e)
{}
finally
{
try
{
// Unread ID3v2 header (10 bytes).
in.reset();
}
catch (IOExcepti... | 4 |
@Override
public void undo() {
if (oldKey == null) {
if (newKey == null) {
// Do Nothing, since this should never happen.
} else {
tree.removeAttribute(newKey);
}
} else {
if (newKey == null) {
tree.setAttribute(oldKey, oldValue, oldReadOnly);
} else {
if (!oldKey.equals(newKey)) {
... | 4 |
public static void main(String args[])
{
String filename = "Ratespiel.java";
if(args.length > 0) {
filename = args[0];
}
String out = read_String(filename);
int laenge = out.length();
int[] zeichen = new int[128];
int i;
for(i=0;i<laenge;i++) {
zeichen[(int)out.charAt(i)]++;
}
System.out.prin... | 4 |
private static Camera makecam(Class<? extends Camera> ct, String... args)
throws ClassNotFoundException {
try {
try {
Constructor<? extends Camera> cons = ct
.getConstructor(String[].class);
return (cons.newInstance(new Object[] { args }));
} catch (IllegalAccessException e) {
} catch (NoSuc... | 8 |
public static float combatStrength(Actor actor, Actor enemy) {
float strength = 0 ;
strength += (actor.gear.armourRating() + actor.gear.attackDamage()) / 20f ;
strength *= (1 + (actor.health.maxHealth() / 10)) / 2f ;
strength *= (1 - actor.health.injuryLevel()) ;
strength *= 1 - actor.health.stressP... | 6 |
public int GetCLHitpoints(int ItemID) {
if (ItemID == 10725) {
return 100;
}
if (ItemID == 10727) {
return 100;
}
if (ItemID == -1) {
return 1;
}
String ItemName = GetItemName(ItemID);
if (ItemName.startsWith("Hitpoints cape")) {
return 100;
}
if (ItemName.startsWith("Hitpoints hood")) {
re... | 5 |
public void setImage(BufferedImage newImage)
{
if (newImage != null)
this.setIcon(new ImageIcon(newImage));
} | 1 |
public static boolean startsWithIgnoreCase(final String stringToCheck, final String prefix) {
if (prefix.length() == 0) {
throw new IllegalArgumentException("Prefix may not be empty");
}
final int prefixLength = prefix.length();
if (stringToCheck.length() < prefixLength) {
return false;
}
return str... | 2 |
private static void handleStreams(final Process p, final OutputStream outStream, final OutputStream errStream, final InputStream inStream) {
//Handle Output
Thread outThread = new Thread(new Runnable() {
public void run() {
try {
InputStream pOut = p.getInputStream();... | 9 |
@Override
public boolean equals(Object obj) {
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final Conta other = (Conta) obj;
if (this.IdConta != other.IdConta && (this.IdConta == null || !this.IdConta.eq... | 5 |
private boolean jj_scan_token(int kind) {
if (jj_scanpos == jj_lastpos) {
jj_la--;
if (jj_scanpos.next == null) {
jj_lastpos = jj_scanpos = jj_scanpos.next = token_source.getNextToken();
} else {
jj_lastpos = jj_scanpos = jj_scanpos.next;
}
} else {
jj_scanpos = jj_... | 9 |
private void setSimulation(boolean simulating) {
if (simulating) {
simulation.launchSimulation(getSelectedAccessPoint(), model, panel.getWidth(), panel.getHeight());
} else {
simulation.clear();
}
panel.updateSimulationDisplay(simulation);
panel.repaint();... | 2 |
public void addSubProcess(SubProcess subProcess) {
if (!this.subProcesses.contains(subProcess)) {
this.subProcesses.add(subProcess);
reSortSubProcesses();
}
} | 1 |
public Set<Point> getPointSet(int i){
return getCell(i).getPointSet();
} | 0 |
private void answerFieldKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_answerFieldKeyPressed
if(evt.getKeyCode() == KeyEvent.VK_ENTER){
endTime = System.currentTimeMillis();
timeProblem(startTime,endTime);
evaluteProblem();
writeLog();
if(proble... | 3 |
public String getWolves() {
String result = "";
boolean first = true;
for (int i = 0; i < wolves.size(); i++) {
if (!first) {
if (i == wolves.size() - 1) {
result += " and ";
} else {
result += ", ";
}
}
result += get(wolves.get(i));
first = false;
}
return result;
} | 3 |
public List<Trip> getTripsByUser(User user) throws UserNotLoggedInException {
List<Trip> tripList = new ArrayList<Trip>();
User loggedUser = UserSession.getInstance().getLoggedUser();
boolean isFriend = false;
if (loggedUser != null) {
for (User friend : user.getFriends()) {
if (friend.equals(loggedUser)... | 4 |
public void alerter(PlayerInteractEvent ev) {
if (Settings.logging) {
writeLog("[EntityManager] "
+ ev.getPlayer().getDisplayName().toLowerCase()
+ " tried to use an "
+ ev.getItem().getType().toString().toLowerCase() + " egg");
}
if (Settings.alertz) {
for (Player p : ev.getPlayer().getServe... | 4 |
public void move(){
x += dx;
y += dy;
// Boundaries
if(x<0) x = 0;
if(x>675) x = 675;
if(y<600) y = 600;
if(y>720) y = 720;
// Animate Thrusters
anim++;
if(anim >3) anim = 0;
} | 5 |
public static CellMarkerFactory getInstance(){
if (singlenton == null){
singlenton = new CellMarkerFactory();
}
return singlenton;
} | 1 |
@Override
public void notifyActionListeners(ActionEvent event) {
if (!mNoNotify) {
super.notifyActionListeners(event);
}
} | 1 |
public void fireSessionCreated(IoSession session) {
SocketAddress serviceAddress = session.getServiceAddress();
boolean firstSession;
Set<IoSession> s = new IdentityHashSet<IoSession>();
synchronized (managedSessions) {
// Get the session set.
Set<IoSession> sess... | 6 |
public static ArrayList parseValue(String source) throws Exception {
ArrayList list = new ArrayList();
String[] lines = source.split("\n");
for (String line : lines) {
String[] typeAndValue = line.split(" ");
if(typeAndValue[0].equals("Boolean"))
list.add(Boolean.parseBoolean(typeAndValue[1]));
el... | 9 |
public boolean dispose(boolean cache, Dictionary referer) {
synchronized(this) {
referenceCount--;
////System.out.println("Resources.dispose() " + getPObjectReference() + " " + uniqueId + " count: " + referenceCount + " cache: " + cache);
////System.out.println("Resource... | 7 |
public static int binarySearch(int[] arr, int low,int high,int key){
int mid;
while(low<=high){
mid=(low+high)/2;
if(key>arr[mid])
low=mid+1;
else if(key<arr[mid])
high=mid-1;
else
return mid;
}
... | 3 |
public static Tile getTile(String s){
if(s.equals(grass.id)) return Tile.grass;
else if(s.equals(rock.id)) return Tile.rock;
else if(s.equals(flowers.id)) return Tile.flowers;
else if(s.equals(floor_wooden.id)) return Tile.floor_wooden;
else if(s.equals(door_closed.id)) return Tile.door_closed;
else if(s.eq... | 6 |
protected boolean isFinished() {
return (shooter.bottomSwitch.get() || shooter.left.getD() <= 5 || shooter.right.getD() <= 5 || feeder.isIn);
} | 3 |
public Player insert(String pseudo, String password) {
try {
PreparedStatement statement = base
.prepareStatement("INSERT INTO player (pseudo, password ,meilleur_score) VALUES (?, ?, ?)");
statement.setString(1, pseudo);
statement.setString(2, password);
statement.setInt(3, 0);
statement.exe... | 2 |
@Override
public void run() {
super.run();
try {
serverSocket=new ServerSocket(Constantes.TCPSystem);
while(true){
server.console("Attente de connexion ... Tcp Controleur ok");
Socket s = serverSocket.accept();
ServerTCPMultiThreadControleur th = new ServerTCPMultiThreadControleur(s, server);
... | 2 |
@Override
public void run(CommandSender sender, String maincmd, String[] args)
{
if (sender instanceof Player && !sender.hasPermission("mobmanager.pspawn"))
{
sender.sendMessage(ChatColor.DARK_RED + "You do not have permission to use /mm spawn");
return;
}
if (!super.validArgs(sender, maincmd, args))... | 6 |
public static boolean partition(ArrayList<Integer> list){
int w = 0;
for (int i = 0; i < list.size(); i++) {
w = w + list.get(i);
}
if(w % 2 == 1) return false;
int[][] matrix = new int[list.size()][w];
for (int i = 0; i < matrix.length; i++) {
for (int j = 0; j < w/2; j++) {
if( j == ... | 9 |
public String getStatName(int i){
String name = null;
switch(i){
case 0: name = "int";
break;
case 1: name = "str";
break;
case 2: name = "wis";
break;
case 3: name = "vit";
break;
case 4: name = "pDef";
break;
case 5: name = "mDef";
break;
case 6: name = "fireRes";
break;
case 7: n... | 9 |
public XbpadFrame(final XbpadLogic logic, final Image image) {
this.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
this.addWindowListener(new WindowAdapter(){
@Override
public void windowClosing(WindowEvent windowEvent) {
setExtendedState(Frame.ICONIFIED);
}
});
if... | 9 |
public KomputerPC(FabrykaPodzespolowKomputerowych f){
fabrykaPodzespolowKomputerowych = f;
skladanie();
} | 0 |
public String arrayToString(String[] stringToChange, String withWhat) {
// take each part of the array and separate it with ':'s
String stringToReturn = stringToChange[0];
try {
// start with the first index on the array
for (int i = 1; i < stringToChange.length; i++) {
stringToReturn = stringToReturn.c... | 2 |
public NoteColor(int note) throws IllegalArgumentException {
if (note < 0) {
throw new IllegalArgumentException("The note value is lower than 0");
}
if (note > 24) {
throw new IllegalArgumentException("The note value is higher than 24");
}
this.note = note;
} | 2 |
public void diffuse(int val, int cx,int cy)
{// centerX,centerY
//Diffusal slope is always one
if (val==0) return;
boolean negative=(val<0);
if (negative)
val=-val;
int endX=Util.lowest(cx+val,Square.xAmt());
... | 7 |
public static void Recuperer_liste_clients()
{
SAXBuilder sxb = new SAXBuilder();
try {
document = sxb.build(new File("bdd_e_resto.xml"));
} catch (JDOMException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.print... | 3 |
*
* @throws UnknownHostException if cyc server host not found on the network
* @throws IOException if a data communication error occurs
* @throws CycApiException if the api request results in a cyc server error
*/
public CycAssertion getAssertionById(Integer id)
throws UnknownHostException, IOEx... | 2 |
private static void checkOptions() {
if (!BloatBenchmark.INTRA && !BloatBenchmark.SPECIALIZE
&& !BloatBenchmark.INLINE) {
BloatBenchmark.err.println("** There is nothing to do!");
BloatBenchmark.usage();
} else if ((BloatBenchmark.MORPH != -1) && !BloatBenchmark.SPECIALIZE) {
BloatBenchmark.err
.... | 5 |
@Override
public void addAccount(User user, Account account) {
PreparedStatement pStmt = null;
try {
pStmt = conn.prepareStatement("INSERT INTO ACCOUNT (user_login, funds) VALUES (?, ?);");
pStmt.setString(1, user.getLogin());
pStmt.setDouble(2, account.getFunds());
pStmt.executeUpdate();
... | 1 |
private static void test2_5() throws FileNotFoundException {
String test1 = "new game\n"+"examine\n"+"quit\n"+"no\n"+"quit\n"+"yes\n";
HashMap<Integer, String> output = new HashMap<Integer, String>();
boolean passed = true;
try {
in = new ByteArrayInputStream(test1.getBytes());
System.setIn(in);
o... | 7 |
private static void appendJSONPair(StringBuilder json, String key, String value) throws UnsupportedEncodingException {
boolean isValueNumeric = false;
try {
if (value.equals("0") || !value.endsWith("0")) {
Double.parseDouble(value);
isValueNumeric = true;
... | 5 |
public void setOverlayPainter(Painter<? super JXMapViewer> overlay) {
Painter<? super JXMapViewer> old = getOverlayPainter();
this.overlay = overlay;
PropertyChangeListener listener = new PropertyChangeListener() {
@Override
public void propertyChange(PropertyChangeEvent... | 9 |
private static void parseByEventReader(InputStream inputStream, XMLInputFactory xis) {
XMLEventReader eventReader = null;
try {
eventReader = xis.createXMLEventReader(inputStream);
while (eventReader.hasNext()) {
XMLEvent event = eventReader.nextEvent();
// event.getEventType()
if (event.isStartEl... | 8 |
public static void main(String[] args) throws IOException {
String inputFileName = "lua/testOutput.csv";
BufferedReader in = new BufferedReader(new FileReader(inputFileName));
CourseMapTransform mapTransform = new CourseMapTransform();
CourseMapWriter mapWriter = new CourseMapWriter(1);
String line =... | 6 |
public List<Propiedad> ObtenerPropiedad(String consulta){
List<Propiedad> lista=new ArrayList<Propiedad>();
if (!consulta.equals("")) {
lista=cx.getObjects(consulta);
}else {
lista=null;
}
return lista;
} | 1 |
public final void checkTakeDamage(final int damage) {
numSequentialDamage++;
lastDamageTakenTime = System.currentTimeMillis();
// System.out.println("tb" + timeBetweenDamage);
// System.out.println("ns" + numSequentialDamage);
// System.out.println(timeBetweenDamage / 1500 + "(" + timeBetweenDamage / numSequentia... | 5 |
private void lireConfig() throws Exception
{
String ligne ="";
boolean fini = false;
File config = new File("FichierServeur/config.txt");
try
{
BufferedReader reader = new BufferedReader(new FileReader(config));
while(!fini)
{
... | 7 |
public void loadProfilesProperties() {
Logger.getLogger(Profiles.class.getName()).entering(Profiles.class.getName(), "loadProfilesProperties");
String value = PropertiesManager.getInstance().getKey("profiles");
if (value == null) {
return;
}
String[] unparsedProfiles ... | 4 |
@Test
public void createMoveFromStringTest2() {
Move move = new Move("C 3");
assertEquals("C 3", move.toString());
} | 0 |
public void scanArchives(URL... urls) throws IOException
{
for (URL url : urls)
{
Filter filter = new Filter()
{
public boolean accepts(String filename)
{
if (filename.endsWith(".class"))
{
if (filename.startsWith("... | 8 |
private boolean isAlmostFull() {
if (personArray.length - queueSize < 2) {
return true;
}
else {
return false;
}
} | 1 |
public void displayCircuit() {
/*
for (int i=0; i<elements.size(); i++) {
System.out.println("El "+i+": isConnected="+elements.get(i).isConnected()+" isTurnedOn="+elements.get(i).isTurnedOn());
if (elements.get(i) instanceof InputAction) {System.out.println("Input: "+((InputAction)element... | 6 |
public static void main(String[] args) throws Exception {
String graphName = args[0];
int nShards = Integer.parseInt(args[1]);
CircleOfTrustSalsa csalsa = new CircleOfTrustSalsa(new VertexQuery(graphName, nShards), 10000);
VertexIdTranslate vertexTrans = VertexIdTranslate.fromFile(new... | 5 |
public static void main(String[] args) {
int maxFields = 16; // number of tiles (x & y)
int tileSize = 24; // size per tile
int miniscale = 4; // scaling of minimap (0 = no minimap)
boolean grid = true; // show grid overlay
boolean debug = false; // console output
long startTime = System.currentTimeMilli... | 6 |
public void setLname(String lname) {
this.lname = lname;
} | 0 |
public HashMap cashInput(int amount) throws Exception
{
char[] params = Convert.toCharArray(amount);
ArrayList<Integer> answer = this.device.send(0x50, 5, params);
if (answer.size() == 0)
throw new Exception("Пустой ответ");
HashMap<String, Integer> result = new HashMap... | 3 |
public boolean containedIn(RPChromosomeRegion testRegion) {
if (startChromID > testRegion.startChromID ||
(startChromID == testRegion.startChromID && startBase >= testRegion.startBase)) {
if (endChromID < testRegion.endChromID ||
(endChromID == testRegion.endChro... | 6 |
public List<String> buildPropsFromList(Map<String, String> props){
List<String> notFound = new LinkedList<String>();
for(String key : props.keySet()){
Class<? extends Property> propType = PropertyFactory.getPropByType( props.get(key));
if(propType != null)
this.addProperty(key, props.get(key));
else
... | 3 |
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
JSONObject other = (JSONObject) obj;
if (map == null) {
if (other.map != null)
return false;
} else if (!map.equals(other.map))
retur... | 6 |
@Override
public void execute() throws MojoExecutionException, MojoFailureException {
if (skip) {
return;
}
try {
ProcessBuilder processBuilder = new ProcessBuilder(getCommandPath("psql"), "--version");
final Process process = processBuilder.start();
... | 6 |
public boolean isYourMove() throws InterruptedException {
if (m_test){
System.out.println("AIEasy.isYourMove- begin");
}
setYourTurn(true);
if (!(getGame().getPlayer1() instanceof Human ||
getGame().getPlayer2() instanceof Human)){
sendMo... | 4 |
@Override
public void onSignOut()
{
ServerUser u = currentClient.attachment();
currentClient.close();
if (u != null)
{
System.out.println( "SERVER: sign-out: " + u.name );
userMap.remove( u.name );
for (ServerUser otherUser : userMap.values(... | 2 |
@Override
protected void setReaction(Message message) {
for(String s : content)
sendMessage(message.author, s);
} | 1 |
@Override
protected Set<NucleotideInteraction> parseInteractions(
Map<String, Sequence> aSequenceMap, File anOutputFile)
throws IOException {
// check that the sequence map is not empty
if (aSequenceMap.isEmpty()) {
throw new IOException("Empty sequence map! Nothing to do!");
}
Set<NucleotideInteracti... | 9 |
public void visit_iflt(final Instruction inst) {
if (longBranch) {
final Label tmp = method.newLabel();
addOpcode(Opcode.opc_ifge);
addBranch(tmp);
addOpcode(Opcode.opc_goto_w);
addLongBranch((Label) inst.operand());
addLabel(tmp);
} else {
addOpcode(Opcode.opc_iflt);
addBranch((Label) inst.... | 1 |
@Override
public void render(Graphics2D g2d) {
bg.render(g2d);
g2d.setColor(new Color(128, 0, 0));
g2d.setFont(new Font(Fonts.CLEOPATRA, Font.PLAIN, 36));
Gfx.drawString(g2d, Game.TITLE, 70);
for(int i = 0; i < options.length; i++){
if(i == currentChoice)... | 2 |
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.