text stringlengths 14 410k | label int32 0 9 |
|---|---|
public void render(float partialTick)
{
int mt = (int)(this.world.player.maxMoveTime/this.world.getTileAt(this.world.player.x, this.world.player.y).getWalkSpeed());
this.px = this.world.player.x*this.world.TILE_SIZE+(int)((this.world.player.nx-this.world.player.x)*(mt-this.world.player.moveTime+partialTick)*this.w... | 8 |
private Integer parent(int pos) {
if(pos == 0) return null;
return pos /2;
} | 1 |
public boolean passable() {
return type.passable() && bomb == null;
} | 1 |
@Override
public void render(float interpolation)
{
super.render(interpolation);
if(anim == null)
return;
anim[getDirectionID(d)].render(playerPos, playerDim);
if(animationStart == -1)
animationStart = System.currentTimeMillis();
if(!turned)
Fonts.get("Jungle").drawCenteredString("Lives: "+Ga... | 5 |
public JSONWriter array() throws JSONException {
if (this.mode == 'i' || this.mode == 'o' || this.mode == 'a') {
this.push(null);
this.append("[");
this.comma = false;
return this;
}
throw new JSONException("Misplaced array.");
} | 3 |
public void unPauseGame() {
board.unpause();
if (pauseMenu != null) {
removeChild(pauseMenu);
}
pauseMenu = null;
} | 1 |
public static boolean cambiarStatusPaquete(Paquete paquete, String status)
{
Document doc;
Long identificadorPaquete;
Element root,child;
List <Element> rootChildrens;
boolean found = false;
int pos = 0;
SAXBuild... | 6 |
public void paintHex( Point aHexIx, Color aColor, boolean aToggle)
{
if (0 <= aHexIx.x && aHexIx.x < myHexGrid.getNumHorizHexes()
&& 0 <= aHexIx.y && aHexIx.y < myHexGrid.getNumVertHexes())
{
Hex hex = myHexGrid.getHexes()[ aHexIx.x][ aHexIx.y];
if (aToggle)
{
... | 6 |
public void setLabel(String label)
{
for(int i=0;i<markers;i++)
{
if(marker[i].isSelected())
{
marker[i].setLabel(label);
//break;
}
}
} | 2 |
public void sortByLevel() {
Collections.sort(
images,
new Comparator<Card>() {
public int compare(Card a, Card b) {
if (a instanceof Climax) { //climaxes should sort to be after all level cards
if (b instanceof Climax) {
return 0;
}
return ... | 3 |
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
FractalColourScheme other = (FractalColourScheme) obj;
if (colours == null) {
... | 9 |
@Override
public boolean invoke(MOB mob, List<String> commands, Physical givenTarget, boolean auto, int asLevel)
{
Physical target=mob;
if((auto)&&(givenTarget!=null))
target=givenTarget;
if(target.fetchEffect(this.ID())!=null)
{
mob.tell(mob,target,null,L("<T-NAME> <T-IS-ARE> already affected by @x1.",... | 7 |
private void cargaNAS(BufferedReader bf) throws IOException
{
String linea;
int indice;
double x,y,z,w;
Nodo nodo;
Elemento elemento;
do
{
linea = bf.readLine();
if(linea.startsWith("GRID"))
{
... | 4 |
public synchronized Object inspectNext() {
return queue.firstElement();
} | 0 |
public void monitorFileCreate(Path file) {
try {
if(file.startsWith(sourceDir)){
Path subPath = sourceDir.relativize(file);
for(Path targetDir : targetDirs){
Path newPath = targetDir.resolve(subPath);
Files.createDirectories(newPath.getParent());
logger.info("cp "+file.toString()+" "+new... | 3 |
@Override
public void run() {
byte[] buffer;
do {
try {
if (!active)
break;
int packageLength = input.readInt();
ByteBuffer wrapped = ByteBuffer.allocate(packageLength);
while (packageLength > 0) {
... | 5 |
public XEquation(String equation){
equ = new Equation(equation);
Vector<Variable> variables = equ.getVariables();
if(variables.size()==0){
x = new Variable("x");
}
else{
if(variables.size()!=1)
throw new EquationException("Invalid X Equation: " + equation);
x = variables.firstElement();
if(!x.... | 3 |
@Override
public boolean equals(Object obj)
{
if (this == obj)
{
return true;
}
if (!super.equals(obj))
{
return false;
}
if (!(obj instanceof BigVersion))
{
return false;
}
... | 5 |
@Override
public ArrayList<String> getLastErrors() {
return this.lastErrors;
} | 0 |
public static Map<String, String> parseMetadata(File metadataFile) {
HashMap<String, String> result = new HashMap<>();
try (FileInputStream in = new FileInputStream(metadataFile)) {
List<String> lines = IOUtils.readLines(in);
for (String line : lines) {
String[] arr = line.split(":");
result.put(arr... | 3 |
public void getList(int rep)
{
String tempQuery = "";
if(rep == 0) {
tempQuery = "SELECT memberid,lastname,firstname,midinit from member order by lastname";
}
else if(rep == 1) {
String searchText = searchBox.getText().toUpperCase();
... | 5 |
private static Event nextEvent() {
Event e = null;
if (Keyboard.next()) {
if (Keyboard.getEventKeyState()) {
e = new Event(EventType.KEY_PRESSED, Keyboard.getEventKey());
} else {
e = new Event(EventType.KEY_RELEASED, Keyboard.getEventKey());
}
}
if (Mouse.next()) {
if (Mouse.get... | 6 |
private static void openConnection() {
try
{
System.out.println("Loading the driver...");
Class.forName("com.mysql.jdbc.Driver");
System.out.println("Loading successed ---------------");
String jsonEnvVars = java.lang.System.getenv("VCAP_SERVICES");
if (json... | 5 |
public static void merge(Comparable[] a, int lo, int mid, int hi) {
int i = lo, j = mid + 1;
for (int k = lo; k <= hi; k++) {
aux[k] = a[k];
}
for (int k = lo; k <= hi; k++) {
// ߵԪþȡұߵԪ
if (i > mid) {
a[k] = aux[j++];
}
// ұߵԪþȡߵԪ
else if (j > hi) {
a[k] = aux[i++];
}
// ҰߵĵǰԪ... | 5 |
public Group setClasses(HashMap<Field, Time> aClasses) {
//System.out.println("Group.setClasses() : " + this + " " + aClasses);
if (aClasses != null)
this.classes = aClasses;
for (Field f : this.classes.keySet())
if (!this.done.containsKey(f))
this.done.put(f, false);
return this;
} | 3 |
public ArrayList<String> initialize(ArrayList<String> subordinatingConjunctions){
Scanner scanner = null;
try {
scanner = new Scanner(new File("subordinating conjunctions")).useDelimiter(",");
} catch (FileNotFoundException e) {
}
while (scanner.hasNextLine()) {
subordinatingConjunctions.ad... | 2 |
public SortMode(boolean sortUp, int sortMode) {
this.sortUp = sortUp;
this.sortMode = sortMode;
} | 0 |
public MowerCommandListStringAdapter(final String mowercommandList) throws UnrecognizedCommandException {
super(null);
LinkedList<MowerCommand> mowerCommands = new LinkedList<MowerCommand>();
for (int i =0;i<mowercommandList.length();i++){
char command = mowercommandList.charAt(i);
switch(command){
... | 4 |
@Override
public void actionPerformed(ActionEvent e) {
if (e.getSource() == configButton || e.getSource() == okButton) {
// hides the config dialog
parent.configAction.tap();
}
} | 2 |
public static List<ContainerData> parseXmlFile(String path) {
try {
// Create a DocumentBuilderFactory
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
// Create a list to store the container data
List<ContainerData> containers = new... | 4 |
public int[] search (ASEvaluation ASEval, Instances data)
throws Exception {
double best_merit = -Double.MAX_VALUE;
double temp_merit;
BitSet temp_group, best_group=null;
if (!(ASEval instanceof SubsetEvaluator)) {
throw new Exception(ASEval.getClass().getName()
... | 9 |
public static void main(String args[]) throws Exception
{
final int TOP = 200;
String outputPath = "C:/z-ling/task/HEY/ResultTest/AccuracyResult_"+TOP+".txt";
FileOutputStream fos=new FileOutputStream(outputPath);
OutputStreamWriter osw=new OutputStreamWriter(fos);
BufferedWr... | 8 |
public void updateMobs(){
for(int i = 0; i < items.size(); i++){
items.get(i).update();
}
for(int i = 0; i < mobs.size(); i++){
mobs.get(i).update();
}
for(Player e : players){
e.update();
}
} | 3 |
public int getValue() {
return value;
} | 0 |
protected boolean checkYObstacle(CommonObject so, double time, int halfOfWidth) {
if ((this.currentCoord.getY() + this.currentHeight + currentVerticalSpeed * time >= so.getCurrentCoordinates().getY())
&& (this.currentCoord.getY() + this.currentHeight <= so.getCurrentCoordinates().getY())
... | 9 |
public static boolean kickClient(Player player, Client adminClient, boolean banUser, boolean banUserAndMac) {
boolean kik = GameManager.kickClient(player.getName(), adminClient);
if (kik == false) {
Client kickedClient = null;
synchronized(clients) {
for (Client client : clients) {
if (client.getPlay... | 9 |
public static void main( String args[] ){
MiniDB db = new MiniDB( "minidb" );
BufMgr bm = db.getBufMgr();
int size = 8;
BPlusTree bpt = null;
try{
bpt = db.createNewBPlusTreeIndex( "table", "val", 8 );
int iters = 50;
MiniDB_Record insertedRecords[] = new MiniDB_Record[iters];
... | 4 |
private void loadLandPolygons(String file, final HashMap<Integer, GMTShape> landPolygons) {
GMTParser gmtpLandPolygons = new GMTParser() {
@Override
public void processShape(GMTShape shape) {
if (shape.getxPoly().length > 0) {
landPolygons.put(shape.ge... | 4 |
public void setLineWidth(float lineWidth) {
// Automatic Stroke Adjustment
if (lineWidth <= Float.MIN_VALUE || lineWidth >= Float.MAX_VALUE ||
lineWidth == 0) {
// set line width to a very small none zero number.
this.lineWidth = 0.001f;
} else {
... | 3 |
public void loadRawData() {
File f = window.showOpenDialog(new FileNameExtensionFilter("Text files", "txt"));
if (f == null) return;
StringBuilder fileStringBuilder = new StringBuilder();
try {
BufferedReader fr = new BufferedReader(new FileReader(f));
String line;
while ((line = fr.readLine()) != null... | 4 |
static public BigDecimal atan(final BigDecimal x)
{
if ( x.compareTo(BigDecimal.ZERO) < 0 )
{
return atan(x.negate()).negate() ;
}
else if ( x.compareTo(BigDecimal.ZERO) == 0 )
return BigDecimal.ZERO ... | 9 |
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Movie other = (Movie) obj;
if (movieId != other.movieId)
return false;
if (title == null) {
if (other.title != null)
return false;
... | 7 |
public static Vector xmlRead(String fileName)
{
SAXBuilder builder = new SAXBuilder();
Vector pointsList = new Vector();
try
{
Document doc = builder.build( fileName ); // parse XML tags
Element root = doc.getRootElement(); // get root of XML tree
... | 9 |
private void loadInfo(ResultSet result){
try{
result.next();
start = result.getString("cas_startu");
end = result.getString("cas_konce");
}catch(SQLException se){
//Handle errors for JDBC
se.printStackTrace();
}
... | 1 |
public JSONObject createDomain(
String mode,
String domain,
String group,
String rname,
String[] ns,
String primary_wildcard,
String primary_wildcard_qtype,
String default_mx) {
StringBuilder uriBuilder = new StringBuilder("/api/createDomain/?") ;
uriBuilder.append("AUTH_TOKEN="+apiToken) ;
... | 7 |
void output(int code, OutputStream outs) throws IOException {
cur_accum &= masks[cur_bits];
if (cur_bits > 0)
cur_accum |= (code << cur_bits);
else
cur_accum = code;
cur_bits += n_bits;
while (cur_bits >= 8) {
char_out((byte) (cur_accum & 0xff), outs);
cur_accum >>= 8;
cur_bits -= 8;
}
... | 8 |
private void LoadSavedBill(){
if(ComboBox_SaveBill.getItemCount() > 0){
int idxFile = ComboBox_SaveBill.getSelectedIndex();
String loadFile = saveBillFile + idxFile;
int count = 1;
clear_Paid_list();
clear_table(dm_hoa_don);
try{
... | 7 |
private boolean abortRequest(Request request) {
// Presumption : transaction exists
transactionEntity tempT = this.transInfo.get(request.transaction);
// remove all transaction requests in the waiting list.
Set<Request> removing = new HashSet<Request>();
for (Request wait : thi... | 4 |
public void setDepartmentId(int departmentId) {
this.departmentId = departmentId;
} | 0 |
public boolean equals(Object o) {
if (o == this) {
return true;
}
if (!(o instanceof TalenPerLandPK)) {
return false;
}
TalenPerLandPK other = (TalenPerLandPK) o;
return true
&& (getLandCode() == null ? other.getLandCode() == null : getLandCode().equals(other.getLandCode()))
&& (getTaalCode() ==... | 6 |
static double dot(svm_node[] x, svm_node[] y)
{
double sum = 0;
int xlen = x.length;
int ylen = y.length;
int i = 0;
int j = 0;
while(i < xlen && j < ylen)
{
if(x[i].index == y[j].index)
sum += x[i++].value * y[j++].value;
else
{
if(x[i].index > y[j].index)
++j;
else
++i;
... | 4 |
public String strStr(String haystack, String needle) {
if (needle.isEmpty())
return haystack;
if (haystack.isEmpty())
return null;
int m = 0; // the beginning of the current match in haystack
int i = 0; // the position of the current character in needle
int[] T = kmpTable(needle);
while (m + i < hay... | 6 |
public void resetDemo()
{
entities.removeAll(Entity.class);
createBorders();
for (int i = 0; i < 10; i++)
createAndPositionToFreeSpot(new Ball());
for (int i = 0; i < Const.cheeseamount; i++)
createAndPositionToFreeSpot(new Cheese());
... | 3 |
public static boolean isReservedOr(String candidate) {
int START_STATE = 0;
int TERMINAL_STATE = 2;
char next;
if (candidate.length()!=2){
return false;
}
int state = START_STATE;
for (int i = 0; i < candidate.length(); i++)
... | 7 |
static final void method129(int i, int i_0_, long[] ls, int i_1_,
int[] is) {
do {
try {
anInt89++;
if ((i ^ 0xffffffff) > (i_1_ ^ 0xffffffff)) {
int i_2_ = (i_1_ + i) / 2;
int i_3_ = i;
long l = ls[i_2_];
ls[i_2_] = ls[i_1_];
ls[i_1_] = l;
int i_4_ = is[i_2_];
is... | 9 |
private void addDeclination( String root, Properties props, int count ) {
for( int i = 1; i <= count; i++ ) {
String declination = props.getProperty( String.valueOf( i ) );
if( declination == null ) {
return;
}
declination = declination.replace( "{... | 4 |
private void checkAndUpdateWeapon() {
TouchableRectangle.direction dir;
for (int i = 0; i < bricks.size() && weapon != null; i++) {
Brick br = bricks.get(i);
if ((dir = br.touches(weapon)) != Brick.direction.NONE) {
Dropping temp = br.dropping;
if... | 7 |
@Override
public void run() {
//Go on while run is true
while(run.get()) {
try {
TFTPPacket packet = packetQueue.take();
if(packet instanceof WRQPacket){
sendFile((WRQPacket) packet);
}e... | 4 |
public SkiPass getSecondHalfDaySkiPass(Date currentDate) {
if (currentDate == null) {
throw new IllegalArgumentException("Current date is null");
}
Calendar calendar = new GregorianCalendar();
calendar.setTime(currentDate);
calendar.set(Calendar.HOUR_OF_DAY, 13);
... | 2 |
private void analyzeImage(BufferedImage image) {
setProgress("Analyzing...");
worker = new PatchFinder(
image,
controller.getParametersBean().getTolerance(),
40 // TODO parameter
);
worker.addPropertyChangeListener(new PropertyChangeListener() {
@Override
public void propertyChange(PropertyC... | 5 |
public String getAnswer(){
for(int a = 1; a < 1000; a++)
for(int b = 1; b < 1000; b++)
for(int c = 1; c < 1000; c++)
if(a + b + c == 1000 && Math.pow(a, 2) + Math.pow(b, 2) == Math.pow(c, 2))
return String.valueOf(a * b * c);
return null;
} | 5 |
private void initComponents() {
//Components
menuBar1 = new JMenuBar();
mFile = new JMenu();
mF1 = new JMenuItem();
mF2 = new JMenuItem();
mF3 = new JMenuItem();
mF4 = new JMenuItem();
mF5 = new JMenuItem();
mEdit = new JMenu();
mE1 = new ... | 7 |
public void merge(int[] A, int m, int[] B, int n) {
int countA = m - 1;
int countB = n - 1;
for(int i = n + m - 1; i >= 0; --i){
if(countA >= 0 && countB >= 0 && A[countA] > B[countB]){
A[i] = A[countA];
countA--;
continue;
}
if(countA >= 0 && countB >= 0 && A[countA] <= B[countB]){
A[i] ... | 8 |
public void onDeath(DamageSource par1DamageSource)
{
Entity var2 = par1DamageSource.getEntity();
if (this.scoreValue >= 0 && var2 != null)
{
var2.addToPlayerScore(this, this.scoreValue);
}
if (var2 != null)
{
var2.onKillEntity(this);
... | 9 |
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 |
private void generateRoom()
{
int regionHeight = y2 - y1 - 2;
int regionWidth = x2 - x1 - 2;
// Muodostetaan huoneen mitat siten, että mitat ovat vähintään ROOM_MIN_SIZE tai satunnaisesti niin isot kuin mahtuu
int roomWidth = (regionWidth == ROOM_MIN_SIZE) ? ROOM_MIN_SIZE : ... | 6 |
public void run() {
Process p = null;
try {
if(game.GetOS.isWindows())
p = Runtime.getRuntime().exec("XboxControllerInputConsole.exe");
if(game.GetOS.isUnix() || game.GetOS.isMac())
p = Runtime.getRuntime().exec("./xboxdrv.sh");
} catch (... | 6 |
public void setMinBill(double minBill) {
if(minBill < 0) {
throw new IllegalArgumentException(
"error: bill minimum must be greater than or equal to zero");
}
this.minBill = minBill;
} | 1 |
private void addTextContent(Element parent, TextObject textObj) /*throws XMLStreamException*/ {
if ( (textObj.getText() == null || textObj.getText().isEmpty())
&& (textObj.getPlainText() == null || textObj.getPlainText().isEmpty()))
return;
Element textEquiv = doc.createElementNS(getNamespace(), Defaul... | 7 |
private void sortForward(int par1)
{
PathPoint var2 = this.pathPoints[par1];
float var3 = var2.distanceToTarget;
while (true)
{
int var4 = 1 + (par1 << 1);
int var5 = var4 + 1;
if (var4 >= this.count)
{
break;
... | 6 |
protected void doMove(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
Map<String, Action> actions = getActions();
if (request.getParameter("action") != null){
if(actions.containsKey(request.getParameter("action"))){
if (actions.get(request.getParamete... | 5 |
public boolean simulateInput(String input) {
/** clear the configurations to begin new simulation. */
myConfigurations.clear();
Configuration[] initialConfigs = getInitialConfigurations(input);
for (int k = 0; k < initialConfigs.length; k++) {
FSAConfiguration initialConfiguration = (FSAConfiguration) initia... | 4 |
@SuppressWarnings("deprecation")
public static boolean UserInputs() {
user = new JTextField(15);
pass = new JPasswordField(15);
JPanel myPanel = new JPanel();
myPanel.add(new JLabel("Username:"));
myPanel.add(user);
myPanel.add(Box.createHorizontalStrut(15)); // a spacer
myPanel.add... | 3 |
@Override
protected Budget createBudget(String budget_choice) throws Exception {
validateBudgetChoice(budget_choice);
return (budget_choice.equals(ANNUAL_BUDGET)) ?
new AnnualBudget("Annual budget", new BigDecimal(BigInteger.ZERO), new Date()) :
new MonthlyBudget("M... | 1 |
public static String[][] translator(String textmap) {
int xSize;
int ySize;
String[][] stringMapArray = null;
//first we need to check that the map is legitimate by calling mapchecker.
if (mapchecker(textmap)) {
try {
//Initiate a buffered reader to read form the file
BufferedReader reader = new Bu... | 5 |
public PhpposItemsEntity getItemPos(int idItemPos){
return (PhpposItemsEntity) getHibernateTemplate().get(PhpposItemsEntity.class, idItemPos);
} | 0 |
public void actionPerformed(ActionEvent e) {
if (e.getSource().equals(genPoints)) {
int w = graphPanel.getWidth();
int h = graphPanel.getHeight();
pRadius = Utils.scaledPointSize(numPoints, w, h);
myGraph.reset();
resetPath();
myGraph.addNodes(Utils.genPoints(numPoints, w, h), w,... | 5 |
private final void method2849(int i, int i_39_, byte i_40_, int i_41_) {
anInt8941++;
Class348_Sub43 class348_sub43
= aClass348_Sub43ArrayArray8928[i_41_][i_39_];
if (class348_sub43 != null) {
int i_42_ = -123 % ((i_40_ - 24) / 42);
aClass348_Sub43ArrayArray8928[i_41_][i_39_] = null;
if ((((Class... | 6 |
public void setSucc(DoublyLinkedNode succ) {
this.succ = succ;
} | 0 |
public int next_note( int data_offset, int[] note ) {
int bitmask, field;
if( data_offset < 0 ) {
data_offset = pattern_data.length;
}
bitmask = 0x80;
if( data_offset < pattern_data.length ) {
bitmask = pattern_data[ data_offset ] & 0xFF;
}
if( ( bitmask & 0x80 ) == 0x80 ) {
data_offset += 1;
}... | 6 |
public void reconnectRejectPart() {
for (Transition t : rejectPartBridges) {
boolean add = false;
if (t.getType() == Derive.class) {
if (items.contains(t.source)) {
add = true;
t.source.derives.add(t);
}
} else { // t is a Reduce
if (items.contains(t.target)) {
add = true;
t.s... | 7 |
protected boolean balancedJSToken() {
Deque<Character> stack = new ArrayDeque<Character>();
while (true) {
int c = input.read();
if (stack.isEmpty() && c == '`') {
return true;
}
if (!stack.isEmpty() && stack.element() == c) {
... | 9 |
int pack_books(Buffer opb){
opb.write(0x05, 8);
opb.write(_vorbis);
// books
opb.write(books-1, 8);
for(int i=0; i<books; i++){
if(book_param[i].pack(opb)!=0){
//goto err_out;
return (-1);
}
}
// times
opb.write(times-1, 6);
for(int i=0; i<times; i++){
... | 7 |
@After
public void tearDown() {
} | 0 |
public void setNumUndo(int nn){
numUndo = nn;
} | 0 |
public String longestCommonPrefix(String[] strs) {
int n = strs.length;
if(n==0){
return "";
}
if(n==1){
return strs[0];
}
if(strs[0] == ""){
return "";
}
int i;
for (i = 0;i<strs[0].length();i++){
fo... | 9 |
public Context(State state) {
this.state = state;
} | 0 |
private Tuple<Float, HeuristicData> max(LongBoard state, HeuristicData data, float alpha,
float beta, int action, int depth) {
Winner win = gameFinished(state);
statesChecked++;
Tuple<Float, HeuristicData> y = new Tuple<>((float) Integer.MIN_VALUE, nul... | 7 |
public void harvest(int quantity, Villager villager)
{
resources -= quantity;
villager.getProffession().setRsrceQuantity(villager.getProffession().getRsrceQuantity() + quantity);
} | 0 |
public void reduceAP(MapleClient c, byte stat, short amount) {
MapleCharacter player = c.getPlayer();
switch (stat) {
case 1: // STR
player.getStat().setStr(player.getStat().getStr() - amount);
player.updateSingleStat(MapleStat.STR, player.getStat().getStr());... | 5 |
public static void main(String[] args)
{
//Symmetric case
sc = new Scanner(System.in);
System.out.println("enter the number of Channels");
m = sc.nextInt();
System.out.println("m is " + m + " and 2m-1 is " + (2 * m - 1));
// forming array with channels starting from 1 to c
arr = new int[2 * m - 1];
fo... | 5 |
public static void readAppletParams(java.applet.Applet applet) {
VoidParameter current = head;
while (current != null) {
String str = applet.getParameter(current.getName());
if (str != null)
current.setParam(str);
current = current.next;
}
} | 2 |
@Override
public void addNews(News news) {
allNews.add(news);
updateAll();
} | 0 |
private int getAdjacentTracks() {
int var1 = 0;
if (this.isMinecartTrack(this.trackX, this.trackY, this.trackZ - 1)) {
++var1;
}
if (this.isMinecartTrack(this.trackX, this.trackY, this.trackZ + 1)) {
++var1;
}
if (this.isMinecartTrack(this.trackX... | 4 |
public boolean equals(Object toCompare)
{
if(toCompare instanceof Quantity)
{
if(this.toString().equals(toCompare.toString()))
return true;
}
return false;
} | 2 |
@Override
public Object[] getData()
{
if (ptr != 0) {
return null;
} else {
if (isConstant()) {
if (length > getMaxSizeOf32bitArray()) return null;
Object[] out = new Object[(int) length];
for (int i = 0; i < length; i++) {
... | 4 |
public static <T> ArrayList<T> array_values(Map<?, T> m) {
// OK
ArrayList<T> output = new ArrayList<T>();
if (m == null) return output;
int i = 0;
synchronized(m) {
for (Map.Entry<?,T> entry : m.entrySet()) {
T value = entry.getValue();
output.add(i,value);
i++;
}
}
return output;
} | 4 |
private void CreateKeyButtons(Keyboard keyboard) {
KeysPanel.removeAll();
KeysPanel.setLayout(new FlowLayout());
if (!keyboard.getMapOfKeys().isEmpty()) {
for (char key : keyboard.getMapOfKeys().keySet()) {
// "" + key
final JToggleButton keyButton = n... | 4 |
public void send(String groupName, Message message) {
message.setSeqNum(this.groupSpg.get(groupName));
this.groupRpg.groups.get(groupName).put(this.localHostName, this.groupSpg.get(groupName));
this.groupSpg.put(groupName, this.groupSpg.get(groupName) + 1);
//this.messagePasser.getTimeStamp().addClock();
... | 2 |
public Model method209(int arg0, int arg1, boolean flag) {
Model model;
if (flag) {
model = getModel(anInt255, anInt256);
} else {
model = getModel(anInt233, mediaId);
}
if (model == null) {
return null;
}
if (arg1 == -1 && arg0 == -1 && model.triangleColors == null) {
return model;
}
Mode... | 9 |
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.