text stringlengths 14 410k | label int32 0 9 |
|---|---|
@Override
public String runMacro(HTTPRequest httpReq, String parm, HTTPResponse httpResp)
{
final java.util.Map<String,String> parms=parseParms(parm);
final String last=httpReq.getUrlParameter("AUTOTITLE");
if(parms.containsKey("RESET"))
{
if(last!=null)
httpReq.removeUrlParameter("AUTOTITLE");
retu... | 8 |
public static void main(String[] args) { //sets look and feel, creates the questionTree, and then moves on to the first GUI
try { //get Windows look and feel if possible
for(javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager
.getInstalledLookAndFeels()) {
if("Windows".equals(info.getName... | 7 |
private static TypeDesc parseTypeDesc(String src, int[] pos) {
// Skip leading whitespace.
skipWhitespace(src, pos);
int i = pos[0];
int length = src.length();
if (i >= length) {
return null;
}
int startPos = i;
char c = src.charAt(i);
... | 9 |
protected boolean learnFromEpoch() {
sampleIndex = 0;
epoch++;
if (sse < 0.001d || isHalted()) {
return haltCalibration();
}
myNetwork.learnFromErrors();
if (!isRunning()) {
if (interruptCalibration()) {
return true;
}
... | 4 |
private boolean isVarLocal(FunctionTrace ft, String varName) {
if (ft == null || varName == null || varName == "") {
System.out
.println("Error: Empty variable or trace passed to isVarLocal");
System.exit(-1);
}
// Find varName in ft's variable list
List<VariableDesc> vDesc_list = ft.f_decl.var_desc... | 7 |
public int sqrt2(int x) { // binary search solution
long i = 0;
long j = x/2+1;
while(i <= j){
long mid = (i+j)/2;
System.out.println(i+ " " + j + " " + mid + " " + mid*mid);
long s = mid*mid;
if(s == x) return (int)mid;
if(s < x) i = mid+1;
else j = mid - 1;
... | 3 |
@Test
public void test_get_long()
{
Assert.assertEquals(8989l, getLong("b_local_port"));
} | 0 |
@Override
public Object getValueAt(int row, int col) {
switch (col) {
case 0:
return data.elementAt(row)[0];
case 1:
return data.elementAt(row)[1];
case 2:
return data.elementAt(row)[2];
case 3:
return data.elementAt(row)[3];
}
throw new IllegalArgumentException(
"Cannot retrieve from sel... | 4 |
public static Action getAction(final short actionID, final MDModel model) {
if (actionID == COUN_ID || actionID == MEAS_ID || actionID == TRAJ_ID || actionID == RAVE_ID
|| actionID == WHAT_ID || actionID == MARK_ID || actionID == SELE_ID) {
Action a = new AbstractAction() {
public void actionPerformed(Acti... | 7 |
@Override
public void i3locate(MOB mob, String mobName)
{
if(mob==null)
return;
if((!i3online())&&(!imc2online()))
return;
if((mobName==null)||(mobName.length()==0))
{
mob.tell(L("You must specify a name."));
return;
}
if(i3online())
{
final LocateQueryPacket ck=new LocateQueryPacket();... | 8 |
protected void authenticateUser() throws LoginException {
if (!(_currentRealm instanceof MultipleLoginRealm)) {
String msg = sm.getString("jdbclm.badrealm");
throw new LoginException(msg);
}
final MultipleLoginRealm jdbcRealm = (MultipleLoginRealm)_currentRealm;
... | 5 |
private static int dfaMenu(DFA dfa){
String menu = dfa.toString()+"\n\n"+
"1. Enter Words\n"+
"2. Print out Alphabet\n"+
"3. Print GRAIL transition table\n"+
"4. Back\n"+alwaysMenu();
Scanner dfaScan = new Scanner(System.in);
int input;
String answer;
do{
System.out.println(menu);
input ... | 5 |
public void updateProduct(Product product) {
try {
beginTransaction();
session.update(product);
session.getTransaction().commit();
} catch (Exception e) {
e.printStackTrace();
} finally {
closeSesion();
}
} | 1 |
public PNGDecoder(InputStream input) throws IOException {
this.input = input;
this.crc = new CRC32();
this.buffer = new byte[4096];
readFully(buffer, 0, SIGNATURE.length);
if(!checkSignature(buffer)) {
throw new IOException("Not a valid PNG file");
}
... | 7 |
@Override
public void execute() {
if (type == null) {
view = new GreenClockView(clock, timezone);
view.show(x, y);
clock.add(view);
} else {
switch (type) {
case GREENCLOCK:
view = new GreenClockView(clock, timezone);
view.show(x, y);
clock.add(view);
break;
case REDCLOCK:
vie... | 4 |
public BreakH(GenericTreeNode<LayoutParserTreeElement> element,
Direction dir, int x, int y, int height, int width) {
GenericTreeNode<LayoutParserTreeElement> parent = element.getParent();
// Setup the new element.
LayoutParserTreeElement newElementData = new LayoutParserTreeElement();
int newLeft = elemen... | 7 |
private JTextField createConstraintField(String text)
{
if (text == null)
return null;
final JTextField tf = new JTextField(text, 50);
tf.setFont(new Font("monospaced", Font.PLAIN, 12));
tf.addKeyListener(new KeyAdapter() {
public void keyPressed(KeyEvent e)
{
if (e.getKeyCode() == KeyE... | 7 |
private void setBalance(BigInteger balance) throws IllegalArgumentException {
if (! this.canHaveAsBalance(balance))
throw new IllegalArgumentException();
this.balance = balance;
} | 1 |
public String getColumnName(int colIndex) {
String name;
int index = colIndex + firstDayOfWeek;
if (index > Calendar.SATURDAY) {
index = Calendar.SUNDAY;
}
switch (index) {
case Calendar.SUNDAY:
name = NAMES_... | 8 |
public String getColumnData(int i) throws Exception {
if (i == 0)
return getUserName();
else if (i == 1)
return getPassword();
else if (i == 2)
return getFirstName();
else if (i == 3)
return getLastName();
else if (i == 4)
return getEmail();
else if (i == 5)
return... | 6 |
protected boolean useLabelBounds(mxCellState state)
{
mxIGraphModel model = state.getView().getGraph().getModel();
mxGeometry geometry = model.getGeometry(state.getCell());
return ((geometry != null && geometry.getOffset() != null
&& !geometry.isRelative() && (geometry.getOffset().getX() != 0 || geometry
... | 5 |
private void collectGridlet()
{
System.out.println(super.get_name() + ": Collecting Gridlets ...");
list_ = new ArrayList(gridletID_ + 1);
Object data = null;
Gridlet gl = null;
int counter = 1; // starts at 1, since gridletID_ starts at 1 too
Sim_event ev = new ... | 5 |
@Override
public void doGet(HttpServletRequest req, HttpServletResponse res)throws ServletException, IOException{
res.setContentType("text/html");
Connection con = null;
String lausend = null;
ResultSet rs = null;
PreparedStatement ps = null;
Gson gson=new Gson();
ArrayList<CreateByParty> byParty=new Arr... | 9 |
protected final void addJobListener( Class<? extends JobListener> jobListenerType )
{
doBind( jobListeners, jobListenerType );
} | 1 |
public HashMap<Integer, ArrayList<Mission>> listeMissionsAttaquesUrgentes() {
HashMap<Integer, ArrayList<Mission>> missionsAttaquesUrgentes = new HashMap<Integer, ArrayList<Mission>>();
for (int i = 0; i < colonnes; i++) {
for (int j = 0; j < lignes; j++) {
if (monstre == Mon... | 9 |
public static String readTextFile(File f) throws IOException
{
if (f != null && f.exists()) {
String str;
Scanner reader = new Scanner(f);
reader.useDelimiter("\\Z");
try {
str = reader.next();
} catch (NoSuchElementException nsee) {
reader.close();
return null;
}
reader.clos... | 3 |
private static void testRename(FileSystem fileSystem, String src, String dest) throws TestFailedException {
try {
fileSystem.rename(src, dest);
if (!fileSystem.pathExists(dest))
throw new TestFailedException("Seems that renaming from " + src + " to " + dest + " did not work");
} catch (PathNotFoundExcept... | 4 |
private boolean jj_3R_62() {
Token xsp;
xsp = jj_scanpos;
if (jj_3_77()) {
jj_scanpos = xsp;
if (jj_3_78()) return true;
}
return false;
} | 2 |
public int choiceOptions()
{
System.out.println("Enter a choice:");
System.out.println("1 - Go (Move Karel one space forward in his "
+ "current direction)");
System.out.println("2 - Turn Karel Left");
System.out.println("3 - Turn Karel Right")... | 0 |
private boolean _jspx_meth_c_forEach_0(PageContext _jspx_page_context)
throws Throwable {
PageContext pageContext = _jspx_page_context;
JspWriter out = _jspx_page_context.getOut();
// c:forEach
org.apache.taglibs.standard.tag.rt.core.ForEachTag _jspx_th_c_forEach_0 = (org.apache.taglibs.stand... | 6 |
public void changeCharacter() {
Cell[][] cells = map.getCells();
int x = 0;
int y = 0;
for (x = 0; x < cells.length; x++) {
for (y = 0; y < cells[x].length; y++) {
if (map.getCell(x, y).getUnit() instanceof Tank) {
((Tank) map.getCell(x, y).getUnit()).nextImage();
} else if (map.getCell(x, y).g... | 4 |
private void jTextPane2MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jTextPane2MouseClicked
// TODO add your handling code here:
}//GEN-LAST:event_jTextPane2MouseClicked | 0 |
public void deleteCustomer(Long id) {
this.em.remove(this.getCustomer(id));
} | 0 |
public ArrayList<Node> findVoisin(Node current){
ArrayList<Node> voisins = new ArrayList<Node>();
int x_cur = current.getXpos();
int y_cur = current.getYpos();
if(view_grid.valideCoord(x_cur+1,y_cur))
voisins.add(view_grid.grids[x_cur+1][y_cur]) ; // North
if(view_gr... | 4 |
public void selectCellForEvent(Object cell, MouseEvent e)
{
boolean isSelected = graph.isCellSelected(cell);
if (isToggleEvent(e))
{
if (isSelected)
{
graph.removeSelectionCell(cell);
}
else
{
graph.addSelectionCell(cell);
}
}
else if (!isSelected || graph.getSelectionCount() != 1)... | 4 |
public Settings() {
setTitle("MobileScriptBuilder - Settings");
setBounds(100, 100, 540, 128);
getContentPane().setLayout(new BorderLayout());
contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5));
getContentPane().add(contentPanel, BorderLayout.CENTER);
contentPanel.setLayout(null);
{
JLabel lblNgecoreL... | 6 |
public void updateMinLocalInf(int x) throws InterruptedException {
s3.acquire();
if (minLocalInf > x)
minLocalInf = x;
s3.release();
} | 1 |
public static void loadSigns(){
File fichier_signs = new File(OneInTheChamber.instance.getDataFolder() + File.separator + "Signs.yml");
YamlConfiguration signsFile = YamlConfiguration.loadConfiguration(fichier_signs);
if(ArenaManager.getArenaManager().getArenas() != null){
for(Arena arena : ArenaManager.getA... | 5 |
@Override
protected Integer doInBackground() throws Exception { //To change body of generated methods, choose Tools | Templates.
if (operation.equals("fc") || operation.equals("it")) {
String innerGrade = grade;
int rowCount= ((DefaultTableModel)table.getModel()... | 7 |
private void renderBlocks(Graphics g){
for (Block b : blocks){
if (b.isVisible()){
g.drawImage(Resources.block, (int)b.getX(), (int)b.getY(), BLOCK_WIDTH, BLOCK_HEIGHT, null);
}
}
} | 2 |
@Override
public String makeMobName(char gender, int age)
{
switch(age)
{
case Race.AGE_INFANT:
case Race.AGE_TODDLER:
return "puppy";
case Race.AGE_CHILD:
{
switch(gender)
{
case 'M':
case 'm':
return "boy puppy";
case 'F':
case 'f':
return "girl puppy";
defa... | 7 |
private boolean allSitesHasVarFail(int index) {
for(int i: sitesHasVar(index).keySet()) {
Site site = sitesHasVar(index).get(i);
if(!site.isFailed()) {
return false;
}
}
return true;
} | 2 |
public void drawStaticHud(GL2 gl) {
this.gl = gl;
if (! player.isAlive())
return;
update();
start2D();
//drawEnergy(gl);
// Set the crosshair color to green
gl.glColor4f(0.0f, 1.0f, 0.0f, 0.0f);
if(crosshair != null) {
crosshai... | 9 |
private ArrayList<Team> getGroup(int groupId, ArrayList<Team> teams)
{
ArrayList<Team> group = new ArrayList();
for (Team t : teams)
{
if (t.getGroupId() == groupId)
{
group.add(t);
}
}
return group.isEmpty() ? null : group... | 3 |
public void method216(int i, int j, int k, int l, int i1, boolean flag)
{
int j1 = 256;
if(flag)
j1 += 0x20000;
k -= anInt290;
l -= anInt291;
if(i == 1 || i == 3)
{
int k1 = j;
j = i1;
i1 = k1;
}
for(int l1 = k; l1 < k + j; l1++)
if(l1 >= 0 && l1 < anInt292)
{
for(int i2 = l; i2 <... | 9 |
@Override
public String[] getHelp() {
return new String[]{
"ttp group [group] [actions..]",
"Group interface"
};
} | 0 |
public void compareNetworks(String netA, String netB){
General u = new General();
Node[] nA = u.readNetworkFromAdjacencyList(netA);
Node[] nB = u.readNetworkFromAdjacencyList(netB);
Set<Integer> nodesA = new HashSet<>();
Set<Integer> nodesB = new HashSet<>();
... | 6 |
protected String FormeChange(String name){
Reader reader = new Reader();
String img_path = null; // 返り値
Integer pkmn_num = null; // 番号
String import_path = null;
Boolean find = false;
try{
// ポケモン名を取得(FC対応)
String ary_pkmn[] = reader.txtReader(Const.POKEMONNAME_FORME);
// 引数に対応した番号... | 4 |
public void fetch() {
// add all start skeletons
for (StorySkeleton sequel : start.getSequels()) {
unvisited.add(sequel);
}
while (!unvisited.isEmpty()) {
Story curr;
try {
curr = unvisited.poll().fetch();
} catch (IOExcepti... | 4 |
public Register getRegister(int index, String[] instArray) {
switch (instArray[index]) {
case "R0":
return registerFile.R0;
case "R1":
return registerFile.R1;
case "R2":
return registerFile.R2;
case "R3":
return registerFile.R3;
case "R4":
return registerFile.R4;
case "R5":
return regist... | 8 |
public void setRight(PExp node)
{
if(this._right_ != null)
{
this._right_.parent(null);
}
if(node != null)
{
if(node.parent() != null)
{
node.parent().removeChild(node);
}
node.parent(this);
... | 3 |
public void act()
{
if (isTouching(Bullet.class)){
world.kills.incrementInteger();
world.removeObject(this);
Greenfoot.playSound("explosion.wav");
return;
}
if (moveLeft == true) move(2);
else move(-2);
if (ge... | 4 |
public Integer getStatusObjectID (String name) {
Integer data = null;
for (int i = 0; i < this.arr_data.size(); i++) {
if (name.equals(this.arr_data.get(i).getDescr()))
data = this.arr_data.get(i).getID();
}
return data;
} | 2 |
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String[] in = br.readLine().split(" ");
int row = Integer.parseInt(in[0]);
int col = Integer.parseInt(in[1]);
int[][] inArr = new int[row][col];
for (int i = 0; i < row; i++)... | 6 |
public NessusClientData downloadReport(String uuid, String path) throws ParserConfigurationException, SAXException {
String c = "/file/report/download";
if(this.url.endsWith("/"))
c = c.substring(1);
NessusClientData scan = null;
/*
* Get a client, setup the POST, and execute.
*/
HttpPost post... | 5 |
public static void main(String[] args)
{
Scanner input = new Scanner(System.in);
double[] min = new double[3];
for(int i=0; i<3; i++)
{
min[i] = input.nextDouble();
}
Arrays.sort(min);
System.out.println(min[0]);
} | 1 |
public void setBounds(int row) {
for (int select = 0; select < 30; select++) {
if (items[row][select] != null) {
if (items[row][select] instanceof Tool) {
((Tool) items[row][select]).setToBigInv(true);
}
switch (select) {
case 0: items[row][select].setBounds(x + 50, y + 78); b... | 8 |
protected int nextDir(final Room R)
{
if(lastDir < 0)
lastDir=Directions.NORTH;
int dir=lastDir;
if(dir >= Directions.CODES().length)
dir=0;
else
dir++;
while(((R.getRoomInDir(dir)==null)
||(R.getExitInDir(dir)==null)
||(!R.getExitInDir(dir).isOpen()))
&&(dir != lastDir))
{
if(dir >=... | 7 |
@Override
public void documentRemoved(DocumentRepositoryEvent e) {
if (isVisible()) {
getModel().removeAllResultsForDocument(e.getDocument());
}
} | 1 |
private static byte[] crypto(byte[] message, String keyString, int cipherMode, IvParameterSpec ivps)
throws GeneralSecurityException {
String pair[] = keyString.split("\\s+");
if (pair.length != 2 || !pair[1].matches("^[A-Za-z0-9+/=]+$")) {
throw new InvalidKeyException("keyStrin... | 4 |
private Map getUsers() throws NamingException {
String filter = "(" + roleNameRDN + "=*)";
HashMap users = new HashMap();
NamingEnumeration results = this.search(roleBase, filter, new String[]{roleMemberRDN});
while (results != null && results.hasMore()) {
SearchResult ro... | 7 |
public boolean entityJoinedWorld(Entity var1) {
int var2 = MathHelper.floor_double(var1.posX / 16.0D);
int var3 = MathHelper.floor_double(var1.posZ / 16.0D);
boolean var4 = false;
if (var1 instanceof EntityPlayer) {
var4 = true;
}
if (!var4 && !this.chunkExis... | 4 |
public Dataset(String path) {
List<String> lines = new ArrayList<>();
try(BufferedReader br = new BufferedReader(new InputStreamReader(
new BufferedInputStream(new FileInputStream(new File(path)))))) {
while(true) {
String line = br.readLine();
if(line == null) {
break;
}
... | 6 |
public void push(int x){
ListNode node = new ListNode(x);
node.next = top;
top = node;
} | 0 |
public static Set<String> getStopWords(){
HashSet<String> stopWords = new HashSet<String>();
List<String> stopLists = new ArrayList<String>();
File[] files = new File("stopwords").listFiles();
for (File file : files) {
if (file.isFile()) {
String fileName = file.getName();
String fileEnd = ... | 6 |
public static ArrayList<Member> getAll(){
try {
if(conn == null || conn.isClosed()){
conn = DatabaseConnection.getConnection();
}
} catch (SQLException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
ArrayList<Member> memberList = new ArrayList<Member>... | 5 |
public static void printExplanationHeader(Justification self, OutputStream stream, KeyValueList mapping) {
{ ExplanationInfo info = Justification.explanationInfo(self, mapping);
String label = info.label;
int indent = label.length() + 1;
if ((((Keyword)(Logic.$EXPLANATION_FORMAT$.get())) == Logic... | 7 |
public static void main(String[] args) {
try {
InputFile in = new InputFile("Cleanup.java");
try {
String s;
int i = 1;
while ((s = in.getLine()) != null)
; // Perform line-by-line processing here...
} catch (Exception e) {
System.out.println("Caught Exception in main");
e.printStack... | 3 |
public Builder id(int receivedId) {
if (receivedId < 0) {
throw new IllegalArgumentException("Id must be integer value more than 0. Received value =" + receivedId);
}
this.id = receivedId;
return this;
} | 1 |
@Override
public void keyReleased(KeyEvent e) {
switch (e.getKeyCode()) {
case KeyEvent.VK_UP:
break;
case KeyEvent.VK_DOWN:
playerSpriteType = Constants.SPRITE_NORMAL;
player.setDucked(false);
player.stop();
break;
case KeyEvent.VK_LEFT:
player.stopLeft(true);
player.stop();
break;
c... | 5 |
public int getColumnCount() {
return 3;
} | 0 |
public String getPrintString(){
String s="";
s+="ID: "+id+"\n";
s+="Name: "+name+"\n";
s+="Severity: "+severity+"\n";
s+="Likelihood: "+likelihood+"\n";
s+="Weaknesses: \n";
for(String temp: weaknesses){
s+= temp+"\n";
}
s+="Prerequisites: \n";
for(String temp: prerequisites){
s+= temp+"\n"... | 9 |
@Override
public boolean onCommand(CommandSender sender, Command cmd, String label,
String[] args) {
try {
commands.execute(cmd.getName(), args, sender, sender);
} catch (CommandPermissionsException e) {
sender.sendMessage(ChatColor.RED + "You don't have permission.");
} catch (MissingNestedCommandExcep... | 6 |
public void loadMatchRecord(String id) {
if (!StringUtil.isBlank(id)) {
PreparedStatement st = null;
ResultSet rs = null;
try {
conn = dbconn.getConnection();
st = conn.prepareStatement("SELECT * FROM match_record_2013 WHERE id = " + id + " lim... | 4 |
public void setProcessMode(int processMode) {this.processMode = processMode;} | 0 |
public void calculatePitch()
{
if( channel != null && channel.attachedSource == this &&
channelJavaSound != null )
{
// If not using Doppler effect, save some calculations:
if( SoundSystemConfig.getDopplerFactor() == 0 )
{
channelJavaSo... | 6 |
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Product other = (Product) obj;
if (pCode == null) {
if (other.pCode != null)
return false;
} else if (!pCode.equals(other.pCode))
ret... | 6 |
public void decode(Buffer stream, Envelope envelope) {
int count = stream.getUnsignedByte();
pairCount[0] = count >> 4;
pairCount[1] = count & 0xf;
if (count != 0) {
unity[0] = stream.getUnsignedLEShort();
unity[1] = stream.getUnsignedLEShort();
int migrated = stream.getUnsignedByte();
for (int dire... | 8 |
public static void main(String[] args)
{
Mine2 frame = new Mine2();
frame.setVisible(true);
} | 0 |
private int height(final int index) {
// Left and right children indices
int leftChildIndex = getLeftChildIndex(index);
int rightChildIndex = getRightChildIndex(index);
boolean childIsNull_l = (array.getElement(leftChildIndex) == null);
boolean childIsNull_r = (array.getElement... | 7 |
public static Extractor create(String url){
for (Extractor extractor : EXTRACTORS) {
if(extractor.accept(url)){
return extractor;
}
}
return null;
} | 2 |
public static ClassType resolveClass(String name, List<String> imports) {
try {
Class.forName(name);
return new ClassType(name);
} catch (Exception e) {
if (imports != null) {
for (String prefix : imports) {
try {
Class.forName(prefix + "." + name);
return new ClassType(prefix + "." + ... | 4 |
private double noise3D(double xin, double yin, double zin) {
double n0, n1, n2, n3; // Noise contributions from the four corners
// Skew the input space to determine which simplex cell we're in
double s = (xin+yin+zin)*F3; // Very nice and simple skew factor for 3D
int i = fastfloor(xin+s);
int j = ... | 9 |
private BufferedReader fluxEntrant() {
if (emetteur != null) {
try {
return new BufferedReader(new InputStreamReader(
emetteur.getInputStream()));
} catch (IOException e) {
System.out
.println("Problème de récupération du flux entrant sur le client.");
}
}
return null;
} | 2 |
private void attachMBlocks() {
for (MBlock b : mBlocks) {
Point adj = b.getDirectionAdjPoint();
if (gBlock.getAttachedPoints().contains(adj) ||
gBlock.location().equals(adj)) {
if (b.isRemover())
gBlock.removePoints(b.getAdjSidesPoints());
else
gBlock.attachBlock(b.location());
... | 5 |
public ThreadClient threadDisponible(){
for(ThreadClient t : poolThread)
{
System.out.println("TEST");
System.out.println(t.getEmetteur());
if(t.getEmetteur() == null)
{
return t;
}
}
return null;
} | 2 |
private void formWindowActivated(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_formWindowActivated
if (!ALREADY_ACTIVATED) {
if (debug)
logger.log(level.DEBUG, "First-time activation: Starting logcat and DMESG.");
if (selectedDevice != null) {
getLogc... | 7 |
public void actionPerformed(ActionEvent e) {
if ("paused".equals(e.getActionCommand()) && !cutscene) {
if (paused) {
paused = false;
pauseButton.setText("Pause");
} else {
paused = true;
pauseButton.setText("Why Pause?");
... | 7 |
void toggleSelectionSet(BitSet bs) {
/*
* toggle each one independently for (int i = viewer.getAtomCount(); --i >= 0; ) if (bs.get(i))
* toggleSelection(i);
*/
int atomCount = viewer.getAtomCount();
int i = atomCount;
while (--i >= 0)
if (bs.get(i) && !bsSelection.get(i))
break;
if (i < 0) { /... | 8 |
private void updateExpression() {
expression.change(ref);
} | 0 |
private static String allowedName(String value) {
StringBuffer buffer = new StringBuffer(value);
for (int index = 0; index < buffer.length(); index++) {
char c = buffer.charAt(index);
if ((c >= '0' && c <= '9') ||
(c >= 'a' && c <= 'z') ||
(c >= '... | 9 |
private void btnBuscarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnBuscarActionPerformed
this.buscar();
}//GEN-LAST:event_btnBuscarActionPerformed | 0 |
private final boolean handleControl(int keycode, int[] cursor, boolean alt) {
switch (keycode) {
case KeyEvent.VK_A:
cursor[1] = 0;
cursor[2] = length();
return true;
case KeyEvent.VK_C:
if (this.head > this.tail) {
growAndCopy();
}
StringBuilder.clip.setContents(new StringSelection(new Stri... | 8 |
@Override
public int[][] applyObstacle(int [][] environment){
for (int i = 0; i < this.w; i++){
for (int j = 0; j < this.h; j++){
environment[x + i][y + j] = Environment.WALL;
}
}
return environment;
} | 2 |
@Override
public void formatTo(Formatter formatter, int flags, int width, int precision) {
final boolean leftJustify = (flags & LEFT_JUSTIFY) == LEFT_JUSTIFY;
StringBuilder buffer = new StringBuilder(width);
int count = 0;
for (int i = 0; i < length; i++) {
... | 8 |
public static void main(String[] args) throws IOException {
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
String line = "";
StringBuilder out = new StringBuilder();
while ((line = in.readLine()) != null && line.length() != 0) {
int n = Integer.parseInt(line.trim());
int ones = ... | 3 |
public Collection<Region> loadRegions(final String world) {
final BufferedYamlConfiguration worldConfig = this.loadConfig(this.worlds, world);
final Set<Region> regions = new HashSet<Region>();
final Set<String> names = worldConfig.getKeys(false);
for (final String name : names) {
... | 9 |
public void setLineStyle(final LineStyle style) {
if (style.getWidth() != null) {
float width_prev = this.lineWidth;
this.setLineWidth(style.getWidth().floatValue());
this.lineWidth = width_prev;
}
if (style.getCap() != null) {
this._out(style.getCap().toString() + " J"); //$NON-NLS-1$
}
if (style... | 7 |
@Override
public void init() {
/* 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://download.o... | 8 |
public void copy(int[] src, int[] dst){
for(int i = 0; i < dst.length; i++){
if(i > src.length-1){
dst[i] = 0;
} else {
dst[i] = src[i];
}
}
} | 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.