text stringlengths 14 410k | label int32 0 9 |
|---|---|
public Double getDouble(String key)
{
Object val = get(key);
if (val == null)
return null;
else if (val instanceof Double)
return (Double)val;
else
return ((Integer)val).doubleValue();
} | 2 |
public static Class<?> wrapperEquivalentOf(Class<?> aClass)
{
Iterator<Map.Entry<Class<?>, Class<?>>> it = objectToPrimitiveMap
.entrySet().iterator();
while (it.hasNext())
{
Map.Entry<Class<?>, Class<?>> entry = it.next();
if (aClass.equals(entry.getValue()))
return (Class<?>) entry.getKey();
}
... | 9 |
public double score(StringWrapper s0, StringWrapper t0) {
SourcedStringWrapper s = (SourcedStringWrapper)s0;
SourcedStringWrapper t = (SourcedStringWrapper)t0;
checkTrainingHasHappened(s, t);
UnitVector sBag = asUnitVector(s);
UnitVector tBag = asUnitVector(t);
List<Simil... | 6 |
public void run() {
try {
while (isMultiplayerGame()) {
int id = inputStream.readInt();
IPacket packet = PacketList.instance.getPacketFromID(id);
if (packet != null){
if (!packet.isServerPacket() || packet.isClientPacket()){
... | 5 |
private void connectToFtpServer() {
FTPClient client = new FTPClient();
try {
client.connect("ftp.site.com");
boolean login = client.login("username", "password");
if (login) {
System.out.println("Connection established...");
// Try to ... | 4 |
public AbstractPlay get(int number) {
return plays.get(number);
} | 0 |
public void paintElement() {
this.addMouseListener(new MouseAdapter() {
public void mousePressed(MouseEvent e) {
switch (sItem) {
case rect:
currentObject = new Rectangle();
break;
case oval:
currentObject = new Oval();
break;
case polygon:
drawPolygon(e);
return;
... | 7 |
public void move(Direction d) {
int x = coord.getX();
int y = coord.getY();
switch(d) {
case NORTH:
coord.setY(y-1);
break;
case SOUTH:
... | 4 |
public boolean InsertarAfecta(Afecta p){
if (p!=null) {
cx.Insertar(p);
return true;
}else {
return false;
}
} | 1 |
public static String toHexString(String input) {
try {
byte[] bytes = input.getBytes(Torrent.BYTE_ENCODING);
return Torrent.byteArrayToHexString(bytes);
} catch (UnsupportedEncodingException uee) {
return null;
}
} | 1 |
@Override
public void act(){
Quest testQuest = player.questList.getQuest("TestQuest");
String speech;
if (testQuest == null) {
testQuest = new TestQuest(stateManager, player);
player.questList.add(testQuest);
testQuest.step = "Start";
}
if (testQuest.step.equal... | 5 |
public double GetCameraTime(int CameraIPIndex) {
if (Parent.GetNoCameraParameter()) {
return 0;
}
URLConnection conn = null;
BufferedReader data = null;
String line;
String result;
StringBuffer buf = new StringBuffer();
URL CommandURL = null;
... | 7 |
@Override
public ElementHandler createHandler(String name) {
if ("material".equals(name)) {
return new MaterialBuilder(context, new FinishCallback<Material>() {
@Override
public void handle(Material value) {
SceneObjectsBuilder.this.context.pu... | 9 |
public long set(int desde, int hasta, long newValue) {
if(flag)
propagar(setValue);
if(desde==cotaDesde&&hasta==cotaHasta) {
propagar(newValue);
}
else {
if(izq!=null&&izq.cotaDesde<=desde&&izq.cotaHasta>=hasta) {
//CHANGE FUNCTION
value=izq.set(desde, hasta, newValue)+der.get(der.cota... | 9 |
public int canCompleteCircuit(int[] gas, int[] cost) {
if (gas == null || cost == null || gas.length == 0 || cost.length == 0 || gas.length != cost.length) {
return -1;
}
//sum after reach every station
int sum = 0;
//start position, will be change later if possible
... | 8 |
public char squareContentSprite(final int x, final int y) {
char result;
final Pawn content = getSquareContent(x,y);
if (content == null) {
if (isBonusSquare(x, y)) {
result = '#';
} else
result = '.';
} else {
if (conte... | 3 |
* @param e
*/
public static void ride(Player p, Entity e) {
if (e instanceof Creature) {
((Creature) e).setTarget(null);
}
if (e.getType() == EntityType.ENDER_DRAGON) {
EnderDragon dr = (EnderDragon) e;
dr.setPassenger(p);
p.sendMessage(RideThaMob.cprefix + Lang._(LangType.RIDE_DRAGON));
return... | 6 |
public int hashCode() {
if (cachedHash != 0xdeadbeef)
return cachedHash;
int[] bounds = new int[2];
this.nonTrivial(bounds);
return cachedHash = buffer.substring(bounds[0], bounds[1]).hashCode();
} | 1 |
public static void main (String args[]) throws InterruptedException
{
int n = 50;
int timeMS = 10000;
boolean prio = true;
for (int i = 0; i < args.length; i++)
{
if (args[i].equals("-n"))
n = new Integer(args[++i]).intValue();
else if (args[i].equals("-p"))
prio = args[++i].charAt(0) != '0';
... | 8 |
public void Checkwhile(String cond){
if(new_flag==2){
current_register--;
}
new_flag=0;
current_label++;
TypeTable.put(current_register,current_element.E_type);
if(cond.equals("TRUE")){
AddOperation("STOR... | 9 |
private void helper() {
int N = r.nextInt(199) + 2;
List<Vertex> G = new ArrayList<Vertex>(N);
for (int i = 0; i < N; i++) {
G.add(new Vertex(i));
}
boolean[][] connected = new boolean[N][N];
int numEdges = r.nextInt(N * (N-1)+1);
for (int i = 0; i < ... | 9 |
public static String arrayToString(Double[][] array) {
String result = "";
int n = array.length;
result += n + "\n";
for (int i = 0; i < n; i++) {
for (int j = 0; j < n; j++) {
result += array[i][j];
if (j + 1 != n) {
result += ",";
}
}
result += "\n";
}
return result;
} | 3 |
public Location getFirstSquareNeighborLocation(int row, int col, int dist,
int id) {
for (int x = row - dist; x <= row + dist; x++) {
if (isInBounds(x)) {
for (int y = col - dist; y <= col + dist; y++) {
if (isInB... | 8 |
public void reproduce(PokemonTeam parent1, PokemonTeam parent2, int rankFit)
{
ArrayList<Pokemon> totalPokes = new ArrayList<Pokemon>();
for (int y =0; y< rankFit; y ++)
{
PokemonTeam child = new PokemonTeam();
child.removeAll2();
ArrayList<String> circum... | 4 |
@Override
public void keyReleased(KeyEvent keyEvent) {
if (keyEvent.getKeyCode() == KeyEvent.VK_P) {
bPausa = !bPausa;
}
if (keyEvent.getKeyCode() == KeyEvent.VK_I) {
if (!bInicio) {
bInicio = true;
sonSelect.play();
sonIntr... | 9 |
public void put(int key, int value) {
HashPrinter.tryPut(key, value);
/** Index that moves through array slots */
int runner = 0;
int hash = (key % table.length);
if (table[hash] == null) {
table[hash] = new Node(key, value);
HashPrinter.successfulInsertion(key, hash);
size++;
} else {
/... | 5 |
private String techLevel(int t) {
switch (t) {
case 0:
return "Pre-Agriculture";
case 1:
return "Agriculture";
case 2:
return "Medieval";
case 3:
return "Renaissance";
case 4:
... | 7 |
public void update(double dt, Snake[] snakes) {
timer += dt;
if (timer > PELLET_TIMER) {
generatePellet();
timer -= PELLET_TIMER;
}
for (int i = bullets.size()-1; i >= 0; i --) {
bullets.get(i).update(this, snakes, dt);
if (bullets.get(i).isFinished()) {
bullets.remove(i);
}
}
} | 3 |
public final void skipWS() {
byte ch;
while (pos < length) {
ch = src[pos];
if ((ch != 0x20) && (ch != 0x09) && (ch != 0x0A) && (ch != 0x0D) && (ch != 0x00)) {
break;
}
pos++;
}
} | 6 |
protected String removeSurroundingSpaces(String html) {
//remove spaces around provided tags
if(removeSurroundingSpaces != null) {
Pattern pattern;
if(removeSurroundingSpaces.equalsIgnoreCase(BLOCK_TAGS_MIN)) {
pattern = surroundingSpacesMinPattern;
} else if(removeSurroundingSpaces.equalsIgnoreCase(BL... | 5 |
@Override
public void onMessage(String channel, String message) {
if (_callbacks.containsKey(channel)) {
for (ClientEventCallback callback : _callbacks.get(channel)) {
callback.setMessage(channel, message);
_pool.execute(callback);
}
}
} | 2 |
public static void main(String[] args) throws Exception {
if (args.length < 1 || args.length > 2) {
System.out.println("[ERROR] Incorrect number arguments");
return;
}
if (args[0].equals("ArrayQueue")) {
if (args.length < 2 || args[1].equals("")) {
... | 8 |
public Resource getClosest(Point p) {
Resource resource = null;
Resource closestResource = null;
double closestDistance = 0;
try {
for (String key : resources.keySet()) {
resource = (Resource) resources.get(key);
double distance = p.distance(... | 4 |
private void actionOptimise()
{
Object[][] data = ((MyTableModel)(tableContainer.getTable().getModel())).getData();
if (data.length > 1 && mapScrollPane.isCreated())
{
ArrayList<House> houses = new ArrayList<House>();
for (int i = 0; i < data.length - 1; i++)
{
System.out.println(data[i][2]... | 7 |
@Test()
public void whiteBoxTestQuadTree() {
/* WHITE BOX QUADTREE TEST.
*
* We want to create a QuadTree with the following parameters:
* Length: 800.
* Number of QuadTrees: 16 (See below for ASCII 'art').
* Number of Points in each: (Check ASCII).
* T... | 3 |
public void locateAllSubTrees(Vertex v, double radius, double offSet) {
if (placedVertices.contains(root)) {
double angularSpan = (Double) v.getProp().obj;
int numberOfDivides = 1;
numberOfDivides = g.getOutDegree(v);
if (numberOfDivides == 0) {
re... | 8 |
public int getPreferredColumnWidth(TreeColumn column) {
Dimension size = column.calculatePreferredHeaderSize(this);
boolean isFirst = column == mColumns.get(0);
for (TreeRow row : new TreeRowViewIterator(this, mRoot.getChildren())) {
int width = column.calculatePreferredWidth(row);
if (isFirst) {
width ... | 3 |
public void store(String id) {
Ident ident = Yaka.tabident.chercheIdent(id);
if (ident != null) {// l'ident existe var_param_const
if (ident.isVar()) {// ident est une variable
int type = this.type.peek();
String t;
t = this.typeToString(type);
if (type == ident.getType()) {// teste si l'expressi... | 5 |
@SuppressWarnings("unchecked")
public static <K> ArrayList<K> getObjectArray(JSONArray jsonArray, Class<K> clazz)
{
K[] result = (K[]) Array.newInstance(clazz, jsonArray.length());
for (int i = 0; i < jsonArray.length(); i++) {
try {
result[i] = clazz.getConstructor(J... | 8 |
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
HandlerType that = (HandlerType) o;
if (event != null ? !event.equals(that.event) : that.event != null) return false;
i... | 8 |
public boolean addCommentToSpecificPost(Comment comment) {
{
/*
* function gets an POST ID of the specific comment we want to add and the user name
* we make sure to update the number of comments we have i that specific post
* we update also the number of posts this user have plus 1
* we save all t... | 3 |
public static void maxHeapify(int[] A, int i, int heapSize){
int left = i*2+1;
int right = left+1;
int largest = i;
if(left < heapSize && A[left] > A[i]){
largest = left;
}
if(right < heapSize && A[right] > A[largest]){
largest = right;
}
if(largest != i){
//exchange x and y
A[i] = A[... | 5 |
public static boolean canSell(String uid, String id, int amount) {
if(checkUserExistance(uid))
{
stocks = UserControl.getUserStock(uid);
if(!stocks.isEmpty())
{
if (stocks.containsKey(id)) {
if (stocks.get(id) >= amount) {
return true;
}
}
... | 4 |
public List<urlObj> parseH5Urls(selectObj selectObj, urlObj urlObj) throws IOException {
Document doc = Jsoup.connect(urlObj.getUrl()).get();
Elements elements = doc.select(selectObj.getDocumentSelect());
List<urlObj> list = new ArrayList<urlObj>();
System.out.println("Fetching : " + ur... | 4 |
public void subtractGold(int goldloss) {
gold -= goldloss;
if ( gold < 0)
gold = 0;
} | 1 |
public void consultar(String chave) {
int indice = chave.hashCode();
Nodo nodoAux = raiz;
while (nodoAux.indice != indice) {
if (indice > nodoAux.indice) {
if (nodoAux.direita.indice == indice) {
System.out.println("Pai: " +nodoAux.direita.pai.conteudo + "\r\n" + "Conteudo: "+ nodoA... | 5 |
public boolean Chk_RivalRate(String str){
boolean bl = false;
Integer num, len;
try{
bl = util.isNumric(str);
if (bl){
num = Integer.parseInt(str);
len = str.length();
if((util.isRange(num, 0, 10000) && util.isRange(len, 0, 4))){
bl = true;
}else{
bl = false;
}
... | 4 |
public static boolean CheckID (String s)
{ String [] tab=s.split ("");
if(tab.length==12 && "7".equals(tab[1]) && "0".equals(tab[2]) && "5".equals(tab[3]) &&"0".equals(tab[10])&& "1".equals(tab[11]))
{ System.out.println("ID correct");
return true;
}
else
{ System.out.println("ID incor... | 6 |
private void refreshTable() {
if (modelInventory.getRowCount() > 0) {
for (int i = modelInventory.getRowCount() - 1; i > -1; i--) {
modelInventory.removeRow(i);
}
}
try {
populateTable();
} catch (Throwable e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
} | 3 |
@Override
public void detectRelationships(Obituary obit) throws Exception {
List<List<Term>> sentences = extractor.tagEntities(obit);
for (List<Term> sentence : sentences) {
sentence = EntityUtils.combineEntities(sentence);
chunker.addBIOChunks(sentence);
tagSentence(sentence);
Tree tree = getTree(sent... | 9 |
private boolean HandleCreatureCommand(String s) {
if (s.matches("^attack \\S+ with \\S+$")) {
// attack (creature) with (item)
String []words = s.split(" ");
String creatureName = words[1];
String itemName = words[3];
if (! inventory.contains(itemName)) {
System.out.println("Bad Command");
retu... | 6 |
private static List<Shape> buscarParce(List<Shape> shapes){
List<Shape> shapeList = new ArrayList<Shape>();
for(Shape shape : shapes)
if (shape != null && shape instanceof ShapeParcela)
shapeList.add((ShapeParcela) shape);
return shapeList;
} | 3 |
private DBObject _create( List<String> path ){
Class c = null;
if ( _collection != null && _collection._objectClass != null){
if ( path == null || path.size() == 0 ){
c = _collection._objectClass;
}
else {
StringBuilder buf = new Stri... | 9 |
public void print_t37convert81(){
for (int i=0; i<t37convert81.length ; i++){
if (i==4||i==9||i==15||i==22||i==28||i==33||i==37) System.out.println();
System.out.print(t37convert81[i]+"\t");
}System.out.println();
} | 8 |
@Override
public void doLogic() {
if (inputList[0] == true || inputList[1] == true || inputList[2] == true || inputList[0] == true){
power = false;
} else {
power = true;
}
inputList[0] = false;
inputList[1] = false;
inputList[2] = false;
inputList[3] = false;
} | 4 |
public ArrayList<Spielfeld> schritte(){
ArrayList<Spielfeld> result = new ArrayList<>();
if(linkerN != null && linkerN != Rand) result.add(linkerN);
if(rechterN != null && rechterN != Rand) result.add(rechterN);
if(obererN != null && obererN != Rand) result.add(obererN);
if(untererN != null && untererN != Ran... | 8 |
private boolean r_verb_suffix() {
int among_var;
int v_1;
int v_2;
int v_3;
// setlimit, line 165
v_1 = limit - cursor;
// tomark, line 165
if (cursor < I_pV)
{
return false;
}
... | 9 |
@Override
public void keyPressed(KeyEvent ke) {
if(ke.getKeyChar() == 'c') {
lastTool = curTool;
curTool = 2;
} else if(ke.getKeyChar() == 'l') {
lastTool = curTool;
curTool = 3;
} else if(ke.getKeyChar() == 'f') {
lastTool = curTool;
curTool = 1;
} else if(ke.getKeyChar() == 'd') {
lastTo... | 8 |
@MCCommand(cmds = { "create" }, op = true, usage = PORT_CREATE)
public boolean portCreate(Player p, String name, String[] args)
{
Port port = pc.getPort(name);
if (port != null)
{
return sendMessage(p,
"&4There is already a port with that name. Please pick a unique name.");
}
Selection sel = wep.get... | 7 |
public static boolean isBorderLegal(int width, int height) {
if (width < 11 && width > 6 && height > 6 && height < 11) {
return true;
} else {
return false;
}
} | 4 |
@Override
protected void setAttrs(Post model, PreparedStatement stmt) throws SQLException {
if (model.getTitle() == null) {
stmt.setNull(1, java.sql.Types.CHAR);
} else {
stmt.setString(1, model.getTitle());
}
if (model.getPostedAtMillis() == null) {
stmt.setNull(2, java.sql.Types.DA... | 4 |
public void run() {
while (true) { // sempre esperando
if (waiting) {
try {
int myColor;
int itsColor = Piece.cNeutral;
serverSocket = new ServerSocket(waitingPort);
socket = serverSocket.accept();
client.writeMessage(3, "INFO: \"" + socket.getInetAddress() + ":" + socket.getPort() + ... | 9 |
public String logout() {
if(session.containsKey(USER_OBJ))
session.remove(USER_OBJ);
return SUCCESS;
} | 1 |
public void actionPerformed(ActionEvent event)
{
// System.out.println(event);
ArrayList<JTextField> fields = parent.getFields();
String msg = "";
//check the first text field
if (!fields.get(0).getText().equals(""))
{
ButtonGroup bg = parent.getButtons();
Enumeration<AbstractButton> buttons = bg.ge... | 9 |
@SuppressWarnings("unchecked")
@Override
public void process(final Exchange exchange) throws Exception {
final List<JUGSession> listOfSessions = new ArrayList<JUGSession>();
exchange.getIn().setBody(null);
// Récupération de l'entityManager
final EntityManager em = EntityManagerUtil.getEntityManager();
fi... | 3 |
public static void main(String[] args) throws Exception {
if (args.length != 2) {
System.err.println(
"Usage: java RFS862_UdpClient <destination host> <destination port>");
System.exit(1);
}
//get the dest host + port from console
String dest_h... | 1 |
public void update() {
up = keys[KeyEvent.VK_UP] || keys[KeyEvent.VK_W];
down = keys[KeyEvent.VK_DOWN] || keys[KeyEvent.VK_S];
left = keys[KeyEvent.VK_LEFT] || keys[KeyEvent.VK_A];
right = keys[KeyEvent.VK_RIGHT] || keys[KeyEvent.VK_D];
C = keys[KeyEvent.VK_C];
R = keys[K... | 4 |
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
PreparedStatementKey that = (PreparedStatementKey) o;
if (!sql.equals(that.sql)) return false;
if (!mappedStatement.equ... | 5 |
static protected void FillBuff() throws java.io.IOException
{
if (maxNextCharInd == available)
{
if (available == bufsize)
{
if (tokenBegin > 2048)
{
bufpos = maxNextCharInd = 0;
available = tokenBegin;
}
else if (tokenB... | 9 |
private boolean jj_2_11(int xla) {
jj_la = xla; jj_lastpos = jj_scanpos = token;
try { return !jj_3_11(); }
catch(LookaheadSuccess ls) { return true; }
finally { jj_save(10, xla); }
} | 1 |
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
PosRecibeDePosEntityPK that = (PosRecibeDePosEntityPK) o;
if (prpIdElemento != that.prpIdElemento) return false;
if (prpMoaConsec != that.prpMo... | 9 |
public int[] searchRange(int[] A, int target) {
int i = 0;
int j = A.length - 1;
int[] results = {-1, -1};
//the idea is to put the lower bound in i
while (i < j) {
int mid = i + (j - i) / 2;
if (target <= A[mid]) {
j = mid;
} e... | 5 |
private Mesh LoadMesh(String fileName)
{
String[] splitArray = fileName.split("\\.");
String ext = splitArray[splitArray.length - 1];
if(!ext.equals("obj"))
{
System.err.println("Error: '" + ext + "' file format not supported for mesh data.");
new Exception().printStackTrace();
System.exit(1);
}
... | 2 |
private void lex(TokenStream tokenStream) {
ASTNode n = root;
Token t = null;
int index = 0;
while (index < tokenStream.size()) {
t = tokenStream.get(index);
switch (t.type) {
case Function:
case Block:
Type endType;
if (t.type == Type.Block)
endType = Type.BlockClose;
else
... | 9 |
@SuppressWarnings("deprecation")
public void setSystemDefaultHeader(Request req, Response resp) {
resp.setStatuCode(200);
Date now = new Date();
resp.setHeader("Server", this.getServerName());
resp.setHeader("Content-Type", getMimeType(req));
resp.setHeader("Date", now.toGMTString());
resp.setHeader("Expir... | 7 |
public ArrayList<Integer> grayCode(int n) {
// IMPORTANT: Please reset any member data you declared, as
// the same Solution instance will be reused for each test case.
ArrayList<Integer> res = new ArrayList<Integer>(1 << n);
res.add(0);
if(n == 0) return res;
res.add(1);... | 3 |
public void paint(Position p, int moves)
{
boolean valid = false;
//System.out.println("painting "+p);
if ( maze.getValueAt(p) == '.')
{
valid = true;
maze.setValue(p, moves);
}
else if ((int)maze.getValueAt(p) > moves)
{
valid = true;
maze.setValue(p, moves);
}
if ( valid )
{
Pos... | 7 |
public static char convertToChar (String string)
{
int length;
Character item;
char ret;
ret = 0;
length = string.length ();
if (0 < length)
{
if ('&' == string.charAt (0))
{
string = string.substring (1);
... | 8 |
public Shape getSahpe(String shapeType){
if(shapeType==null){
return null;
}
if("CIRCLE".equalsIgnoreCase(shapeType)){
return new Circle();
}else if("RECTANGLE".equalsIgnoreCase(shapeType)){
return new Rectangle();
}else if("SQUARE".equalsIgnoreCase(shapeType)){
return new Square();
}
retur... | 4 |
public ASNode route(ASNode source, String name) throws FileNotFoundException, IOException {
ASNode cnode = source, nnbr = source;
int routingHops = 0;
int totalLatency = 0;
int ovHops = 0;
while (!cnode.prefix.isMatch(name)) {
if (ovHops > Math.log(nodeStore.length) /... | 8 |
public BufferedImage parseUserSkin(BufferedImage par1BufferedImage)
{
if (par1BufferedImage == null)
{
return null;
}
imageWidth = 64;
imageHeight = 32;
BufferedImage bufferedimage = new BufferedImage(imageWidth, imageHeight, 2);
Graphics g = buff... | 8 |
@Override
public void union(int p, int q)
{
int pRoot = find(p); // component of p
int qRoot = find(q); // component of q
// Do nothing if p and q belong to the same component
if (pRoot == qRoot)
return;
// Take care to make smaller tree point to larger one thus keeping the
// component-tree height r... | 2 |
public static void main(String[] args) {
// E A I
final int MAXVOLUME[] = { 15, 10, 5 };
final int MAXJOUR[] = { 45, 20, 30};
String strNumero;
char charCategorie;
int iCategorie = 0;
int iPossession;
int iEmprunt;
Boolean bResultat;
//ramasser les données... | 7 |
private String balance(String input) {
int tam = input.length();
char stack[] = new char[tam];
int top = 0;
for ( int i = 0; i < tam; i++ ) {
char c = input.charAt(i);
if ( c == '(' || c == '[') {
stack[top] = c;
top++;
} else if ( top == 0 ) {
return "No";
} else {
char topChar = st... | 9 |
public void fillCustomerOrder(int orderid) {
//System.out.println("FillCustomerOrder-------------------");
try {
// Here you only need one statement I think. You are subtracting amount from stock number
PreparedStatement stmt = connection.prepareStatement("select stock_number, amo... | 3 |
public void removePathsContaining(final Block block) {
for (int i = paths.size() - 1; i >= 0; i--) {
final Block[] path = (Block[]) paths.get(i);
if ((path[0] == block) || (path[1] == block)) {
if (FlowGraph.DEBUG) {
System.out.println("removing path " + path[0] + " -> "
+ path[1]);
}
pa... | 4 |
@Override public String toString(){
return expression;
} | 0 |
PhysObject3D(Object3D obj, String name, SimpleVector velocity) {
super(obj);
setName(name);
this.velocity = velocity;
this.acceleration = new SimpleVector();
} | 0 |
AllImagesIterator(final String first, final String prefix, final boolean lexicographicalOrder, final Long minimumLength, final Long maximumLength, final String sha1) {
super("aifrom", first /* can also be null */);
getParams = paramValuesToMap("action", "query", "format", "xml", "list", "allimages", "ailimit", "... | 5 |
public void die() {
alive = false;
} | 0 |
public byte[] decrypt(byte[] textEncrypted, String key){
byte[] decrypted = null;
try{
//keygenerator.init(bits); // 192 and bits bits may not be available
byte[] keyPadded = new byte[bits / 8];
for(int i = 0; i < bits / 8 && i < key.length(); i++){
keyPadded[i] = (byte)key.charAt(i);
}
/*... | 7 |
public void dessinerObjet(Graphics g) {
int size = 600; //size in pixels
BufferedImage bufImg = new BufferedImage(size, size, BufferedImage.TYPE_4BYTE_ABGR);
BufferedImage solo;
try {
solo = ImageIO.read(new File("carrenoir.jpeg"));
... | 9 |
public double getBECharge(int reactor_type, int tech_number, double capacity, int DDFlag, int year) {
double cumMass = getBECumMass(reactor_type, tech_number, capacity, DDFlag, year);
double tempCost = 0.;
double charge = 0.;
double tech_capacity = 0.;
int i, j;
// TODO why is SFReprocessed 0?
/* fo... | 9 |
public synchronized int[] baseNumberCds2Pos() {
if (cds2pos != null) return cds2pos;
calcCdsStartEnd();
cds2pos = new int[cds().length()];
for (int i = 0; i < cds2pos.length; i++)
cds2pos[i] = -1;
int cdsMin = Math.min(cdsStart, cdsEnd);
int cdsMax = Math.max(cdsStart, cdsEnd);
// For each exon, ad... | 9 |
public static void main( String [ ] args )
{
PairingHeap<Integer> h = new PairingHeap<>( );
int numItems = 10000;
int i = 37;
int j;
System.out.println( "Checking; no bad output is good" );
for( i = 37; i != 0; i = ( i + 37 ) % numItems )
h.insert( i );
for( i = 1; i < numIt... | 8 |
public SaveAction(Environment environment) {
super(environment);
putValue(NAME, "Save");
putValue(ACCELERATOR_KEY, KeyStroke.getKeyStroke(KeyEvent.VK_S,
MAIN_MENU_MASK));
this.environment = environment;
} | 0 |
public HashMap<String, List<Integer>> fillHashMap(HashMap<String, List<Integer>> allKMers, String pathToFile) throws IOException {
LinkedList<Character> helpList = new LinkedList<Character>();
FileReader fr;
fr = new FileReader(pathToFile);
BufferedReader br = new BufferedReader(fr);
... | 4 |
public final double getLineWidth() {
return lineWidth;
} | 0 |
private void beginServing() {
if (m_ServletMap.size() > 0) {
do {
// System.out.println("=========================");
// System.out.println("SERVER PULSE");
// System.out.println("=========================");
for (int i = 0; i < SERVLET_TYPE.values().length; i++) {
SERVLET_TYPE servletType = S... | 7 |
public void draw(Graphics g) {
g.setColor(Color.ORANGE);
for (Meat meat : meats) {
g.fillOval(meat.getX(), meat.getY(), 8, 8);
}
g.setColor(Color.black);
for (Meat meat : meats) {
g.drawOval(meat.getX(), meat.getY(), 8, 8);
}
} | 2 |
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.