text stringlengths 14 410k | label int32 0 9 |
|---|---|
@Override
public void keyPressed(int key, char character, GUIComponent component) {
switch (key) {
case (Keyboard.KEY_ESCAPE) : {
this.deactivate();
Game.linkedGet().resumePlay();
break;
}
case (Keyboard.KEY_RETURN) : {
... | 2 |
@Override
public boolean retainAll(Collection<?> c) {
int n = this.size();
for(LinkedList<E> bucket : buckets) {
for(E e : bucket) {
if(!(c.contains(e))) {
this.remove(e);
}
}
}
if(n != this.size())
... | 5 |
@Override
public void mouseUp(EventMouse eventMouse){
if (action != null)
action.go();
} | 1 |
public PeopleTalk(String username, String age) {
this.username = username;
this.age = age;
} | 0 |
private void output(PixelArray out){
int temp_x, temp_8y, temp;
int k=0;
int DU10[], DU20[];
DU10=DU[1][0]; DU20=DU[2][0];
num++;
for(int i=0; i<YV; i++){
for(int j=0; j<YH; j++){
temp_8y=i*32;
temp_x=temp=j*4;
for(int l=0; l<64; l++){
if(x<Xs... | 9 |
@Override
public final void mouseDragged(MouseEvent mouseevent) {
int x = mouseevent.getX();
int y = mouseevent.getY();
if (frame != null) {
x -= 4;
y -= 22;
}
idleTime = 0;
mouseX = x;
mouseY = y;
} | 1 |
public static List<Ville> selectVilleByName(String name) throws SQLException {
String query = null;
List<Ville> ville1 = new ArrayList<Ville>();
ResultSet resultat;
try {
query = "SELECT * from VILLE where VINOM like ? order by VINOM asc";
PreparedStatement p... | 2 |
private void init() {
BufferedReader br = null;
try {
br = new BufferedReader(new FileReader(goldFile));
String line = null;
int lineNumber = 0;
while ((line = br.readLine()) != null) {
lineNumber++;
if(lineNumber == 1) {
for(String splitLocation:line.split(" ")... | 8 |
private void readAndValidateRecordFile(
Integer recordKey, String xmlPath, String formatPrefix, String state,
Connection conn) {
File recordFile = _cache.getFile(xmlPath);
ValidationInfo validationInfo = null;
BufferedReader reader = null;
StringBuffer contentBuffer = new... | 8 |
public static void mutateInAncestorsDirection(int[] gene, int[] inheritedGene, int[] grandpaGenes) {
int diff;
for (int i = 0; i < Constants.GENE_COUNT; i++) {
diff = inheritedGene[i] - grandpaGenes[i];
gene[i] = inheritedGene[i] + (int) (diff * WormUtils.getRandomPercent());
... | 3 |
private void productionSleeveListSelectioner2()
{
try
{
managerStockItem.addObserver(this);
modelStocklist = new StockList2TableModel(managerStockItem.getAll());
tblStockList.setModel(modelStocklist);
managerOrder.addObserver(this);
... | 7 |
public String parse(String line) {
logger.info("Parser:" + line);
row++;
Map<Integer,Object> map = new Hashtable<>(simpleFormat.getColumns().size());
String part = "";
for(Column c:simpleFormat.getColumns()){
try {
part = line.substring(c.getBeginIndex(), c.ge... | 7 |
private void verifyResource() throws HttpException
{
//check exists
if (this.resource == null || !this.resource.exists() || this.resource.isDirectory())
throw new HttpException("File not found", StatusCode.NOT_FOUND);
//check permissions
if (!this.domain.isPathInDirectory(this.resource) || !this.resource... | 6 |
public Member getMember() {
return member;
} | 0 |
public void atualizar(){ //Atualiza as informações da tela e verifica se a batalha terminou
caixaDeTexto.setText("<html>"+textoBatalha+"</html>");
hpMonstro.setText("HP: "+Integer.toString(mob.hp)+"/"+maxhp);
if(mob.hp<=0){ //VITÓRIA
InfoChar.experiencia+=mob.xpReward;
In... | 9 |
@Override
public void run() {
for(JSONObject article:articleJsonlist){
Date date = new Date();
String name = date.getTime()+".txt";
String path = Path+name;
File file = new File(path);
if(!file.exists()){
file = new File(path);
... | 5 |
public void process( Log log )
throws JxrException
{
Map info = getPackageInfo();
VelocityEngine engine = new VelocityEngine();
setProperties( engine, log );
try
{
engine.init();
}
catch ( Exception e )
{
throw new JxrE... | 2 |
@Override
public void setValue(Object o) {
nativeValue=convertObject(o);
} | 0 |
public void setTimes(TTimes node)
{
if(this._times_ != null)
{
this._times_.parent(null);
}
if(node != null)
{
if(node.parent() != null)
{
node.parent().removeChild(node);
}
node.parent(this);
... | 3 |
final public void parseFile(File file, DirManager dirManager) {
try {
BufferedReader br = new BufferedReader(new FileReader(file));
String line;
while ((line = br.readLine()) != null) {
parseLine(line, dirManager);
}
br.close();
} catch (FileNotFoundException e) {
e.printStackTrace();
... | 3 |
public synchronized void setCountdown(String umessage, int seconds) {
try {
thaw();
this.secondsRemaining = seconds;
long time = seconds * 1000;
final String message = umessage;
freezeMessage = true;
countdownTimer = new java.u... | 6 |
public void queryUsers() throws SQLException {
if (conn != null)
{
System.out.println("**********USERS**********");
queryTable("crmusers");
System.out.println("**********AVAILABILITIES**********");
queryTable("crmavailabilities");
System.out.println("**********INTERESTS**********");
queryTable("cr... | 1 |
public boolean canHaveAsBalance(BigInteger balance) {
return (balance != null) && (balance.compareTo(this.getCreditLimit()) >= 0);
} | 1 |
public void execute() {
setPeriod(Math.abs(Robot.shooter.getPIDController().getError())*PERIOD_SCALAR);
super.execute();
} | 0 |
public void addEntry(int startPc, int length, int nameIndex,
int descriptorIndex, int index) {
int size = info.length;
byte[] newInfo = new byte[size + 10];
ByteArray.write16bit(tableLength() + 1, newInfo, 0);
for (int i = 2; i < size; ++i)
newInfo[i]... | 1 |
public void exitAndCleanUp()
{
this.mainController.exitAndCleanUp();
if(this.parameterSetup != null)
{
this.parameterSetup.dispose();
}
if(this.parameterConfirm != null)
{
this.parameterConfirm.dispose();
}
if(this.popu... | 5 |
static public ParseException generateParseException() {
jj_expentries.clear();
boolean[] la1tokens = new boolean[14];
if (jj_kind >= 0) {
la1tokens[jj_kind] = true;
jj_kind = -1;
}
for (int i = 0; i < 7; i++) {
if (jj_la1[i] == jj_gen) {
for (int j = 0; j < 32; j++) {
... | 8 |
public static <GItem> Comparator<GItem> chainedComparator(final Comparator<? super GItem> comparator1, final Comparator<? super GItem> comparator2)
throws NullPointerException {
if (comparator1 == null) throw new NullPointerException("comparator1 = null");
if (comparator2 == null) throw new NullPointerException("... | 5 |
public void postProcess(SipMessage sipMessage) {
if (realm == null || nonce == null || digest == null) {
return;
}
SipHeaders sipHeaders = sipMessage.getSipHeaders();
String cseq = sipHeaders.get(
new SipHeaderFieldName(RFC3261.HDR_CSEQ)).getValue();
S... | 9 |
public void scanForExtensions(String directory, String fileNameFilter)
{
if(registry == null) {
registry = new HashMap<String, LinkedList<Extension>>();
}
if(directory == null) {
directory = ".";
}
if(DEBUG) System.out.println("current working directory: " +System.getProperty("user.dir"));
scan... | 4 |
public void addView(AbstractView view) {
registeredViews.add(view);
view.addPropertyChangeListener(this);
} | 0 |
private void processQueuedCommands()
{
synchronized (queuedCommands)
{
if (!queuedCommands.isEmpty())
{
logger.log("Processing Queued commands.");
}
else
{
logger.log("There are no Queued commands.");
}
int MAX_ITERATION = 0;
for (int i : queuedCommands.keySet())
{
if (i > MA... | 9 |
public byte[] handle(ConnectionDetails connectionDetails,
byte[] buffer, int bytesRead)
throws java.io.IOException
{
final StringBuffer stringBuffer = new StringBuffer();
boolean inHex = false;
for(int i=0; i<bytesRead; i++) {
final int value = (buffer[i] & 0xFF);
// If it's ASCII, print i... | 8 |
public Inventory(){
inv = new Block[16];
for(int i = 0; i < inv.length; i++){
inv[i] = new Block(0,0,16,16,0);
}
} | 1 |
public boolean despiertaProceso(Proceso p) {
boolean despertado = false;
int prioridadDinamica;
int quantum = (140 - p.getPrioridadEstatica()) * (p.getPrioridadEstatica() < 120 ? 20 : 5);
/**
* Si el proceso aun no tiene tiempo de ejecucion para el CPU se
* despacha a l... | 6 |
public void keyPressed(int k) {
if (k == KeyEvent.VK_A) {
player.setLeft(true);
}
if (k == KeyEvent.VK_D)
player.setRight(true);
if (k == KeyEvent.VK_UP)
player.setUp(true);
if (k == KeyEvent.VK_DOWN)
player.setDown(true);
if (k == KeyEvent.VK_SPACE)
player.setJumping(true);
if (k == KeyEve... | 8 |
public void move() {
paddle.y += yDirection;
if(paddle.y <= 25)
paddle.y = 25;
if(paddle.y >= 250)
paddle.y = 250;
if(this.id == 2 && players == 1) {
collision();
if(((LocalGame) screen).getBallY() < paddle.y+25)
setYDirecti... | 6 |
private void selectedOrderSleeve2()
{if(ord == null)
{
txtOrderName3.setText("");
txtOrderId4.setText("");
lblSleeves.setText("");
}
if(operator == null)
{
txtId1.setText("");
txtName1.setText("");
txtLastName1.s... | 8 |
public GamePanel() {
/**
* Declare a KeyListener interface to try the keyboard events when we
* press any key.
*/
KeyListener n = new KeyListener() {
/**
* This method works when we press any key.
*/
@Override
public void keyPressed(KeyEvent e) {
// TODO Auto-generated method stub
... | 9 |
public void setMessage(String message) {
this.message = message;
if(this.message != null && this.message.equals(""))
this.message = null;
} | 2 |
private String[] getFileNames(String str) throws IllegalArgumentException {
// Tokens are split using quotation marks
StringTokenizer strTok = new StringTokenizer(str, "\"");
// An arraylist is used to store the tokens
ArrayList<String> tokens = new ArrayList<String>();
// 2 or 4 tokens required for legal... | 5 |
public double getY() {
return y;
} | 0 |
@Override
public boolean edgeIsBetween(Long eId, Long v1Id, Long v2Id) {
return (this.getSource(eId) == v1Id && this.getTarget(eId) == v2Id)
|| (this.getSource(eId) == v2Id && this.getTarget(eId) == v1Id);
} | 3 |
public static void main(String args[]) throws java.lang.Exception {
URL wsdlURL = MytxtbuddySoapApi_Service.WSDL_LOCATION;
if (args.length > 0 && args[0] != null && !"".equals(args[0])) {
File wsdlFile = new File(args[0]);
try {
if (wsdlFile.exists()) {
... | 5 |
public static void main(String[] args) throws IOException
{
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
HashMap<Integer, String> map = new HashMap<Integer, String>();
for (int i = 0; i < 10; i++)
{
int index = Integer.parseInt(reader.re... | 2 |
public static void main(String[] args)
{
// Set up Player A, always draw Paper
Player player1 = new Player("Player A");
player1.setDrawOutput(Output.Paper);
// Set up Player B
Player player2 = new Player("Player B");
// Start the manager
GameManager manager ... | 0 |
public StackPane initContent() {
StackPane content = new StackPane();
content.setAlignment(Pos.TOP_LEFT);
content.setPadding(new Insets(8, 5, 5, 5));
content.getStyleClass().add("popUpBody");
content.setMinHeight(50);
GridPane grid = new GridPane();
grid.setHgap(10);
grid.setVgap(10);
grid.setPaddin... | 0 |
private void initOptionsBarMenu(Color bg) {
this.optionsBarMenu = new JPanel();
this.optionsBarMenu.setBackground(bg);
this.optionsBarMenu.setLayout(new VerticalLayout(5, VerticalLayout.LEFT));
// size
final Numberfield numfield = new Numberfield(this.skin.getOptionsbarHeight(),... | 2 |
public void testCycListPrettyStringDetails() {
System.out.println("\n*** testCycListPrettyStringDetails ***");
try {
CycList example = null;
Map<ArgPosition, Span> map = null;
ArgPosition curPos = null;
example = (CycList) org.opencyc.parser.CycLParserUtil.parseCycLTerm("(#$isa #$Muffet ... | 1 |
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Album that = (Album) o;
if (idAlbum != that.idAlbum) return false;
if (!Arrays.equals(cover, that.cover)) return false;
if (description... | 9 |
public void setItemcode(String itemcode) {
this.itemcode = itemcode;
} | 0 |
public TypedObject peekResult(int id)
{
if (results.containsKey(id))
{
TypedObject ret = results.remove(id);
return ret;
}
return null;
} | 1 |
public Set<BankAccount> getAccountsSatisfying(Checker<BankAccount> checker) {
Set<BankAccount> result = new HashSet<>();
for (BankAccount account: accounts)
if (checker.check(account))
result.add(account);
return result;
} | 2 |
@SuppressWarnings("unused")
public static void main(String[] args) {
int addedElements1 = 0;
int addedElements2 = 0;
boolean isEmpty = true;
// testing size when trees are empty
checkSize(addedElements1);
// testing isEmpty when trees are empty
checkIsEmpty(isEmpty);
// testing add, remove and conta... | 4 |
private static void writeTestCompareFile(HashMap<String, HashMap<String, List<List<Double>>>> map) throws Exception
{
List<String> taxaNames = getTaxaNames();
List<String> mbqcNames = getMBQCIDs(map);
BufferedWriter writer = new BufferedWriter(new FileWriter(
ConfigReader.getMbqcDir() + File.separator + "a... | 8 |
private static String getTypeString(int type) {
if (type == 0)
return "fine";
if (type == 1)
return "error";
if (type == 2)
return "info";
return "type value error";
} | 3 |
public static void main(String[] args) throws InterruptedException {
ExecutorService executor = Executors.newCachedThreadPool();
//anonymous call of Callable
Future<Integer> future = executor.submit(new Callable<Integer>() {
@Override
//return value is Integer
... | 4 |
private void decode()
{
int index = 0;
LinkedHashMap<Integer, String> decodeDictionary = new LinkedHashMap<Integer, String>();
// initialize dictionary w/ single symbols - Same method as encode, decodeDictionary will contain
// only single/initial symbols
for(int i = 0; i < fileContent.length(); i++)
{
... | 9 |
void printTable(Map<Person, List<Score>> table){
List<Person> ls = new ArrayList<>(table.keySet());
ls.sort(Comparator.comparing(p -> p.name));
ToIntBiFunction<List<Score>, Person> extra = (t, p) -> {
for (Score s: t) {
if (s.self.equals(p)) return s.score;
... | 2 |
public void setHeader(File file, String[] header)
{
if(!file.exists())
return;
try
{
String currentLine;
StringBuilder config = new StringBuilder("");
BufferedReader reader = new BufferedReader(new FileReader(file));
while((currentLine = reader.readLine()) != null)
config.append(currentLine... | 7 |
private void goDown(ColorPatch patch, int x, int y) {
if ( ++y < image.getHeight() ) {
Color color = pixel(x, y);
if ( isIncluded(x, y) ) {
if ( patch.getColor().distance(color, Color.RGB_DISTANCE) < tolerance ) {
patch.add(color);
goRight(patch, x, y);
goDown(patch, x, y);
}
}
excl... | 3 |
public void parseSurroundingEndElement() {
try {
if (xmlReader.hasNext()
&& xmlReader.getEventType() == XMLStreamConstants.END_ELEMENT) {
xmlReader.next();
while (xmlReader.hasNext()
&& xmlReader.getEventType() == XMLStreamConstants.CHARACTERS) {
if (!xmlReader.isWhiteSpace()) {
throw... | 6 |
public DefaultResponse postProfile(String asUserId, Profile aaUserProfile) {
if (asUserId == null || asUserId.trim().length() == 0) {
throw new IllegalArgumentException("userId is null");
}
return post(REST_URL_PROFILE + asUserId, aaUserProfile, DefaultResponse.class);
} | 2 |
public void method545(Stream stream, Class29 class29)
{
int i = stream.readUnsignedByte();
anIntArray665[0] = i >> 4;
anIntArray665[1] = i & 0xf;
if(i != 0)
{
anIntArray668[0] = stream.readUnsignedWord();
anIntArray668[1] = stream.readUnsignedWord();
int j = stream.readUnsignedByte();
for(int k =... | 8 |
private void addNewClaim() {
String titleValue = titleNAJtxt.getText()
, descriptionValue = descriptionNAJtxa.getText();
DateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy HH:mm a");
Date date = new Date();
if (titleValue == null || titleValue.equals("")) {
JOptionPane.showMessageDialog(newActionJf... | 5 |
public int getMinFilledBlock(){
int n = block.size();
int min = 0;
while (n != 1) {
n = n >> 1;
++min;
}
for (int step = block.size(); step != 1; step /= 2){
boolean stepIsReasonable = false;
for (int i = 0; i < block.size(); i += s... | 7 |
public static boolean isConfigured(){
return parameters.get("username") != null &&
parameters.get("password") != null &&
parameters.get("host") != null &&
parameters.get("port") != null &&
parameters.get("database") != null;
} | 4 |
public boolean itemSent(String time, String trackingId) {
try {
itemSentInt = "1";
sentTimeInt = time;
sentTrackingInt = trackingId;
return true;
} catch (Exception e) {
return false;
}
} | 1 |
private void SendFileButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_SendFileButtonActionPerformed
// TODO add your handling code here:
String dest = myList.getSelectedValue().toString();
String src = client.getName();
dest = dest.trim();
client.sendFile(... | 0 |
private void doubleSize() {
if (corridors.length == 0) {
corridors = new Corridor[2];
return;
}
Corridor[] newVersionOfCorridors = new Corridor[corridors.length*2];
for (int i=0; i<corridors.length; i++) {
newVersionOfCorridors[i] = corridors[i];
}
corridors = newVersionOfCorridors;
} | 2 |
public void printBlockLayoutOrder(Writer w) throws Exception {
w.write(getNodeName() + " [label=\"" + getNodeName() + "\\l");
for(Instruction i : instructions) {
i.printInstruction(w);
w.write("\\l");
}
w.write("\"]\n");
if(next != null) {
w.wr... | 2 |
static int process(String line) {
int cases = Integer.parseInt(line.trim());
for(int c = 1; c <= cases; c++) {
line = readLine().trim();
StringBuffer temp = new StringBuffer();
for(char ch : line.trim().toCharArray()) {
if(Character.isAlphabetic(ch)){
temp.append(ch);
}
}
String a = temp... | 8 |
public static List<AbstractCarriage> findCarriages(SimpleTrain train,
int minPassengerCount, int maxPassengerCount) {
if(train == null){
LOG.error("Train is null");
throw new IllegalArgumentException("Train is null");
}
List<AbstractCarriage> list = new ArrayList<AbstractCarriage>();
for (AbstractCarri... | 5 |
public void fillDeclarables(Collection used) {
ClassInfo clazz = getClassInfo();
InnerClassInfo outer = getOuterClassInfo(clazz);
ClassAnalyzer clazzAna = methodAnalyzer.getClassAnalyzer(clazz);
if ((Options.options & Options.OPTION_ANON) != 0 && outer != null
&& outer.outer == null && outer.name != null
... | 6 |
private Vector2f rectCollide(Vector2f oldPos, Vector2f newPos, Vector2f size1, Vector2f pos2, Vector2f size2)
{
Vector2f result = new Vector2f(0,0);
if(newPos.getX() + size1.getX() < pos2.getX() ||
newPos.getX() - size1.getX() > pos2.getX() + size2.getX() * size2.getX() ||
oldPos.getY() + size1.getY()... | 8 |
@RequestMapping("/showUser")
public String showUser(User user, String pages,HttpServletRequest request) {
Map<Object, Object> map = new HashMap<Object, Object>();
map.put("cardno", user.getCardno());
map.put("name", user.getName());
map.put("phone", user.getPhone());
map.put("idcard", user.getIdcard());
... | 3 |
public static DataD blockDivide(final FunctionTypes.ZeroInBlockD3 func, BlockD3 block, PlotData data) {
final int width = data.resolution.width;
final int height = data.resolution.height;
final double max = data.max;
final double error = data.error;
final DataD.Builder3 mat = new DataD.Builder3... | 9 |
@Override
public List<MavenVersion> getVersionsAvalible(Artifact artifact) throws IOException, DownloadException, SAXException, ParseException {
Set<MavenVersion> result = new HashSet<MavenVersion>();
for (String repo : repositories) {
Metadata artifactMetaData = getArtifactMetaData(repo... | 4 |
public static void qsort(Work[] works, int start, int end) {
if (start >= end) return;
int left = start, right = end;
int pivot = works[(left + right) / 2].start; //use the middle node's value for pivot
while (left <= right) {
while (works[left].start < pivot) left++;
... | 7 |
private static Fn makeFn(final List params, final Object body, final Map env) {
final boolean hasVarargParam = !params.isEmpty() && ((Symbol) params.get(params.size() - 1)).name.startsWith("&");
final int nofNormalArgs = hasVarargParam ? params.size() - 1 : params.size();
return new Fn() {
public Object invoke... | 9 |
private void propagar(int x, int y) {
for (int i = x - 1; i < x + 1 && i > 0 && i < rows; i++) {
for (int j = y - 1; j < (y + 1) && j > 0 && j < cols; j++) {
if (field[i][j].getAjacentMines() == 0) {
pintar(i, j, i * 64, j * 64 + 64);
}
}
}
} | 7 |
private int[][][] generaFoco(int i,int j,int k)
{
int b[][][];
b=new int [i][j][k];
int x1 = (int) (Math.random() * i);
int y1 = (int) (Math.random() * j);
int z1= 1+(int) (Math.random() * (k-2));
double capa1,capa2;
capa1=Math.sqrt(3.1); //ANALIZAR PARA TAM... | 6 |
public static void setprop(String key, Object val) {
ThreadGroup tg = Thread.currentThread().getThreadGroup();
if(tg instanceof ErrorHandler)
((ErrorHandler)tg).lsetprop(key, val);
} | 1 |
public Card(int x){
cardID=x;
rank = getRank();
suit = getSuit();
cardValue=getInitialValue();
} | 0 |
@Override
public void unInvoke()
{
if(canBeUninvoked())
{
if(affected instanceof MOB)
{
final MOB mob=(MOB)affected;
if((buildingI!=null)&&(!aborted))
{
if(messedUp)
{
if(activity == CraftingActivity.LEARNING)
commonEmote(mob,L("<S-NAME> fail(s) to learn how to make @x1.",... | 7 |
float getBandFactor(float eq)
{
if (eq==BAND_NOT_PRESENT)
return 0.0f;
float f = (float)Math.pow(2.0, eq);
return f;
} | 1 |
public static int insertCommandeClient(int identreprise, int idinterlocuteur, Date datecommandeclient,String referencecommandeclient,Float totalhtcommandeclient,Float totalttccommandeclient, Float remisecommandeclient) throws SQLException {
String query = "";
ResultSet resultat;
int retour=0;
... | 2 |
public void valueChanged(ListSelectionEvent arg0)
{
if(arg0.getValueIsAdjusting())return;
int index = arg0.getFirstIndex();
if(index < 0)return;
if(arg0.getSource() == this)
{
Quest q = getSelectedValue();
if(q != null)
{
update(q);
if(qp.olist.getSelectedIndex() == -1)qp.op.clear();
}
... | 7 |
@Override
public boolean equals(Object obj) {
if(!this.getClass().getName().equals(obj.getClass().getName())) return false;
return this.hashCode() == obj.hashCode();
} | 1 |
double[] p() {
int tot = 0;
for (int c : counts) {
c += FAKE_COUNTS;
tot += c;
}
double p[] = new double[4];
int i = 0;
for (int c : counts) {
c += FAKE_COUNTS;
p[i] = ((double) c) / tot;
i++;
}
return p;
} | 2 |
public static Binding parseBinding(final CycList rawBinding) {
if (rawBinding.size() == 2) {
final CycVariable variable = (CycVariable) rawBinding.get(0);
final Object term = rawBinding.getDottedElement();
return new DefaultBinding(variable, term);
}
return null;
} | 1 |
public static void main(String[] args) throws Exception{
// Your S3 credentials are required to manage S3 accounts.
// These credentials are stored in an AWSCredentials object:
AWSCredentials s3Credentials = TransferManager.loadKeys();
// To communicate with S3 use the RestS3Ser... | 2 |
@Override
public void writePayload(final ByteWriter out) throws IOException {
switch(getType()) {
case BYTE:
out.write((Byte) payload);
break;
case SHORT:
out.write((Short) payload);
break;
case INT:
out.write((Integer) payload);
break;
case ... | 6 |
public boolean hasMagicPeerId() {
if (hasPeerId()) return isMagicPeerId(this.peerId.array());
else return false;
} | 1 |
public static Node intersectionOf2Lists(LinkedList list, LinkedList list2) {
if (list == null || list2 == null || list.size() == 0 || list2.size() == 0)
return null;
int list1Length = list.size();
int list2Length = list2.size();
Node list1Node = list.g... | 9 |
private static HashMap<Long, Integer> readHashMap(String directory)
throws IOException, ClassNotFoundException {
FileInputStream fin;
try {
fin = new FileInputStream(directory);
} catch (FileNotFoundException e) {
writeHashMap(directory, new HashMap<Long, Integer>());
fin = new FileInputStream(directo... | 1 |
static long getDaysFromBasis( int basis, long date0, long date1 )
{
if( (basis == 0) || (basis == 4) )
{ // # months * 30 + extra days
GregorianCalendar fromDate = (GregorianCalendar) DateConverter.getCalendarFromNumber( new Long( date0 ) );
GregorianCalendar toDate = (GregorianCalendar) DateConverter.getCal... | 6 |
public String decodeExtendedStatus(final int ext_status)
{
switch (ext_status)
{
case 0x0107: return "Connection not found";
case 0x0204: return "Unconnected send timed out, no module in slot?";
case 0x0312: return "link not found, no module in slot?";
case 0x0318: return "link to self invalid"... | 7 |
final boolean method481(byte i, int i_36_) {
anInt957++;
if (i_36_ == -1)
return false;
if (i_36_ == ((ObjectDefinition) this).anInt868)
return true;
if (((ObjectDefinition) this).anIntArray943 != null) {
for (int i_37_ = 0; i_37_ < ((ObjectDefinition) this).anIntArray943.length;
i_37_++) {
if (... | 6 |
static public void main(String args[])
{
String[] argv;
long start = System.currentTimeMillis();
int argc = args.length + 1;
argv = new String[argc];
argv[0] = "jlc";
for(int i=0;i<args.length;i++)
argv[i+1] = args[i];
jlcArgs ma = new jlcArgs();
if (!ma.processArgs(argv))
System.exit(1);
Con... | 4 |
Subsets and Splits
SQL Console for giganticode/java-cmpx-v1
The query retrieves a limited number of text entries within a specific length range, providing basic filtering but minimal analytical insight.