text stringlengths 14 410k | label int32 0 9 |
|---|---|
public String getDiagnostico() {
return diagnostico;
} | 0 |
void setCellBackground () {
if (!instance.startup) {
table1.getItem (0).setBackground (1, cellBackgroundColor);
}
/* Set the background color item's image to match the background color of the cell. */
Color color = cellBackgroundColor;
if (color == null) color = table1.getItem (0).getBackground (1);
Tabl... | 3 |
@Override
public Orientation getStepOrientation(int lineIndex) {
switch(lineIndex) {
case 0:
case 4:
return Orientation.LEFT;
case 1:
case 5:
return Orientation.DOWN;
case 2:
case 6:
return Orientation.UP;
case 3:
case 7:
return Orientation.RIGHT;
default:
return Orientation.NONE;
... | 8 |
@Override
protected void execute(CommandSender sender, String Command, List<String> list) {
this.init(sender);
// /rm limit list <sell/rent>
// /rm limit <region> <sell/rent> <int>
// /rm limit <region> <sell/rent>
if (list.get(0).equals("list")) {
Map<String, Integer> limit = null;
if (list.get(1).e... | 5 |
@Override
public byte[] getSchedule() {
byte[] schedule = new byte[getScheduleSize()];
for (int i = 0; i < numSlots; i++) {
if(desiredSlots[i]) {
setSlot(schedule, i, footprints[i]);
}
}
return schedule;
} | 2 |
private Hashtable<String, String> loadCsv(HttpServletRequest request, String tempFolder) throws IOException
{
Hashtable<String, String> items = new Hashtable<String, String>();
File csv = null;
if (request.getParameter("uploadfile") != null && (request instanceof SabaHttpServletRequest))
{
csv = ((SabaHt... | 9 |
public OnDemandRequest getNextNode() {
OnDemandRequest onDemandRequest;
synchronized (aClass19_1358) {
onDemandRequest = (OnDemandRequest) aClass19_1358.popFront();
}
if (onDemandRequest == null) {
return null;
}
synchronized (queue) {
... | 6 |
public void setDescription(String description) {
this.description = description;
} | 0 |
public void showMessage(String message, String title, int messageType){
JOptionPane.showMessageDialog(frame, message, title, messageType);
} | 0 |
@Override
public void killProcess(String programName) throws IOException, InterruptedException,
ProcessKillerException {
logger.trace("Attempt to kill " + programName);
int attempts = 0;
if (!isProgramRunning(programName))
return;
for (attempts = 0; attempts... | 4 |
public Object getArgument(String arg, String classDescription){
switch(classDescription)
{
case "boolean":
return getBooleanArgument(arg,true);
case "double":
return getDoubleArgument(arg,true);
case "long":
return getLo... | 5 |
public void unsubscribeEvent(String eventName, Object className) {
HashMap<Object, String> eventCallbacks = this.eventMap.get(eventName);
if(eventCallbacks != null) {
if(eventCallbacks.containsKey(className)) {
eventCallbacks.remove(className);
if(eventCallbacks.size() == 0) {
this.eventMap.remove... | 3 |
private int findLekarzId(int nr_lekarza)
{
int id = 0;
Session session = factory.openSession();
Transaction tx = null;
try
{
tx = session.beginTransaction();
Query query = session.createQuery("from lekarze where nr_lekarza = :id ");
query.setParame... | 4 |
@Override
public void execute(VirtualMachine vm) {
} | 0 |
private void push(JSONObject jo) throws JSONException {
if (this.top >= maxdepth) {
throw new JSONException("Nesting too deep.");
}
this.stack[this.top] = jo;
this.mode = jo == null ? 'a' : 'k';
this.top += 1;
} | 2 |
public static void init(){
Toolbox.debugPrint(TAG, numLines + "");
tb = new TextBox();
lines = new Label[numLines];
tb.setX(3);
tb.setY(CMConfig.WINDOW_HEIGHT - 17);
tb.setHintText("Enter Command");
tb.getLabel().setFont("data/roboto_small.fnt", "data/roboto_sma... | 9 |
private static int[] matchNodes(SquareMatrix S) {
// Number of rows <= Number of columns
int numRows = S.getNumberOfRows();
int numCols = S.getNumberOfColumns();
int[] matches = new int[numRows];
ArrayList<Integer> tabuRows = new ArrayList<Integer>();
ArrayList<Integer> tabuCols = new ArrayList<Integer>();... | 6 |
public void removeLastStmt() {
final ListIterator iter = stmts.listIterator(stmts.size());
while (iter.hasPrevious()) {
final Stmt s = (Stmt) iter.previous();
if (s instanceof LabelStmt) {
continue;
}
iter.remove();
return;
}
} | 2 |
@Override
public boolean execute(String code)
{
int indexValue = 0;
int pointerToAdd = 0;
String effectiveAddress = "";
String val = "";
seperateCode(code);
// Get the addressing mode.
int addressMode = getAddressingMethod(code);
try {
... | 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 |
public static void main(String[] args) throws Throwable {
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
for( String linea; (linea = in.readLine() ) != null ; ) {
v = new boolean[12];
int guess = Integer.parseInt(linea);
if(guess == 0) break;
String resp = in.readLine();
wh... | 7 |
private void sendQuickLaunchFiles(){
if(client_connected){
// Notify connected client of new files (TCP)
for(int x = 0; x < quick_launch_files.length; x++){
sendQuickLaunchFile(x);
}
}
} | 2 |
private void calculateEnabledState(JoeTree tree) {
Document doc = tree.getDocument();
if (doc == Outliner.documents.getMostRecentDocumentTouched()) {
Node node = tree.getEditingNode();
if (tree.getComponentFocus() == OutlineLayoutManager.TEXT) {
if (node.isLeaf()) {
setEnabled(false);
} el... | 6 |
protected boolean verificaVencedor() {
boolean daVez = jogador1.obterDaVez();
boolean ocupada;
boolean haAdversarios;
Troglodita troglodita;
Posicao posicaoTemporaria;
//Verifica se não há trogloditas adversários, e depois se há próprio troglodita na última linha.
if(daVez){
haAdversarios = jogado... | 9 |
private void initMenu() {
connectItem = new JMenuItem("Connect");
connectItem.setEnabled(false);
connectItem.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
for (JCheckBoxMenuItem portItem : portItems) {
... | 9 |
@Override
public boolean equals(Object object) {
// TODO: Warning - this method won't work in the case the id fields are not set
if (!(object instanceof ConsultantInfo)) {
return false;
}
ConsultantInfo other = (ConsultantInfo) object;
if ((this.userId == null && ... | 5 |
private final AStarNode obtainOpenWithLowestCost() {
Iterator<Entry<Float, Vector<AStarNode>>> entries = open.entrySet().iterator();
if (!entries.hasNext())
return null;
Vector<AStarNode> costEntry = entries.next().getValue();
int lastCostEntry = costEntry.size() - 1;
AStarNode lowestCostNode = costEntry.g... | 2 |
public void decodeToFile(BufferedReader br, BufferedWriter bw, int total) throws IOException{
int input;
boolean[] new_bits;
while ((input = br.read()) != -1 && total > 0) {
if(total <= 0){
System.out.println("stopped due to max words!");
}
new_bits = byteToBooleans(input);
addToQueue(new_bits);
... | 6 |
public ArrayList<AreaFormacao> listar(String condicao) throws Exception
{
ArrayList<AreaFormacao> listaAreaFormacao = new ArrayList<AreaFormacao>();
String sql = "SELECT * FROM areaformacao " + condicao;
try
{
PreparedStatement stmt = ConnectionFactory.getConnection().prepareStatement(sql);
ResultSet ... | 2 |
public void stop(){ stopping = true; } | 0 |
public static Titulo sqlLeer(Titulo titulo){
String sql="SELECT * FROM titulo WHERE idtitulo = '"+titulo.getId()+"'";
if(!BD.getInstance().sqlSelect(sql)){
return null;
}
if(!BD.getInstance().sqlFetch()){
return null;
}
titulo.setId(BD... | 2 |
public AuthHeader getAuthHeaderByToken(String token){
AuthHeader ah=null;
Connection con = null;
Statement stmt = null;
try {
DBconnection dbCon = new DBconnection();
Class.forName(dbCon.getJDBC_DRIVER());
con = DriverManager.getConnection(dbCon.getDATABASE... | 5 |
synchronized private void waitReady(DocumentsWriterThreadState state) {
while (!closed && ((state != null && !state.isIdle) || pauseThreads != 0 || flushPending || aborting)) {
try {
wait();
} catch (InterruptedException ie) {
throw new ThreadInterruptedException(ie);
}
}
... | 8 |
public ListNode removeNthFromEnd(ListNode head, int n) {
ListNode p1,p2;
if (n <=0 ) return head;
int k = n;
p1 = head;
while (k > 0 && p1 != null)
{
k--;
p1 = p1.next;
}
if (k ==0 && p1 ==null)
{
head = head.ne... | 7 |
@Override
public void actionPerformed(ActionEvent arg0)
{
if (colorGain)
colorN += 3;
else
colorN -= 5;
if (colorN >= 200)
colorGain = false;
else if (colorN <= 30)
colorGain = true;
if (!seen)
{
tutorial = true;
hero.setPaused(true);
if (tutorialX > 0)
{
tutorialX -= 15;
t... | 8 |
public static Collection getAllTasks(){
Session session = HibernateUtil.getSessionFactory().openSession();
List answer = new ArrayList<Task>();
try {
session = HibernateUtil.getSessionFactory().openSession();
answer = session.createCriteria(Task.class).list();
... | 3 |
private void compute_pcm_samples15(Obuffer buffer)
{
final float[] vp = actual_v;
//int inc = v_inc;
final float[] tmpOut = _tmpOut;
int dvp =0;
// fat chance of having this loop unroll
for( int i=0; i<32; i++)
{
float pcm_sample;
final float dp[] = d16[i];
pcm_sample = (float)(((vp[15 ... | 1 |
public void play() {
pause = false;
timer = new Timer();
timer.scheduleAtFixedRate(new Timing(this), 0, (int) (50.0f / vitesseBase));
} | 0 |
protected void doGet(HttpServletRequest request,
HttpServletResponse response) throws ServletException, IOException {
try {
Library library = new Library();
ResultPage<Patron> patrons = library.getPatronList(
Integer.parseInt(request.getParameter("offset")));
JSONObject result = new JSONObject();
... | 4 |
public PointGame getLeftNeighbor() {
int x0 = x;
int y0 = y;
while (x0 > MINX) {
// check if x=4 and y=3, we cannot go to the left.
if(x0==4 && y0==3)
break;
x0--;
if (Board.validPoints.contains(new PointGame(x0,y0))) {
return new PointGame(x0,y0);
}
}
return null;
} | 4 |
private void checkForPrompt()
{
// Text has been entered, remove the prompt
if (document.getLength() > 0)
{
setVisible( false );
return;
} else if(show == Show.EMPTY) { //Show always parent text is empty
setVisible(true);
return;
}
// Prompt has already been shown once, remove it
if (sho... | 9 |
@Override
public boolean show() {
if (!tab.open())
return false;
WidgetChild window = Widgets.get(BOOK_WIDGET, CLICK_WINDOW);
WidgetChild wc = getChild();
WidgetChild scrollbar = Widgets.get(BOOK_WIDGET, SCROLLBAR);
if (wc == null || window == null || scrollbar == null || !wc.visible() || !window.visible(... | 8 |
public void keyPressed(KeyEvent arg0) {
if(arg0.getKeyCode() == KeyEvent.VK_ESCAPE) {
frame.setVisible(false);
}
} | 1 |
public void chargeProvinceRent(Player player) {
String playerName = player.getName();
String worldName = player.getWorld().getName();
String query = "SELECT * FROM `Monarchy_Provinces` WHERE `player` = ? AND `world` = ? ORDER BY `time` ASC;";
Connection con = getSQLConnection();
try {
PreparedStatement... | 8 |
public int balance ()
{
org.omg.CORBA.portable.InputStream $in = null;
try {
org.omg.CORBA.portable.OutputStream $out = _request ("balance", true);
$in = _invoke ($out);
int $result = $in.read_long ();
return $result;
... | 2 |
public void keyReleased(KeyEvent e) {
if (e.getKeyCode() == 10) {
if (textWavelength.isFocusOwner()) {
wavelength = (int) Double.parseDouble(textWavelength
.getText().replaceAll(",", ""));
loadExistingValues();
updateConsole();
}
else if (textPower.isFocusOwner()) {
power[i] = Double.p... | 4 |
@Override
public void draw() {
StringBuilder s = new StringBuilder();
for (int i = 0; i < side; i++) {
s.append("# ");
}
for (int i = 0; i < side; i++) {
System.out.println(s);
}
} | 2 |
@SuppressWarnings({ "unchecked", "rawtypes" })
public void SaveLevel() {
System.out.println("Attempting level save.");
new Thread(new Runnable() {
public void run() {
for(int i = 1; i<=Layers; i++) {
File layer_file = new File(workingDir, ("Layer" + i + ".dat"));
FileSystem.SaveDatFile(LayerList.g... | 5 |
public synchronized void detectPulse(Record record) {
if (this.lastRecord != null) {
// check whether we have not found a peak after 166% of avg2 if so take the last peak as a signal peak
// if that greater than half threshold.
if ((record.getTime() - this.lastSPKTime) > 1... | 9 |
@Override
protected void _processWalks(WalkArray walkArray, int[] atVertices) {
long[] walks = ((LongWalkArray)walkArray).getArray();
long t1 = System.currentTimeMillis();
for(int i=0; i < walks.length; i++) {
long w = walks[i];
int atVertex = atVertices[i];
... | 3 |
@Override
public void run() {
try {
Thread.sleep(1000);
System.out.println("here");
} catch (InterruptedException e) {
e.printStackTrace();
}
} | 1 |
private void removeClientFromResourceMap(ClientInterface clientInterface){
synchronized(resourcesOfClients){
Set<String> list = resourcesOfClients.keySet();
Iterator<String> iter = list.iterator();
Vector<String> keysToBeDeleted = null;
while(iter.hasNext()) {
String key = iter.next();
resourcesO... | 4 |
private void divideSamples(Node node, SampleSet nodeSet){
/*
* The first step is to assign the given set to the top node of the subtree.
* If it is a leaf, we're done; else we have to divide the samples into the
* correct subsets for the subtrees.
*/
node.setSampleSet(nodeSet);
if(!node.isLeaf()){
... | 9 |
protected boolean checkCDATA(StringBuffer buf) throws IOException {
char ch = this.readChar();
if (ch != '[') {
this.unreadChar(ch);
this.skipSpecialTag(0);
return false;
} else if (!this.checkLiteral("CDATA[")) {
this.skipSpecialTag(1); // one [ h... | 9 |
public static String parseSpace(char[] s, int length) {
// 1.check number of space in original array
int count = 0;
for (char c : s) {
if (c == ' ') {
++count;
}
}
int newLength = length + count * 2;
int j = newLength - 1;
for ( int i=length-1; i >=0; --i ){
if ( s[i] == ' ' ){
s[j--]... | 4 |
protected void FillBuff() throws java.io.IOException
{
if (maxNextCharInd == available)
{
if (available == bufsize)
{
if (tokenBegin > 2048)
{
bufpos = maxNextCharInd = 0;
available = tokenBegin;
}
else if (tokenBegin < 0)
bufpos = maxN... | 9 |
int getCountCorrect()
{
int count = 0;
for(int i=0;i<sudokuSize;i++) {
for(int j=0;j<sudokuSize;j++) {
if(cells[i][j].valueState == 1 || cells[i][j].valueState == 7)
count++;
}
}
return count;
} | 4 |
private HttpResponse processRequest() {
try {
// Read client Input and parse it.
BufferedReader inFromClient = new BufferedReader(new InputStreamReader(socket.getInputStream()));
RequestParser requestParser = new RequestParser(this);
parsedHttpRequest = requestParser.getParsedRequest(inFromClient);
/... | 8 |
protected void doProtocolPings()
{
if(getClientTelnetMode(TELNET_MSDP))
{
final byte[] msdpPingBuf=CMLib.protocol().pingMsdp(this, msdpReportables);
if(msdpPingBuf!=null)
{
try
{
rawBytesOut(rawout, msdpPingBuf);
}
catch (final IOException e)
{
}
if(CMSecurity.isDebugging(... | 7 |
private boolean isSwf(String filetype){
if(filetype.equals("doc")
||filetype.equals("docx")
||filetype.equals("ppt")
||filetype.equals("pptx")
||filetype.equals("xls")
||filetype.equals("xlsx")) {
return true;
}e... | 6 |
private Dimension layoutSize(Container parent, boolean minimum) {
Dimension dim = new Dimension(0, 0);
Dimension d;
synchronized (parent.getTreeLock()) {
int n = parent.getComponentCount();
for (int i = 0; i < n; i++) {
Component c = parent.getComponent(i)... | 4 |
public Carte( String url, int i, String nomAnimal ) {
this.url = url;
this.nomAnimal = nomAnimal;
ijk = i;
telecharger();
initComponents();
label1.setIcon(new ImageIcon(nomImage));
} | 0 |
@Override
public boolean onCommand(CommandSender sender, Command cmd, String commandLabel, String[] args) {
if (args.length == 1 && "reload".equalsIgnoreCase(args[0]) && sender.hasPermission("orelog.reload")) {
if (sender instanceof Player) {
this.plugin.reload(sender.getName());... | 4 |
public static void clientRemove(final Socket socket,DataInputStream datais,String basepath) {
boolean success=false;
DataOutputStream dataOutputStream=null;
OutputStream outputStream=null;
try {
outputStream=socket.getOutputStream();
dataOutputStream = new DataOutputStream(outputStream);
// 读取到请求的url
... | 9 |
public void setupButtons() {
side_hud_panel.removeAll();
if (selected.size() > 0
&& selected.getFirst() instanceof VillagerEntity) {
VillagerEntity tower = ((VillagerEntity) selected.getFirst());
final JCheckBox build = new JCheckBox("Build: "
+ createCostString(VillagerEntity.MAKE_TOWER_COST));
s... | 8 |
private void inviteNickHelper() {
if (true) {
return;
} //TODO Fix this method
if (!hasArgs || !(cmdArgs.split("\\s++").length > 0)) { // Min 1 Arg
//@TODO Replace code with getHelp(cmd); //Overloaded method
connection.msgChannel(config.getChannel(), "Usage: " + config.getCmdSymb() + "inv... | 7 |
public static boolean isPowerProviderOrWire(IBlockAccess var0, int var1, int var2, int var3, int var4) {
int var5 = var0.getBlockId(var1, var2, var3);
if(var5 == Block.redstoneWire.blockID) {
return true;
} else if(var5 == 0) {
return false;
} else if(Block.blocksList[var5].can... | 5 |
@Override
@Command
public MessageResponse getProxyPublicKey() throws IOException {
if(initRMI()) {
ProxyPublicKeyResponse response = proxyRMI.getProxyPublicKey();
if(!response.hasKey()) return new MessageResponse(response.toString());
else {
String pathToPublicKey = keysDir+"/proxy.pub.pem";
PEMWri... | 2 |
public <VT> List<VertexIdValue<VT>> queryWithValues(int vertexId, BytesToValueConverter<VT> conv) throws
IOException {
List<VertexIdValue<VT>> results = new ArrayList<VertexIdValue<VT>>();
ShardIndex.IndexEntry entry = index.lookup(vertexId);
int curvid = entry.vert... | 6 |
public static void setOutputParams(String failedUrlsFileName, String succedUrlsFileName,
String postsFileName, String postsParamsFileName, WriteToCsvDiscussionsFile writeToCsvDiscussionsFile) {
OutputParams.failedUrlsFileName = failedUrlsFileName;
OutputParams.succedUrlsFileName = succedUrlsFileName;
Output... | 4 |
public void handleAnnounceResponse(Map<String, BEValue> answer) {
try {
if (answer != null && answer.containsKey("interval")) {
this.interval = answer.get("interval").getInt();
this.initial = false;
}
} catch (InvalidBEncodingException ibee) {
this.stop(true);
}
} | 3 |
public Rectangle2D.Float getBounds() {
if (bounds == null) {
// increase bounds as glyphs are detected.
for (GlyphText glyph : glyphs) {
if (bounds == null) {
bounds = new Rectangle2D.Float();
bounds.setRect(glyph.getBounds());
... | 3 |
private void createUser()
{
if(userType.equalsIgnoreCase("guest"))
user = new GuestUser();
else if(userType.equalsIgnoreCase("handicap"))
user = new HandicappedUser();
else
{
searchFiu(userID);
if(userType.equalsIgnoreCase("stud... | 5 |
public void analyze(int minWalkId, int maxWalkId, int maxHops) throws IOException {
int numberOfWalks = maxWalkId - minWalkId + 1;
Walk[] paths = new Walk[numberOfWalks];
for(int i=0; i < paths.length; i++) {
paths[i] = new Walk(maxHops);
}
String[] walkFiles = direc... | 8 |
@Override
public boolean equals(Object o) {
LightRabin tmpLIFRTA = (LightRabin) o;
return tmpLIFRTA.states.equals(states) && tmpLIFRTA.initialState.equals(initialState) && tmpLIFRTA.liveStates.equals(liveStates);
} | 2 |
public void render() {
System.out.println("RenderLoopBegin");
try {
g = bi.createGraphics();
g.setColor(background);
g.fillRect(0, 0, frameW, frameH);
/************/
for (int i = 0; i < tasks.size(); ) {
tmpTask = t... | 8 |
public void acquireLog() {
synchronized (fLogLengthTable) {
String ip = null;
String logKey = null;
int logLength = 0;
Integer lengthValue = null;
fLogAcquired = false;
MeetingProtocol.getInstance().logLen... | 9 |
public static String getCoastlineCoding(Game game, Position center) {
char[] coding = {'0','0','0','0' };
int row = center.getRow(), col = center.getColumn();
Position p;
int offsetRow[] = { -1,0,+1,0 };
int offsetCol[] = { 0,+1,0,-1 };
// iterate over the four compas directions
// for... | 6 |
private Image unmarshalImage(Node t, String baseDir) throws IOException
{
Image img = null;
String source = getAttributeValue(t, "source");
if (source != null) {
if (checkRoot(source)) {
source = makeUrl(source);
} else {
source = mak... | 5 |
static boolean parseArguments(String args[]) {
if (args.length < 2) {
System.out
.println("Syntax: java Snoop <server_name> <port_number> [optional args]");
System.out.println("\nPossible values for [optional args]:");
System.out
.println(" -snoopPort <local port number>");
System... | 9 |
@Override
public int getVendidosSecao(Secao secao, Evento evento) {
try {
conn = ConnectionFactory.getConnection();
String sql = "SELECT COUNT(ingresso.id) AS vendidos " +
"FROM ingresso " +
"JOIN secao on ingresso.idsecao = s... | 3 |
public static EventDetailInfo getEventDetail(int eventId)
throws HibernateException {
EventDetailInfo eventDetail = null;
Session session = HibernateUtil.getSessionFactory().getCurrentSession();
try {
// Begin unit of work
session.beginTransaction();
// get the event
EventInfo eventInfo = getEvent... | 4 |
@Override
public boolean onPointerMove(int mX, int mY, int mDX, int mDY) {
Iterator<IGameScreen> it = screens.iterator();
while(it.hasNext()) {
IGameScreen screen = it.next();
if(screen.onPointerMove(mX, mY, mDX, mDY)) {
return true;
... | 3 |
private boolean isEqual(char[] c, String s)
{
if (c.length != s.length()) return false;
for (int i = 0; i < c.length; i++)
if (Character.toLowerCase(s.charAt(i)) != Character.toLowerCase(c[i])) return false;
return true;
} | 3 |
public static void update(float delta) {
if (Gdx.input.isButtonPressed(Input.Buttons.LEFT)) {
if (abilityRequesting != null) {
abilityRequesting.fireAction(Camera.getRealWorldX(), Camera.getRealWorldY());
}
Gdx.input.setCursorCatched(true);
} else if (... | 8 |
private boolean r_un_accent() {
int v_3;
// (, line 215
// atleast, line 216
{
int v_1 = 1;
// atleast, line 216
replab0: while(true)
{
lab1: do {
if (!(out_groupin... | 8 |
public boolean addSheet(String sheetname){
FileOutputStream fileOut;
try {
workbook.createSheet(sheetname);
fileOut = new FileOutputStream(path);
workbook.write(fileOut);
fileOut.close();
} catch (Exception e) {
e.printStackTrace();
return false;
}
return true;
} | 1 |
public void actionPerformed(ActionEvent e) {
Object o = e.getSource();
Debug.print("Action performed on: " + o);
if(o == okButton) {
// create a new Ferm object
Fermentable i = new Fermentable();
i.setName(txtName.getText());
try {
NumberFormat format = NumberFormat.getInstance(Local... | 9 |
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 ArrayList getSolutionsRunningOnSpecificPlatform(int tmpClassID, String tmpPlatformName)
{
ArrayList result = new ArrayList<Solution>();
int tmpCounter = 0;
ArrayList<Solution> allSolutionInstances = getInstances(tmpClassID);
if(allSolutionInstances != null)
{
... | 5 |
public static boolean isVowel(String str, int index, int depth) throws java.io.IOException {
if (index < str.length() && index >= 0) {
char letter = str.charAt(index);
if (inList(VOWELS, letter) > -1) {
return true;
} else if (letter == 'y') {
... | 6 |
protected void sortIntoMap() {
outputMap = new TreeMap<Object, ArrayList<CalendarEvent>>();
int conflictNum = 1;
for (int i = 0; i < outputList.size(); i++) {
for (int j = 0; j < outputList.size(); j++) {
if (j > i) {
CalendarEvent event1 = outputList.get(i);
long start1 = event1.getmyStartTim... | 7 |
public static NoOpenStartTagException makeNoOpenStartTagException(
int nodeKind, String name, int hostLanguage, boolean parentIsDocument, boolean isSerializing) {
String message;
String errorCode;
if (parentIsDocument) {
if (isSerializing) {
String kind = ... | 9 |
public static void removeIfCaptured(Board board, int player, int x, int y) {
if (board.intersections[x][y] == player) {
List<Intersection> group = getGroup(board, x, y);
if (countLiberties(board, group) == 0) {
board.captures.addAll(group);
for (Intersection intersection : group) {
board.intersecti... | 3 |
static public Matricula instancia() {
if (UnicaInstancia == null) {
UnicaInstancia = new Matricula();
}
return UnicaInstancia;
} | 1 |
public void traverse(ASTVisitor visitor, ClassScope classScope) {
if (visitor.visit(this, classScope)) {
if (this.javadoc != null) {
this.javadoc.traverse(visitor, this.scope);
}
if (this.arguments != null) {
int argumentLength = this.arguments.length;
for (int i = 0; i < argumentLength; i++)
this.a... | 7 |
public MultipleCYKParseAction(GrammarEnvironment environment) {
super("Multiple CYK Parse", environment);
this.environment = environment;
this.frame = Universe.frameForEnvironment(environment);
} | 0 |
@Override
public Connection crearConexion() {
try {
InitialContext initialContext = new InitialContext();
DataSource dataSource = (DataSource) initialContext.lookup("java:comp/env/jdbc/ausiasyield");
Connection connection = dataSource.getConnection();
return c... | 2 |
public void mouseClicked(int clickX, int clickY) {
clickY = (int)APPLET_HEIGHT - clickY;
Point pnt = new Point(clickX, clickY);
Point selection = new Point();
Card clickCard;
if (pnt.x>offsetX && pnt.x<maxX && pnt.y>offsetY && pnt.y<maxY)
{
selection.x = (pnt.x-offsetX)/cardSize;
selection.y = (pn... | 9 |
TreeNode next() {
TreeNode head = queue.poll();
if (head == null) {
if (!queue.isEmpty())
queue.offer(null);
return null;
}
if (head.left != null)
queue.offer(head.left);
if (head.right != nu... | 4 |
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.