text stringlengths 14 410k | label int32 0 9 |
|---|---|
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((brandName == null) ? 0 : brandName.hashCode());
result = prime * result + ((originalPrice == null) ? 0 : originalPrice.hashCode());
result = prime * result + ((percentOff == nu... | 9 |
public void setValor(PValor node)
{
if(this._valor_ != null)
{
this._valor_.parent(null);
}
if(node != null)
{
if(node.parent() != null)
{
node.parent().removeChild(node);
}
node.parent(this);
... | 3 |
private void exception(Throwable e)
{
try
{
_persistent=false;
int error_code=HttpResponse.__500_Internal_Server_Error;
if (e instanceof HttpException)
{
error_code=((HttpException)e).getCode();
... | 7 |
public static Image getSingleCardImage(int index) {
String curDir = System.getProperty("user.dir");
String pathName = curDir + "/classic_cards/";
//System.out.println("Current work dir is: " + curDir);
Image pic = Toolkit.getDefaultToolkit().getImage(pathName + cardImageFileNames[index])... | 0 |
public static void main(String[] args) {
Reta reta = new Reta();
Retangulo retan = new Retangulo();
Triangulo trian = new Triangulo();
Circulo cir = new Circulo();
//inicia scanner
Scanner ler = new Scanner (System.in);
//ler a linha toda
String cmd = ler.nextLine();
//delimita as i... | 4 |
public SongEvent popBeat() {
if (!measures.isEmpty()) {
SongEvent beat = measures.get(0).pop();
if (measures.get(0).isEmpty()) {
popMeasure();
}
return beat;
} else {
return SongEvent.END;
}
} | 2 |
private void setButtonMode(Integer bm) {
if (bm == 0) {
okButton.setEnabled(false);
cancelButton.setEnabled(false);
deleteButton.setEnabled (true);
editButton.setEnabled(true);
newButton.setEnabled(true);
}
if (bm == 1) {
okButton.setEnabled(true);
cancelButton.setEnabled(true);
d... | 2 |
public static void PROVJERI_naredba_grananja(){
String linija = mParser.ParsirajNovuLiniju(); // ucitaj KR_IF
UniformniZnak uz_kr_if = UniformniZnak.SigurnoStvaranje(linija);
linija = mParser.ParsirajNovuLiniju(); // ucitaj L_ZAGRADA
UniformniZnak uz_l_zagrada = UniformniZnak.SigurnoStvaranje(linija);
linija ... | 7 |
public String request(String request) {
Response response = new Response(Status.failed, null, null);
Gson gson = GsonFactory.getGsonInstance();
JsonParser parser = new JsonParser();
IHandler handler = null;
try {
JsonElement root = parser.parse(request);
if(root.isJsonObject()) {
... | 9 |
private static void writeFile0(ClassFile cf, String directoryName)
throws CannotCompileException, IOException {
String classname = cf.getName();
String filename = directoryName + File.separatorChar
+ classname.replace('.', File.separatorChar) + ".class";
int pos = fil... | 3 |
public void renderHue(int xp, int yp, Sprite sprite, int color) {
int w = sprite.getWidth();
int h = sprite.getHeight();
double hue = Color.getHue(color);
double saturation = (color >> 24 & 0xff) / 255.0;
for (int y = 0; y < h; y++) {
for (int x = 0; x < w; x++) {
int c = sprite.getPixel(x, y);
... | 2 |
public void ge_operation(TextArea area,String ope,String left_var,String right_var,String prefix){
if(ope.equals("+"))
{
String instr = prefix + "%add"+String.valueOf(add_num)+" = add nsw i32 "+left_var+", "+right_var+"\n";
area.append(instr);
add_num = add_num+1;
... | 5 |
@Override
public boolean equals(final Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (! (obj instanceof StringMessage)) {
return false;
}
StringMessage other = (StringMessage) obj;
if (text == null) {
if (other.text != null) {
return false;
}
... | 6 |
public int compareTo(KeyRegistrationRecord o) {
int thisVal = this.base64key.hashCode();
int anotherVal = o.base64key.hashCode();
return (thisVal<anotherVal ? -1 : (thisVal==anotherVal ? 0 : 1));
} | 2 |
public void move() { //class of paddle motion
x += dx; //the paddle moves only in the x place with a dx change in position
if (x <= 2) //sets a limit to the paddles' motion to the left of the screen (it's two because each dx change is of 2 pixles)
x = 2; //if the user tries to go beyond that p... | 2 |
public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
Player player = null;
if (sender instanceof Player) {
player = (Player) sender;
}
if (args.length == 0) {
if (player == null) {
sender.sendMessage(ChatColor.RED+"This command can o... | 9 |
private static String detectWebAppDir() {
String rootClassPath = PathKit.getRootClassPath();
if (rootClassPath.indexOf("\\WEB-INF\\") != -1) {
String[] temp = rootClassPath.split("\\\\");
return temp[temp.length - 3];
}
else if (rootClassPath.indexOf("/WEB-INF/") != -1) {
String[] temp = rootClassPath.... | 2 |
public void something() {
gT.populate();
lT.lookupTablepop();
l.file();
while (l.scncnt < l.temp.length()) {
int nextIn = l.scan(l.temp);
if (nextIn == -9999) {
break;
}
//System.out.println(nextIn);
nextState = ... | 8 |
public void InsertaInicio (int ElemInser)
{
if (VaciaLista())
{
PrimerNodo = new NodosProcesos (ElemInser);
PrimerNodo.siguiente = PrimerNodo;
}
else
{
NodosProcesos Nuevo = new NodosProcesos(ElemInser);
NodosProcesos Aux = PrimerNodo;
while (Aux.siguiente !=PrimerNodo)
Aux = Aux.siguiente;
... | 2 |
@Override
public void propagate(boolean force) {
if (!force && !isReady())
return;
// memory logic is here
int index = 0;
for (int i = 0; i < in_addr.length; i++) {
if (in_addr[i].out(0))
index += 1<<i;
}
if (in_mode.out(0)) {
// write mode
storage[index] = 0;
for (int i = 0; i < in_data... | 8 |
public DeleteTool(AutomatonPane view, AutomatonDrawer drawer) {
super(view, drawer);
} | 0 |
public Rectangle computeBound()
{
int minX = Integer.MAX_VALUE, maxX = 0;
int minY = Integer.MAX_VALUE, maxY = 0;
for (Level l : levels)
{
for (Piece p : l)
{
minX = Math.min(p.x, minX);
minY = Math.min(p.y, minY);
maxX = Math.max(p.x + p.type.width*2,... | 6 |
public UniversalNamespaceCache(Document document, boolean toplevelOnly) {
examineNode(document.getFirstChild(), toplevelOnly);
if (AzotConfig.GLOBAL.DEBUG && isDebug()) {
System.out.println("The list of the cached namespaces:");
for (String key : prefix2Uri.keySet()) {
... | 3 |
public Point devide(double d) {
if (properties != null) {
for (int i = 0; i < properties.size(); i++) {
set(i, get(i) / d);
}
}
return this;
} | 2 |
public void act() {
//Check voor victims binnen bereik. Voeg punten toe en verwijder victim wanneer gevonden.
List<Actor> victims = getObjectsInRange(radius, Victim.class);
for (Actor victim : victims) {
HelicopterWorld world = (HelicopterWorld)getWorld();
world.addScore(... | 9 |
public Receipt checkin(Car car, boolean isHandicapped) {
if(isHandicapped) {
if(!freeHandicappedParkingSpace.isEmpty()) {
ParkingSpace space = freeHandicappedParkingSpace.removeFirst();
space.car = car;
filledHandicappedParkingSpace.put(car.registrati... | 6 |
private String[] getIndexes(final Object data) throws DataClassException {
Map<Index, String> indexValuePair = new EnumMap<Index, String>(Index.class);
Field[] fields = data.getClass().getDeclaredFields();
for (Field field : fields) {
System.out.println(field);
if (field.... | 7 |
public void setHeight(double height) {
this.height = height;
} | 0 |
private void testAdd(String start, DurationFieldType type, int amt, String end) {
DateTime dtStart = new DateTime(start, ISOChronology.getInstanceUTC());
DateTime dtEnd = new DateTime(end, ISOChronology.getInstanceUTC());
assertEquals(dtEnd, dtStart.withFieldAdded(type, amt));
assertEqua... | 3 |
public void configureForOpen(String protocolName, String currentDirectory) {
lazyInstantiate();
// adjust title
setDialogTitle("Open: " + protocolName);
// adjust approve button
setApproveButtonToolTipText("Open selected file");
// Set the Accessory state.
setAccessory(openAccessory);
// Set the A... | 0 |
public void setupSlide(Slide newSlide){
currentSlide = newSlide;
slideID = currentSlide.getSlideID();
slideName = currentSlide.getSlideName();
layeredPane = new JLayeredPane();
layeredPane.setBounds(0, 0, (int) (presentation.getWidth()*scalingFactorX), (int) (presentation.getHeight()*scalingFactorY));
lay... | 3 |
@Override
public void doing(Request baseRequest, HttpServletRequest request, HttpServletResponse response) throws IOException {
String type = request.getParameter("type");
String phone = request.getParameter("phone");
if (phone == null || phone.equals("") || type == null || type.equals(""))
return;
String... | 6 |
private void animate() {
GreenfootImage back = new GreenfootImage(worldWidthInPixels, height);
switch (direction) {
case LEFT_TO_RIGHT:
xPos += speed;
break;
case RIGHT_TO_LEFT:
xPos -= speed;
break;
}
back.drawImage(originalImage, Math.round(xPos), 0);
setImage(back);
time++;
if (time ... | 9 |
public final void setSite(IServiceProvider value)
{
privateSite = value;
} | 0 |
public boolean setTailleLigne(int nvTaille){
if(nvTaille >= MIN_TAILLE && nvTaille <= MAX_TAILLE){
Integer taille = nvTaille;
propriete.setProperty("taille", taille.toString());
return true;
}
else{
return false;
}
} | 2 |
private boolean checkForWinSWT() {
if (logicField.checkForWin()) {
final Shell dialog = new Shell(GuiSWT.shell, SWT.DIALOG_TRIM
| SWT.APPLICATION_MODAL);
Font fontForDialog = new Font(StartAllVersionHere.display, "Arial", 14, SWT.BOLD
| SWT.ITALIC);
RowLayout layoutForDialogWindow = new RowLayout... | 7 |
public ArrayList<Usuarios> getAll(){
PreparedStatement ps;
ArrayList<Usuarios> usuarios = new ArrayList<>();
try {
ps = mycon.prepareStatement("SELECT * FROM Usuarios");
ResultSet rs = ps.executeQuery();
if(rs!=null){
try {
... | 4 |
public ResultSet execute(String query) {
try {
Statement stm = this.con.createStatement();
if(stm.execute(query)){
return stm.getResultSet();
}
return null;
} catch (SQLException e) {
LogHandler.writeStackTrace(log, e, Level.SEVERE);
return null;
}
} | 2 |
public void increment() {
count.incrementAndGet();
} | 0 |
@Override
public String getGUITreeComponentID() {return this.id;} | 0 |
public void componentRemoved(ContainerEvent e) {
if (e.getChild() instanceof CPPaletteFrame) {
CPPaletteFrame frame = (CPPaletteFrame) e.getChild();
for (CPPalette palette : frame.getPalettesList()) {
controller.getMainGUI().setPaletteMenuItem(palette.title, false);
}
}
} | 2 |
public AirNowData parseSiteInfo(InputStream is){
try{
AirNowData data = new AirNowData();
BufferedReader reader = new BufferedReader(new InputStreamReader(is));
String curLine;
while ((curLine = reader.readLine()) != null){
String[] lineParts = curLine.split("\\|");
if (lineParts.length == 21){
... | 4 |
@Override
public boolean equals(Object obj) {
if (obj instanceof Question) {
Question o = (Question) obj;
return o.getQuestionText().equals(getQuestionText())
&& o.getAnswerText().equals(getAnswerText())
&& o.getPrompt().equals(getPrompt())
... | 4 |
public static void main(String[] args) {
int[] testArray = {3, 7, 17, 25, 33, 47, 56, 62, 65, 66, 68, 70, 78, 89, 92};
ArrayList<Unit<Integer, String>> testArrayList = new ArrayList();
BinarySearch search = new BinarySearch();
for (int i : testArray) {
testArrayList.add(new U... | 7 |
public RTsemBuffer () {
Buffer buff = new Buffer();
Producer p = new Producer(buff);
Consumer c = new Consumer(buff);
c.start();
p.start();
System.out.println("\n\n"+"RTsemBuffer: Threads are running ...");
try {
p.join();
// Give consumer 10s to complete its work, then stop it.
Thread.sleep(1000... | 1 |
public VariableStack mapStackToLocal(VariableStack stack) {
/*
* There shouldn't be any JSR blocks remaining, but who knows.
*/
/*
* The innerBlock is startet with a new stack entry (return address) It
* should GOTO immediately and never complete.
*/
LocalInfo retAddr = new LocalInfo();
retAddr.s... | 1 |
public void addEdge(int i, int j) {
// System.out.println(i + " " + j);
if (!adj[i].contains(j)) {
adj[i].add(j);
}
} | 1 |
@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 Theater)) {
return false;
}
Theater other = (Theater) object;
if ((this.id == null && other.id != null) || (thi... | 5 |
private void resize() {
width = getSkinnable().getWidth();
height = getSkinnable().getHeight();
if (getSkinnable().isKeepAspect()) {
if (aspectRatio * width > height) {
width = 1 / (aspectRatio / height);
} else if (1 / (aspectRatio / height) > width) {
... | 8 |
NPCHandler() {
for(int i = 0; i < maxNPCs; i++) {
npcs[i] = null;
}
for(int i = 0; i < maxListedNPCs; i++) {
NpcList[i] = null;
}
for(int i = 0; i < maxNPCDrops; i++) {
NpcDrops[i] = null;
}
loadNPCList("npc.cfg");
loadNPCDrops("npcdrops.cfg");
loadAutoSpawn("autospawn.cfg");
} | 3 |
public static double[] invVector(
double[] inVector )
{
int m = inVector.length;
double[] outVector = new double[m];
for ( int i = 0; i < m; ++i )
outVector[i] = 1 / inVector[i];
return(outVector);
} | 1 |
public static String concatenateStrings(String... strValues) {
String retValue = null;
if (null != strValues) {
StringBuilder sbValue = new StringBuilder();
for (String strValue : strValues) {
sbValue.append(strValue);
}
retValue = sbValue.toString();
}
return retValue;
} | 2 |
public void doLaunch () {
JavaInfo java = Settings.getSettings().getCurrentJava();
int[] minSup = ModPack.getSelectedPack().getMinJRE();
if (ModPack.getSelectedPack().getMinLaunchSpec() <= Constants.buildNumber) {
if (users.getSelectedIndex() > 1 && ModPack.getSelectedPack() != null)... | 7 |
public static void main (String [] args) {
try {
Options options = new Options();
options.addOption("cp", "c_port", true, "Client port");
options.addOption("h", "host", true, "Server host");
options.addOption("p", "port", true, "Server port");
CommandL... | 3 |
@Override
public String toString() {
final StringBuilder str = new StringBuilder();
if (this.creditCardNumber != null) {
str.append("CREDIT_CARD_NUMBER").append("=").append(this.creditCardNumber).append("\n");
}
if (this.expiryDate != null) {
str.append("EXPIR... | 6 |
public void setContract(String contract) {
Contract = contract;
} | 0 |
private void firstLoad() throws SQLException {
if (initialLoad) {
if (gui.connection != null) {
int columns = rsltMetaData.getColumnCount();
for (int i = 1; i <= columns; i++) {
this.tableCellRenderer.setColumn(i,
rsltMetaData.isAutoIncrement(i),
rsltMetaData.isNullable(i));
}
in... | 3 |
@Override
public void sort(int[] array) {
int i, j, b = 0;
int[] c = new int[100];
for (i = 0; i < 100; i++) c[i] = 0;
for (i = 0; i < array.length; i++) {
c[array[i]] = c[array[i]] + 1;
b = 0;
}
for (j = ... | 4 |
public static void main(String[] args) {
Communicator communicator = new Communicator();
communicator.startListening();
// if(!communicator.portsAreValid()){
// System.out.println("Invalid Ports!");
// System.exit(1);
// }
//
// //String gridString = GridStrings.getGrid(1);
// String gridString = ... | 2 |
private int getEnd(int offs) throws BadLocationException {
int length = getLength();
for (int i=offs;i<length;i++){
char c = getText(i, 1).charAt(0);
if (c == ' ' || c == '\t' || c == '\n'){
return i;
}
}
return length;
} | 4 |
@Override
/*
* actionPerformed is used for the login button
* gets the username and to fields and sets them to
* username and connectedTo variables
* then remoes the login panel
* and refreshes the layout
* then calls the initChatComponents
*/
... | 8 |
private void bootStrap(){
try {
JtapiPeer peer = JtapiPeerFactory.getJtapiPeer("");
String[] myServices = peer.getServices();
String providerString=myServices[0]+
";login=anis;passwd=123456";
provider = peer.getProvider(providerString);
... | 1 |
public Metrics(final Plugin plugin) throws IOException {
if (plugin == null) {
throw new IllegalArgumentException("Plugin cannot be null");
}
this.plugin = plugin;
// load the config
configurationFile = getConfigFile();
configuration = YamlConfiguration.load... | 2 |
public ArrayList<HashMap<String, Double>> extractMostCorrelated(double cutoff){
ArrayList<HashMap<String, Double>> rt = new ArrayList<HashMap<String, Double>>();
HashMap<String, Double> mostCorrelated = new HashMap<String, Double>();
HashMap<String, Double> mostCorrelatedFDR = new HashMap<String, Double>();
Has... | 7 |
public static String extractBuiltYear(String sourceText) {
String[] lines = sourceText.split("\n");
String result = "";
for (int i = 0; i < lines.length; i++) {
if (lines[i].contains("Approx Yr Blt")) {
try {
String[] subStrings = lines[i].split(" ");
for (int j = 0; j < subStrings.length; j++) {... | 7 |
@Override
public void run() {
boolean quit = false;
while (!quit) {
for (int x = -tile_generate_area / 2; x < tile_generate_area / 2; x++) {
for (int y = -tile_generate_area / 2; y < tile_generate_area / 2; y++) {
Point playerloc = zoneHandler.getPlaye... | 4 |
@Override
public void setValue(Object o) {
// TODO support setting (by pushing properties to parent)
throw new UnsupportedOperationException("Not supported yet.");
/*
String[] vals=o.toString().split("/");
if(vals.length>0) {
this.getParent().setValue(MediaProperty.VORBISFIELD_ENCODERSOFT... | 0 |
@Override
public void paintComponent(Graphics graphics) {
Graphics2D graphics2D = (Graphics2D) graphics;
graphics2D.translate(-camera.getLocation().getX(), -camera.getLocation().getY());
for (Tile tile : getTiles(Layer.BACK)) {
tile.render(graphics, Layer.BACK);
}
... | 5 |
private static void stackOperation(IStack stack) {
do {
System.out.println("---------------------------------------------------------------------------------------");
System.out.println("[1] capcity / [2] clear / [3] isEmpty / [4] peek / [5] size / [6] pop / [7] push / [8] toString");
System.out.println("... | 9 |
public void eval(EvalContext context) {
int stmtId = context.newStmtId();
context.logEntering("Evaluating Fun<" + name + ">@" + stmtId + " ctx@" + context.id);
StringBuilder builder = new StringBuilder();
int len = params.length;
for(int i=0; i<len; i++) {
String varN... | 1 |
public void addDegreeToStudent(int studentId, int degreeId) {
if(!isValidId(studentId) || !isValidId(degreeId)) {
return;
}
Student student = studentDao.getStudent(studentId);
Degree degree = degreeDao.getDegree(degreeId);
if(student != null && degree != null) {
for(Degree d : student.getDeg... | 6 |
@SuppressWarnings( "unchecked" )
public void load( String fn )
{
try( ObjectInputStream is = new
ObjectInputStream( new FileInputStream( fn ) ) )
{
int n = is.readInt( );
for( int i = 0; i < n; i++ )
add( i, ( T ) is.readObject( ) );
}
catch( IOException | ClassNotFoundException e )... | 2 |
private void loadResource(File var1, String var2) {
File[] var3 = var1.listFiles();
for(int var4 = 0; var4 < var3.length; ++var4) {
if(var3[var4].isDirectory()) {
this.loadResource(var3[var4], var2 + var3[var4].getName() + "/");
} else {
try {
this.m... | 3 |
public void load()
{
if( ready ) return;
InputStream INP = BasicEngine2D.getResource(FileName);
inner = BasicEngine2D.last;
if( INP==null ) { error=1; wreck=true; return; }
AudioInputStream AIS = null;
try { AIS = AudioSystem.getAudioInputStream( new BufferedInputStream( INP ) ); }
catch (Unsupported... | 7 |
public boolean isConserved(int pos) {
int countNonZero = 0;
for (int i = 0; i < countMatrix.length; i++)
if (countMatrix[i][pos] > 0) countNonZero++;
return countNonZero == 1;
} | 2 |
@Test
public void ToolTest() {
ArrayList<Keyword> tool = new ArrayList<Keyword>();
//tool.add(loadKeyword(171)); //oven
tool.add(loadKeyword(172)); //knife
//tool.add(loadKeyword(173)); //spoon
try {
DialogTest.currentDialog.updateState(tool, null, null);
} catch (WrongStateClassException e) {
//neve... | 3 |
private int getFascia( int ora){
if (ora>=7 && ora<=11)
return 0;
if (ora>=12 && ora<=14)
return 1;
if (ora>=15 && ora<=18)
return 2;
if (ora>=19 && ora<=23)
return 3;
return -1; // -1 f... | 8 |
@Override
public Confirmation deliver(final Message message) {
int count = 0;
for (final Permissible permissible : Bukkit.getPluginManager().getPermissionSubscriptions(this.permission))
if (permissible instanceof CommandSender && permissible.hasPermission(this.permission)) {
... | 3 |
public PieChart()
{
} | 0 |
public static BOMColumnDescription create(BOMColumn column) {
switch (column) {
case ID:
return new BOMColumnDescription<String>(column.ordinal(), "id", "ID", 4, new TextFormat(), new CountingAggregator());
case TITLE:
return new BOMColumnDescription<Strin... | 8 |
public boolean addProtocol(FileProtocol protocol) {
if (isNameUnique(protocol)) {
protocols.add(protocol);
// Also add it to the list of protocols stored in the preferences
Preferences.FILE_PROTOCOLS.add(protocol.getName());
return true;
}
return false;
} | 1 |
public Record next()
{
Record rec = reader.next();
Leader l = rec.getLeader();
boolean is_utf_8 = false;
if (l.getCharCodingScheme() == 'a') is_utf_8 = true;
if (is_utf_8 && unicodeNormalize == Normalizer.NONE) return(rec);
List<VariableField> fields = rec.getVariable... | 9 |
private void initDBManager() throws DataBaseServerException {
dbManager = new DataBaseManager();
System.out.println("Start loading data from backup...");
try {
dbManager.loadDataFromBackup();
} catch (IOException e) {
throw new DataBaseServerException("Unable to l... | 1 |
public String toString()
{
if(this.link==null)
{
return "(deta:" + String.valueOf(data)+ ", link: null";
}
else
{
return "(deta:" + String.valueOf(data)+ ", link: " + this.link.toString() + ")";
}
} | 1 |
private void setEhtoY(Pelihahmo h, int y){
if (h==h1){
ehtoh1y = y;
} else {
ehtoh2y = y;
}
} | 1 |
public static String toUTF8(String str){
if(str == null){
return null;
}
StringBuffer sb = new StringBuffer();
for (int i=0; i< str.length(); i++) {
char c = str.charAt(i);
if(c >= 0 && c <= 256){
sb.append(c);
}
else{
try{
byte[] b = Character.toString(c).getBytes("UTF-8");
for... | 7 |
@Override
public void addClientConnectListener(ConnectOnServerListener listener) {
if (clientConnectListenerList != null) {
clientConnectListenerList.add(ConnectOnServerListener.class, listener);
}
} | 1 |
@Override
public void gameRenderObjects() {
if (dbImage == null) {
dbImage = frame.createImage(dbWidth, dbHeight);
if (dbImage == null) {
return;
}
}
dbg = dbImage.getGraphics();
dbg.setColor(Color.WHITE); // The Screen
dbg.fillRect(0, 0, dbWidth, dbHeight);
dbg.setColor(Color.green); // L... | 2 |
private static final byte getTypeFromString(String type) {
switch (ScoreKeywords.getIDFromKeyword(type)) {
case "var":
return VAR_ARRAY;
case "bool":
return BOOL_ARRAY;
case "char":
return CHAR_ARRAY;
case "float":
return FLOAT_ARRAY;
case "int":
return INT_ARRAY;
case "string":
... | 7 |
private void startClustersMonitor(){
try{
// Create a new selector
Selector selector = Selector.open();
// Create a new non-blocking server socket channel
ServerSocketChannel serverChannel = ServerSocketChannel.open();
serverChannel.configureBlocking(false);
InetSocketAddress isa = new Ine... | 7 |
public static float pideFloat(String texto) {
InputStreamReader flujo=new InputStreamReader(System.in);
BufferedReader teclado=new BufferedReader(flujo);
String cadnum;
float numero=0;
boolean correcto;
do {
try {
correcto=true... | 3 |
public Dimension minimumLayoutSize(Container target) {
synchronized (target.getTreeLock()) {
Dimension dim = new Dimension(0, 0);
if (eastComponent != null) {
Dimension d = eastComponent.getMinimumSize();
dim.width += d.width + getHgap();
dim.height = Math.max(d.height, dim.height);
}
if (w... | 9 |
private void foo(T internal2) {
int compareTo = internal.compareTo(internal2);
} | 0 |
public static void close() {
if (connection == null) {
return;
}
try {
connection.close();
} catch (SQLException e) {
throw new RuntimeException(e);
}
} | 2 |
public LinkedList<Edge> findAugmentingPath () {
//BFS Algorithm begin
Queue<Vertex> queue = new LinkedList<Vertex>();
LinkedList<Edge> edges = new LinkedList<Edge>();
boolean containsSink = false;
for(int i=0;i<numVertices;i++){
getVertexByIndex(i).setColor(Vertex.WHITE);
getVertexByIndex(i).setPa... | 8 |
private JSONWriter append(String string) throws JSONException {
if (string == null) {
throw new JSONException("Null pointer");
}
if (this.mode == 'o' || this.mode == 'a') {
try {
if (this.comma && this.mode == 'a') {
this.writer.write('... | 7 |
public Boolean getIsBattingFirstTurn() {
return isBattingFirstTurn;
} | 0 |
public ArrayList<String> listarLinks() throws GlobalException, NoDataException{
try {
conectar(user, pass,ip,port,db);
}
catch(ClassNotFoundException ex)
{
throw new GlobalException("No se ha localizado el Driver");
}
catch (SQ... | 9 |
private synchronized void seriesTableValueChanged(javax.swing.event.ListSelectionEvent evt) {
Logger.getLogger(MainInterface.class.getName()).entering(MainInterface.class.getName(), "seriesTableValueChanged");
if (booksDirectory == null) {
Logger.getLogger(MainInterface.class.getName()).exit... | 3 |
private void computeLineClear(int linesCleared) {
assert linesCleared >= 0 && linesCleared <= 4 : linesCleared;
if (linesCleared == 0) {
combo = 0;
return;
}
totalLines += linesCleared;
int lineScore = 0;
String msg = "";
switch (linesCleared) {
case 1:
lineScore = 100;
msg = "Singl... | 8 |
Subsets and Splits
SQL Console for giganticode/java-cmpx-v1
The query retrieves a limited number of text entries within a specific length range, providing basic filtering but minimal analytical insight.