text stringlengths 14 410k | label int32 0 9 |
|---|---|
private List<CmdArg> tokenize()
throws Exception
{
char[] str = value.toCharArray();
int p = 0;
List<CmdArg> tokens = new ArrayList<CmdArg>();
String tok = "";
boolean invar = false;
boolean instr = true;
while (p < str.length) {
if (invar)... | 9 |
public final void push(T val) {
back_chunk.values [back_pos] = val;
back_chunk = end_chunk;
back_pos = end_pos;
end_pos ++;
if (end_pos != size)
return;
Chunk sc = spare_chunk;
if (sc != begin_chunk) {
spare_chunk = spare_chunk.next;
... | 2 |
private int lookup(int left, int right) {
if (found) {
return 0;
}
if (user.theNumberIs(left)) {
found = true;
return left;
}
if (user.theNumberIs(right)) {
found = true;
return right;
}
if (left == right... | 5 |
void drawLoadingText(int i, String s) {
while (graphics == null) {
graphics = getGameComponent().getGraphics();
try {
getGameComponent().repaint();
} catch (Exception exception) {
}
try {
Thread.sleep(1000L);
} catch (Exception exception) {
}
}
java.awt.Font boldFont = new java.awt.Fo... | 4 |
private void loadKompetenser() {
PanelHelper.cleanPanel(kompetensHolder);
ArrayList<String> al = null;
try {
String query = "select kid from kompetensdoman";
al = DB.fetchColumn(query);
} catch (InfException e) {
e.getMessage();
}
for... | 3 |
public static boolean isItalic(JTextPane pane)
{
AttributeSet attributes = pane.getInputAttributes();
if (attributes.containsAttribute(StyleConstants.Italic, Boolean.TRUE))
{
return true;
}
if (attributes.getAttribute(CSS.Attribute.FONT_STYLE) != null)
{
Object fontWeight = attributes
.getAttr... | 2 |
public static final String format(boolean value) {
return value ? "yes" : "no"; //$NON-NLS-1$ //$NON-NLS-2$
} | 1 |
public static void initParser(String[] args) throws IllegalArgumentException{
_CSPort = CS.DEFAULT_PORT;
_CSName = "localhost";
if(args.length != 0){
if(args.length == 2){
if(args[0].equals("-n")){
_CSName = args[1];
}
else if(args[0].equals("-p")){
_CSPort = Integer.parseInt(args[1]);
... | 7 |
public ArrayList<ArrayList<Integer>> levelOrderBottom(TreeNode root) {
ArrayList<ArrayList<Integer>> result = new ArrayList<ArrayList<Integer>>();
ArrayList<Integer> row = new ArrayList<Integer>();
if (root == null) {
return result;
}
TreeIterator iterator = new Tr... | 3 |
public char getNextChar() {
try {
//Leemos un caracter y seteamos a nuestra variable currentChar de objeto
setCurrentChar((char) pr.read());
//Sumamos 1 al caracter en la línea
setNumeroDeCaracterEnLinea(getNumeroDeCaracterEnLinea()+1);
... | 4 |
public void gameTick() {
if (player.isLevelAdvance()) {
levelsCompleted++;
totalPoint += temporaryPoint;
temporaryPoint = 0;
if (currentLevel.getNextLevel() == 0)
gameCompleted = true;
else {
currentLevel = new Level(currentLevel.getNextLevel());
player.setxCoord(currentLe... | 5 |
public int get(long millis) {
int dayOfWeek = (int) TestGJChronology.mod(iChronology.fixedFromMillis(millis), 7);
if (dayOfWeek == 0) {
dayOfWeek = 7;
}
return dayOfWeek;
} | 1 |
private void showFilter() {
if (isAncestorOf(searchPanel)) {
remove(searchPanel);
} else {
add(searchPanel,java.awt.BorderLayout.NORTH);
searchPanel.set(mp3list.getIndex(),mp3list.NoE(),mp3list.length());
searchPanel.Focus();
}
revalidate();
repaint();
} | 1 |
public boolean similarColors(Card c2){
boolean result = false;
String cost1 = this.cost + "1";
String cost2 = c2.getCost() + "1";
for(char c : cost1.toCharArray())
if(c != 1 && cost2.indexOf(c) != -1)
result = true;
for(char c : cost2.toCharArray())
if(cost1.indexOf(c) == -1)
result = f... | 5 |
public static void connectGraph(){
int n = _graph.getVertexCount();
System.out.println("n = " + n );
System.out.println("Calculating Euclidean Distance");
Collection<BCNode> nodes = _graph.getVertices();
Iterator<BCNode> iti = nodes.iterator();... | 4 |
public void printComponent(Graphics g) {
int recursionDepth = spinnerModel.getNumber().intValue();
List expansion = expander.expansionForLevel(recursionDepth);
// Now, set the display.
Map parameters = lsystem.getValues();
Matrix m = new Matrix();
double pitch = pitchModel.getNumber().doubleValue(), roll = ... | 0 |
public Timestamp asTimestamp()
{
try {
if (isNull()) {
return null;
} else if (isTimestamp()) {
return (Timestamp) value;
}
if (isTime()) {
Calendar cal = Calendar.getInstance();
cal.setTime((Time) value);
return new Timestamp(cal.getTime().getTime());
} else if (isUtilDate()) {... | 7 |
public Integer Byte4ToInt32(byte[] bytes) throws Exception {
if (bytes.length != 4) throw new Exception("aBytes.length != 4");
/*** forward algorithm [123][0][0][0] ***/
Integer result = new Integer(0);
byte i = 3;
while(true) {
result |= bytes[i] & 0xFF;
if (i == 0) break;
result ... | 3 |
private Location findFood(Location location)
{
Field field = getField();
List<Location> adjacent = field.adjacentLocations(getLocation());
Iterator<Location> it = adjacent.iterator();
while(it.hasNext()) {
Location where = it.next();
Object animal = field.getO... | 6 |
@EventHandler(priority = EventPriority.NORMAL)
public final void onVotifierEvent(final VotifierEvent event) {
Vote vote = event.getVote();
String user = vote.getUsername();
log.info(String.format(plugin.getMessages().getString("player.vote.event"), user));
OfflinePlayer thePlayer =... | 2 |
public void setTitle(String title) {
this.title = title;
} | 0 |
public boolean ApagarTodosQuandoExcluiPessoa(int idPessoa){
try{
PreparedStatement comando = banco.getConexao()
.prepareStatement("UPDATE enderecos SET ativo = 0 WHERE id_pessoa= ?");
comando.setInt(1, idPessoa);
comando.executeUpdate();
comand... | 1 |
public void _jspService(HttpServletRequest request, HttpServletResponse response)
throws java.io.IOException, ServletException {
PageContext pageContext = null;
HttpSession session = null;
ServletContext application = null;
ServletConfig config = null;
JspWriter out = null;
Object page ... | 6 |
private static Class<? extends AttributeImpl> getClassForInterface(Class<? extends Attribute> attClass) {
synchronized(attClassImplMap) {
final WeakReference<Class<? extends AttributeImpl>> ref = attClassImplMap.get(attClass);
Class<? extends AttributeImpl> clazz = (ref == null) ? null : ref... | 8 |
public void redraw(GameWorld world) {
this.gameWorld = world;
for (Avatar a : gameWorld.getAvatars()) {
if (a.getName().equals(name)) {
this.avatar = a;
}
}
if (avatar != null) {
int health = avatar.getHealth();
healthBar.setValue(health);
if (health > 75) {
healthBar.setForeground(Color... | 8 |
private void openSession()
{
if(session == null)
session = HibernateUtils.getSessionFactory().openSession();
} | 1 |
public void down() {
currentlySelected--;
if(currentlySelected == -1)
currentlySelected = countItemsInInventory() - 1;
} | 1 |
public Grammar(final Reader in) throws GrammarSyntaxException {
productions = new HashMap<String, TreeSet<String[]>>();
leftmost = new HashMap<String, Set<String>>();
final Scanner sc = new Scanner(in).useDelimiter("\\s*[\r\n]+\\s*");
while (sc.hasNext()) {
final String line = sc.next().trim();
... | 7 |
@Override
public boolean equals(Object matrix) {
if (!(matrix instanceof Matrix)) {
return false;
}
if (((Matrix) matrix).getRows() != rows || ((Matrix) matrix).getColumns() != columns) {
return false;
}
for (int x = 0; x < rows; x++) {
f... | 6 |
@Test
public void testNumberOfDoorways()
{
int numDoors = 0;
int totalCells = board.getNumColumns() * board.getNumRows();
Assert.assertEquals(506, totalCells);
for (int i=0; i<totalCells; i++)
{
BoardCell cell = board.getCellAt(i);
if (cell.isDoorway())
numDoors++;
}
Assert.assertEquals(16, n... | 2 |
public void testSetMinuteOfDay_int2() {
MutableDateTime test = new MutableDateTime(2002, 6, 9, 5, 6, 7, 8);
try {
test.setMinuteOfDay(24 * 60);
fail();
} catch (IllegalArgumentException ex) {}
assertEquals("2002-06-09T05:06:07.008+01:00", test.toString());
} | 1 |
public void keyPressed(KeyEvent key)
{
int code = key.getKeyCode();
if(code == KeyEvent.VK_LEFT)
{
player.setLeft(true);
}
if(code == KeyEvent.VK_RIGHT)
{
player.setRight(true);
}
if(code == KeyEvent.VK_DOWN)
{
player.setDown(true);
}
if(code == KeyEvent.VK_Z)
{
player.setJumping(t... | 7 |
public static Object[] sliceFromFinalBoundary(Object[] sequence, Boolean[] boundaries) {
// Find the last boundary. If no boundary is found, -1 is correct since
// when it is incremented it will be zero, the first index in the text
int last = -1;
for (int i = 0; i < boundaries.length; i++) {
if (boundaries[i... | 2 |
public static void main(String[] args)
{
// initialize all data
try
{
// start reading the input txt file
String fname = "Assignment03.txt";
Scanner scnr = new Scanner(new File(fname));
int numpatch = scnr.nextInt();
int numit ... | 8 |
public void readInput(int level, String type, Client c, int amounttomake) {
if (c.getItems().getItemName(Integer.parseInt(type)).contains("Bronze"))
{
CheckBronze(c, level, amounttomake, type);
}
else if (c.getItems().getItemName(Integer.parseInt(type)).contains("Iron"))
{
CheckIron(c, level, amountt... | 8 |
@Override
public void newbie() {
hello.newbie();
} | 0 |
private boolean isCtrlTabPressed(KeyEvent e) {
return e.character == SWT.TAB && ((e.stateMask & SWT.CTRL) != 0) && ((e.stateMask & SWT.SHIFT) == 0);
} | 2 |
public ArrayList<Cliente> searchClientes(String nom){
ArrayList<Cliente> cList = new ArrayList();
ArrayList<Cliente> res = new ArrayList();
cList.addAll(cjtClientes.values());
for(int i=0; i<cList.size(); ++i){
if(cList.get(i).getNombre().contains(nom))
res.ad... | 2 |
public void updatePlayerCards(List<Card> cardlist) {
int size = cardlist.size();
if (size >= 2) {
FirstCardPlayer.setImage(new Image(cardlist.get(0).getLink().toString())); //initialize only if the user has only two
FirstCardPlayer.setVisible(true);
SecoundCardPlayer.setImage(new Ima... | 8 |
public List<Integer> getIntegerList(String path) {
List<?> list = getList(path);
if (list == null) {
return new ArrayList<Integer>(0);
}
List<Integer> result = new ArrayList<Integer>();
for (Object object : list) {
if (object instanceof Integer) {
... | 8 |
@EventHandler
private void onInventoryClick(InventoryClickEvent event) {
if(event.getWhoClicked() instanceof Player) {
if(ColoredArmor.config.getBoolean("Check.move-item")) {
Player player = (Player) event.getWhoClicked();
if(!(player.hasPermission("ca.check.move.bypass"))) {
if(event.getView().getTo... | 9 |
@Override
public BinaryNodePS<T> addLeftChild(Node<T> parent, T info) {
if (!(parent instanceof BinaryNodePS)) {
throw new DifferentNodeTypesException();
} else if (isSafe() && !contains(parent)) {
throw new NodeNotFoundException();
}
BinaryNodePS<T> bn = (BinaryNodePS<T>) parent;
if (bn.getLeft() != n... | 4 |
protected static int levelCapacity(int lev)
{
if(lev == 1)
return 2;
else if(lev == 2)
return 8;
else if(lev == 3)
return 18;
else if(lev == 4)
return 32;
else if(lev == 5)
return 32;
else if(lev == 6)
return 18;
else if(lev == 7)
return 8;
return 0;
} | 7 |
@Override
public void newSource( boolean priority, boolean toStream, boolean toLoop,
String sourcename, FilenameURL filenameURL, float x,
float y, float z, int attModel, float distOrRoll )
{
SoundBuffer buffer = null;
if( !toStream )... | 6 |
public int size() {
return N;
} | 0 |
public void tick (int verb)
{
if(!gameOn) return;
//sets the new ivars
Move newMove = computeNewPosition(verb, currentMove);
//how to detect when a piece has landed
//if this move hits something on its down vert, and the pervious verb was also down
... | 4 |
public void body()
{
//register oneself
write("register this entity to GridInformationService entity.");
super.sim_schedule(GridSim.getGridInfoServiceEntityId(),
GridSimTags.SCHEDULE_NOW, GridSimTags.REGISTER_ROUTER,
new Integer(super.get_id()) );
// ... | 3 |
private static double calculateAngle(double x1, double y1,
double x2, double y2) {
double dx = x2 - x1;
double dy = y2 - y1;
double angle = 0.0; // Horisontal to the right
if (dx == 0.0) { // Vertical
if (dy == 0.0) { // No angle
angl... | 7 |
public static Node sumThat(Node node1, Node node2, int extraCarry, Node result)
{
if(node1==null && node2==null)
return result;
int sum = extraCarry;
if(node1.val != null)
sum += node1.intVal;
if(node2.val != null)
sum += node2.intVal;
if(sum > 10)
{
sum = sum - 10;
extraCarry = 1;
... | 8 |
public List<CallData> getCallData(final String callName) {
List<CallData> callDataList = callData.get(callName);
if(callDataList == null) {
callDataList = new LinkedList<CallData>();
callData.put(callName, callDataList);
callNames.add(callName);
}
return callDataList;
} | 1 |
public static float[] fft(final float[] inputReal, float[] inputImag,
boolean DIRECT) {
// - n is the dimension of the problem
// - nu is its logarithm in base e
int n = inputReal.length;
// If n is a power of 2, then ld is an integer (_without_ decimals)
double ld = Math.log(n) / Math.log(2.0);
// Her... | 9 |
private void drawTabArea() {
tabImageProducer.initDrawingArea();
Rasterizer.lineOffsets = sidebarOffsets;
inventoryBackgroundImage.drawImage(0, 0);
if (inventoryOverlayInterfaceID != -1)
drawInterface(0, 0, RSInterface.cache[inventoryOverlayInterfaceID],
0);
else if (tabInterfaceIDs[currentTabId] != -... | 4 |
@EventHandler
public void onEntityDamage(EntityDamageEvent event) {
// do not act when disabled TODO, use unregister when available
if ( !this.sheepFeedPlugin.isEnabled() ) {
return;
}
// see whether this is an attack event
if ( event.getCause() != DamageCause.ENTITY_ATTACK ) {
return;
}
Ent... | 5 |
public int getIndex(){
return index;
} | 0 |
private String romI(int i) {
switch (i) {
case 1: return "I";
case 2: return "II";
case 3: return "III";
case 4: return "IV";
case 5: return "V";
case 6: return "VI";
case 7: return "VII";
case 8: return "VIII";
case 9: return "IX";
default:return "";
}
} | 9 |
public static void main(String[] args) throws Exception {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
PrintWriter pw = new PrintWriter(System.out);
StringTokenizer st;
String line;
int[] LL = new int[100005];
int[] RR = new int[100005];
... | 8 |
public String toString() {
return new StringBuilder(super.toString())
.append(" [")
.append((this.choked ? "C" : "c"))
.append((this.interested ? "I" : "i"))
.append("|")
.append((this.choking ? "C" : "c"))
.append((this.interesting ? "I" : "i"))
.append("]")
.toString();
} | 4 |
public static void main(String[] args) {
GraphicsMain.init();
main = new Main();
main.start();
} | 0 |
private void readEncodingData (int base) {
if (base == 0) { // this is the StandardEncoding
System.arraycopy (FontSupport.standardEncoding, 0, encoding, 0,
FontSupport.standardEncoding.length);
} else if (base == 1) { // this is the expert encoding
// TODO: ... | 7 |
private static byte[] getSecondHalf(byte[] block) {
byte[] temp = Arrays.copyOfRange(block, block.length / 2, block.length);
// middle of block is in the middle of a byte
if ( (block.length / 2d) % 1 == 0.5) {
temp = ByteHelper.rotateLeft(temp, temp.length * 8, 4);
}
... | 1 |
private void initialize() {
frame = new JFrame();
frame.setBounds(100, 100, 283, 353);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setTitle("Search");
try {
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
} catch (ClassNotFoundException e) {
e.printStackTrace();... | 5 |
public boolean inAny(List<Polygon> polygons) {
for(Polygon p: polygons)
if(p.contains(this))
return true;
return false;
} | 2 |
void periodCertification() {
int inner = 0;
for (int i = 0; i < 4; i++)
inner ^= sfmt[i] & parity[i];
for (int i = 16; i > 0; i >>= 1)
inner ^= inner >> i;
if ((inner & 1) != 0) // check OK
return;
for (int i = 0; i < 4; i++) {
int work = 1;
for (int j = 0; j < 32; j++) {
if ((work & parity... | 6 |
public static void main(String[] args)
{
if(args.length > 1) {
String filename = args[0];
LinkedList<String> columns = new LinkedList<String>();
for(int i=1; i<args.length; i++) {
columns.add(args[i]);
}
try {
int[] entries = new int[1];
HashMap<Double, Integer> data = calculateDis... | 4 |
public void update(){
//Sometimes there seems to be a slight lag between audio .start() and .isActive()
//The audioActivation-boolean takes care of that
if(audioActivation && audioClip.isActive()){
audioActivation = false;
}
if(clicked){
clicked();
}else if(!audioActivation&&audioClip!=null&&!aud... | 6 |
@Override
public GameState[] allActions(GameState state, Card card, int time) {
GameState[] states = new GameState[1];
states[0] = state;
if(time == Time.DAY)
{
//Do nothing
}
else if(time == Time.DUSK)
{
PickTreasure temp = new PickTreasure();
states = temp.allActions(state, card, time);
}... | 3 |
@SuppressWarnings("unchecked")
public String getOverviewChart() {
PreparedStatement st = null;
ResultSet rs = null;
JSONArray json = new JSONArray();
try {
conn = dbconn.getConnection();
st = conn.prepareStatement("SELECT team_id, sum(auton_top)*6 + sum(auton_... | 3 |
public static Image scaleImage(Image source, int width, int height, int gap) {
BufferedImage img = new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB);
Graphics2D g = (Graphics2D) img.getGraphics();
g.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION... | 0 |
private boolean r_tidy_up() {
int among_var;
// (, line 183
// [, line 184
ket = cursor;
// substring, line 184
among_var = find_among_b(a_7, 4);
if (among_var == 0)
{
... | 8 |
@Override
public String toString() {
switch (handRank) {
case StraightFlush: return ranks.get(0) + " high " + handRank + " of " + suit;
case FourOfAKind: return "Four " + ranks.get(0) + "s, " + ranks.get(1) + " kicker";
case FullHouse: return handRank + ", " + ranks.get(0) + "s full of " + ranks.get(1) + "... | 9 |
@Override
public void mousePressed(MouseEvent e) {
Piece[][] board = _modelBoard.getBoard();
chessPiece = null;
//Piece[][] board = _modelBoard.getBoard();
Component c = _view.getChessBoard().findComponentAt(e.getX(), e.getY());
if (c instanceof JPanel) return;
if( c == null) return;
Point st... | 6 |
@Override
public void onKeyPressed(char key, int keyCode, boolean coded) {
if(!coded){
if(key == KeyEvent.VK_ENTER){
//Starts playing the midi
this.midiMusic.startMusic(0, null);
//When you start playing a new song, it isn't paused right from the get-go.
this.paused = false;
//And let's reset ... | 9 |
@Override
public SkillsMain[] getSkillNames() {
return Constants.rogueSkillSkills;
} | 0 |
private void afficherDetailsPraticien(String Praticien){
if (ctrlPraticiens == null) {
VuePraticiens vueP = new VuePraticiens(ctrlA);
ctrlPraticiens = new CtrlPraticiens(vueP, vueA);
}
//préparation des combos box
String nomPraticien= Praticien.split(" ")[0];
... | 1 |
public static void main(String[] args)
{
boolean debugger = false;
if(args != null && args.length > 0 && args[0].equals("true"))
{
debugger = true;
}
Main main = new Main(debugger);
main.setVisible(true);
} | 3 |
public Date getDoneTime() {
return doneTime;
} | 0 |
public Board(ArrayList<SimulatorRobot> r, String theme) {
setDoubleBuffered(true);
this.bullets = new Vector();
this.deadRobots = new ArrayList();
this.pills = new ArrayList();
this.expAnim = new ArrayList();
this.obstacles = new ArrayList();
this.ovnis = new Arr... | 6 |
@Override
public boolean tick(Tickable ticking, int tickID)
{
if(!super.tick(ticking,tickID))
return false;
if(affected==null)
return false;
if(!(affected instanceof MOB))
return true;
final MOB mob=(MOB)affected;
if((!mob.amDead())&&((--diseaseTick)<=0))
{
MOB diseaser=invoker;
if(disease... | 7 |
private void writeAnimation(Sprite s, XMLWriter w) throws IOException {
w.startElement("animation");
for (int k = 0; k < s.getTotalKeys(); k++) {
Sprite.KeyFrame key = s.getKey(k);
w.startElement("keyframe");
w.writeAttribute("name", key.getName());
for (i... | 2 |
protected static Method findSetter(String name, Class<?> type,
Class<?> self) {
if (name == null || name.trim().isEmpty()) {
return null;
}
Method[] methods = self.getDeclaredMethods();
for (Method method : methods) {
if (!method.getName().equals(name)) {
continue;
}
Class<?>[] ... | 9 |
private void setTimeSpinners() {
Date date = getDate();
if (date != null) {
timeSpinner.setValue( date );
}
} | 1 |
private static Box initialize() {
Box[] nodes = new Box[7];
nodes[1] = new Box(1);
int[] s = {1, 4, 7};
for (int i = 0; i < 3; ++i) {
nodes[2] = new Box(21 + i);
nodes[1].add(nodes[2]);
int lev = 3;
for (int j = 0; j < 4; ++j) {
... | 2 |
@Override
public int hashCode() {
int result = id;
result = 31 * result + (firstName != null ? firstName.hashCode() : 0);
result = 31 * result + (lastName != null ? lastName.hashCode() : 0);
result = 31 * result + (businessPhone != null ? businessPhone.hashCode() : 0);
result... | 7 |
public boolean stateEquals(Object o) {
if (o == this)
return true;
if (o == null || !(o instanceof MersenneTwister))
return false;
MersenneTwister other = (MersenneTwister) o;
if (mti != other.mti)
return false;
for (int x = 0; x < mag01.length; x++)
if (mag01[x] != other.mag01[x])
return fals... | 8 |
public void equipOutfit(Item outfit) {
if (! (outfit.type instanceof OutfitType)) return ;
final Actor actor = (Actor) owner ;
final JointSprite sprite = (JointSprite) actor.sprite() ;
final Item oldItem = this.outfit ;
this.outfit = outfit ;
if (hasShields()) fuelCells = MAX_FUEL_CELLS ;
//... | 6 |
private static void parseUnit(UnitTree tree, SourceInputStream in)
throws IOException, ParseException {
int ch = in.read();
List<Tree> children = tree.getChildren();
while (ch != -1) {
in.backup();
switch (ch) {
case '+':
case '-':
children.add(parseInc(in));
break;
case '<':
ca... | 9 |
public Collection<String> getFormatableAttributes(Class<?> clazz) {
Collection<String> attributes = new ArrayList<String>();
for(Method m : clazz.getMethods()) {
// lookup getters
String name = m.getName();
if (m.getParameterTypes().length == 0 && name.matches(getterPattern) && !exceptions.contains(name)) ... | 5 |
static String readChunk(BufferedReader br, int len) throws Exception {
StringBuilder sb = new StringBuilder();
for (int i = 0; i < len; ++i) {
int ch = br.read();
if (ch < 0)
throw new Exception("unexpected EOF in body");
if (ch >= U_0080 && ch < U_0800) // 2 bytes
++i;
else if (ch >= U_D800 &... | 9 |
public int SubjectVariable(PHPFileOperations PHPFile, String PHPFileTextClean, int CharNumStart) {
int i = 0, l = PHPFileTextClean.length();
char ch = ' ';
i = CharNumStart;
//recursively detect what follows the function name
while (i < l) {
ch = PHPFileTextClean.cha... | 7 |
public void vieillir() {
super.vieillir();
loterie = new Random();
if (age > 15)
fertilite = loterie.nextInt(100);
if (age <= 15 && poids < 40)
grossir(loterie.nextInt(3) + 1);
} | 3 |
StandardPlane(AbstractToolkit abstracttoolkit, int i, int i_123_, int i_124_, int i_125_, int[][] is, int[][] is_126_, int i_127_) {
super(i_124_, i_125_, i_127_, is);
anAbstractToolkit8004 = abstracttoolkit;
anInt7993 = -2 + anInt3410;
anIntArrayArrayArray8013 = new int[i_124_][i_125_][];
anIntArrayArrayArra... | 9 |
public void putAll( Map<? extends Float, ? extends Byte> map ) {
Iterator<? extends Entry<? extends Float,? extends Byte>> it =
map.entrySet().iterator();
for ( int i = map.size(); i-- > 0; ) {
Entry<? extends Float,? extends Byte> e = it.next();
this.put( e.getKey(),... | 8 |
private void setUpShader(String vertexPath, String fragmentPath) throws IOException {
shaderProgram = glCreateProgram();
int vertexShader = glCreateShader(GL_VERTEX_SHADER);
int fragmentShader = glCreateShader(GL_FRAGMENT_SHADER);
StringBuilder vertexShaderSource = new StringBuilder();
... | 5 |
public Object newInstance(final Object... override) throws InstantiationException, IllegalAccessException
{
if (clazz != null) {
return clazz.newInstance();
}
else if (isCollection || isArray) {
if (override.length > 0) {
return ((Class<?>) override[0]).newInstance();
... | 7 |
@Override
public Titre insert(Titre obj) {
PreparedStatement pst = null;
try {
pst = this.connect().prepareStatement("INSERT INTO Titre (nom,annee,id) VALUES (?,?,?);");
pst.setString(1, obj.getNom());
pst.setString... | 3 |
@After
public void tearDown() {
} | 0 |
protected void getClaimDetail(String title) {
if (title != null) {
for (int i = 0; i < claimResultList.size(); i++) {
if (claimResultList.get(i).getTitle().equals(title)) {
if (!(claimResultList.get(i).getDescription() == null
|| claimResultList.get(i).getDescription().equals("null"))) {
des... | 7 |
Color getShadedColorForType(int pType, double pSunValue)
{
double lBrightness;
if(pSunValue < 0)
{
// The sun is below the horizon.
lBrightness = fNightSideBrightness / 100;
} else
{
// The sun is above the horizon. The brightness will range from
// the base to the maximum... | 8 |
public void redraw() {
// update playing area
// 1) look at cards in playerHand and dealerHand and add/update labes in the "Grid"
for (int i = 1; i < dealerHand.getCardCount() + 1; i++) {
Card dealerCard = dealerHand.getCard(i - 1);
arLblDealer[i].setIcon(new ImageIcon(Ge... | 3 |
public static BufferedImage crop(BufferedImage image, int x, int y, int width, int height) {
return image.getSubimage(x, y, (width > 0 ? width : 1), (height > 0 ? height : 1));
} | 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.