text stringlengths 14 410k | label int32 0 9 |
|---|---|
public String getValue() {
return value;
} | 0 |
static Implementation getImplementation(
String baseName,
String algorithm,
String provider)
throws NoSuchProviderException
{
if (provider == null)
{
Provider[] prov = Security.getProviders();
//
// search every prov... | 6 |
private boolean jj_3_71() {
if (jj_scan_token(OR)) return true;
return false;
} | 1 |
@Override
public void endElement(String uri, String localName, String qName) {
switch (localName) {
case TagConstants.ARTIFICIAL_FLOWER_TAG:
case TagConstants.NATURAL_FLOWER_TAG:
case TagConstants.CUT_FLOWER_TAG:
floralComposition.addFlower(currentFlower);... | 5 |
public void setSelectedItem(Object item) {
if ((selected != null && !selected.equals(item))
|| (selected == null && item != null)) {
// YUCK from useing generics + old SWING stuff
selected = (T)item;
fireContentsChanged(this, -1, -1);
}
} | 4 |
public void testPropertyCompareToMonthOfYear() {
MonthDay test1 = new MonthDay(TEST_TIME1);
MonthDay test2 = new MonthDay(TEST_TIME2);
assertEquals(true, test1.monthOfYear().compareTo(test2) < 0);
assertEquals(true, test2.monthOfYear().compareTo(test1) > 0);
assertEquals(true, te... | 2 |
public void fin() {
total = System.nanoTime() - then;
nm = new String[nw.size()];
prt = new long[pw.size()];
for(int i = 0; i < pw.size(); i++) {
nm[i] = nw.get(i);
prt[i] = pw.get(i);
}
hist[i] = this;
if(++i >= hist.length)
i = 0;
pw = null;
nw = null;
} | 2 |
public List<Booking> getBookingsOfRenter(String authToken, String renterID) throws AccessException{
if(authToken != "abcd1234") throw new AccessException("Access denied");
Renter r = this.getRenterByID(authToken, renterID);
try{
List<Booking> b = r.getBookings();
if(b == null || b.size() == 0) throw new Bus... | 4 |
public String getName() {
return s;
} | 0 |
@Override
public void keyTyped(KeyEvent e) {
} | 0 |
public ArrayList<ArrayList<Integer>> levelOrder(TreeNode root) {
ArrayList<ArrayList<Integer>> result = new ArrayList<ArrayList<Integer>>();
ArrayList<Integer> row = new ArrayList<Integer>();
if (root == null) {
return result;
}
TreeIterator iterator = new TreeIter... | 3 |
public static void main(String[] args) throws Exception
{
// the first row and last column were manually removed...
File inFile = new File( ConfigReader.getBigDataScalingFactorsDir() + File.separator +
"MouseDonors" + File.separator + "otu_table_edited.txt");
File outFile = new File( ConfigReader.getBigD... | 8 |
private void readDataFromTextFile() throws IOException
{
//read each data line or until end of file reached
String line;
if ((line = in.readLine()) != null){
dataVersion = line;
}
for (int i=0; i<DATA_SIZE; i++){
if ((line = in.readLine()) == null) { break; }
data[i] ... | 3 |
private HttpRespons send(String urlString, String method,
Map<String, String> parameters, Map<String, String> propertys)
throws IOException {
HttpURLConnection urlConnection = null;
if (method.equalsIgnoreCase("GET") && parameters != null) {
StringBuffer param = new StringBuffer();
int i = 0;
for (... | 9 |
public static ListNode detectCycle(ListNode head) {
if (head == null || head.next == null || head.next.next == null)
return null;
ListNode oneStep = head.next;
ListNode twoStep = head.next.next;
ListNode ecounterPoint = null;
while (twoStep != null) {
if (oneStep == twoStep) {
ecounterPoint = oneSt... | 9 |
static String normalize(String address){
if(address==null){ return "localhost"; }
else if(address.length()==0 || address.equals("*")){ return ""; }
else{ return address; }
} | 3 |
public boolean confirmPossibleMaterialLocation(int resource, Room room)
{
if(room==null)
return false;
final Integer I=Integer.valueOf(resource);
final boolean isMaterial=(resource&RawMaterial.RESOURCE_MASK)==0;
final int roomResourceType=room.myResource();
if(((isMaterial&&(resource==(roomResourceType&Ra... | 9 |
private void addVarOp(int op, int varIndex)
{
switch (op) {
case Token.SETCONSTVAR:
if (varIndex < 128) {
addIcode(Icode_SETCONSTVAR1);
addUint8(varIndex);
return;
}
addIndexOp(Icode_SETCONSTVAR, varIndex);
... | 7 |
public int checkWin(Player player){
int playerHandValue = player.getHand(1).isBust() ? 0 : player.getHand(1).getValues().get(0);
int dealerHandValue = dealer.getHand(1).isBust() ? 0 : dealer.getHand(1).getValues().get(0);
if(playerHandValue > dealerHandValue){
return 1;
}
else if(playerHandValue < dealerH... | 4 |
public Event get_next_double_cpu() {
Event out = null;
double min = Double.MAX_VALUE;
if (tempoCPU1 < min) {
min = tempoCPU1;
out = Event.CPU1;
}
if (tempoCPU2 < min) {
min = tempoCPU2;
out = Event.CPU2;
}
if (tempoA... | 4 |
public Component getRendererComponent(SubGraph sd) {
sgbck=sd;
final SubGraph mysd = new SubGraph(sd.graph);
mysd.vertices = new HashSet<Vertex>(sd.vertices);
mysd.edges = new HashSet<Edge>(sd.edges);
mysd.label = sd.label;
String txt = "";
txt = "<HTML><BODY>";
... | 9 |
@Override
public String toString() {
if (type == VariableType.ARRAYLIST) {
StringBuilder str = new StringBuilder();
str.append("[");
for (Value val : (ArrayList<Value>) value) {
str.append(val.toString());
if (!val.equals(((ArrayList<Valu... | 5 |
private static void myMenu(BufferedReader br, ServiceInterface obj,
Scanner cs) throws IOException {
// TODO Auto-generated method stub
System.out.println("1 Update");
System.out.println("0 Logout");
int val = cs.nextInt();
if (val == 0)
showMenu(br, obj, cs);
else if (val == 1)
update(br, obj, c... | 2 |
public static List<String> getAvailableLanguages () {
List<String> result = new ArrayList<String>();
result.add("");
for (String language : Locale.getISOLanguages()) {
String fileName = MESSAGE_BASENAME + "_" + language + ".properties";
URL url = MessageUtils.class.getClassLoader().getResource(CONFIG_DIR + ... | 2 |
public static void main(String[] args) {
// TODO Auto-generated method stub
String s = "Hello a olleH";
String str = "aaaa aabaa bbb samaaiaaksl iiii aisk";
String1 strObj = new String1();
String palindromeWords="";
String wordswithVowelInMid="";
if(strObj.isPalindrome(s))
System.out.println(... | 5 |
public EsteTest() {
} | 0 |
public void updateDisplay() {
if (this.stock != null) {
this.setTitle("Edit stock \"" + this.stock.getName() + "\"");
this.txfName.setText(this.stock.getName());
this.cbxType.setSelectedItem(stock.getType());
this.txfCapacity.setText(stock.getCapacity() + "");
this.txfMaxTrays.setText(stock.getMaxTrays... | 1 |
private boolean isDragOk(final java.io.PrintStream out, final java.awt.dnd.DropTargetDragEvent evt) {
boolean ok = false;
// Get data flavors being dragged
java.awt.datatransfer.DataFlavor[] flavors = evt.getCurrentDataFlavors();
// See if any of the flavors are a file list
int... | 7 |
@Override
public void run()
{
long previousTime = System.currentTimeMillis();
long currentTime = previousTime;
if( soundSystem == null )
{
errorMessage( "SoundSystem was null in method run().", 0 );
cleanup();
return;
}
... | 5 |
static int lowestBoard(Circuit circuit) {
int ypos = 0;
StringReader sr = new StringReader(circuit.toString());
StreamTokenizer st = new StreamTokenizer(sr);
st.parseNumbers();
try {
while (st.nextToken() != -1) {
if (st.ttype == -3 && st.sval.equals("Board") && st.nextToken() == -3) {
st.nextTok... | 6 |
Space[] won() {
int n = numToWin - 1;
if (lastSpaceMoved == null)
return null;
int[] pos = lastSpaceMoved.getPos();
for (int i = 0, rowInd = pos[0]; i <= n; i++, rowInd = pos[0] - i)
for (int j = 0, colInd = pos[1]; j <= n; j++, colInd = pos[1] - j) {
boolean outOfBounds = rowInd < 0 || colInd < 0
... | 9 |
static String[] getPortForwarding(Session session){
java.util.Vector foo=new java.util.Vector();
synchronized(pool){
for(int i=0; i<pool.size(); i++){
PortWatcher p=(PortWatcher)(pool.elementAt(i));
if(p.session==session){
foo.addElement(p.lport+":"+p.host+":"+p.rport);
}
}
}
String[] ... | 3 |
public void renderSlot(int id, float x, float y, int mx, int my, boolean[] buttons, boolean selected)
{
super.renderSlot(id, x, y, mx, my, buttons, selected);
String n = file.getName();
if(file.isDirectory() && !file.getName().endsWith(File.separator))
n+=File.separator;
if(!FontRenderer.drawStringInBounds(... | 6 |
private static double[][] normalizeDensity(double[][] unNormDensity){
// The number of gridlines across the density domain
int numGridLines = getNumGridlines();
int iter = 0; // How many normalization cycles have been performed
double threshold = Math.pow(10, -8); // The maximum acc... | 9 |
public boolean Salvar(Produto obj){
try{
if(obj.getId() == 0){
PreparedStatement comando = bd.getConexao()
.prepareStatement("INSERT INTO produtos (nome,descricao,"
+ "valor_uni_Compra,valor_uni_Venda,ativo) VALUES (?,?,?,?,1)");
... | 2 |
public boolean similar(Object other) {
if (!(other instanceof JSONArray)) {
return false;
}
int len = this.length();
if (len != ((JSONArray)other).length()) {
return false;
}
for (int i = 0; i < len; i += 1) {
Object valueThis = this.ge... | 8 |
public static void stopMusic()
{
if(BATTLE_TYPE.equals("WILD"))
{
if(!Mechanics.isLegendary(enemy[0]))
wildMusic.stop();
else
fatefulMusic.stop();
}
else if(BATTLE_TYPE.equals("TRAINER"))
{
if(b1.trainer.type==Trainer.TrainerType.JAVA)
javaMusic.stop();
else
traine... | 7 |
public static void main(String[] args) throws Exception {
String languagesList = (args.length>0) ? args[0] : "en";
String dirName = (args.length>1) ? args[1].replace( '\\', '/' ) : "";
if(dirName.length() > 0 && !dirName.endsWith( "/" )){
dirName += '/';
}
String[] l... | 5 |
public synchronized void mouseMoved(MouseEvent e) {
// this event is from re-centering the mouse - ignore it
if (isRecentering &&
centerLocation.x == e.getX() &&
centerLocation.y == e.getY())
{
isRecentering = false;
}
else {
int dx... | 4 |
public void readHistory(DataInput input) {
try {
int unused = input.readInt(); // VERSION = 1
int commandCount = input.readInt();
if (directoryCombo == null) {
directoryCombo = new JComboBox();
}
for (int i = 0; i < commandCount; ++i) ... | 6 |
protected DateTimeField getField(int index, Chronology chrono) {
switch (index) {
case 0:
return chrono.year();
case 1:
return chrono.monthOfYear();
default:
throw new IndexOutOfBoundsException();
... | 2 |
public static String doubleToString(double d) {
if (Double.isInfinite(d) || Double.isNaN(d)) {
return "null";
}
// Shave off trailing zeros and decimal point, if possible.
String string = Double.toString(d);
if (string.indexOf('.') > 0 && string.indexOf('e') < 0
... | 7 |
private double hilb_index(double x, double y, int lvl){
if (lvl==0) return x;
if ( x<0.5 && y<0.5 )
return hilb_index(y*2, x*2, lvl-1)*0.25;
if ( x<0.5 && y>=0.5)
return 0.25 + hilb_index(x*2, y*2-1, lvl-1)*0.25;
if (x>=0.5 && y<0.5)
return 0.75 + hilb_index(1-y*2, 2-x*2, lvl-1)*0.25;
if (x>=0.5 ... | 9 |
private boolean jj_2_62(int xla) {
jj_la = xla; jj_lastpos = jj_scanpos = token;
try { return !jj_3_62(); }
catch(LookaheadSuccess ls) { return true; }
finally { jj_save(61, xla); }
} | 1 |
private boolean overlaps(Piece pi, int x0, int y0) {
if( pi.w() + x0 > w() ){
return true;
}
if( pi.h() + y0 > h() ){
return true;
}
for( int x = 0 ; x < pi.w() ; x++ ){
for( int y = 0 ; y < pi.h() ; y++ ){
if( pi.contains(x, y) ){
if( _board[x+x0][y+y0] != null ){
return true;
... | 6 |
public int I(Privacy p) {
switch (p) {
case PUBLIC:
return 0;
case PROTECTED:
return 1;
}
return 2;
} | 2 |
public void start(){
try {
//ServerSocket serverSocket = new ServerSocket(port);
while(true){
if(shutdown){
break;
}
Socket socket = getServerSocket().accept();
Request request = new Request(socket);
Response response = new Response(socket);
... | 9 |
public boolean next() throws IOException {
while (true) {
if (count == df)
return false;
final int docCode = freqStream.readVInt();
if (currentFieldOmitTermFreqAndPositions) {
doc += docCode;
freq = 1;
} else {
doc += docCode >>> 1; // shift off l... | 6 |
@Override
public int castingQuality(MOB mob, Physical target)
{
if(mob!=null)
{
if(target instanceof MOB)
{
final Room R=((MOB)target).location();
boolean found=false;
if(R!=null)
for(int r=0;r<R.numInhabitants();r++)
{
final MOB M=R.fetchInhabitant(r);
if((M!=null)&&(M!=mo... | 9 |
@EventHandler
public void onVehicleExit(VehicleExitEvent event) {
if (event.getExited() != null && event.getExited() instanceof Player) {
Player player = (Player) event.getExited();
if (this.manager.isRoutePlayer(player)) {
event.setCancelled(true);
}
}
} | 3 |
public void addEdge(int from, int to, String edgeValueToken) throws IOException {
if (maxVertexId < from) maxVertexId = from;
if (maxVertexId < to) maxVertexId = to;
/* If the from and to ids are same, this entry is assumed to contain value
for the vertex, and it is passed to the ve... | 7 |
@Override
public void run() {
AudioInputStream audioIn = null;
try {
audioIn = AudioSystem.getAudioInputStream(getClass()
.getResource(track));
} catch (UnsupportedAudioFileException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-g... | 5 |
public static void refreshConnectionToTrackingServer() {
System.setProperty("java.rmi.server.hostname", currentPeerInfo.getIp());
int trackingServerPort = PeerConfig.getTrackingServerPort();
String trackingServerIp = PeerConfig.getTrackingServerIp();
while(true) {
try {
trackingServerRMIObjectHandle ... | 7 |
@Override
public Solution search(Puzzle puzzle) {
fringe.add(new Node(puzzle.getInitialState(), null, null));
while (!fringe.isEmpty()) {
Node selectedNode = fringe.poll();
if (puzzle.getGoalTest().isGoalState(selectedNode.getState())) {
return new Solution(selectedNode, getNodeExpanded());
}
close... | 5 |
public static void main(String[] args) {
// 1,new A()
System.out.println("***new init***");
@SuppressWarnings("unused")
A a = new A();
// 2,Class.forname("package-path.class-name")
System.out.println("***Class.forname init***");
try {
Class<?> clazz =Class.forName(A.class.getName());
try {
cl... | 8 |
public void run() {
synchronized (this) {
try {
this.wait(MainServerApp.initializationTime);
}catch(Exception e){}
}
while(true){
synchronized (monitor) {
while(registeredThreads != MainServerApp.numberOfThreads) {
try {
monitor.wait();
}
catch (InterruptedException e){
... | 7 |
public static Figure getFigure(int figureId) {
Figure figure = null;
switch (figureId) {
case Figure.FIGURE_ID_I:
figure = new FigureI();
break;
case Figure.FIGURE_ID_T:
figure = new FigureT();
break;
case Figure.FIGURE_ID_O:
figure = new FigureO();
... | 7 |
public boolean within(MouseEvent e, int x, int y, int width, int height) {
if (e.getX() > x && e.getX() < x + width && e.getY() > y
&& e.getY() < y + height) {
return true;
}
return false;
} | 4 |
public static boolean isValidVector(Vector3f vector) {
if (vector == null) return false;
if (Float.isNaN(vector.x) ||
Float.isNaN(vector.y) ||
Float.isNaN(vector.z)) return false;
if (Float.isInfinite(vector.x) ||
Float.isInfinite(vector.y) ||
Float.isInfinite(v... | 7 |
public void testWithField2() {
Partial test = createHourMinPartial();
try {
test.withField(null, 6);
fail();
} catch (IllegalArgumentException ex) {}
check(test, 10, 20);
} | 1 |
public boolean hasPermission(CommandSender sender) {
if (sender instanceof Player) {
return sender.isOp() || (permissionNode != null && sender.hasPermission("getperms." + permissionNode));
}
return true;
} | 3 |
@Override
public void execute(Object parent)
{
mxIGraphModel model = graph.getModel();
// Moves the vertices to build a circle. Makes sure the
// radius is large enough for the vertices to not
// overlap
model.beginUpdate();
try
{
// Gets all vertices inside the parent and finds
// the maximum di... | 8 |
public void update(long elapsedTime) {
ShipV2 player = (ShipV2)map.getPlayer();
JTabbedPane tabbelShipMenu = menu.tabbedShipMenu;
//JPanel sliderMenu = ((JPanel)menu.tabbedShipMenu.getComponent(0));
//menu.updateShipSliders(sliderMenu);
/* don't plan on doing this now
... | 3 |
@EventHandler(priority = EventPriority.HIGH)
public void onPlayerRespawn(PlayerRespawnEvent event) {
try {
// first try to get our "default" home
ArrayList<HashMap<String, Object>> results = DatabaseManager.accessQuery(
"select * from homes where owner=? and name=?;",
event.getPlayer().getName(), "de... | 3 |
public void loadPreview()
{
if (selectedCard != null)
{
if (selectedCard instanceof HeroFrontCard)
{
creator = new CreatorTabHeroFront(frame, (HeroFrontCard)selectedCard);
ImageIcon ii = new ImageIcon(creator.getImage(214, 300));
preview.setIcon(ii);
}
if (selectedCard instanceof H... | 8 |
private final void loadImages() throws IOException
{
// RenderableObjects
BufferedImage mainMenuSheet = ImageIO.read(Images.class.getResource(imageDir + "/mainMenu.png"));
BufferedImage saveManagerSheet = ImageIO.read(Images.class.getResource(imageDir + "/saveManager.png"));
// Map textures
Bu... | 9 |
@Override
public boolean isCellEditable(int rowIndex, int columnIndex) {
switch (COLUMNS.values()[columnIndex]) {
case ID:
return false;
case FIRSTNAME:
case LASTNAME:
case BIRTH:
case EMAIL:
return true;
default:
throw new IllegalArgumentException("columnIndex");
}
} | 5 |
private boolean jj_3R_33() {
if (jj_3R_77()) return true;
return false;
} | 1 |
public void test_01() {
initSnpEffPredictor("testCase");
String fileName = "./tests/vcf.vcf";
VcfFileIterator vcf = new VcfFileIterator(fileName, genome);
vcf.setCreateChromos(true);
for (VcfEntry vcfEntry : vcf) {
for (Variant seqChange : vcfEntry.variants()) {
System.out.println(seqChange);
Stri... | 2 |
public long getSumOfMostCommonValues(int[] result) {
if (result == null || result.length == 0)
return 0;
quickSort(0, result.length - 1, result);
int maxCount = 1;
int count = 0;
int base = result[0];
int number = base;
for (int i : result) {
if (base == i)
count++;
else {
if (count > ... | 5 |
private URL getURL(String filename) {
URL url = null;
try {
url = this.getClass().getResource(filename);
}
catch (Exception e) {
}
return url;
} | 1 |
public void setVisible(boolean visible) {
if(frame == null) {
hud = new HUDManager(model);
flyups = new FlyUpsManager();
options = new OptionsManager(model);
buildGUI();
}
frame.setVisible(visible);
} | 1 |
protected void paintComponent(Graphics g) {
super.paintComponent(g); // Paints the background
if (image == null) {
return;
}
if (scale == 0.0) {
initializeParams();
}
if (isHighQualityRendering()) {
Rectangle rect = getImageClipBounds();
if (rect == null || rect.width == 0 || rec... | 7 |
public void showHelpAndExit() {
List<String> names = new ArrayList<>(mOptions.keySet());
int cmdWidth = 0;
Collections.sort(names);
System.out.println();
System.out.println(BundleInfo.getDefault().getAppBanner());
System.out.println();
if (mHelpHeader != null) {
System.out.println(mHelpHeader);
Sy... | 9 |
*/
public void removeAll () {
checkWidget ();
if (itemsCount == 0) return;
setRedraw (false);
setFocusItem (null, false);
for (int i = 0; i < itemsCount; i++) {
items [i].dispose (false);
}
items = new CTableItem [0];
selectedItems = new CTableItem [0];
int oldCount = itemsCount;
itemsCount = topIndex = 0;... | 5 |
@Override
public boolean onCommand(CommandSender cs, Command cmd, String label, String[] args) {
if (cs instanceof Player) {
final Player player = (Player) cs;
if (Lobby.started && !Game.started) {
if (DatabaseHandler.hasPass(player)) {
if (!Lobby.forcedTraitors.contains(player) && !Lobby.forcedDetect... | 7 |
public TreeNode buildTree(Vector<Integer> v ,int sta, int end){
if(end - sta < 0 )
return null;
int mid = (sta + end)/2;
TreeNode node = new TreeNode(v.get(mid));
node.left = buildTree(v,sta,mid-1);
node.right = buildTree(v,mid+1,end);
return node;
} | 1 |
@Test
public void testSolve() throws ParseurException {
SolutionState solutionState = null;
try{
solutionState = tournee.solve(MAX_TIME_SEC * 1000);
} catch (Exception e) {
e.printStackTrace();
fail();
}
if (solutionState == SolutionState.OPTIMAL_S... | 3 |
@Override
public void start(Stage primaryStage) {
this.stage = primaryStage;
root = new StackPane();
Button btn = new Button();
btn.setText("Say 'Hello World'");
btn.setOnAction(new EventHandler<ActionEvent>() {
@Override
public void handle(ActionEvent... | 5 |
@Override
public boolean invoke(MOB mob, List<String> commands, Physical givenTarget, boolean auto, int asLevel)
{
if(!super.invoke(mob,commands,givenTarget,auto,asLevel))
return false;
final boolean success=proficiencyCheck(mob,0,auto);
if(success)
{
invoker=mob;
final CMMsg msg=CMClass.getMsg(mob... | 7 |
public void active(int speed){
if( dir==DirKey.Up ){
this.y = this.y - speed;
}
else if( dir==DirKey.Down ){
this.y = this.y + speed;
}
else if( dir==DirKey.Left ){
this.x = this.x - speed;
}
else if( dir==DirKey.Right ){
this.x = this.x + speed;
}
} | 4 |
private void ensureColumnBounds(Sheet sheet) {
if (gotBounds) {
return;
}
Iterator<Row> iter = sheet.rowIterator();
firstColumn = (iter.hasNext() ? Integer.MAX_VALUE : 0);
endColumn = 0;
while (iter.hasNext()) {
Row row = iter.next();
... | 6 |
public static void init() {
//Configurations for file properties using
Properties properties = new Properties();
FileInputStream propFile;
try {
propFile = new FileInputStream("test.properties");
properties.load(propFile);
} catch (IOException e) {
... | 6 |
public void incUtteranceWords(String[] units, Boolean[] stresses,
Boolean[] boundaries, boolean[] trusts) {
// If we're not using trusts, ignore the trusts passed
Boolean[] wordsTrusts;
if (!useTrust || trusts == null) {
wordsTrusts = null;
}
else {
wordsTrusts = SegUtil.wordsTrusts(trusts, boundarie... | 5 |
@EventHandler
public void GhastConfusion(EntityDamageByEntityEvent event) {
Entity e = event.getEntity();
Entity damager = event.getDamager();
String world = e.getWorld().getName();
boolean dodged = false;
Random random = new Random();
double randomChance = plugin.getZombieConfig().getDouble("Ghast.Nausea.... | 7 |
public static Song interpret(String string) {
Song song = new Song("Imported Song", Instrument.BELL, 100);
for (int i = 0; i < string.length(); i++) {
char character = string.charAt(i);
Action act = Action.getActionFor(character);
if (act != null) {
if (string.length() > i + 2) {
... | 6 |
public static HashMap<String, ArrayList<HashMap<String, Object>>> bundle(ArrayList<HashMap<String, Object>> flatData) {
HashMap<String, ArrayList<HashMap<String, Object>>> bigBox = new HashMap<String, ArrayList<HashMap<String, Object>>>();
ArrayList<HashMap<String, Object>> experiments = new ArrayList<H... | 7 |
public int GetStopBusStop()
{
//get the person stop bus stop
return stopBustop;
} | 0 |
protected RoomnumberSet getLocations()
{
final Vector<Physical> items=makeVector();
final RoomnumberSet homes=(RoomnumberSet)CMClass.getCommon("DefaultRoomnumberSet");
final RoomnumberSet set=(RoomnumberSet)CMClass.getCommon("DefaultRoomnumberSet");
Room R=null;
for(final Environmental E : items)
{
... | 8 |
private boolean lahdeSuuntaan(ArrayList<Merkki> merkit, Suunta suunta,
Merkki merkki, int askel, ArrayList<Laatu> jono) {
if (merkki.getLaatu() == (jono.get(askel))) {
if (askel + 1 == jono.size()) {
return true;//paatepiste
}
for (Merkki seuraava ... | 7 |
public Method findGetMethod(Field field) {
if(field == null)
return null;
if(getFieldDetailStore().isGetMethodPresentFor(field)) {
return getFieldDetailStore().getMethodOf(field);
}
String getterName = createMethodName("get", field.getName());... | 4 |
StringWriter getResult() {
try {
is.close();
} catch (IOException e) {
System.err.println("Unable to close input stream in StreamReader");
}
/**
*
* the StringWriter is closed in {@link #doExec(String[])} after storing its string result.
*/
return sw;
} | 1 |
private void handleKeyPressed(KeyPressedEvent event) {
if (event.getCharacter() != 0 && event.getKeyCode() != KeyCode.KEY_BACK && event.getKeyCode() != KeyCode.KEY_ESC) {
this.tbv.addChar(event.getCharacter());
return;
}
switch (event.getKeyCode()) {
case KeyCode.KEY_BACK:
this.tbv.back();
bre... | 8 |
protected void getMods() {
if(modPath != null){
File file = new File(modPath);
modDir = file.list(new FilenameFilter() {
@Override
public boolean accept(File current, String name) {
File mfile = new File(current, name);
if(name.endsWith(".zip") || mfile.isDirectory())
return true;
... | 3 |
@Test
public void delMinReturnsCorrectOrderWithManyIdenticalElements() {
Random r = new Random();
int[] expected = new int[100];
for (int i = 0; i < 100; i++) {
int randomInteger = r.nextInt(4);
h.insert(new Vertex(0, randomInteger));
expected[i] = randomI... | 2 |
public JButton getButtonOK(){
return buttonOK;
} | 0 |
void scoreDnaAndQualitySequence(String seq1, String seq2, int start, int threshold, int result) {
// Overlapping with DnaAndQualitySequence
DnaAndQualitySequence s1 = new DnaAndQualitySequence(seq1);
DnaAndQualitySequence s2 = new DnaAndQualitySequence(seq2);
DnaQualSubsequenceComparator compartor = new DnaQual... | 2 |
private boolean expr_sempred(ExprContext _localctx, int predIndex) {
switch (predIndex) {
case 0: return precpred(_ctx, 13);
case 1: return precpred(_ctx, 12);
case 2: return precpred(_ctx, 11);
case 3: return precpred(_ctx, 10);
case 4: return precpred(_ctx, 9);
case 5: return precpred(_ctx, 8);
... | 8 |
@Override
public BeerResponse getBeer(String beerId) {
BeerReadOnly beerReadOnly = barService.getBeer(beerId);
return new BeerResponse(beerReadOnly);
} | 0 |
public String toString() //Displays the rank and suit of the card as a string
{
String suitName;
String rankName;
if (suit == SPADES)
suitName = "spades";
else if (suit == CLUBS)
suitName = "clubs";
else if (suit == HEARTS)
suitName = "hearts";
el... | 8 |
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.