text stringlengths 14 410k | label int32 0 9 |
|---|---|
public static ByteBuffer decode(PDFObject dict, ByteBuffer buf,
PDFObject params) throws IOException {
Inflater inf = new Inflater(false);
int bufSize = buf.remaining();
// copy the data, since the array() method is not supported
// on raf-based ByteBuffers
byte[] d... | 7 |
protected String readString(InputStream in) throws IOException {
int length = readInt(in);
// Avoid allocating a rediculous array size.
// But InputStreams don't universally track position/size.
// And available() might only mean blocking, not the end.
// So try some special cases...
if ( in instanceof ... | 9 |
public final void loadAssetDetailsFromXml(String... xmlFilePaths) {
XStream xstream = new XStream(new DomDriver());
for (String xmlFilePath : xmlFilePaths) {
String xmlContents = FileManager.getFileContents(xmlFilePath);
// Cast the xml contents to the same as our data field
Map<String, Map<String, String>... | 4 |
public GraphicsMain() {
setMinimumSize(new Dimension(WIDTH * SCALE, HEIGHT * SCALE));
setMaximumSize(new Dimension(WIDTH * SCALE, HEIGHT * SCALE));
setPreferredSize(new Dimension(WIDTH * SCALE, HEIGHT * SCALE));
setIgnoreRepaint(true);
frame = new JFrame(Main.NAME);
frame.setDefaultCloseOperation(JFra... | 2 |
public Object execute(ExecutionEvent event) throws ExecutionException {
IWorkbenchWindow window = HandlerUtil.getActiveWorkbenchWindowChecked(event);
String line;
String viewName = null;
EditorHelper editor = EditorHelper.getCurrent(event);
int lineNo = editor.getCurrentLineNo();
line = editor.getLine(line... | 9 |
void attackBot(BattleBot bot) {
//Check what bot is attacking, subtract health accordingly. Set victor if a bot dies.
if (bot == bot1) {
this.hpBot2--;
if (this.hpBot2 <= 0) {
this.victor = 1;
}
}
else
{
this.hpBot1--;
... | 3 |
int insertKeyRehash(long val, int index, int hash, byte state) {
// compute the double hash
final int length = _set.length;
int probe = 1 + (hash % (length - 2));
final int loopIndex = index;
int firstRemoved = -1;
/**
* Look u... | 9 |
public JButton getjButtonSuiv() {
return jButtonSuiv;
} | 0 |
public User getUser() {
return m_user;
} | 0 |
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
PII other = (PII) obj;
if (a != other.a)
return false;
if (b != other.b)
return false;
return true;
} | 5 |
public AnnotationVisitor visitArray(final String name) {
buf.setLength(0);
appendComa(valueNumber++);
if (name != null) {
buf.append(name).append('=');
}
buf.append('{');
text.add(buf.toString());
TraceAnnotationVisitor tav = createTraceAnnotationVisit... | 2 |
final String _readKey_(int symbol) throws IOException, IllegalArgumentException {
final Reader source = this._reader_;
final StringBuilder result = this._builder_;
result.setLength(0);
while (true) {
switch (symbol) {
case -1:
case '\r':
case '\n':
throw new IllegalArgumentException();
c... | 6 |
Space[][] openSets(Space sp) {
Space[][] sets = new Space[numOpenSets(sp)][5];
int index = 0;
if (numOpenSets(sp) != 0) {
if (isOpen(board[sp.pos[0]], sp.piece, 1)) {
sets[index] = board[sp.pos[0]];
index++;
}
if (isOpen(getColumn(sp.pos[1]), sp.piece, 1)) {
sets[index] = getColumn(sp.pos[1])... | 7 |
private boolean isConnectableInternal(Neighborhood n1, Neighborhood n2) {
if (n1.getCenter().equals(n2.getCenter())) {
return false;
}
final LineSegmentInt seg1 = new LineSegmentInt(n1.getCenter(), n2.getCenter());
if (hasIntersectionStrict(seg1)) {
return false;
}
final double angle1 = Singularity.co... | 8 |
public void setIterationCount(BigInteger value) {
this.iterationCount = value;
} | 0 |
@Override
public boolean equals(Object obj) {
if (!(obj instanceof IndexItem<?,?>)) {
return false;
}
IndexItem<? extends Annotation,?> o = (IndexItem<?,?>) obj;
return structure.equals(o.structure) && annotationType == o.annotationType && loader == o.loader;
} | 9 |
private void formWindowOpened(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_formWindowOpened
Pays paysVide = new Pays(-1,"");
this.jComboBoxPays.addItem(paysVide);
try {
List<Pays> pp1 = RequetesPays.selectPays();
for (Pays pays : pp1) {
... | 2 |
public ArrayList<FirstMove> makeFirstMoves(SearchPiece[] board) {
ArrayList<String> history = new ArrayList<String>();
ArrayList<FirstMove> firstmoves = new ArrayList<FirstMove>();
for (int i = 0; i < board.length; i++) {
SearchBoard move1 = new SearchBoard(board, 1, 1, i);
SearchBoard move2 = new Searc... | 7 |
public static int getAuctionTime( int auctionID ) throws DatabaseException {
Connection conn = null;
ResultSet rs = null;
PreparedStatement ps = null;
int uid, bids;
String qGetAuctionTime = "SELECT endingTime FROM auctiontime WHERE auctionID = ?";
try {
conn = DBPool.getInstance().getConnection();
//... | 8 |
public List<Pixel> neighbours(int width, int height)
{
List<Pixel> result = new ArrayList<Pixel>(8);
for(int i = -1; i <= 1; i++)
{
for(int j = -1; j <= 1; j++)
{
if(i != 0 || j != 0)
{
int newX = x + i;
... | 8 |
private void listar_Impresoras (){
String [] separada;
separada = jComboBox1.getSelectedItem().toString().split("-");
int modulo = Integer.parseInt(separada[0].trim());
r_con.Connection();
Vector<Vector<String>>v = r_con.getContenidoTabla("SELECT * FROM impresoras WHERE imp_id_modulo = "+modulo);
... | 5 |
public Result execute(Command command) {
LabelDTO labelDTOren = (LabelDTO) ((Object[]) command.getCommandSource())[0];
Account accountren;
accountren = accountDAO.getAccountByname(labelDTOren.getAccount());
Set<Label> labelsren = new HashSet<Label>();
labelsren = accountren.getL... | 2 |
private
List<Element> queryXPathList(String query) {
if (query == null) return new ArrayList<Element>(0);
try {
Element root = doc.getRootElement();
XPathBuilder<Element> xpb = new XPathBuilder<Element>(query,Filters.element());
XPathExpression<Element> xpe = xpb.compileWith(XPathFactory.instance()); // ... | 2 |
public Matrix solve (Matrix B) {
if (B.getRowDimension() != m) {
throw new IllegalArgumentException("Matrix row dimensions must agree.");
}
if (!this.isNonsingular()) {
throw new RuntimeException("Matrix is singular.");
}
// Copy right hand side with pivoting
int n... | 9 |
public boolean getBoolean(String key) throws JSONException {
Object object = this.get(key);
if (object.equals(Boolean.FALSE)
|| (object instanceof String && ((String) object)
.equalsIgnoreCase("false"))) {
return false;
} else if (object.equals... | 6 |
public boolean isLegalMovement(HantoCell from, HantoCell to, HantoBasePiece piece)throws HantoException{
boolean isLegal = true;
int cellDistance = getDistance(from, to);
if (!isAdjacent(to.getX(), to.getY())){
throw new HantoException("Cell is not adjacent");
}
if (breaksContinuity(from, to)){
thro... | 7 |
@Override
public boolean performFinish() {
final String containerName = page.getContainerName();
final String fileName = page.getFileName();
IRunnableWithProgress op = new IRunnableWithProgress() {
@Override
public void run(IProgressMonitor monitor) throws InvocationT... | 3 |
private void downloadNewTables() {
List<Integer> changes = findTableChanges();
Queue<FileRequest> requests = new LinkedList<FileRequest>();
tables = new ReferenceTable[versionTable.getEntryCount()];
for (int i = 0; i < changes.size(); i++) {
requests.offer(requester.request(255, changes.get(i)));
}
whil... | 4 |
public Image getImage(String s, Color fill) {
// check xobjects for stream
Stream st = (Stream) library.getObject(xobjects, s);
if (st == null) {
return null;
}
// return null if the xobject is not an image
if (!st.isImageSubtype()) {
return null;... | 3 |
final void a(int i) {
if ((mask & 0x5) != 5)
throw new IllegalStateException();
if (i == 4096)
method644();
else if (i == 8192)
method651();
else if (i == 12288)
method639();
else {
int i_578_ = Class70.sineTable[i];
int i_579_ = Class70.cosineTable[i];
synchronized (this) {
fo... | 5 |
@Override
public boolean invoke(MOB mob, List<String> commands, Physical givenTarget, boolean auto, int asLevel)
{
final MOB target=this.getTarget(mob,commands,givenTarget);
if(target==null)
return false;
if(!super.invoke(mob,commands,givenTarget,auto,asLevel))
return false;
final boolean success=prof... | 8 |
@Override
public void mouseReleased(MouseEvent e) {
mouseKeyStatus(e, false);
} | 0 |
public void m1() {
try {
this.i = 10;
System.out.println("dans m1 : i = "+this.i);
this.m2(this.i);
} catch(Exception e) {
// code palliant l’erreur ayant provoqué l’exception.
}
System.out.println("catch de m1 : i = " + this.i);
} | 1 |
public Unit(double conversionFactor, String name) {
this.conversionFactor = conversionFactor;
this.name = name;
} | 0 |
public void run(){
byte[] b = new byte[8192];
MessageEvent me = new MessageEvent(b);
while(true){
try{
Connection.getInputStream().read(b);
Main.getDefaultEventSystem().listen(me.setBytes(b));
if(me.isCanceled())break;
}catch(Exception e){e.printStackTrace(); break;}
}
System.out.println("Re... | 3 |
public void lisaaHoitoOhjeet(HttpServletRequest request, HttpServletResponse response) throws NamingException, SQLException, ServletException, IOException {
Kayttaja a = haeAsiakkaanTiedotAsiakasIdlla(request);
try {
List<HoitoOhje> h = new ArrayList<HoitoOhje>();
List<Oirekuvaus... | 4 |
public int executeUpdate(String sql,List params) {
int result = -1;
try {
//执行SQL语句
PreparedStatement ps = connection.prepareStatement(sql);
if(params != null)
for(int i = 0 ;i < params.size();i++){
ps.setObject(i+1,params.get(i));
}
result = ps.exe... | 3 |
public static void sort(long[]arr){
long tmp = 0;
for(int i=1;i<arr.length;i++){
tmp = arr[i];
int j=i;
while(j>0 && arr[j] >= tmp){
arr[j] = arr[j - 1];
j--;
}
arr[j] = tmp;
}
} | 3 |
public JSONWriter object() throws JSONException {
if (this.mode == 'i') {
this.mode = 'o';
}
if (this.mode == 'o' || this.mode == 'a') {
this.append("{");
this.push(new JSONObject());
this.comma = false;
return this;
}
t... | 3 |
public void merge(int a[], int m, int b[], int n) {
int aIndex = m - 1, bIndex = n - 1;
for (int i = m + n - 1; i >= 0; i --) {
Integer aItem = aIndex >= 0 ? a[aIndex] : null;
Integer bItem = bIndex >= 0 ? b[bIndex] : null;
boolean fromB = false;
if (aIn... | 7 |
public static void Initialize(int width, int height){
if(GRASS == null)
GRASS = new Tile(width, height, true, 0xff45ef45);
if(WALL == null)
WALL = new Tile(width, height, false, 0xff121212);
if(HERO == null)
HERO = new Tile(width - 4, height - 4, false, 0xffef... | 3 |
@Override
public void visitConstantExpr(ClassNode c, MethodNode m, final ConstantExpr expr) {
if (expr.value() instanceof Type) {
Type typeValue = (Type) expr.value();
String name = typeValue.toString().replaceAll("/", ".").replaceFirst("L", "").replace(";", "");
CallStaticExpr forName = new CallStaticExp... | 1 |
@Override
public int[] getInts(int par1, int par2, int par3, int par4)
{
int i1 = par1 - 1;
int j1 = par2 - 1;
int k1 = par3 + 2;
int l1 = par4 + 2;
int[] aint = this.parent.getInts(i1, j1, k1, l1);
int[] aint1 = IntCache.getIntCache(par3 * par4);
for (in... | 8 |
@Override
public void scoreRound(boolean won, int score) {
//If we won the round, update the weights for reinforcement learning
if (won) updateWeights();
} | 1 |
public static void putOnStack(Node[] state, char player){
double[] ourState = new double[state.length * 2];
//put in the x's
for(int i = 0; i < 48; i++){
if(state[i].getChar() == 'x'){
ourState[i] = 1;
}
else{
ourState[i] = 0;
}
}
//put in the o's
for(int i = 48; i < input.length-1; i++... | 4 |
public InetAddress getAddress() {
return this.address;
} | 0 |
public void testSafeAddLong() {
assertEquals(0L, FieldUtils.safeAdd(0L, 0L));
assertEquals(5L, FieldUtils.safeAdd(2L, 3L));
assertEquals(-1L, FieldUtils.safeAdd(2L, -3L));
assertEquals(1L, FieldUtils.safeAdd(-2L, 3L));
assertEquals(-5L, FieldUtils.safeAdd(-2L, -3L));
as... | 6 |
public boolean interact(Widget w, Coord c) {
for (Widget wdg = w.lchild; wdg != null; wdg = wdg.prev) {
if (wdg == this)
continue;
Coord cc = w.xlate(wdg.c, true);
if (c.isect(cc, (wdg.hsz == null) ? wdg.sz : wdg.hsz)) {
if (interact(wdg, c.add... | 7 |
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... | 7 |
private boolean agregarALista(NodoTablaHashing<K,V>[] aP, K k, V v) {
int llave=hash(k);
boolean bool=false;
if(aP[hash(k)]!=null){
int i=llave;
while(i<aP.length&&!bool){
if(aP[i]==null){
aP[i]=new NodoTablaHashing<K, V>(k, v); bool=true;
}
i++;
}
for(int j=0;j<llave&&!bool;j++){
... | 7 |
private int gameValue() {
// Calculate the base value for the game
int baseVal = 24; // start off with grand game value.
// Grab our gametype, and if it's not grand, calculate the values.
GameTypeOptions.GameType actualGameType = this.gameType.getGameType();
if(actualGameType != GameTypeOptions.GameType.Gr... | 8 |
public DotMessageShower(String message,IOnStringInput onStringInput) {
super(message,SYMBOL,onStringInput);
} | 0 |
public Item(GameWindow w, int x, int y, int type){
window = w;
panel = w.panel;
energy =100;
posX =x;
posY =y;
bounds = new Rectangle(posX,posY,32,32);
itemType = type;
switch(itemType){
case(0): //Waffe
damage = 1;
name = "Magnum";
break;
case(1): //medikit, nahrung
h... | 6 |
public void drawCell(int x, int y){
/* Cell Drawing Option
* 0 = Regular drawing
* 1 = Checker Board pattern
* 2 = Randomized
* 3 = Randomized/Checker Board
*/
if(rcflag){if(cdo == 1){ cellCheckDraw(x,y, true);}else{cellAltDraw(x,y);}}
else{
switch(cdo){
c... | 6 |
public int value() {
return i;
} | 0 |
public double value(double x) {
if (Double.isNaN(this.Demand.density(x))) System.out.println(
"NaN Density at "+x+" of "+Demand+" with mean "+Demand.getNumericalMean()+
" and sd "+Math.sqrt(Demand.getNumericalVariance()));
return (this.y-x)*this.Demand.density(x);
} | 1 |
public static List<Block> getBlocks(Cuboid cuboid, World world){
List<Block> blocks = new ArrayList<Block>();
for(int x = cuboid.getVectorMin().getBlockX(); x <= cuboid.getVectorMax().getBlockX(); x++){
for(int y = cuboid.getVectorMin().getBlockY(); y <= cuboid.getVectorMax().getBlockY(); ... | 3 |
public int getNeighbourIndex(final Direction direction, final Cell cell, final Player player) {
switch (direction) {
case TOP:
return verticalMoveChecker.getTopNeighbourIndex(cell, player);
case BOTTOM:
return verticalMoveChecker.getBottomNeighbourIndex(cell, player);
case LEFT:
return horizontalMoveCh... | 8 |
@Override
public boolean removeLetterTiles(List<Location> tilesPlayed) {
if(tilesPlayed == null) return true;
List<Tile> removedTiles = new ArrayList<Tile>();
for(Location loc : tilesPlayed){
Tile t = loc.getTile();
if(t==null){
throw new NullPointerException("Can't remove null tile from player");
}... | 6 |
public static void changeSetting(String key, String newValue) {
//Check if the key exists, if so; remove it
if (configuration.containsKey(key) && !configuration.get(key).equals(newValue)) {
Logger.log("Removed: " + key);
configuration.remove(key);
}
//Put in the new value
configuration.put(key, newVa... | 2 |
public DonkeyRegion(File hardFile) {
this.hardFile = hardFile;
try {
if (hardFile.exists()) {
lastModification = hardFile.lastModified();
}
file = new RandomAccessFile(hardFile, "rw");
if (file.length() < 5) {
// Write the... | 8 |
@Override
public boolean process(Player player) {
if (ingredients == Ingredients.TORSTOL && otherItem.getId() != VIAL) {
if (!player.getInventory().containsOneItem(15309)
|| !player.getInventory().containsOneItem(15313)
|| !player.getInventory().containsOneItem(15317)
|| !player.getInventory().cont... | 9 |
@Override
public void handleResult() throws InvalidRpcDataException {
String result = getStringResult();
if (result.equalsIgnoreCase(STATUS_STRING_OK)) {
EventBusFactory.getDefault().fire(new DownloadRemovedEvent(downloadGid));
} else {
// TODO: handle
... | 1 |
public boolean isValid(String s) {
if (s == null || s.length() <= 1) {
return false;
}
Map<Character, Character> map = new HashMap<Character, Character>();
map.put('(', ')');
map.put('[', ']');
map.put('{', '}');
Stack<Character> stack = new Stack<Character>();
for (char c : s.toCharArray())... | 7 |
public static BufferedImage detectVerticalEdges(BufferedImage image, int amount) {
int width = image.getWidth();
int height = image.getHeight();
BufferedImage edgeImage = new BufferedImage(width, height, BufferedImage.TYPE_BYTE_GRAY);
for(int x = 0; x < width; x++)
for(int y = 0;... | 9 |
public double getEtxToMeFromNode(int nodeID) {
Iterator<Edge> it2 = this.outgoingConnections.iterator();
EdgeOldBetEtx e;
while (it2.hasNext()) {
e = (EdgeOldBetEtx) it2.next();
if (e.endNode.ID == nodeID){
e = (EdgeOldBetEtx) e.getOppositeEdge();
return e.getEtx();
}
}
return 0.0;
} | 2 |
public InputStream pcmstream() {
return(new InputStream() {
private byte[] buf;
private int bufp;
private boolean convert() throws IOException {
float[][] inb = decode();
if(inb == null) {
buf = new byte[0];
return(false);
}
buf = new byte[2 * chn * inb[0].length];
int p = ... | 9 |
@Override
public void terminateMachine(IMachine machine) throws InvalidObjectException, ConnectorException
{
try
{
CloudStackClient client = ClientLocator.getInstance().getClient(machine.getComputeCenter().getProperties(),
controllerServices);
client.terminateVirtualMachine(machine.getName());
... | 1 |
public void load(Vehicle vehicle, File file){
// Load the Vehicle in Territory.
addVehicle(vehicle);
BufferedReader reader = null;
String line = "";
String splitBy = ",";
try {
reader = new BufferedReader(new FileReader(file));
while ((line = reader.readLine()) != null) {
String[] data = lin... | 5 |
public int getRobotState() {
return robotState;
} | 0 |
static public Spell getEarthSpell(int i)
{
switch (i)
{
default:
case 0:
return new Earthbending();
case 1:
return new EarthbendingSpike();
case 2:
return new EarthbendingShard();
case 3:
... | 7 |
private boolean evaluateTcfClause(String clause) {
if (model instanceof MesoModel)
return false;
if (clause == null || clause.equals(""))
return false;
String[] sub = clause.split(REGEX_AND);
Tcf.Parameter[] par = new Tcf.Parameter[sub.length];
String funx, funy;
byte id;
short length;
for (int n ... | 9 |
public boolean removeLift(int LiftID){
for(int i=0;i<lifts.size();i++){
if(lifts.get(i).getLiftID()==LiftID){
lifts.get(i).delete();
lifts.remove(i);
return true;
}
}
return false;
} | 2 |
@Override
public void paintComponent(Graphics g) {
Graphics2D graphics = (Graphics2D) g;
super.paintComponent(graphics);
/*
* Berechnung der Groesse der Blockelemente. Die Groesse ist abhaengig
* von der Anzahl der Spalten und Zeilen und der jeweils verfuegbaren
*... | 3 |
private int getNextDir(int[] from,int to,boolean closer,Game.DM measure)
{
int dir=-1;
double min=Integer.MAX_VALUE;
double max=-Integer.MAX_VALUE;
for(int i=0;i<from.length;i++)
{
if(from[i]!=-1)
{
double dist=0;
switch(measure)
{
case PATH: dist=getPathDistance(from[i],to)... | 9 |
public synchronized void setFrame(final CEMILData frame)
{
if (!frame.getDestination().equals(getKey()))
throw new KNXIllegalArgumentException("frame key differs from this key");
if (!max)
ensureCapacity();
else if (!overwrite && size == timestamps.length)
return;
final CEMILData[] c = (CEMILData[]) v... | 7 |
public static List<CategoryNode> buildCategoryByUrl(String url) throws IOException {
System.out.println("Trying to get url: " + url);
Document document;
try {
document = Jsoup.connect(url).get();
} catch(IOException e) {
throw new IOException("Error when get " + url, e);
}
Elements elements = document... | 8 |
public static void main(String[] args) throws IOException {
Scanner sc = new Scanner(new BufferedInputStream(System.in));
PrintWriter cout = new PrintWriter(System.out);
while(sc.hasNext()!=false){
String[] originals = sc.nextLine().split(" ");
if(originals.length==1&&ori... | 9 |
public boolean PointerMoveListener(int mX, int mY, int mDX, int mDY) {
if(mainLogic.currentState == GameLogic.GameState.PLAYING) {
currentMouseAction.onPointerMove(mX, mY, mDX, mDY);
}
/*
for(long a : selectedWeapons) {
GameActor act = mainLogic.getActor(... | 1 |
public char skipTo(char to) throws JSONException {
char c;
try {
long startIndex = this.index;
long startCharacter = this.character;
long startLine = this.line;
this.reader.mark(1000000);
do {
c = this.next();
if... | 3 |
public static int getRotatedMapChunkY(int y, int rotation, int x) {
rotation &= 3;
if (rotation == 0) {
return y;
}
if (rotation == 1) {
return 7 - x;
}
if (rotation == 2) {
return 7 - y;
} else {
return x;
}
} | 3 |
public void run() {
ServerSocket s = null;
try{
this.frame.setDB();
s = new ServerSocket(this.PORT);
try {
this.frame.serverOutput.setText("---- Server Avviato Correttamente! ---- \n Server in attesa di richieste...");
while(true) {
Socket socket = s.accept();
try{
new ... | 5 |
public static String getJavaTypeFor( String type )
{
String tocheck = Util.sanitize( type, false ).toLowerCase();
if ( tocheck.equals( "null" ) )
{
return "null";
}
if ( tocheck.equals( "integer" ) )
{
return "int";
}
if ( tocheck.equals( "real" ) )
{
return "double";
}
if ( tocheck.equa... | 6 |
public void setjComboBoxLabo(JComboBox jComboBoxLabo) {
this.jComboBoxLabo = jComboBoxLabo;
} | 0 |
public String toString() {
StringBuffer sb = new StringBuffer("<class>" + getClass().getName() + "</class>\n");
if (uid != null)
sb.append("<uid>" + uid + "</uid>\n");
sb.append("<width>" + (widthIsRelative ? (widthRatio > 1.0f ? 1 : widthRatio) : getWidth()) + "</width>\n");
sb.append("<height>" + (heightIs... | 7 |
private void addNewBook(){
int choice;
boolean quit;
quit = false;
try
{
con.setAutoCommit(false);
while(!quit)
{
System.out.print("\n\nPlease choose one of the following: \n");
System.out.print("1. Add Standard\n");
System.out.print("2... | 9 |
private static String suit(Card card) {
switch(card.getSuit()) {
case HEARTS:
return !UNICODE ? "H" : "\u2661"; // 2665 on windows
case DIAMONDS:
return !UNICODE ? "D" : "\u2662"; // 2666 on windows
case SPADES:
return !UNICODE ? "S" : "\u2660";
case CLUBS:
return !UNICODE ? "C" : "\u2663";
... | 8 |
public JComboBoxUnit() {
super();
final ListCellRenderer r = getRenderer();
setRenderer(new ListCellRenderer() {
public Component getListCellRendererComponent(JList list, Object value,
int index, boolean isSelected, boolean cellHasFocus) {
Component c;
if(disabl... | 5 |
public static void main(String[] args) throws IOException {
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
StringBuilder out = new StringBuilder();
String line;
Queue<Character> q = new LinkedList<>();
boolean hyphen = false;
while ((line = in.readLine()) != null) {
if ((line =... | 9 |
private Type mergeClasses(Type type) throws NotFoundException {
CtClass superClass = findCommonSuperClass(this.clazz, type.clazz);
// If its Object, then try and find a common interface(s)
if (superClass.getSuperclass() == null) {
Map interfaces = findCommonInterfaces(type);
... | 4 |
public boolean tarkistaSarakkeet(int kuka) {
int vierekkaiset = 0;
for (int i = 0; i < 3; i++) {
for (int j = 0; j < 3; j++) {
if (poyta[j][i] == kuka) {
vierekkaiset++;
}
}
if (vierekkaiset == 3) {
... | 4 |
private boolean fileIsVideo(String string) {
if(string.endsWith(".mov") || string.endsWith(".MOV") || string.endsWith(".mp4") || string.endsWith(".MP4"))
return true;
return false;
} | 4 |
public int get_END_IF(int INDEX, String code)
{
log.log(4, log_key, "call get_END_IF, INDEX = ", new Integer(INDEX).toString(), "\n");
for(;;INDEX++) {
if ( (code.charAt(INDEX) == 'E') &&
(code.charAt(INDEX + 1) == 'N') &&
(code.charAt(INDEX + 2... | 9 |
@Override
protected boolean check() {
return (method.getParameterTypes()[0] == Updates.class && (method
.getParameterTypes()[1] == String.class || (method
.getParameterTypes()[1] == String[].class && method
.getParameterTypes()[2] == String.class)));
} | 3 |
public static BPInt from(byte[] bytes) {
// note - all negative numbers are represented by 8 bytes.
int size = bytes.length;
boolean highestBitIsSet = ((0x80 & bytes[0]) == 128);
if (size == 1) {
return new BPInt(0xff & bytes[0]);
} else if (size == 2) {
r... | 7 |
public List<Blog> getBlogs(){
return blogModelBS.getBlogs();
} | 0 |
public static boolean isNegativeSentiment ( String str ) {
if ( negativeHashMap.containsKey(str) ) return true;
else return false;
} | 1 |
private void nextToken()
{
try
{
current = scanner.next();
}
catch (IOException e)
{
}
} | 1 |
public void visit_dup_x2(final Instruction inst) {
// Top value on stack must be category 1.
final Set top1 = atDepth(0);
checkCategory(top1, 1);
final Set top2 = atDepth(1);
final int category = checkCategory(top2);
if (category == 1) {
final Set top3 = atDepth(2);
checkCategory(top3, 1);
// ... | 1 |
static boolean isSameType(Type t1, Type t2, Types types) {
if (t1 == null) { return t2 == null; }
if (t2 == null) { return false; }
if (isInt(t1) && isInt(t2)) { return true; }
if (t1.tag == UNINITIALIZED_THIS) {
return t2.tag == UNINITIALIZED_THIS;
... | 9 |
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.