text stringlengths 14 410k | label int32 0 9 |
|---|---|
@Override
public void excecuteCommand(String channel, String sender, String message) throws Exception {
this.channel = channel;
String[] args = message.split(" ");
switch(args[1]) {
case "start":
if(GAMES.containsKey(sender)) {
GAMES.get(sender).start();
} else {
GAMES.put(sender, new Bla... | 8 |
public static boolean computeCell(boolean[][] world, int col, int row)
{
// liveCell is true if the cell at position (col,row) in world is live
boolean liveCell = getCell(world, col, row);
// neighbours is the number of live neighbours to cell (col,row)
int neighbours = countNeighbours(world, col... | 8 |
public static float GetAxis(String axis) {
if (axis.equalsIgnoreCase("Horizontal")) {
if (Keyboard.isKeyDown(Keyboard.KEY_D)) {
return 1;
}
if (Keyboard.isKeyDown(Keyboard.KEY_A)) {
return -1;
}
return 0;
}
else if (axis.equalsIgnoreCase("Vertical")) {
if (Keyboard.isKeyDown(Keyboard.KEY... | 6 |
public void createResPackDir(File file){
if(getExtension(file) == null){
if(!file.exists())createDir(file);//Create resourcepack folder
createDir(new File(file.getPath() + "/assets"));//create assets folder
if(!new File(file.getPath() + "/assets/minecraft").exists())createDir(new File(file.getPath() + "/... | 9 |
private static <T> PartitionList<T> eparition(PartitionListElement<T> tail2) {
PartitionList<T> returner = new PartitionList<T>();
for(int i = 1; i <= tail2.size(); i++){
PartitionListItem<T> partition = OrderConstrainedPartitionList.partition(tail2, i);
returner.add(partition);
if(partition.size() > 1... | 6 |
private URL getURL(String filename) {
URL url = null;
try {
url = this.getClass().getResource(filename);
} catch (Exception e) {
System.out.println("Error en " + e.toString());
}
return url;
} | 1 |
private Enemy getEnemyById(String id) {
for (Enemy e : getEnemies()) {
if (e.getId().equals(id))
return e;
}
return null;
} | 2 |
public void pushPlusOperator(){
((Vector)operatorStack).add(0, new PlusOperator());
} | 0 |
public Object whoIsRight(Object a, Object b)
{
Random r = new Random();
if(r.nextBoolean())
{
return a;
}
return b;
} | 1 |
private boolean inPoly(FastVector ob, double x, double y) {
//brief on how this works
//it draws a line horizontally from the point to the right (infinitly)
//it then sees how many lines of the polygon intersect this,
//if it is even then the point is
// outside the polygon if it's odd th... | 8 |
private void buildTrees(final Block firstBlock, final Map labelPos) {
db(" Building trees for " + firstBlock);
// Maps a "catch block" (beginning of exception handler that
// stores the exception) to a "catch body" (the code immediately
// follows the "catch block" -- the rest of the handler).
final HashMap... | 7 |
public static void compileGafAssetsFile(String prjCompileDir, String prjGameName, String prjDir) {
File selectedFile = new File(prjCompileDir + File.separator + prjGameName.toLowerCase() + ".assets.cache.jar");
File content = new File(prjDir);
File[] files = content.listFiles();
assert f... | 8 |
public void setModelValue(Object obj) {
if (autoInsertCancel) {
this.autoInsertCancel = false;
}
// closing the editor if for some reason it is still active:
if (this.getCellEditor() != null) {
this.getCellEditor().stopCellEditing()... | 6 |
public String getTunnisteet(){
String palautettava = "";
for (String tunniste : tunnisteet) {
palautettava += tunniste + " ";
}
return palautettava;
} | 1 |
public void drawItem(Graphics2D g2,
XYItemRendererState state,
Rectangle2D dataArea,
PlotRenderingInfo info,
XYPlot plot,
ValueAxis domainAxis,
ValueAxis rangeAxis,
... | 7 |
public JSONWriter object() throws JSONException {
if (this.mode == 'i') {
this.mode = 'o';
}
if (this.mode == 'o' || this.mode == 'a') {
this.append("{");
this.push(new JSONObject());
this.comma = false;
return this;
}
t... | 3 |
public static Map<Class<? extends Object>, List<String>> config(String path) throws NoConfigException {
Map<Class<? extends Object>, List<String>> ret = configs.get(path);
if (null == ret)
return initConfig(path);
return ret;
} | 3 |
public Object showScoreList(String term) {
String command = "show;student_score_list;" + term;
ArrayList<String> list = null;
String[][] content = null;
try {
NetService client = initNetService();
client.sendCommand(command);
list = client.receiveList();
content = new String[list.size()][];
for (... | 5 |
public boolean canMove()
{
Grid<Actor> gr = getGrid();
if (gr == null)
return false;
Location loc = getLocation();
Location next = loc.getAdjacentLocation(getDirection());
if (!gr.isValid(next))
return false;
Actor neighbor = gr.get(next);
... | 3 |
public static void testSeqRead() throws IOException{
Read rd = new Read();
rd.startTest();
} | 0 |
public void lastStep(Context ctx) {
ctx.setState(null);
} | 0 |
@Override
public void removeExtension(String ext) {
extensions.remove(ext);
} | 0 |
public double timeLengthRank(double percentage)
{
boolean cutOffNotOkay=true;//determines if cut off is appropriate
Collections.sort(library,TimeLengthComparator.getTL());
double percentageOfMean=percentage*1.5;
while(cutOffNotOkay)
{
int count=0;
double cutoff= tlMean *percentageOfMean; // the cut of... | 7 |
public static void main(String[] args) throws Exception {
ObjectOutput out = new ObjectOutputStream(new FileOutputStream("X.file"));
Alien quellek = new Alien();
out.writeObject(quellek);
out.close();
} | 0 |
public void setAlphabet(String regex) {
int i = 0;
for (char c = regex.charAt(i); i < regex.length(); i++) {
if (c == '[') {
break;
}
}
if (i >= regex.length()) {
throw new IllegalArgumentException("Regex may only contain a group");
}
for (char c = regex.charAt(i); i < regex.length(); i++) {... | 6 |
public void clickTutorial() {
state.clickTutorial();
} | 0 |
public static void main(String[] args) {
Model m = new Model();
m.getSearchFormats().add("mp3");
m.getSearchFormats().add("mov");
m.getSearchFormats().add("m4v");
m.getSearchKeywords().add("Videos");
m.getSearchKeywords().add("movies");
Controller controller = new Controller(m);
final testFrame t = new testF... | 1 |
public void close () {
boolean wasConnected = isConnected;
isConnected = false;
tcp.close();
if (udp != null && udp.connectedAddress != null) udp.close();
if (wasConnected) {
notifyDisconnected();
if (INFO) info("kryonet", this + " disconnected.");
}
setConnected(false);
} | 4 |
public void reachableReference(Reference ref, boolean isVirtual) {
String clName = ref.getClazz();
if (clName.charAt(0) == '[')
/* Can't represent arrays */
return;
ClassIdentifier ident = getClassIdentifier(clName.substring(1,
clName.length() - 1).replace('/', '.'));
if (ident != null)
ident.reach... | 2 |
protected TemplateIssue createTemplateIssue(String sourcePath,
CompileEvent event) {
SourceInfo info = event.getSourceInfo();
if (info == null) {
return null;
}
CompilationUnit unit = event.getCompilatio... | 9 |
private void runParkingDisplay(Scanner scan, PrintWriter pout,
String spotNumber)
{
spot = garage.searchBySpotNumber(spotNumber);
if(!isConnectionAvailable(spotNumber))
{
System.out.println("Another display is connect... | 6 |
public static boolean isReservedMinusOp(String candidate) {
int START_STATE = 0;
int TERMINAL_STATE = 1;
char next;
if (candidate.length()!=1){
return false;
}
int state = START_STATE;
for (int i = 0; i < candidate.length(); i++)
... | 5 |
String checkSecurity(int iLevel, javax.servlet.http.HttpSession session, javax.servlet.http.HttpServletResponse response, javax.servlet.http.HttpServletRequest request){
try {
Object o1 = session.getAttribute("UserID");
Object o2 = session.getAttribute("UserRights");
boolean bRedirect = false;
... | 7 |
@Override
public byte[] getData()
{
if (ptr != 0) {
return null;
} else {
if (isConstant()) {
if (length > getMaxSizeOf32bitArray()) return null;
byte[] out = new byte[(int) length];
for (int i = 0; i < length; i++) {
... | 4 |
private void action(final String input) throws ParseException {
String s1;
s1 = calcWeekDay(input);
System.out.println(s1);
} | 0 |
public boolean isValidStatus(String status){
if(status.equals("available") || status.equals("lost") ||status.equals("checked-out")||status.equals("in-queue"))
return true;
else
return false;
} | 4 |
@Override
public void onNeighborBlockChange(Block blockChanged) {
int meta = tileEntity.getBlockMetadata();
boolean valid = isRailValid(getWorld(), tileEntity.xCoord, tileEntity.yCoord, tileEntity.zCoord, meta);
if (!valid) {
Block blockTrack = getBlock();
blockTrack.... | 5 |
public String getPlayersName() {
String resultName = "";
for (Player player : players) {
resultName += player.getName() + "\n";
}
return resultName;
} | 1 |
public static Object fromReflectType(String typeSig, Object value) {
switch (typeSig.charAt(0)) {
case 'Z':
return new Integer(((Boolean) value).booleanValue() ? 1 : 0);
case 'B':
case 'S':
return new Integer(((Number) value).intValue());
case 'C':
return new Integer(((Character) value).charValue());... | 5 |
private Item nextToCatalogue() {
float quality = Float.POSITIVE_INFINITY ;
Item catalogued = null ;
for (Item i : stocks.matches(DATALINKS)) {
if (! (i.refers instanceof Skill)) continue ;
if (i.quality < quality) { catalogued = i ; quality = i.quality ; }
}
if (catalogued == null || cat... | 5 |
public static void rotateLeft2(int[] array, int shift) {
if (shift <= 0 || array == null || array.length <= shift) {
throw new IllegalArgumentException("Invalid args");
}
int n = array.length;
int i, j, k, temp;
for (i = 0; i < GCD.gcd(shift, n); i++) {
/*... | 7 |
public static boolean destroy(String alias) {
if(aliasMap.containsKey(alias)) {
Shader removed = aliasMap.get(alias);
Iterator<Entry<String, Shader>> it = aliasMap.entrySet().iterator();
while(it.hasNext()) {
Entry<String, Shader> entry = it.next();
if(entry.getValue().equals(removed)) it.remove();
... | 3 |
static void tumblep_drawsprites(osd_bitmap bitmap)
{
int offs;
for (offs = 0;offs < 0x800;offs += 8)
{
int x,y,sprite,colour,multi,fx,fy,inc,flash;
sprite = spriteram.READ_WORD(offs+2) & 0x3fff;
if (sprite==0) continue;
y = spriteram.READ_WORD(offs);
flash=y&0x1000;
if (flash!=0 && (cpu_g... | 8 |
public String getUnprocessedInput()
{
return myUnprocessedInput;
} | 0 |
@Override
public List<Aluno> Buscar(Aluno obj) {
String sql = "select a from Aluno a";
String filtros = "";
if(obj != null){
if(obj.getId() != null){
filtros += "a.id = " + obj.getId();
}
if(obj.getMatricula() > 0... | 7 |
public synchronized Collection getRefClasses() {
ClassFile cf = getClassFile2();
if (cf != null) {
ClassMap cm = new ClassMap() {
public void put(String oldname, String newname) {
put0(oldname, newname);
}
public Object get... | 1 |
public Destination to(String s) {
return new Destination(s);
} | 0 |
@Override
public int read() {
FileInputStream fis = null;
try {
fis = new FileInputStream(src);
} catch (FileNotFoundException e1) {
return -1;
}
int result = -1;
try {
fis.skip(byteCounter++);
result = fis.read();
} catch (IOException e) {
e.printStackTrace();
}
try {
fis.... | 3 |
protected ExportData createExportData() throws RrdException
{
if ( sources == null)
throw new RrdException( "Sources not calculated, no data to return." );
// Now create a RrdDataSet object containing the results
Source[] sourceSet;
String[][] export = def.getExportDatasources();
HashMap legends = ne... | 5 |
public void act(List<Actor> newFoxes)
{
incrementAge();
incrementHunger();
if(isAlive()) {
giveBirth(newFoxes);
// Move towards a source of food if found.
Location newLocation = findFood();
if(newLocation == null) {
... | 3 |
@Override
protected DPLotSizingDecision getDecision(DPBackwardRecursionPeriod[] periods, int setupPeriod, int nextSetupPeriod, double alpha) throws ConvolutionNotDefinedException{
//Get the vector of aggregated demand (there is no ADI in static uncertainty)
RealDistribution[] demand = new RealDistribution[nextSetu... | 3 |
public static String getPremier(String date, String state)
{
date = date.replaceAll("-", "");
DB db = _mongo.getDB(DATABASE_NAME);
DBCollection coll = db.getCollection(COLLECTION_PREMIER);
BasicDBObject query = new BasicDBObject();
query.put("start.date", new BasicDBObject("$lte", date))... | 1 |
private static void method495(char ac[])
{
int i = 0;
for(int j = 0; j < ac.length; j++)
{
if(method496(ac[j]))
ac[i] = ac[j];
else
ac[i] = ' ';
if(i == 0 || ac[i] != ' ' || ac[i - 1] != ' ')
i++;
}
for(int k = i; k < ac.length; k++)
ac[k] = ' ';
} | 6 |
public Object[] lookupCflow(String name) {
if (cflow == null)
cflow = new Hashtable();
return (Object[])cflow.get(name);
} | 1 |
@Test
public void testMoveBackward()
{
Random rand = Mockito.mock(Random.class);
// On s'assure que le terrain et toujours franchissable.
Mockito.when(rand.nextInt(Land.CountLand())).thenReturn(0);
Robot r = new Robot();
r.land(new Coordinates(0,0), new LandSensor(rand))... | 4 |
private static boolean matchesSeq(String[] words, String[]... sequence) {
// If there aren't enough words to possibly
// match the sequence, return false
if(words.length < sequence.length) {
return false;
}
// For each item in the sequence, ensure the
// word is one of the possibilities given
for(int ... | 3 |
@Override
public HTTPResponse handle(HTTPRequest req)
{
String HTTPAuthUsername = Config.getString(HOST, "AuthUsername", "");
if ( !HTTPAuthUsername.equals("") )
{
String responseAuthHeader = req.getHeader("Authorization");
if ( responseAuthHeader.equals("") )
{
HTTPResponse response = ErrorFactor... | 8 |
public static String getFeeders(ArrayList<TeamMatch> matches) {
boolean ground = false, feeder = false;
for (TeamMatch match : matches) {
if (Arrays.asList(match.getIntakes()).contains(TeamMatch.Intake.GroundPickup)) {
ground = true;
} else if (Arrays.asList(match... | 9 |
public void mousePressed(MouseEvent e) {
super.mousePressed(e);
int selectedRow = m_tree.getRowForLocation(e.getX(), e.getY());
TreePath selectedPath = m_tree.getPathForLocation(e.getX(), e.getY());
if (selectedRow != -1) {
if (e.getClickCount() == 1) {
if (SwingUtilities.isRightMouseButton(e))
sho... | 5 |
private Object[] loadRow(DataStructures obj){
return new Object[]
{
Integer.toString(tableModelArrays.getRowCount()+1),
obj.getType(),
Integer.toString(obj.getLength(0)),
obj.getState(),
... | 0 |
private void setIcon(BufferedImage image)
{
Component root = SwingUtilities.getRoot(this);
if (root instanceof JFrame || root instanceof Frame)
{
Frame frame = (Frame)root;
frame.setIconImage(image);
}
} | 2 |
public Queue(){} | 0 |
private static void keccakPad() {
if ((bitsInQueue % 8) != 0) {
// The bits are numbered from 0=LSB to 7=MSB
byte padByte = (byte) (1 << (bitsInQueue % 8));
dataQueue[bitsInQueue / 8] |= padByte;
bitsInQueue += 8 - (bitsInQueue % 8);
} else {
d... | 5 |
private static String initialise(Token currentToken,
int[][] expectedTokenSequences,
String[] tokenImage) {
String eol = System.getProperty("line.separator", "\n");
StringBuffer expected = new StringBuffer();
int maxSize = 0;
for (int i = 0; i < expe... | 8 |
public void decodeFrame() throws DecoderException
{
num_subbands = header.number_of_subbands();
subbands = new Subband[32];
mode = header.mode();
createSubbands();
readAllocation();
readScaleFactorSelection();
if ((crc != null) || header.checksum_ok())
{
readScaleFactors();
r... | 2 |
@Override
public void setPixel(int x, int y, int c)
{
int bx = x / 8;
int by = y / 8;
int offs = bx + by * (width / 8) - tileOffset;
if (offs < 0)
return;
offs *= 64;
offs += x % 8 + 8 * (y % 8);
if (offs < 0)
return;
if (... | 3 |
private static List<String> fillCollection(){
List<String> features = new ArrayList<String>();
HashMap<String,String> components = new HashMap<String, String>();
components.put("Settings", "Settings");
components.put("Map", "Map");
components.put("Attachment", "Attachment");
components.put("BGColor", "BGCol... | 2 |
public RepositoryVm getRepoFiles(String repositoryName, String baseUrl) throws IOException {
String organizationName = ApplicationProperties.getProperties().getProperty(PropertiesConstants.GITHUB_ORGANIZATION);
Repository repository = getRepository(organizationName, repositoryName);
Release late... | 9 |
public void mergeClips(Collection<SpriteClip> mergeClips) {
if (mergeClips == null || mergeClips.size() == 0) {
return;
}
if (mergeClips.size() == 1) {
/**
* If only 1 clip is selected, then find overlapping clips and merge them.
*/
... | 7 |
public IrodsFile asFile() throws IrodsException {
if (exists()) {
if (irodsFile.isFile()) {
return (this instanceof JargonFile) ? (IrodsFile) this : new JargonFile(conn, irodsFile);
} else {
throw new IrodsException("irods object already exists and is not ... | 3 |
public TableListener(JTable table, Preference pref) {
setTable(table);
setPreference(pref);
} | 0 |
@Override
public void renderControl(Graphics2D g) {
BufferedImage control = new BufferedImage(this.getSize().getWidth(), this.getSize().getHeight(), BufferedImage.TYPE_INT_ARGB);
BufferedImage itemsImage = new BufferedImage(this.getSize().getWidth() -10, 64 * this.Items.size(), BufferedImage.TYPE_I... | 2 |
public void deleteHostFromTeams(String hostName){
try {
cs = con.prepareCall("{call DELETE_HOST_FROM_TEAMS(?)}");
cs.setString(1, hostName);
cs.executeUpdate();
} catch (SQLException e) {
e.printStackTrace();
}
} | 1 |
public void pickedUpCoin(int xH, int yH) {
Rectangle heroCoin = new Rectangle(xH, yH, 50, 50);
if (rc1.intersects(heroCoin)) {
coinPicked1 = true;
button1Used = true;
}
if (rc2.intersects(heroCoin)) {
coinPicked2 = true;
button2Used = true;... | 4 |
public static void save()
{
try
{
File f;
f = new File(System.getProperty("user.home") + "\\.Awesome Mario Remake\\MarioData.save");
if (!f.exists())
{
f.createNewFile();
}
FileOutputStream fos = new FileOutputSt... | 2 |
public LaenderGraph() {
this.initKarte();
} | 0 |
private void paintMarker(Graphics g) {
Rectangle inside = getInside();
int length = (getOrientation() == HORIZONTAL) ? inside.width
: inside.height;
int[] xPoints, yPoints;
int value = (int) (Math.max(
0,
Math.min((1.0 / (getMaximum() - getMinimum()))
* (getValue() - getMinimum()), 1)) * len... | 7 |
public static void getControlSelect(Global global, GameContainer container){
if (global.getCurrent().getMenu().getName().equals("controlselect")){
Input input = container.getInput();
for (int i=0; i<Keyboard.KEYBOARD_SIZE; i++){
if (input.isKeyDown(i) && !input.isKeyDown(Input.KEY_LMENU)){
if (g... | 8 |
protected void readImage() {
ix = readShort(); // (sub)image position & size
iy = readShort();
iw = readShort();
ih = readShort();
int packed = read();
lctFlag = (packed & 0x80) != 0; // 1 - local color table flag
interlace = (packed & 0x40) != 0; // 2 - inte... | 7 |
public static void generateNQueens(int[] position,int insertN,int n) {
for (int i=0;i<n;i++){
position[insertN-1] = i;
boolean satis = true;
for (int j=0;j<insertN-1;j++){
if(insertN-1-j==position[insertN-1]-position[j]||insertN-1-j==position[j]-position[inser... | 7 |
public int numDistinct(String S, String T) {
int[][] dp = new int[T.length() + 1][S.length() + 1];
dp[0][0] = 1;
//first column all 0
for (int i = 1; i <= T.length(); i++) {
dp[i][0] = 0;
}
//first row all 1
for (int j = 1; j <= S.length(); j++) {
... | 5 |
public static int showOptionDialog(Component parentComponent, Object message, String title, boolean resizable, int optionType, int messageType, Icon icon, Object[] options, Object initialValue) {
JOptionPane pane = new JOptionPane(message, messageType, optionType, icon, options, initialValue);
pane.setUI(new SizeAw... | 7 |
@Test
public void NotOccupiedName() throws Exception {
LoginCheck logCh = new LoginCheck();
name = "sunny00000000000";
if (kesh.containsKey(name)) {
assertFalse(kesh.get(name));
} else {
boolean result = logCh.validate(name);
kesh.put(name, result)... | 1 |
@Override
public void method2() {
System.out.println("Running: method2()");
} | 0 |
private void removeAppActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_removeAppActionPerformed
try {
int result = JOptionPane.showConfirmDialog(null, CONFIRM_MSG, CONFIRM_MSG_TITLE, JOptionPane.YES_NO_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE);
if (result == JOptionP... | 2 |
public static void main(String[] args) throws ParserConfigurationException, SAXException, XMLStreamException {
CommandLineParser clParser = new BasicParser();
Options options = new Options();
Option optFile = new Option(OPT_FILE, "file", true, "path to keepass xml file");
optFile.setArg... | 2 |
public void set(final int portal, final Location block){
if(portal == 1) this.one = block;
else if(portal == 2) this.two = block;
else throw new IllegalArgumentException("Portal number must be 1 or 2");
} | 2 |
@Override
public int getWidth() { return width; } | 0 |
public static void main(String[] args) {
DataModel model = new DataModel();
SentenceSegmentation segmentation = new SentenceSegmentation();
List<Integer> list1 = model.getKeys1();
for (int i = 0; i < list1.size(); i++) {
// dohvati tekst ključa koji se nalazi na i-toj poziciji liste
int key = list1.get(i... | 5 |
@Override
public void mouseDragged(MouseEvent evt)
{
if (!SwingUtilities.isLeftMouseButton(evt))
return;
Point current = evt.getPoint();
double x = viewer.getCenter().getX();
double y = viewer.getCenter().getY();
if(prev != null){
x += prev.x - current.x;
y += prev.y - current.y;
}
if (!vi... | 5 |
public void handlePressedKeys(ArrayList<KeyButtons> keyPressed)
{
if (keyPressed.contains(KeyButtons.LEFT))
{
left = true;
}
if (keyPressed.contains(KeyButtons.RIGHT))
{
right = true;
}
if (keyPressed.contains(KeyButtons.UP))
{
... | 5 |
public int getSelection()
{
if(selectionOvalY == 3)
return 1;
else if(selectionOvalY == 27)
return 2;
else if(selectionOvalY == 51)
return 3;
else if(selectionOvalY == 75)
return 4;
else if(selectionOvalY == 99)
return 5;
else if(selectionOvalY == 123)
return 6;
else if(se... | 8 |
@Override
public void onRelocateTag( TagView tagViewToRelocate, TagView tagViewRelocationRef, InsertionPoint insertionPoint ) {
//Prevent modification between two similar TagLists
if( !this.containsTagView( tagViewToRelocate ) || !this.containsTagView( tagViewRelocationRef ) )
return;
... | 8 |
private static void configureLoggerWrapperByConfigurator (LoggerWrapper loggerWrapper, Node configNode) {
boolean goOn = true;
Node classNameNode = configNode.getAttributes ().getNamedItem ("class-name");
String className = "(unknown)";
if (goOn) {
if (classNameNode != null) {
className = classNameNode.... | 9 |
@Override
@SuppressWarnings("unchecked")
public JsonElement serialize(GeoJsonObject src, Type typeOfSrc, JsonSerializationContext context)
{
Class<GeoJsonObject> cls;
try
{
cls = (Class<GeoJsonObject>)Class.forName(GeoJson.class.getPackage().getName().concat(".").concat(src.getType()));
}
catch (ClassNo... | 1 |
public static Transition[] getTransitionsForProduction(
Production production, VariableDependencyGraph graph) {
ArrayList list = new ArrayList();
String v1 = production.getLHS();
ProductionChecker pc = new ProductionChecker();
String rhs = production.getRHS();
for (int k = 0; k < rhs.length(); k++) {
ch... | 2 |
private AndroidMethod parseMethod(Matcher m) {
assert(m.group(1) != null && m.group(2) != null && m.group(3) != null
&& m.group(4) != null);
int groupIdx = 1;
//class name
String className = m.group(groupIdx++).trim();
//return type
String returnType = m.group(groupIdx++).trim();
//method n... | 5 |
public String calculateResult(String expression) {
String result = parseExpression(expression);
Double lastOperand = 0.0;
// If no exception pop the top operand
if (result.equals("")) {
lastOperand = operands.top();
operands.pop();
}
// If no operands are left set result to the last operand
if... | 7 |
@Override
public void actionPerformed(ActionEvent arg0)
{
Component f = ui;
while ((f != null) && (!(f instanceof Window)))
f = f.getParent();
if (arg0.getActionCommand().equalsIgnoreCase("Cancel"))
{
if (f != null)
f.setVisible(false);
}
else if (arg0.getActionCommand().equalsIgnoreCase("Save"... | 8 |
@Override
protected void dispatchEvent(AWTEvent event)
{
// Potentially intercept KeyEvents
if (event.getID() == KeyEvent.KEY_TYPED
|| event.getID() == KeyEvent.KEY_PRESSED
|| event.getID() == KeyEvent.KEY_RELEASED)
{
KeyEvent keyEvent = (KeyEvent)event;
KeyStroke keyStroke = KeyStrok... | 6 |
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.