text stringlengths 14 410k | label int32 0 9 |
|---|---|
public void limpiarTabla(){
try {
DefaultTableModel modelo=(DefaultTableModel) tabla.getModel();
int filas=tabla.getRowCount();
for (int i = 0;filas>i; i++) {
modelo.removeRow(0);
}
} catch (Exception e) {
JOptionPane.showMessag... | 2 |
public VCFReader(String _dataFile, String _sampleName) throws IOException {
dataFile = _dataFile;
sampleName = _sampleName;
br = new BufferedReader(new FileReader(dataFile));
String line = null;
while ((line=br.readLine())!=null) {
if (line.length()<=0) continue;
// If it is not a meta-infor... | 9 |
private static void writeBit(boolean bit) {
// add bit to buffer
buffer <<= 1;
if (bit) buffer |= 1;
// if buffer is full (8 bits), write out as a single byte
N++;
if (N == 8) clearBuffer();
} | 2 |
public boolean start() {
synchronized (optOutLock) {
// Did we opt out?
if (isOptOut()) {
return false;
}
// Is metrics already running?
if (task != null) {
return true;
}
// Begin hitting the s... | 7 |
@Test
public void filtersByAddressWorks2() {
citations.add(c1);
citations.add(c2);
citations.add(cnull);
filter.addFieldFilter("address", "Espoo");
List<Citation> filtered = filter.getFilteredList();
assertTrue(filtered.contains(c2) && filtered.size() == 1);
} | 1 |
public IQ parseIQ(XmlPullParser parser) throws Exception {
boolean done = false;
Bytestream toReturn = new Bytestream();
String id = parser.getAttributeValue("", "sid");
String mode = parser.getAttributeValue("", "mode");
// streamhost
String JID = null;
String host = null;
String port = null;
int... | 9 |
public void initialize(FlowChartInstance flowChartinstance, ChartItemSpecification chartItemSpecification) throws MaltChainedException {
super.initialize(flowChartinstance, chartItemSpecification);
for (String key : chartItemSpecification.getChartItemAttributes().keySet()) {
if (key.equals("id")) {
idName... | 8 |
@Override
public String execute(HttpServletRequest request, HttpServletResponse response) throws Exception {
try {
ClienteDao_Mysql oClienteDAO = new ClienteDao_Mysql(Conexion.getConection());
ClienteBean oCliente = new ClienteBean();
... | 2 |
@Override
public void documentAdded(DocumentRepositoryEvent e) {} | 0 |
public boolean resetStream( AudioFormat format )
{
// make sure the Mixer exists:
if( errorCheck( myMixer == null,
"Mixer null in method 'resetStream'" ) )
return false;
// make sure a format was specified:
if( errorCheck( format == null,
... | 7 |
@Override
public String serializeToString(Element root) {
if (root == null) {
return null;
}
if (root.getGUID() == null) {
root.setGUID(guidCreator.getNewGUID());
}
StringBuilder sb = new StringBuilder("{");
if (!root... | 8 |
public String testUpdateUrl(String appKey, String userKey, String testId) {
try {
appKey = URLEncoder.encode(appKey, "UTF-8");
userKey = URLEncoder.encode(userKey, "UTF-8");
testId = URLEncoder.encode(testId, "UTF-8");
} catch (UnsupportedEncodingException e) {
... | 1 |
static public CycObject convertResponseToCycObject(Object response) {
if (response.equals(CycObjectFactory.nil)) {
return new CycList();
} else {
return (CycObject) response;
}
} | 1 |
private static boolean parseURL(StringBuilder sourceCode) {
if (sourceCode.toString() == "-1") return false;
Pattern p = Pattern.compile("id=\"((Selected_filmography)|(Film)|(Filmography))\">");
Matcher m = p.matcher(sourceCode);
if (m.find()) {
start = m.start();
p = Pattern.compile("Main art... | 6 |
public byte[] getAuthenticatorServer() {
return this.AuthenticatorServer;
} | 0 |
public EnergyVisualizer(MDModel m) {
model = m;
String s = MDView.getInternationalText("Energy");
String s1 = MDView.getInternationalText("TimeInFemtoseconds");
cg = new CurveGroup(s != null ? s : "Energies", new AxisLabel(s1 != null ? s1 : "Time (fs)"), new AxisLabel(
(s != null ? s : "Energies") + " (eV... | 8 |
@SuppressWarnings("unchecked")
private String generateColorTeamTable(String color) {
PreparedStatement st = null;
ResultSet rs = null;
JSONArray json = new JSONArray();
try {
conn = dbconn.getConnection();
st = conn.prepareStatement("SELECT id, team_id, auton_... | 3 |
public void check() {
if (this.isInputValid()) {
this.setBackground(validColor);
} else {
this.setBackground(errorColor);
}
this.repaint();
} | 1 |
public void keyReleased(KeyEvent e)
{
int key=e.getKeyCode();
if(key==KeyEvent.VK_UP || key== KeyEvent.VK_DOWN)
dy=0;
if(key==KeyEvent.VK_LEFT || key== KeyEvent.VK_RIGHT)
dx=0;
if(key == KeyEvent.VK_SPACE) {
isCharging = false;
fire();
}
... | 5 |
static public void setMapType(String type)
{
mapType=type;
} | 0 |
final void put(final ClassWriter cw, final byte[] code, final int len,
final int maxStack, final int maxLocals, final ByteVector out) {
Attribute attr = this;
while (attr != null) {
ByteVector b = attr.write(cw, code, len, maxStack, maxLocals);
out.putShort(cw.newUTF8(attr.type)).putInt(b.length);
out.p... | 1 |
public static Statement createStmt(Connection conn) {
Statement stmt = null;
try {
stmt = conn.createStatement();
} catch (SQLException e) {
e.printStackTrace();
}
return stmt;
} | 1 |
public int getQuantityOfVictims() {
return victims.size();
} | 0 |
private void testJceAvailability(int keyBitLength)
throws
EncryptionUnsupportedByPlatformException, PDFParseException {
// we need to supply a little buffer for AES, which will look
// for an initialisation vector of 16 bytes
final byte[] junkBuffer = new byte[16];
... | 9 |
public static boolean wasKeyPressed(char c) {
try {
if (!keypCheckInitiated) {
keypCheckInitiated = true;
keypLastUpdate = System.currentTimeMillis();
}
if (keypLastUpdate + TIMEOUT < System.currentTimeMillis()) {
app.keysPressed.clear();
}
Character n = new Cha... | 5 |
@Override
public boolean equals(Object other) {
if (other == this)
return true;
if (other == null || other.getClass() != this.getClass())
return false;
Position pos = (Position) other;
return this.getxCoordinate() == pos.getxCoordinate()
&& this.getyCoordinate() ==... | 4 |
public static String encodeForHtml(String s) {
StringBuilder sb = new StringBuilder();
int len = (s == null ? -1 : s.length());
for(int i=0; i<len; i++) {
char c = s.charAt(i);
if(c == '&') {
sb.append("&");
} else if(c == '<') {
sb.append("<");
} else if(c == '>') {
sb.appen... | 8 |
public OlympicDataVisualiserFrame() {
TitledBorder title;
// TODO Add more views
// TODO filter data (sliders, checkboxes)
// This instantiates the classes based of the name in the
// visualisationOptions array
// Each of these classes must have a constructor which takes one
// string(data) to open the ... | 4 |
public void onKeyReleased(char key, int code, boolean coded)
{
if (coded)
{
// Marks the key as released
if (!this.codesReleased.contains(code))
this.codesReleased.add(code);
// Sets the key up (= not down)
if(this.codesDown.contains(code))
this.codesDown.remove(this.codesDown.indexOf(code)... | 4 |
private List<TableRow> Code(List<TableRow> l){
if(l.size()>1){
int psum=0;
for(TableRow t:l)
psum+=t.getP();
int sum=0,mind=psum,mini=-1;
for(int i=0;i<l.size()-1;i++){
sum+=l.get(i).getP();
int d=Math.abs(psum-2*sum);
if(d<mind){
mini=i;
mind=d;
}
}
List<TableRow> l... | 7 |
private boolean getFreeCell(ERow row){
int i =0;
for (i = 0; i < size; i++) {
if(U[row.getXs()[i]][row.getYs()[i]] == 0)
break;
}
if(i<size){
x = row.getXs()[i];
y = row.getYs()[i];
System.out.println("free " + x + ":" + y);... | 3 |
public Object readConst(final int item, final char[] buf){
int index = items[item];
switch(b[index - 1])
{
case ClassWriter.INT:
return new Integer(readInt(index));
case ClassWriter.FLOAT:
return new Float(Float.intBitsToFloat(readInt(index)));
case ClassWriter.LONG:
return new Long(readLong(index));... | 6 |
private static ArrayList<String> getRowColAndGapsTrimmed(String s)
{
if (s.indexOf('|') != -1)
s = s.replaceAll("\\|", "][");
ArrayList<String> retList = new ArrayList<String>(Math.max(s.length() >> 2 + 1, 3)); // Approx return length.
int s0 = 0, s1 = 0; // '[' and ']' count.
int st = 0; // Start of "next... | 9 |
private long removeRefTradeDataNym(long lIndex) {
//
// loop through the elements in the actual container, in order to find the one
// at lIndex. Once it is found, then loop through the reference list and remove
// the corresponding reference for that element.
//
TradeDataNym refActualElement = GetTradeDataNym(l... | 5 |
public void serverStart(int max, int port) throws java.net.BindException {
try {
clients = new ArrayList<ClientThread>();
RoomList = new ArrayList<RoomList>();
serverSocket = new ServerSocket(port);
serverThread = new ServerThread(serverSocket, max);
... | 2 |
public Rule(int code, int[] in, int[] out) throws Exception{
super();
this.code = code;
/*Throws an exception if in or out is not well formatted
* (which means not int triplets)*/
if(in.length%3!=0 || out.length%3!=0){
throw new TripleFormatException("Triples must be like \"(s p o)*\"");
}
/*Gen... | 4 |
private Mesh loadMesh(String fileName){
String[] splitArray = fileName.split("\\.");
String ext = splitArray[splitArray.length - 1];
if(!ext.equalsIgnoreCase("obj")){
System.err.println("ERROR: File format not supported - " + ext);
new Exception().printStackTrace();
... | 8 |
@Override
public void set_irq_line(int irqline, int state) {
int eddge;
if (m6800.irq_state[irqline] == state) return;
//LOG((errorlog, "M6800#%d set_irq_line %d,%d\n", cpu_getactivecpu(), irqline, state));
m6800.irq_state[irqline] = state;
switch(irqline)
{
case M6800_IRQ_LINE:
if (state == CLEAR_LINE) ... | 8 |
public static String reformatTitle(String fullTitle) {
if (!fullTitle.contains("_URL_"))
return "incompatible text";
String dateTitle = fullTitle.replaceAll(".html", "").replaceAll(
"_URL_", " ");
return dateTitle;
} | 1 |
private void run() {
isRunning = true;
int frames = 0;
long frameCounter = 0;
final double frameTime = 1.0 / FRAME_CAP;
long lastTime = Time.getTime();
double unprocessedTime = 0;
while (isRunning) {
boolean render = false;
long startT... | 6 |
public void previewRoom(Player player, int[] boundChuncks, RoomReference reference, boolean remove) {
int boundX = reference.x * 8;
int boundY = reference.y * 8;
Region region = World.getRegion(RegionBuilder.getRegionHash(reference.room.chunkX/8, reference.room.chunkY/8));
int boundX2 = (reference.room.chunkX -... | 7 |
public static void main(String[] args) throws Exception {
if (args.length != 1) {
System.err.println(
"Usage: java ReliableUdpServer <listening port>");
System.exit(1);
}
int serverPort = Integer.parseInt(args[0]);
//create new datagram socket ... | 1 |
private boolean sendData(BufferedInputStream bis, StageContext ctx) {
final TextConnection c = new TextConnection(ctx.getConnection());
Integer pos = (Integer) ctx.getParameter("position");
if (pos == null) {
pos = 0;
}
if (pos == 0) {
tr... | 8 |
public String toString() {
try {
return this.toJSON().toString(4);
} catch (JSONException e) {
return "Error";
}
} | 1 |
@Override
public List<String> getColumns(String fileName) throws CustomerizedException {
List<String> columnNames = new ArrayList<String>();
String line = "";
String columnLines = "";
log.info("Start to read column names in "+fileName+"... ...");
//Get Column Name list
try {
FileReader fr = new FileReader... | 7 |
public static void main(String[] args) throws InterruptedException {
class SendThread extends Thread{
ClientTurtleEnvironment nioClientMT;
public SendThread(ClientTurtleEnvironment nioClientMT){
this.nioClientMT = nioClientMT;
}
@Override
... | 4 |
public static Community parseCommunity(String name, String[] jsonFiles)
throws IOException {
// resulting community object to be filled with data.
Community result = new Community(name);
for (String file : jsonFiles) {
BufferedReader bin = new BufferedReader(new InputStreamReader(
new FileInputStream(f... | 8 |
public qr_fact_househ(Matrix M) {
// Declare global variables
QR = M.getArrayCopy();
m = M.getRowDimension();
n = M.getColumnDimension();
if (!(m >= n)) {
entryError();
}
diagR = new double[n];
// Outer loop
for (int k = 0; k < n; k++)... | 9 |
public boolean query(String query){
// TODO: all calls here should call a closeQuery() which closes ps and currentResult
try {
ps = con.prepareStatement(query);
currentResult = ps.executeQuery();
return true;
} catch( SQLException e ){
if( debug ) System.out.println("Error in DataBaseConnection.query(... | 2 |
public void removeRow(int row)
{
if (getRowCount() > 0)
{
Object[][] temp = new Object[data.length - 1][data[0].length];
for (int i = 0; i < temp.length - 1; i++)
{
if (i < row)
{
temp[i] = data[i];
}
else
{
temp[i] = data[i + 1];
}
temp[i][1] = new Integer(i + ... | 3 |
@Override
public synchronized void avaliarCaso(Oferta oferta, boolean avaliacao)
throws RemoteException, SQLException {
if (oferta == null) {
throw new InvalidParameterException();
}
if (oferta instanceof OfertaEmprego) {
mConexaoBD.reviewEmprego(oferta.... | 5 |
public void displayGuiScreen(GuiScreen par1GuiScreen)
{
if (!(this.currentScreen instanceof GuiErrorScreen))
{
if (this.currentScreen != null)
{
this.currentScreen.onGuiClosed();
}
if (par1GuiScreen instanceof GuiMainMenu)
... | 9 |
private void setSizes(Container parent) {
int nComps = parent.getComponentCount();
Dimension d = null;
// Reset preferred/minimum width and height.
preferredWidth = 0;
preferredHeight = 0;
minWidth = 0;
minHeight = 0;
for (int i = 0; i < nComps; i++) {
... | 4 |
public List<Point> performFloodFile(Point start, FloodFillFunction function, int size) {
Set<Point> closed_set = new HashSet<>();
Queue<Point> open_list = new LinkedList<>();
List<Point> filled_list = new ArrayList<>();
open_list.add(start);
while (open_list.size() > 0) {
Point cur_point = open_list.poll();... | 5 |
public OptionsFrame(VncViewer v) {
super("TigerVNC Options");
viewer = v;
GridBagLayout gridbag = new GridBagLayout();
setLayout(gridbag);
GridBagConstraints gbc = new GridBagConstraints();
gbc.fill = GridBagConstraints.BOTH;
for (int i = 0; i < names.length; i++) {
labels[i] = new... | 8 |
public static void main(String[] args)
{
System.out.println ("Text eingeben, 'Enter' schickt ihn zum Server. Eingabe von 'X' zum Beenden!");
// Tastatureingaben werden eingelesen:
BufferedReader reader = new BufferedReader ( new InputStreamReader (System.in));
//Server-Verbindung aufbauen:
... | 5 |
public int incrementAndGet() {
int val;
synchronized (this) {
this.sharedCounter ++;
val = sharedCounter;
}
return val;
} | 0 |
public void obstacleEvent(MapObstacle obstacle){
if(obstacle.getType() == ObstacleType.BUSH){
AudioPlayer.play(ResourceTools.getResourceAsStream("sounds/hitbush.wav"));
}
if(obstacle.getType() == ObstacleType.WALL){
AudioPlayer.play(ResourceTools.getResourceAsStream("s... | 3 |
public String getArtifactFilename(String classifier) {
if (this.name == null) throw new IllegalStateException("Cannot get artifact filename of empty/blank artifact");
String[] parts = this.name.split(":", 3);
String result = String.format("%s-%s%s.jar", new Object[] { parts[1], parts[2], "-" + classifier }... | 1 |
public static void main(String[] args) {
for(;;)
{
System.out.println("\nDigite o comando: ");
String comando = sc.nextLine();
String[] array = comando.split(" ");
String opcao = array[0];
switch (opcao) {
case "imagem":
imagem = new Imagem(Integer.valueO... | 9 |
public boolean run() {
return gameWorld.run(camera, buffer);
} | 0 |
public void setTestInfo(TestInfo testInfo) {
BmTestManager bmTestManager = BmTestManager.getInstance();
if (testInfo == null || testInfo.isEmpty() || !testInfo.isValid()) {
testInfo = new TestInfo();
testInfo.setName(Constants.NEW);
testIdComboBox.setSelectedItem(test... | 4 |
@Override
public void paint(Graphics g) {
super.paint(g);
System.out.println("Printing Start Menu...");
Graphics2D g2d = (Graphics2D) g;
g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
RenderingHints.VALUE_ANTIALIAS_ON);
... | 5 |
public OutConnectionHandler(ObjectOutputStream out) {
this.out = out;
} | 0 |
public static boolean getResultSet(String path,String request){
Connection c = null;
Statement stmt = null;
int s = 0;
try {
Class.forName("org.sqlite.JDBC");
c = DriverManager.getConnection("jdbc:sqlite:"+path);
stmt = c.createStatement();
ResultSet rs = stmt.... | 3 |
public void echo() {
BufferedReader br = null;
try {
br = getReader(socket);
String str = null;
while (true) {
str = br.readLine();
if (str != null) {
System.out.println("From server: " + str);
if (str.startsWith("yt"))
ai_response(str);
} else {
break;
}
}
} catch... | 5 |
public static void main(String[] args) {
System.out.print("Enter the integers between 1 and 100: ");
Scanner scanner = new Scanner(System.in);
int integer = scanner.nextInt();
ArrayList integers = new ArrayList();
while (integer != 0) {
integers.add(integer);
integer = scanner.nextInt();
}
fo... | 5 |
@Override
public int compare(Event<?, ?> e1, Event<?, ?> e2)
{
Interval<?> i1 = e1.getInterval();
Interval<?> i2 = e2.getInterval();
return ComparisonChain.start()
.compare(i1.getFrom(), i2.getFrom())
.compare(i1.getTo(), i2.getTo())
.compare(e1.getPayload(), e2.g... | 6 |
boolean validateMove(movePair movepr, Pair pr) {
Point src = movepr.src;
Point target = movepr.target;
boolean rightposition = false;
if (Math.abs(target.x-src.x)==Math.abs(pr.p) && Math.abs(target.y-src.y)==Math.abs(pr.q)) {
rightposition = true;
}
if (Math.abs(target.x-src.x)... | 7 |
public Object deepCopy() throws Exception
{
ByteArrayOutputStream bos = new ByteArrayOutputStream();
ObjectOutputStream oos = new ObjectOutputStream(bos);
oos.writeObject(this);
ByteArrayInputStream bis = new ByteArrayInputStream(bos.toByteArray());
ObjectInputStream ois = new ObjectInputStrea... | 0 |
public int decodeInteger(boolean implicit) throws Asn1Exception {
int retValue;
//
// There must be at least 2 bytes available
//
if (residualLength < 2)
throw new Asn1Exception("Attempt to read past end of stream");
//
// Validate the tag for an exp... | 8 |
@Override
protected Void doInBackground() throws Exception {
int hundred=pointsList.size();
setProgress(0);
for(int index=0;index<hundred;++index){
if (isCancelled())
return null;
List<Instance> tmpLst=new ArrayList<Instance>();
//Step 1 --> 4
Instance p=pointsList.get(index);
if(p.isClassed()... | 9 |
public static int getAnsiScale(int color) {
int space = 256/5;
if(color == 0) {
return 0;
}
if(color < space*1) {
return 1;
}
if( color > space*1 && color < space*2) {
return 2;
}
if( color > space*2 && color < s... | 9 |
protected void onAction(String sender, String login, String hostname, String target, String action) {} | 0 |
public Object execute(IEval aEval, IContext aCtx, Object[] aArgs)
throws CommandException
{
try
{
Object[] lArgs = aArgs;
if (argList != null)
{
lArgs = argList.guard(aArgs, aCtx);
}
if(argMapping != null)
... | 9 |
public void wrap(Calculation base, int id) {
List<Node> sublist = new ArrayList<>();
List<Node> exp = base.algorithm;
int bracketCheck = 0;
/* Cutting the thing.*/
while (exp.size() > id) {
Node node = exp.remove(id);
sublist.add(node);
if (node instanceof ControlNode) {
if (((ControlNode) no... | 9 |
@Override
public void close() {
if(status == STATUS_ALIVE){
try {
try {
if (serverSocket != null) socket.close();
} catch (IOException e) { e.printStackTrace(); }
try {
if (readStream != null) readStream.close();
} catch (IOException e) { e.printStackTrace(); }
try {
if... | 9 |
public void panic(EntityLiving el) {
if(el.left){
el.setRight(true);
}else
el.setLeft(true);
} | 1 |
public static void search_query(String[] query, String[] pages) {
StringBuilder re = new StringBuilder();
for (String q : query) {
re.append(q).append(".*");
}
Pattern pattern = Pattern.compile(re.toString());
int matchedCount = 0;
for (String page : pages)... | 3 |
public static boolean isBSTTwo(BinaryTreeNode root) {
if (root == null) {
return true;
}
if (root.leftChild != null) {
int leftMinValue = BinaryTreeMin.minValueRecursive(root.leftChild);
if (root.data < leftMinValue) {
return false;
}
}
if (root.rightChild != null) {
int righ... | 6 |
public String readTxtFileRangeRow(String filePath) {
StringBuilder contents;
contents = new StringBuilder();
try {
String encoding = "UTF-8";
// filePath = RecoverUserFromDbTask.class.getResource("/").getPath() + filePath;
File file = new File(filePath);
// ... | 7 |
public int updateFileSystemObject(Vector<Object> data) throws SoSimException {
// Update any file system item
FolderItem folder;
if (selectedObject.isFolder()) folder = selectedObject.getParent();
else folder = selectedObject.getFolder();
if (selectedObject.getParent() == null) throw new ... | 9 |
public String toStringf(){
//System.out.printf("\tMarker 1\n");
String str1 = toString();
String str2;
//System.out.println("\tMarker 2\tstr1 = "+str1);
int len = str1.length();
//System.out.printf("\tMarker 3\tlen = %d\n", len);
if (len>3){
// System.out.printf("\tMarker 4\n");
... | 1 |
@Override
public void mouseMoved(MouseEvent arg0) {
int x = arg0.getX();
int y = arg0.getY();
if(x>XPAINT && x<XPAINT+WIDTH && y>YPAINT && y<YPAINT+HEIGHT){
if((x-XPAINT)/32!=current_abscisse || (y-YPAINT)/32!=current_ordonnee){
repaint(XPAINT+current_abscisse*32,... | 6 |
public void unionIn(PostingsList other) {
// Don't do anything if other has no elements
if (other.size() == 0) {
return;
}
Node<Posting> meCur = this.getHeadNode(), meNext = meCur.next;
Node<Posting> them = other.getHeadNode().next;
while (them != null) {
if (meCur != this.getHeadNode() &&
them.v... | 8 |
public Wave31(){
super();
MobBuilder m = super.mobBuilder;
for(int i = 0; i < 1100; i++){
if(i % 27 == 0)
add(m.buildMob(MobID.TENTACRUEL));
else if(i % 5 == 0)
add(m.buildMob(MobID.TENTACOOL));
else if(i % 4 == 0)
add(m.buildMob(MobID.SHELLDER));
else if(i % 3 == 0)
add(m.buildMob(Mob... | 6 |
@Override
public void keyPressed(KeyEvent e) {
traceKeyEvents(e);
switch (e.getKeyCode()) {
case KeyEvent.VK_LEFT:
case KeyEvent.VK_NUMPAD4:
case KeyEvent.VK_A:
deltaX--;
xPosition = xPosition + deltaX;
if (xPositio... | 8 |
public final void sendMessage(Message msg) {
System.out.println("============== Sending Msg ==================" );
try {
byte[] buffer = new byte[1024];
DatagramPacket packet = new DatagramPacket(buffer, buffer.length, multicastAddre, 4446);
... | 2 |
public void printListForwards() {
if (next != null) {
System.out.println(this.getData());
next.printListForwards();
} else {
System.out.println(this.getData());
}
} | 1 |
@Override
public boolean isValidObject(){
if(lines.size() == 3){
String begin = lines.get(0);
String middle = lines.get(1);
String end =lines.get(2);
return (begin.startsWith(SECTION_SEP) && end.startsWith(SECTION_SEP) && isValidSectionNumber(middle))
|| (begin.startsWith(SUBSECTION_SEP) && e... | 9 |
@Test
public void requestCreation() {
TeleSignRequest tr;
if(!timeouts && !isHttpsProtocolSet)
tr = new TeleSignRequest("https://rest.telesign.com", "/v1/phoneid/standard/15551234567", "GET", "customer_id", "secret_key");
else if(timeouts && !isHttpsProtocolSet)
tr = new TeleSignRequest("https://rest.teles... | 6 |
public static String doubleToString(double d) {
if (Double.isInfinite(d) || Double.isNaN(d)) {
return "null";
}
// Shave off trailing zeros and decimal point, if possible.
String string = Double.toString(d);
if (string.indexOf('.') > 0 && string.indexOf('e') < 0 &&
... | 7 |
private void btnguardarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnguardarActionPerformed
String nombre="", precio="", descripcion="", nombrev="", status="A", status2="", sSQL="", sSQL2="";
nombre=txtnombre.getText();
precio=txtprecio.getText();
descripcion=... | 8 |
public void changeArrayProperties(boolean clear){
boolean go = true;
JTextField field1 = new JTextField(EditorWindow.panel.editor.getTileBuffer().getMap().getCols()+"");
JTextField field2 = new JTextField(EditorWindow.panel.editor.getTileBuffer().getMap().getRows()+"");
JPanel panel = ne... | 7 |
private static String getVariableTypeFromName(String name) {
for (VariableInformation var : variableList)
if (var.name.equals(name))
return var.type;
if (name.equals("inf") || name.equals("-inf") || name.equals("nullity"))
return "transreal";
return "unknown";
} | 5 |
private void resetImageGeometry() {
this.imgHeight = -1;
this.imgWidth = -1;
this.imgBitsPerPixel = -1;
this.imgIndexedColors = 0;
} | 0 |
@Override
public int attack(NPC npc, Entity target) {
final NPCCombatDefinitions defs = npc.getCombatDefinitions();
int distanceX = target.getX() - npc.getX();
int distanceY = target.getY() - npc.getY();
int size = npc.getSize();
int hit = 0;
int attackStyle = Utils.random(2);
if (attackStyle == 0 && (di... | 7 |
private static void println(String msg) {
if (AzotConfig.GLOBAL.VERBOSE) {
System.out.println(msg);
}
} | 1 |
public boolean accountExists(String name) {
for (Account a : accounts) {
if (a.owner.equals(name)) {
return true;
}
}
return false;
} | 2 |
private void doClick(int xVal, int yVal, boolean leftClick, boolean rightClick,MouseEvent e){
int columnIndex = determineColumn(xVal);
int rowIndex = determineRow(yVal);
if(rowIndex == -1 && columnIndex != -1){
updateController(rowIndex, columnIndex);
}
// br... | 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.