text stringlengths 14 410k | label int32 0 9 |
|---|---|
public int initialize2(byte dataSrc[], int offset)
{
int vertexCount = getVertexCount();
vertexIndexArray = new int[vertexCount];
for (int index = 0; index < vertexIndexArray.length; ++index)
{
vertexIndexArray[index] = ByteConversions.getUnsignedShortInByteArray... | 6 |
private int busquedaVirus(int i, int j, int l, int maximo) {
for (int k = 0; k < dx.length; k++) {
int temp_dx = i+dx[k];
int temp_dy = j+dy[k];
if(temp_dx>=0 && temp_dx < tablero.filas() && temp_dy>=0 && temp_dy < tablero.columnas() && !visited[temp_dx][temp_dy]
&& tablero.getElemento(temp_dx, temp_dy)... | 9 |
public Object getValueAt(int row, int column) {
switch (column) {
case 0:
return "" + transitions[row].getFromState().getID();
case 1:
return "" + transitions[row].getToState().getID();
case 2:
return transitions[row].getDescription();
default:
return null;
}
} | 3 |
public void fill(Graphics2D g){
if(canMove)doMovement();
if(relative){
centerX=(img.getWidth()/2)-(Display.player.loc.getX()/relXT);
centerY=(img.getHeight()/2)-(Display.player.loc.getY()/relYT);
}
testTouching();
if(textured){
int xl = (int) Math.round(centerX-(width/2));
int yl = (int) Math.roun... | 3 |
private void sendData( String message )
{
try // send object to client
{
//PrintWriter pw = new PrintWriter(output);
output.writeObject( "SERVER>>> " + message );
output.flush(); // flush output to client
System.out.println( "\nSERVER>>> " + message );
} // end try
catch ( IOException ioException )... | 1 |
static String formatHanyuPinyin(String pinyinStr,
HanyuPinyinOutputFormat outputFormat)
throws BadHanyuPinyinOutputFormatCombination
{
if ((HanyuPinyinToneType.WITH_TONE_MARK == outputFormat.getToneType())
&& ((HanyuPinyinVCharType.WITH_V == outputFormat.getVCharType(... | 8 |
private void RealizePorRandomAMutacao () {
cadeiaDeCaminhos = new int[tamanhoTotalDoCaminho];
Caminho caminho;
int numRandomico;
for (int i = 0; i != numeroGenes; i++) {
numRandomico = geradorRandomico.nextInt(populacaoDaPonteControlador... | 4 |
public CgiArguments(String uriQuery) {
String[] params = uriQuery.split("&");
for (String param : params) {
String[] keyval = param.split("=", 2);
if (keyval.length < 2) {
continue;
}
String key = keyval[0].toLowerCase();
String val = keyval[1];
if (key.equals("query")) {
_query = val;
... | 9 |
public final static String MD5(String s) {
char hexDigits[] = { '0', '1', '2', '3', '4',
'5', '6', '7', '8', '9',
'A', 'B', 'C', 'D', 'E', 'F' };
try {
byte[] btInput = s.getBytes();
//获得MD5摘要算法的 MessageDigest 对象
Mess... | 2 |
private Object readJSON() throws JSONException {
switch (read(3)) {
case zipObject:
return readObject();
case zipArrayString:
return readArray(true);
case zipArrayValue:
return readArray(false);
case zipEmptyObject:
return new JSONO... | 7 |
public boolean isFeasible(Coordinate c) {
boolean validI = c.i >= 0 && c.i < size;
boolean validJ = c.j >= 0 && c.j < size;
boolean validCell = false;
if (validI && validJ) {
validCell = (maze.get(c.i).get(c.j).val == 0);
}
return validI && validJ && validCell;
} | 6 |
public static int charToInt(char c) {
int data = 0;
switch (c) {
case 'I':
data = 1;
break;
case 'V':
data = 5;
break;
case 'X':
data = 10;
... | 7 |
private SaveResults() {} // Es una MAE. | 0 |
public CustomCanvas()
{
super("Custom Canvas");
// Demonstrates the use of a Swing component for rendering vertices.
// Note: Use the heavyweight feature to allow for event handling in
// the Swing component that is used for rendering the vertex.
mxGraph graph = new mxGraph()
{
public void drawState(m... | 6 |
public void writeControlFile(String controlPath) throws IOException {
Map<String, String> env = System.getenv();
File controlFile = new File(env.get("control_dir"), controlPath);
if (!controlFile.exists())
controlFile.createNewFile();
List<String> envProperties = getPropert... | 2 |
private boolean evaluateCardPlayable(Card c) {
// There are spells that have no cost, and those cannot be played for
// their cost, seeing as they don't have one. Thus, despite not
// implementing those cards for a while, there will be a special case
// where I check to see if their cost is null.
if (c.getCo... | 5 |
protected static boolean isCommutative(int operator) {
return (operator == Token.AND ||
operator == Token.OR ||
operator == Token.UNION ||
operator == Token.INTERSECT ||
operator == Token.PLUS ||
operator == Token.MULT ||
... | 9 |
public boolean hasRole(Role role, User user) throws Exception {
try {
boolean itHasRole = false;
session = HibernateUtil.getSessionFactory().openSession();
session.beginTransaction();
Query q = session.getNamedQuery(getNamedQueryToHasRole());
... | 2 |
@Override
public Value evaluate(Value... arguments) throws Exception {
// Check the number of argument
if (arguments.length == 1) {
// get Value
Value value = arguments[0];
// If numerical
if (value.getType().isNumeric()) {
return new Value(new Double(Math.atan(value.getDouble())));
}
if (va... | 4 |
@Test
@SuppressWarnings("unused")
public void testThresholdOfNeighborhood() throws Exception {
// keeping the same implementation as before except that we use a threshold based neighborhood
// how does the threshold of the neighborhood influence the performance (root mean square error) of the recommender?
do... | 1 |
public int getVitality(){
int value = 0;
for (Armor armor : armorList) {
if(armor != null) value += armor.getStats().getVitality();
}
return value;
} | 2 |
@Column(name = "PRP_ID_ELEMENTO")
@Id
public Integer getPrpIdElemento() {
return prpIdElemento;
} | 0 |
public static int maxRight() {
int arr[] = new int[1001];
for (int i = 1; i <= 1000; i++) {
for (int j = 1; j < 1000; j++) {
if (i + j + Math.sqrt(i * i + j * j) > 1000) {
break;
}
if (Math.sqrt(i * i + j * j) % 1 == 0)
arr[i + j + (int) Math.sqrt(i * i + j * j)]++;
}
}
int max = 0;... | 6 |
@Override
public void keyPressed(KeyEvent e) {
super.keyPressed(e);
if (e.getKeyCode() == KeyEvent.VK_A || e.getKeyCode() == KeyEvent.VK_LEFT) {
controlled.move(Direction.WEST);
}
else if (e.getKeyCode() == KeyEvent.VK_D || e.getKeyCode() == KeyEvent.VK_RIGHT) {
... | 8 |
public static void drawVisSquare(GOut g, Coord tc, Coord hsz) {
if(JSBotUtils.playerID == -1)
return;
if(UI.instance.minimap == null) return;
Coord current;
if(JSBotUtils.getPlayerSelf() == null)
current = new Coord(0, 0);
else {
if(JSBotUtils.getPlayerSelf() == null)
current = new Coord(0, 0);
... | 4 |
@Override
public Car driverCar() {
return new AudoCar();
} | 0 |
public static VaryNode makeVaryNode(int iNode, FastVector nRecords, Instances instances) {
VaryNode _VaryNode = new VaryNode(iNode);
int nValues = instances.attribute(iNode).numValues();
// reserve memory and initialize
FastVector [] nChildRecords = new FastVector[nValues];
for (int iChild =... | 7 |
public Long getId() {
return id;
} | 0 |
public static JSONObject convertToJSON(Properties properties) throws JSONException {
JSONObject jsonObject = new JSONObject();
Enumeration e = properties.propertyNames();
while (e.hasMoreElements()) {
String key = (String) e.nextElement();
jsonObject.put(key, properties... | 1 |
@Test
public void getAllRecipesTest() throws Exception {
Recipe recipe = new Recipe();
recipe.setName("borscht");
recipe.setCategory(CategoryEnum.chicken);
try {
recipe.canSave();
recipeService.createRecipe(recipe);
} catch (SaveError e) {
... | 1 |
private int getDistanceToNearestOpponent() {
nearestOpponent = null;
int distance = LONGDISTANCE;
Opponent[] opponents = getOpponents();
for (int i=0; i<opponents.length; i++) {
int d = (int)Vector3D.getDistance(getLocation(), opponents[i].getLocation());
if (d < distance) {
distance = d;
nearestO... | 2 |
public void update (double elapsedTime, Dimension bounds, List<Force> activeForces) {
for (Force f : activeForces) {
f.applyForce(elapsedTime, bounds, myMasses);
}
for (Spring s : mySprings) {
s.update(elapsedTime, bounds);
}
for (Mass m : myMasses) {
... | 3 |
public Card DealCard(){
Card newcard = new Card(shuffledDeck.get(getDealCounter()));
decremDealCounter();
return newcard;
} | 0 |
public void keyReleased(KeyEvent e) {
int keycode = 0;
try {
keycode = e.getKeyCode();
} catch (Exception E) {
//pass
}
if (keycode == KeyEvent.VK_UP) {
dy += 1;
} if (keycode == KeyEvent.VK_DOWN) {
dy -= 1;
} if (keycode == KeyEvent.VK_RIGHT) {
dx -= 1;
} if (keycode == KeyEvent.VK_L... | 5 |
public void typeCounter() {
try {
String line, s[], ss[];
while((line=sortBr.readLine())!=null) {
s = line.split(" ");
sortmap.put(s[0], s[1]);
}
while((line=typeBr.readLine())!=null) {
ss = line.split("... | 5 |
@Override public String nextName() throws IOException {
expect(JsonToken.NAME);
Iterator<?> i = (Iterator<?>) peekStack();
Map.Entry<?, ?> entry = (Map.Entry<?, ?>) i.next();
stack.add(entry.getValue());
return (String) entry.getKey();
} | 6 |
public void setOptions(String[] options) throws Exception {
String classifierString = Utils.getOption('W', options);
if (classifierString.length() == 0)
classifierString = weka.classifiers.rules.ZeroR.class.getName();
String[] classifierSpec = Utils.splitOptions(classifierString);
if (classifierS... | 7 |
private void handleError(String message, Exception e)
{
MessageDialog.getInstance().showError(message);
LOGGER.error(message, e);
} | 0 |
private void checkMinimumPlayers() {
if (controller.canGameBeStarted()) {
startServerButton.setEnabled(true);
}
addButtonHandlers();
} | 1 |
public LRParseTableChooserPane(LRParseTable table) {
super(table);
} | 0 |
public static String trimNullSquares(String s)
{
if (s != null && s.indexOf('\u0000') >= 0)
{
s = s.substring(0, s.indexOf('\u0000'));
}
return s;
} | 2 |
public static Set<ITrackTile> getAdjecentTrackTiles(World world, int x, int y, int z) {
Set<ITrackTile> tracks = new HashSet<ITrackTile>();
ITrackTile tile = getTrackFuzzyAt(world, x, y, z - 1);
if (tile != null)
tracks.add(tile);
tile = getTrackFuzzyAt(world, x, y, z + 1);... | 4 |
public static boolean adjacentCoordinates(Coordinates c1, Coordinates c2, int height, int width) {
// If they are in the same row
if (c1.row == c2.row) {
// If they are one to the left or one to the right of
// each other
... | 6 |
protected void addRandomNucleotide() {
double dr = 4 * Math.random();
Nucleotide nn = null;
if (dr >= 0 && dr < 1)
nn = Nucleotide.ADENINE;
else if (dr >= 1 && dr < 2)
nn = Nucleotide.GUANINE;
else if (dr >= 2 && dr < 3)
nn = Nucleotide.CYTOSINE;
else if (dr >= 3 && dr < 4)
nn = Nucleotide.THYMI... | 8 |
public String stComposeEmailForYahooEmailService(int dataId,int ExpVal,String flow )
{
int actVal=1000;
String returnVal=null;
hm.clear();
hm=STFunctionLibrary.stMakeData(dataId, "ExternalEmail");
String to = hm.get("To");
String subject = hm.get("Subject");
String message = hm.get("Message")... | 6 |
public static void connect(TreeLinkNode root) {
if (root == null)
return;
//connectHelper1(root);
//connectHelper2(root);
if (root.left != null) {
root.left.next = root.right;
connect(root.left);
connect(root.right);
}
if (root.left != null &&root.right != null) {
TreeLinkNode rootLeft = root... | 6 |
public static void input (String cmd, String args) {
switch (cmd) {
case "/help":
getHelp ();
break;
case "/day":
// Check in debug
LineManager.addDay ();
System.out.println ("Day " + (LineManager.dayNum + 1)... | 8 |
public void remove(WeakReference<Object> wref)
{
Set<Entry<Long, List<WeakReference<Object>>>> entrySet = buckets.entrySet();
// iterate over the buckets
Iterator<Entry<Long, List<WeakReference<Object>>>> iterator = entrySet.iterator();
while (iterator.hasNext())
{
Entry<Long, List<WeakReference<Ob... | 4 |
public static LinkedListNode reverseEveryOtherKNodes(LinkedListNode head,
int k)
{
LinkedListNode prev = null;
LinkedListNode current = head;
LinkedListNode next;
int count = 0;
while (count < k && current != null)
{
next = current.ge... | 6 |
public void setGender(String gender) {
if (gender.toLowerCase() == "male" && isFemale == true) {
this.isFemale = false;
totalWomen--;
}
else if (gender.toLowerCase() == "female" && isFemale == false){
this.isFemale = true;
totalWomen++;
}
} | 4 |
public static Stella_Object accessAlternativeBindingsSetSlotValue(AlternativeBindingsSet self, Symbol slotname, Stella_Object value, boolean setvalueP) {
if (slotname == Logic.SYM_LOGIC_THE_VARIABLE) {
if (setvalueP) {
self.theVariable = ((PatternVariable)(value));
}
else {
value =... | 7 |
public static void main(String[] args) {
String s = "国无锡";
try {
MessageDigest md = MessageDigest.getInstance("MD5");
md.update(s.getBytes());
byte[] b = md.digest();
int i;
StringBuffer buf = new StringBuffer("");
for (int offset = 0; offset < b.length; offset++) {
... | 5 |
void run() {
// System.out.println("Started " + in2);
for (int i = 0; i < 1000000; i++) {
double f = i + Math.PI * i / 12.3456 * i;
double g = Math.sin(f * f) / (i + 1) * Math.PI;
}
// System.out.println("Done " + in2);
} | 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 Applicant)) {
return false;
}
Applicant other = (Applicant) object;
if ((this.id == null && other.id != null) |... | 5 |
private ILNode setupNode(final IFPNode fp, final DomainTuple d, final ILNode parent)
throws Exception {
if( ! evaluate( fp.getCondition(), d ) ) {
return new LFalse();
}
final FactorCatalog factCat
= getFactorCatalog(fp.getId());
final GenTuple ... | 9 |
private boolean versionCheck() {
final String title = this.versionName;
if (this.type != UpdateType.NO_VERSION_CHECK) {
final String localVersion = this.plugin.getDescription().getVersion();
if (title.split(DELIMETER).length == 2) {
// Get the newest file's version number
final String remoteVersion = ... | 5 |
public static String [] partitionOptions(String [] options) {
for (int i = 0; i < options.length; i++) {
if (options[i].equals("--")) {
// ensure it follows by a -E option
int j = i;
while ((j < options.length) && !(options[j].equals("-E"))) {
j++;
}
/* if (j >= options.length) {
return new... | 7 |
private static String getTaxonomy( String key )
throws Exception
{
key = key.toLowerCase();
for(int x=1; x < NewRDPParserFileLine.TAXA_ARRAY.length; x++)
{
String level = NewRDPParserFileLine.TAXA_ARRAY[x];
if( key.indexOf(level) != -1 )
return level;
}
if( key.endsWith("cla"))
return NewRD... | 8 |
public void draw(Graphics2D graphics) {
if (xOffset == -1) {
xOffset = (int) (rect.width - font.getStringBounds(label, graphics.getFontRenderContext()).getWidth()) / 2;
yOffset = (int) (font.getLineMetrics(label, graphics.getFontRenderContext()).getAscent() + rect.height) / 2;
}
... | 3 |
private int makeFieldInitializer(Bytecode code, CtClass[] parameters)
throws CannotCompileException, NotFoundException
{
int stacksize = 0;
Javac jv = new Javac(code, this);
try {
jv.recordParams(parameters, false);
}
catch (CompileError e) {
t... | 4 |
private void generateModeConversionRules(List<CtModeConversionRule> modeConversionRules) {
if (null == modeConversionRules || modeConversionRules.size() == 0) return;
for (CtModeConversionRule conversionRule : modeConversionRules) {
List<String> conversionList = conversionRule.getTo();
if (null == conversionL... | 5 |
public void draw(double[] input) {
draw.show(0);
draw.clear(Drawer.BLACK);
double barWidth = 1.0 / input.length;
double width = 0.90 * barWidth;
for (int i = 0; i < input.length; i++) {
if (exch.contains(i)) {
draw.setPenColor(Drawer.RED);
} else if (less.contains(i)) {
draw.setPenColor(Drawe... | 3 |
public static void main(String[] args) {
ParentProducer producer = new ParentProducer();
ParentReturn ret = producer.process();
System.out.println(ret);
producer = new ChildProducer();
ret = producer.process();
System.out.println(ret);
} | 0 |
private static Location getLocation(String location)
throws NewCustomException {
Session session = null;
Transaction tx = null;
Location loc = null;
try {
session = HibernateUtil.createSessionFactory().openSession();
tx = session.beginTransaction();
Criteria criteria = session.createCriteria(Locati... | 3 |
private static boolean validateMove(PGNMove move) {
String strippedMove = move.getMove();
if (move.isCastle()) {
return true;
} else if (move.isEndGameMarked()) {
return true;
} else if (strippedMove.length() == MOVE_TYPE_1_LENGTH) {
return PGNParseUtils.matchType1(strippedMove);
... | 8 |
@Test
public void testLoadToMemory() { //Test assembled code is loaded to memory
loader.load(testProgram);
loader.loadToMemory();
for (int i = 0; i < testProgram.length; i++) {
assertEquals(testProgram[i].toString(), memory.accessAddress(i).toString());
}
} | 1 |
public static void tokenize(String line, ArrayList<String> tokens) {
StringTokenizer strTok = new StringTokenizer(line);
while (strTok.hasMoreTokens()) {
String token = strTok.nextToken();
tokens.add(token);
}
} | 1 |
public static String shorten(Graphics g, String text, int width, Preference preference) {
if (g.getFontMetrics().stringWidth(text) <= width)
return text;
if (preference == Preference.begin) {
if (g.getFontMetrics().stringWidth("..") > width)
return "";
... | 7 |
public String getLogin() {
return login;
} | 0 |
private String getSelectedExpression()
{
String result="";
switch(Equation.getSelectedIndex()+1)
{
case 1:
result=fx;
break;
case 2:
result=gx;
break;
case 3:
result=ax;
... | 7 |
public static void saveAdventurer(Adventurer adventurer) throws IOException {
try {
List<Adventurer> adventurers = new ArrayList<>();
adventurers = getAllAdventurer();
boolean found = false;
for (int i = 0, end = adventurers.size(); i < end; i++) {
... | 4 |
String getHanyuPinyinStringWithPolyphones(String string){
for(int i=0; i<string.length(); i++){
String pinyinRecord = getHanyuPinyinRecordFromChar(string.charAt(i));
if(null != pinyinRecord){
int indexOfLeftBracket = pinyinRecord.indexOf(Field.LEFT_BRACKET);
int indexOfRightBracket = pinyin... | 8 |
public Piece[][] generateBoard(){
ArrayList<Piece> figuren = new ArrayList<Piece>();
Piece[][] newBoard = new Piece[8][8];
//Weisse Figuren
figuren.add(new King("weiss"));
figuren.add(new Queen("weiss"));
figuren.add(new Knight("weiss", 1));
figuren.add(new Knight("weiss", 2));
figuren.add(new Bishop("w... | 5 |
public void setChecked(int locx, int locy, int setDirec) {
//System.out.println("Set checked called");
switch (setDirec) {
case 0:
traversal[locy][locx] |= 0x10;
if (locy > 0) traversal[locy - 1][locx] |= 0x40;
break;
case 1:
... | 8 |
public void setCostPrice(double costPrice) {
this.costPrice = costPrice;
} | 0 |
public static int discrete(double[] a) {
double EPSILON = 1E-14;
double sum = 0.0;
for (int i = 0; i < a.length; i++) {
if (a[i] < 0.0) throw new IllegalArgumentException("array entry " + i + " is negative: " + a[i]);
sum = sum + a[i];
}
if (sum > 1.0 + EP... | 7 |
public FontRenderer(GameSettings var1, String var2, TextureManager var3) {
this.settings = var1;
BufferedImage var14;
try {
var14 = ImageIO.read(TextureManager.class.getResourceAsStream(var2));
} catch (IOException var13) {
throw new RuntimeException(var13);
}
int... | 8 |
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
NanoPost np;
byte[] parentHash = EncryptionProvider.EMPTY_HASH_SHA256;
String parentHashStr = edParentHash.getText();
if (!parentHashStr.trim().isEmpty()) {
if ((p... | 9 |
public static void loadPrefsFile(CommandParser parser, String filename) {
try {
BufferedReader buffer = new BufferedReader(new InputStreamReader(new FileInputStream(filename)));
String line = buffer.readLine();
while (line != null) {
try {
parser.parse(line, true, true);
} catch (UnknownCommand... | 4 |
public void buttonInsertClicked (int xKoordinate, int yKoordinate, String objektName, JComboBox removeBox) {
if (objektName == "Turtle") {
Turtle turtle = new Turtle(xKoordinate, yKoordinate, getNumberOfObjekt(objektName) + " " + objektName, ocean);
removeBox.addItem(getNumberOfObjekt(objektName) + " " + objekt... | 6 |
protected Object instanceToArray(Instance instance) throws Exception {
int index;
int count;
int i;
Object result;
// determine number of non-zero attributes
count = 0;
for (i = 0; i < instance.numValues(); i++) {
if (instance.index(i) == instance.classIndex())
c... | 8 |
public String[] getGroupNames(){
if(!this.dataEntered)throw new IllegalArgumentException("no data has been entered");
String[] ret = new String[this.nGroups];
for(int i=0; i<this.nGroups; i++)ret[i] = this.groupNames[i];
return ret;
} | 2 |
public void declare(JFormatter f) {
if (jdoc != null)
f.nl().g(jdoc);
if (annotations != null){
for (JAnnotationUse annotation : annotations)
f.g(annotation).nl();
}
f.g(mods).p(classType.declarationToken).id(name).d(generifiable);
if (s... | 8 |
public Image idleImages(int i)
{
Image temp = null;
switch(i)
{
case 1:
temp = new ImageIcon("src/images/idle_north.png").getImage();
break;
case 2:
temp = new ImageIcon("src/images/idle_north_east.png").getImage();
break;
case 3:
... | 8 |
@Override
public void deserialize(Buffer buf) {
super.deserialize(buf);
diceNum = buf.readShort();
if (diceNum < 0)
throw new RuntimeException("Forbidden value on diceNum = " + diceNum + ", it doesn't respect the following condition : diceNum < 0");
diceSide = buf.readSho... | 3 |
public RandomIntTest() {
} | 0 |
private void createEvents() {
btnUploadSong.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
EventQueue.invokeLater(new Runnable() {
public void run() {
try {
UploadSongFrame frame = new UploadSongFrame(
indexPanel, controller);
frame.setV... | 5 |
public boolean erTegen(double nx, double ny){
if (nx <= getX()+getWidth() && nx >= getX()
&& ny <= getY()+getHeight() && ny >= getY()){
return true;
}
return false;
} | 4 |
private MulticastSocket openUDPBroadcastSocket(
NetworkInterface pNetworkInterface)
{
MulticastSocket socket;
try{
if (!simulateNotchers) {
socket = new MulticastSocket(4445);
if (pNetworkInterface != null) {
try{
... | 4 |
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Block block = (Block) o;
if (initialMoves != block.initialMoves) return false;
if (remainingMoves != block.remainingMoves) return false;
... | 9 |
public VDKInnerDirectory findChild(int offset) {
for(VDKInnerDirectory d : children) {
if(!(d instanceof VDKInnerFile)) {
if(d.getDotDirectory().getOffset() == offset)
return d;
return d.findChild(offset);
}
}
//TODO - Herestt: Throw exception.
return null;
} | 3 |
protected static String getSorting(Class<?> cls) {
String r = "";
for (Field f : cls.getFields()) {
if (f.isAnnotationPresent(SortBy.class))
r += (r.length() == 0 ? "" : " ,") + f.getName()
+ (f.getAnnotation(SortBy.class).reverse() ? " DESC" : " ASC")... | 5 |
private void actualizarListaProd() {
abrirBase();
tablaProd.setRowCount(0);
prodlista = Articulo.where("codigo like ? or descripcion like ?", "%" + textcodprod.getText() + "%", "%" + textcodprod.getText() + "%");
Iterator<Articulo> it = prodlista.iterator();
while (it.hasNext()) ... | 6 |
private void displayCreature(Creature currCreature) {
String url = "http://bulbapedia.bulbagarden.net/wiki/"
+ currCreature.getName();
System.out.printf("%s \n[%s]\n", currCreature, url);
for (Ability a : currCreature.getAbilities()) {
if (a == null) {
System.out.println("NULL ABILITY");
System.ex... | 9 |
public String[] pickValues(int[] thrown) {
Player player = GameEngine.activePlayer;
myBet = thrown[2];
player.addRolls(thrown);
thrownSum = thrown[0]+thrown[1];
ArrayList<String> list = new ArrayList<String>();
for (int i = 1; i <= 6 ; i++) {
for (int j = 1; ... | 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 |
private ReflectiveTypeAdapterFactory.BoundField createBoundField(
final Gson context, final Field field, final String name,
final TypeToken<?> fieldType, boolean serialize, boolean deserialize) {
final boolean isPrimitive = Primitives.isPrimitive(fieldType.getRawType());
// special casing primitives... | 4 |
private int indexCycle(int index, int delta) {
int size = m_Components.length;
int next = (index + delta + size) % size;
return next;
} | 0 |
public CtConstructor makeClassInitializer()
throws CannotCompileException
{
CtConstructor clinit = getClassInitializer();
if (clinit != null)
return clinit;
checkModify();
ClassFile cf = getClassFile2();
Bytecode code = new Bytecode(cf.getConstPool(), 0, ... | 1 |
public void draw(Graphics g) {
if (inMenu()) {
mainMenu.draw(g);
} else {
currentDemo.draw(g);
if (currentDemo != null && !currentDemo.running()) {
g.setColor(new Color(0, 0, 0, 200));
g.fillRect(0, 0, width, height);
... | 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.