text stringlengths 14 410k | label int32 0 9 |
|---|---|
@Override
public void happens() {
for (Character characterChecking : Game.getInstance().getCharacters()) {
if (characterChecking.getCurrentRoom().getFloor() == Floor_Name.BASEMENT) {
int rollResult = characterChecking.getTraitRoll(Trait.SANITY);
if (rollResult >= 1 && rollResult <= 3){
Trait chosenT... | 7 |
private void updateStateEntry(List<Keyword> keywords, List<String> terms) {
//Either jumped due to RecipeName passed, or no Recipe could be found
if (keywords == null || keywords.isEmpty()) {
if (terms != null && !terms.isEmpty()) {
recipeName = terms.get(0);
getCurrentDialogState().setCurrentState(RecipeAssi... | 9 |
public void join() {
if (!isOnline) {
isOnline = true;
System.out.println("Input IP-address of active node");
System.out.println("If it is the first online node input 127.0.0.1");
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
... | 7 |
@Test
public void test() {
// 00000000 00000001 11111111
String data = "Hello World!";
// SO: junit-how-to-simulate-system-in-testing
InputStream stdin = System.in;
try {
System.setIn(new ByteArrayInputStream(data.getBytes()));
RunLength.compress();
} finally {
S... | 0 |
public void testConstructor_ObjectStringEx5() throws Throwable {
try {
new LocalDateTime("10:20:30.040");
fail();
} catch (IllegalArgumentException ex) {}
} | 1 |
private int findRec(){
int i = TLTa_table.getSelectedRow();
int x;
for (x = 0; i>0; x++){
i = i - patient.getTreatmentRec(x).getTreatmentSize();
if (i<0)
x--;
}
return x;
} | 2 |
public void fusionWithHardLightFullAlpha(CPLayer fusion, CPRect rc) {
CPRect rect = new CPRect(0, 0, width, height);
rect.clip(rc);
for (int j = rect.top; j < rect.bottom; j++) {
int off = rect.left + j * width;
for (int i = rect.left; i < rect.right; i++, off++) {
int color1 = data[off];
int alpha... | 7 |
public GoTerm rootNode() {
if( (parents == null) || parents.isEmpty() ) return this;
return parents.iterator().next().rootNode();
} | 2 |
public void setNum(String num) {
this.num = num;
} | 0 |
public void run(){
while(loop());
new read("deletePlayer;"+gameTag+";",ID).start();
} | 4 |
public double[] getBulkConcns(){
if(!this.psi0set && !this.sigmaSet)throw new IllegalArgumentException("Neither a surface potential nor a surface charge/density have been entered");
if(this.sigmaSet && !this.psi0set)this.getSurfacePotential();
if(this.psi0set && !this.sigmaSet)this.getSurfaceCha... | 7 |
@Test
public void hahmoEiPaaseVasemmallaPuolellaOlevastaEsteestaLapi() {
laitetaasPariEstetta();
for (int i = 0; i < 100; i++) {
pe.liikuVasemmalle();
}
assertTrue("Hahmo pääsi seinästä läpi vasemmalle paahtaessaan. x = "
+ pe.getX(), pe.getX() > 0);
... | 1 |
private int binarysearch(int[] arr,int target,int b, int e)
{
if (b >= e) return -1;
if (b == e - 1)
if (arr[b] == target) return b;
else return -1;
int mid = (b + e) /2;
if (arr[mid] == target) return mid;
if (arr[mid] > target) return binarysearch(arr, target, b, mid);
return binarysearch(arr, t... | 5 |
@Override
public String textAendern(String text) {
if (text == null) {
return "";
}
ArrayList<Integer> spaces = new ArrayList<>();
StringBuilder buffer = new StringBuilder();
//Position der Spaces in eine ArrayList schreiben
//und aus dem String entfern... | 6 |
private void dropLink() throws Exception {
Session s = HibernateUtil.getSessionFactory().getCurrentSession();
try {
ObjectInputStream ois = new ObjectInputStream(socket.getInputStream());
Object obj = ois.readObject();
if(obj instanceof Link) {
s.beginTransaction();
s.delete(obj);... | 3 |
public void open(final InputStream is, final OutputStream os)
throws BITalinoException {
try {
socket = new BITalinoSocket(new DataInputStream(is), os);
Thread.sleep(SLEEP);
} catch (Exception e) {
e.printStackTrace(System.err);
close();
... | 6 |
static String stripAccess(String newClass) {
// loop until all the known access flags are stripped
boolean flag = true;
while (flag) {
flag = false;
for (int i = 0; i < accessStrings.length; i++) {
String s = accessStrings[i][0];
if (newClass.substring(0, s.le... | 4 |
public Beverage makeBeverage(String beverageType) {
Beverage beverage = null;
if (beverageType.equalsIgnoreCase("Coffee")) {
beverage = new Coffee();
} else if (beverageType.equalsIgnoreCase("Tea")) {
beverage = new Tea();
} else if (beverageType.equalsIgnoreCase("Lemonade")) {
beverage = new Lemonade(... | 3 |
public Complex Newt(Complex z, double i, double j, int mode) {
if (mode == 1) {
return z.sub(UnityFunction(z, i, j).div(UnityDerivative(z, i, j)));
} else if (mode == 2) {
return z.sub(Poly2Function(z, i, j).div(Poly2Derivative(z, i, j)));
} else if (mode == 3) {
return z.sub(DivZ2Function(z, i, j).div(D... | 5 |
private void hideFile() {
if (stegoImg == null) {
((StegoHide)getTopLevelAncestor()).showErrorMessage("Please select a cover image!");
return;
}
int seedValue;
try {
seedValue = Integer.parseInt(seed.getText());
} catch(NumberFormatException ex) {
((StegoHide)getTopLevelAncestor()).showErrorM... | 7 |
public static long[] euclideEtendu(long x, long y) {
if (x <= 1 || y <= 1) throw new IllegalArgumentException();
long r, q, xTemp, yTemp,
x0 = 1, x1 = 0,
y0 = 0, y1 = 1;
while (y != 0) {
r = x % y;
q = x / y;
x = y; y = r;
... | 3 |
public void put(String cod_competicao, String cod_jogador) {
try (Statement stm = conn.createStatement()) {
int i = stm.executeUpdate("Update Marcadores set Cod_Competicao='" + cod_competicao + "',cod_jogador='" + cod_jogador + "',Golo=to_number('0') WHERE Cod_competicao='" + cod_competicao + "'an... | 2 |
@Override
public void connected(ConnectedEvent e) {
} | 0 |
public boolean getStudentByUniqueId(IssueBookVO issueBookVO)
throws LibraryManagementException {
boolean returnValue = true;
ConnectionFactory connectionFactory = new ConnectionFactory();
Connection connection;
try {
connection = connectionFactory.getConnection();
} catch (LibraryManagementException e)... | 5 |
*/
public String getConfig() {
StringBuilder buffer = new StringBuilder();
int count = mModel.getColumnCount();
buffer.append(OutlineModel.CONFIG_VERSION);
buffer.append('\t');
buffer.append(count);
for (int i = 0; i < count; i++) {
Column column = mModel.getColumnAtIndex(i);
buffer.append('\t');
... | 1 |
public int calculerGain() {
int gains = 0;
Iterator<Territoire> it = this.territoiresOccupes.iterator();
// Calcul des gains pour chaque territoire
while (it.hasNext()) {
Territoire t = it.next();
gains += 1 + this.bonusGain(t) + t.bonusGain();
if (hasPower()) {
gains += this.pouvoir.... | 2 |
@Override
public void onEntityTarget(EntityTargetEvent event) {
if (event.isCancelled()) {
return;
}
if (!(event.getTarget() instanceof Player)) {
return;
}
Player player = (Player) event.getTarget();
if (player.getGameMode().equals(GameMode.CR... | 5 |
@Test
public void readWorks() throws IOException {
ConnectMessage msg = new ConnectMessage("test", true, 10000);
msg.setCredentials("username", "password");
msg.setWill("/will/topic", "this is will message", QoS.EXACTLY_ONCE,
true);
byte[] data = msg.toBytes();
MessageInputStream is = new MessageInputStr... | 1 |
public static void read() throws Exception {
synchronized (SystemProperty.class) {
if (instance == null) {
instance = new SystemProperty();
}
}
// Map作成
if (prop != null) {
prop.clear();
prop = null;
}
prop = new HashMap<String, List<String>>();
// ドキュメントビルダーファクトリを生成
Document... | 5 |
public static void run()
{
System.out.println("--|Basic Usage|--------------------------------------------------------------");
System.out.println("Some simple uses of the hat container");
// put some data into a hat and then get a random item
String[] names = {"Alice", "Betty", "Celia", "Darcy"};
Hat<Str... | 4 |
public static Node inorderSuccessor(Node root,int val)
{
if(root!=null)
{
if(root.data==val)
{
if(root.right!=null)
{
return minValue(root.right);
}
else
{
return maxAncestor;
}
}
else if(root.data<val)
{
return inorderSuccessor(root.right, val);
}
else
{
maxA... | 4 |
@Basic
@Column(name = "SOL_FECHA_HASTA")
public Date getSolFechaHasta() {
return solFechaHasta;
} | 0 |
public FiilContactFormParameter(String nameF, String nameL, String address,
String phoneH, String phoneM, String phoneW, String email1,
String email2, String bday, String bmonth, String byear,
String address2) {
this.nameF = nameF;
this.nameL = nameL;
this.address = address;
this.phoneH = phoneH;
thi... | 0 |
private static void doHelpTest()
{
String[] args0 = { "-h" };
String[] args1 = { "-h","add"};
String[] args2 = { "-h","archive"};
String[] args3 = { "-h","compare"};
String[] args4 = { "-h","create"};
String[] args5 = { "-h","delete"};
String[] args6 = { "-h","description"};
String[] args7 = { "-h","ex... | 3 |
Object invoke(Object target, Object[] args)
{
Method method = method();
try {
try {
return method.invoke(target, args);
} catch (IllegalAccessException ex) {
Method accessible = searchAccessibleMethod(method, argTypes);
if (acce... | 7 |
public void setModelValue(Object obj) throws YException {
if (obj == null) {
this.setSelectedIndex(-1);
} else {
// searching corresponding item in list:
if (items == null) {
throw new YException("List model for YList is not set.");
} else {
for (i... | 6 |
public BitTorrentMessage receiveMessage () throws IOException {
try {
// Message length
inputBuffer.clear().limit(4);
while (inputBuffer.remaining() > 0) {
channel.read(inputBuffer);
}
inputBuffer.flip();
int length = inputB... | 3 |
static private final int jjMoveStringLiteralDfa14_0(long old0, long active0)
{
if (((active0 &= old0)) == 0L)
return jjStartNfa_0(12, old0);
try { curChar = input_stream.readChar(); }
catch(java.io.IOException e) {
jjStopStringLiteralDfa_0(13, active0);
return 14;
}
switch(curChar)
... | 7 |
public void sort(List <T> values) {
// Check for empty or null array
if (values ==null || values.size()==0){
return;
}
this.values = values;
number = values.size();
quicksort(0, number - 1);
} | 2 |
private String findElement(String response, String elementTag, String elementTypeLink, String elementName) throws InvalidObjectException, ConnectorException {
Document doc = RestClient.stringToXmlDocument(response);
NodeList list = doc.getElementsByTagName(elementTag);
for(int i=0; i < list.getLength();i++){
... | 6 |
public static boolean implementsInterfaceIncludingSuper(Class<?> implementor, Class<?> interf)
{
List<Class<?>> interfaces = getAllInterfacesIncludingSuper(implementor);
for (Class<?> intf : interfaces)
{
if (intf.equals(interf))
{
return true;
}
}
return false;
} | 6 |
public boolean removeByKey(String tableName, String key) throws DataBaseTableException {
Table table = tableHashMap.get(tableName);
if (table == null) {
throw new DataBaseTableException("no such table");
}
return table.remove(key);
} | 1 |
public void start() {
server = new Server();
server.setPort(port);
server.setNoSystemExit(true);
server.setDatabasePath(0, path);
server.setDatabaseName(0, name);
server.setErrWriter(new PrintWriter(System.out));
server.setLogWriter(new PrintWriter(System.out));
server.setSilent(true);
server.setTrace... | 4 |
/** @param scrollTo The row index to scroll to. */
protected void keyScroll(int scrollTo) {
Outline real = getRealOutline();
if (!keyScrollInternal(real, scrollTo)) {
for (OutlineProxy proxy : real.mProxies) {
if (keyScrollInternal(proxy, scrollTo)) {
break;
}
}
}
} | 3 |
public boolean setPituus(double pituus){
if (pituus > minPituus){
this.pituus = pituus;
paivitaMinMax();
return true;
} else {
return false;
}
} | 1 |
public String buscaLogin(String login, String pass) {
String res = "error";
Statement statement;
ResultSet resultSet;
try {
Connection con = DriverManager.getConnection(connectString, user, password);
statement = con.createStatement();
resultSet = sta... | 2 |
static void getCommand(int blocks, int bytesPerBlock, String filename) throws IOException {
BufferedReader r = new BufferedReader(new FileReader(filename));
//StringTokenizer token = new StringTokenizer(r.readLine());
FileManager file = new FileManager(blocks, bytesPerBlock);
String storageName;
int ... | 8 |
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + id;
result = prime * result + ((nome == null) ? 0 : nome.hashCode());
result = prime * result + ((obs == null) ? 0 : obs.hashCode());
long temp;
temp = Double.doubleToLongBits(preco);
result = prime * resu... | 2 |
@Override
protected DataSet doParse() {
try {
lineCount = 0;
return doDelimitedFile(getDataSourceReader(), shouldCreateMDFromFile());
} catch (final IOException e) {
LOGGER.error("error accessing/creating inputstream", e);
}
return null;
} | 1 |
public void playFirework(World world, Location loc, FireworkEffect fe) throws Exception {
// Bukkity load (CraftFirework)
Firework fw = (Firework) world.spawn(loc, Firework.class);
// the net.minecraft.server.World
Object nms_world = null;
... | 2 |
@Override
public boolean verifier() throws SemantiqueException {
//Dans le cas où il y aurait d'autres methodes verifier pouvant retourner false
/*if(value instanceof Identificateur){
if(!((Identificateur) value).verifier())
GestionnaireSemantique.getInstance().add(new Se... | 2 |
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Tuple tuple = (Tuple) o;
if (first != null ? !first.equals(tuple.first) : tuple.first != null) return false;
if (second != null ? !second.equal... | 7 |
public int numUpgrades() {
if (upgrades == null) return 0 ;
int num = 0 ;
for (int i = 0 ; i < upgrades.length ; i++) {
if (upgrades[i] == null || upgradeStates[i] != STATE_INTACT) continue ;
num++ ;
}
return num ;
} | 4 |
@Override
public void deleteIngredient(int index) {
for(int i = 0; i<ingredientRepository.size(); i++){
if(ingredientRepository.get(i).getIngredientId() == index){
ingredientRepository.remove(i);
return;
}
}
} | 2 |
private Field filterFields(Field[] fields, Class type) throws /*NoSuchFieldException,*/ TooManyMatchesException
{
ArrayList<Field> list = new ArrayList<Field>();
for(Field f : fields)
{
if(!f.getType().equals(type))
{
continue;
}
... | 5 |
public String toString() {
String result = "Runs from: " + m_RunLower + " to: " + m_RunUpper + '\n';
result += "Datasets:";
for (int i = 0; i < m_Datasets.size(); i ++) {
result += " " + m_Datasets.elementAt(i);
}
result += '\n';
result += "Custom property iterator: "
+ (m_UseProper... | 9 |
private void btn_aceptarActionPerformed(java.awt.event.ActionEvent evt) {
if (lab_modo.getText().equals("Alta")){
if (camposCompletos()){
if (validarFechas()){
ocultar_Msj();
insertar();
... | 9 |
protected void extendToString(StringBuffer buffer) {
if (hasConstructor)
buffer.append("hasConstructor ");
super.extendToString(buffer);
} | 1 |
private void processOffScreen(String offScreenString){
String[] gameObjects = offScreenString.split("#");
//Object data contains two fields: type, number of the object
for(int i = 1; i < gameObjects.length; i++){
ArrayList<String> objectData = processOffScreenObject(gameObjects[i]);
String type = obje... | 8 |
public Cuboid expand(CuboidDirection dir, int amount) {
switch (dir) {
case North:
return new Cuboid(this.worldName, this.x1 - amount, this.y1, this.z1, this.x2, this.y2, this.z2);
case South:
return new Cuboid(this.worldNam... | 6 |
@Override
public synchronized int read() throws IOException
{
if (bsize == 0) return -1;
int returnValue = buffer[offset];
if (bsize == buffer.length)
{
int read = in.read();
if (read != -1)
buffer[offset] = (byte) read;
else --bsize;
} else {
--bsize;
}
offset = (++offset) % buffer.leng... | 3 |
@Override
public void run() {
try {
report("checking cache", 1); // same as in GetPageJob before trying to read cache;
if (page.loadFromCache()) {
report("read from cache", 1); // same as in GetPageJob on successful reading cache;
//note: this iterator does not require locking because of CopyOnWriteArr... | 3 |
public static boolean endsWithIgnoreCase(String s,String w)
{
if (w==null)
return true;
int sl=s.length();
int wl=w.length();
if (s==null || sl<wl)
return false;
for (int i=wl;i-->0;)
{
char c1=s.charAt(--... | 8 |
private boolean r_prelude() {
int among_var;
int v_1;
// repeat, line 36
replab0: while(true)
{
v_1 = cursor;
lab1: do {
// (, line 36
... | 8 |
@Execute
public void execute() {
for (int a = 0; a < 100000; a++) {
est_coeff = p1 * 1.2;
estimate = p2 + p2 + p3;
double d = Math.atan2(1.0666, 3.45);
d = Math.sin(1.0666);
}
} | 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 Grupo)) {
return false;
}
Grupo other = (Grupo) object;
if ((this.codgrupo == null && other.codgrupo != null) |... | 5 |
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 |
@Override
protected boolean perform(final CommandSender sender, final Command command, final String label, final List<String> args, final Region region) {
String owner = RegionExecutor.parse(args, 0, "<Owner>", sender);
if (owner == null) return false;
// Do not allow an owner to remove the... | 3 |
private static void createGridResource(String name, int totalMachine,
int totalPE, double bandwidth, int[] peRating,
int policy, double cost)
{
// Here are the steps needed to create a Grid resource:
// 1. We need to create an object of Mac... | 3 |
private Set<VehiclePart> findConnectedFuelTanks(final VehiclePart engine) {
final Set<VehiclePart> connectedParts = new HashSet<>();
final Set<VehiclePart> scanned = new HashSet<>();
final Deque<VehiclePart> parts = new ArrayDeque<>();
parts.add(engine);
scanned.add(engine);
... | 9 |
public static Attributed readAttrs(Reader source) throws IOException{
StreamTokenizer in = new StreamTokenizer(source);
AttributedImpl attrs = new AttributedImpl();
Attr attr = null;
in.commentChar('#');
in.ordinaryChar('/');
while(in.nextToken() != StreamTokenizer.TT_EOF){
if(in.ttype == StreamTokenizer... | 6 |
public News[] LoadNews(){
News[] res = null;
try{
File xmlFile = new File(xmlFileName);
DocumentBuilderFactory dFactory = DocumentBuilderFactory.newInstance();
DocumentBuilder xmlBulder = dFactory.newDocumentBuilder();
Document doc;
doc = xmlBulder.parse(xmlFile);
NodeList items = doc.getElementsB... | 9 |
public void run() {
NPC cat = spiceLooter.getCat();
if (cat.interact("Interact-with", cat.getName())) {
int time = 0;
while (!chaseVermin.validate() && time <= 3000) {
time += 50;
Time.sleep(50);
}
}
if (chaseVermin.validate() && chaseVermin.click(true)) {
int time = 0;
while (!cat.isMovi... | 7 |
@SuppressWarnings("static-access")
private void ROUND4() {
enemises.clear();
System.out.println("Round4!!!!!!");
for (int i = 0; i < level.getWidth(); i++) {
for (int j = 0; j < level.getHeight(); j++) {
if ((level.getPixel(i, j) & 0x0000FF) == 2) {
... | 3 |
public String buscarProspectoPorTelefono(String telefono){
//##########################CARGA_BASE DE DATOS#############
tablaDeProspectos();
//##########################INGRESO_VACIO###################
if(telefono.equals("")){
telefono = "No busque nada";
... | 5 |
@Override
public boolean equals(Object obj) {
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final JHeader other = (JHeader) obj;
if (!Objects.equals(this.IdOrder, other.IdOrder)) {
return fal... | 3 |
public String getAmount() {
return amount;
} | 0 |
private Set<String> complete(final String cmd) {
final Set<String> set = new HashSet<>();
for (final String s : commandMap.keySet()) {
if (s.startsWith(cmd)) {
set.add(s);
}
}
for (final String s : helpCommands.keySet()) {
if (s == null) {
if ("help".startsWith(cmd)) {
set.add("help");
... | 6 |
public void save() throws IOException {
try {
this.mutex.acquire();
// On enregistre le fichier
FileWriter fw = new FileWriter(XML_PATH, false);
BufferedWriter bw = new BufferedWriter(fw);
bw.write("<?xml version=\"1.0\"?>");
bw.newLine()... | 2 |
public Flip(int random, int s1, int s2) {
this.random = random;
this.state1 = s1;
this.state2 = s2;
} | 0 |
@Test
public void containsReturnsCorrectly() {
for (int i = 0; i < 5; i++) {
l.insert(v);
}
l.insert(a);
for (int i = 0; i < 5; i++) {
l.insert(v);
}
assertTrue(l.contains(a));
assertFalse(l.contains(b));
} | 2 |
@Override
public void assign(final Assignment<? extends Item> assignment) throws NullPointerException, IllegalArgumentException {
if (assignment == null) throw new NullPointerException("assignment = null");
final Item value = assignment.value();
if (value == null) throw new IllegalArgumentException("value = null... | 6 |
public static void showBoards(BoardGen bg)
{
n = bg.getBoardNum();
System.out.println("Board " + n + ": ");
for(int x = 1; x < b.length; x++)
{
for(int y = 1; y < b[x].length; y++)
{
System.out.print(b[x][y] + " ");
}
System.out.println();
}
System.out.println("\nBoard " + n + ": ");
... | 5 |
public InetAddress[] getValueAsInetAddrs() throws IllegalArgumentException {
if (!isOptionAsInetAddrs(code)) {
throw new IllegalArgumentException("DHCP option type ("+ this.code +") is not InetAddr[]");
}
if (this.value == null) {
throw new IllegalStateException("value is nu... | 5 |
@SuppressWarnings("unchecked")
public static Map<String, Object> parseMap(String json) {
ObjectMapper mapper = new ObjectMapper();
JsonFactory factory = mapper.getFactory();
JsonParser jp = null;
Map<String, Object> result = null;
try {
jp = factory.createParser(json);
result = jp.readValueAs(HashMap.c... | 3 |
public List<String> getStringListFromString(String xArg)
{
if (xArg == null || xArg.equalsIgnoreCase(""))
return null;
List<String> d = new ArrayList<String>();
char[] c = xArg.toCharArray();
int lastPos = 0;
for (int i = 0; i < c.length; i++)
{
if (c[i] == ',')
{
d.add(returnMergedChara... | 4 |
public String getTypeSignature() {
switch (((IntegerType) getHint()).possTypes) {
case IT_Z:
return "Z";
case IT_C:
return "C";
case IT_B:
return "B";
case IT_S:
return "S";
case IT_I:
default:
return "I";
}
} | 5 |
@Override
public void agisci(Parco parco) {
if (this.isMorto()) {
parco.eliminaAnimale(this);
return;
}
this.riproduci(parco);
Posizione nuovaPosizione;
Animale roditore;
roditore = trovaRoditore(parco);
if (roditore != null) {
this.incrementaCibo(1);
parco.eliminaAnimale(roditore);
nuova... | 4 |
public static int get() {
return value.get();
} | 0 |
void radf2(int ido, int l1, final double cc[], double ch[],
final double wtable[], int offset)
{
int i, k, ic;
double ti2, tr2;
int iw1;
iw1 = offset;
for(k=0; k<l1; k++)
{
ch[2*k*ido]=cc[k*ido]+cc[(k+l1)*ido];
c... | 7 |
public void temporizador() throws SQLException {
System.out.println("1");
long start = System.currentTimeMillis();
long aux = start;
while (true) {
long end = System.currentTimeMillis();
long res = end - start;
if (aux != end) {
aux = e... | 8 |
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
@SuppressWarnings("unchecked")
Range<T> other = (Range<T>) obj;
if (max == null) {
if (other.max != null)
return false;
} else if (!ma... | 9 |
@AfterClass
public static void afterClass() throws Exception {
File file = new File(VALID_FILE);
if (!file.delete()) {
throw new Exception("Finished testing for routing table persistency" +
"and trying to cleanup resources used, " +
"but for some r... | 4 |
public void addParticleSprite(String spriteName, BufferedImage spriteImage) {
if (spriteName == null || spriteImage == null) {
throw new IllegalArgumentException("Cannot add a null sprite!");
}
particleSprites.put(spriteName, spriteImage);
} | 2 |
public static void checkCache(double[] cache, double[] read) {
boolean error = false;
if (cache.length != read.length) {
System.out.println("\tERROR: Cache array length difference : cache length = " + cache.length
+ "\t obsval length = " + read.length);
error... | 5 |
public Query handleInsertStatement(ZInsert s, TransactionId tId)
throws TransactionAbortedException, DbException, IOException,
simpledb.ParsingException, Zql.ParseException {
int tableId;
try {
tableId = Database.getCatalog().getTableId(s.getTable()); // will
... | 9 |
public boolean isConstant() {
for (int i = 0; i < subExpressions.length; i++)
if (!subExpressions[i].isConstant())
return false;
return true;
} | 2 |
public CrossingStructure findPath(Crossing start, Crossing end, int limit) {
closedList = new ArrayList<CrossingStructure>();
openList = new ArrayList<CrossingStructure>();
CrossingStructure current = new CrossingStructure(start, null);
current.setgScore(0).sethScore( heuristic.calculat... | 9 |
public static SwingDrawer createSwingDrawer( Drawable drawable )
{
if ( drawable instanceof Cheese )
return new SwingDrawerCheese();
else if ( drawable instanceof Door )
return new SwingDrawerDoor( (Door)drawable );
else if ( drawable instanceof Floor )
return new SwingDrawerFloor();
else if ( drawabl... | 6 |
private void onLoad(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_onLoad
toggler.setState(false);
chooser.showOpenDialog(this);
if (chooser.getSelectedFile() != null) {
try (DataInputStream dis = new DataInputStream(new FileInputStream(chooser.getSelectedFile()))) {
... | 5 |
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.