text stringlengths 14 410k | label int32 0 9 |
|---|---|
private void callExpression()
{
if (accept(NonTerminal.CALL_EXPRESSION))
{
tryResolveSymbol(current);
expect(Token.Kind.IDENTIFIER);
expect(Token.Kind.OPEN_PAREN);
expressionList();
expect(Token.Kind.CLOSE_PAREN);
}
} | 1 |
public void resetOTItems(int WriteFrame) {
outStream.createFrameVarSizeWord(53);
outStream.writeWord(WriteFrame);
outStream.writeWord(playerOTItems.length);
for (int i = 0; i < playerOTItems.length; i++) {
if (playerOTItemsN[i] > 254) {
outStream.writeByte(255); // item's stack count. if over 254, ... | 4 |
public static void question1() {
/*
QUESTION PANEL SETUP
*/
questionLabel.setText("How are you feeling today?");
questionNumberLabel.setText("1");
/*
ANSWERS PANEL SETUP
*/
//resetting
radioButton1.setSelected(false);
radioButton2.s... | 0 |
public Image[] getCells(ImageRetriever paramImageRetriever, int paramInt1, int paramInt2)
{
Integer localInteger = new Integer(paramInt1);
if (animationList == null)
animationList = new Hashtable();
Object localObject = animationList.get(localInteger);
Image[] arrayOfImage;
if (localObject =... | 5 |
private long deleteByIndex(final long index)
{
assert 0 <= index && index < this.borderIndex : "Index: " + index + " - Border: "
+ this.borderIndex + " - MaxNum: " + this.maxNum + " replace: "
+ this.replace.get(index);
final long preBorderIndex = this.borderIndex - 1;
final long preBorderElement = repla... | 7 |
public static ResultSet doQuery(String cmd) throws DALException
{
try { return stm.executeQuery(cmd); }
catch (SQLException e) { throw new DALException(e); }
} | 1 |
public void changedUpdate(DocumentEvent e, Shape a, ViewFactory f) {
super.changedUpdate(e,a,f);
float align = getVerticalAlignment();
int height = fHeight;
int width = fWidth;
initialize(getElement());
boolean hChanged = fHeight!=height;
boolean wChanged = fWidth!=width;
if( hChanged || wChanged ||... | 3 |
@Override
public boolean isPossible(CommandInvocation invocation)
{
String token = invocation.currentToken();
if (token.startsWith("-"))
{
token = token.substring(1);
if (name().equalsIgnoreCase(token) || longName().equalsIgnoreCase(token))
{
... | 3 |
public void save(File file) {
try {
if (file.exists()) {
file.delete();
file.createNewFile();
}
Map<String, BufferedImage> images = new HashMap<>();
ZipOutputStream zipOutputStream = new ZipOutputStream(new FileOutputStream(file));
... | 5 |
public static boolean stageClear() {
for (Entity e : Game.world.entities) {
if (e instanceof Creature && ((Creature) e).isHostile()) return false;
}
return true;
} | 3 |
private void allocateQueueGridlet()
{
// if there are many Gridlets in the QUEUE, then allocate a
// PE to the first Gridlet in the list since it follows FCFS
// (First Come First Serve) approach. Then removes the Gridlet from
// the Queue list
if (gridletQueueList_.size() > ... | 3 |
public ListNode mergeKLists(List<ListNode> lists) {
while (lists.contains(null)) {
lists.remove(null);
}
if (lists.size() == 0) {
return null;
}
if (lists.size() == 1) {
return lists.get(0);
}
... | 9 |
public void setColumns(int colums) {
this.columns = colums;
} | 0 |
public XMLGregorianCalendar getStartDate() {
return startDate;
} | 0 |
public void testNodeRemoval3() {
setTree(new TreeNode("dummy"));
TreeNode root = new TreeNode("root", 1);
TreeNode subtree = new TreeNode("subtree", 1);
TreeNode leaf = new TreeNode("leaf");
root.branch[0] = subtree;
subtree.branch[0] = leaf;
Map tree = Collection... | 8 |
public void update() {
Vector3f dirToCam = Transform.getCamera().getPos().sub(transform.getTranslation());
float distance = dirToCam.length();
Vector3f orientation = dirToCam.div(distance);
alignWithGround();
faceCamera(orientation, distance);
switch(state){
... | 5 |
private static Mesh loadOBJMesh(String fileName) {
ArrayList<Vertex3f> vertices = new ArrayList<Vertex3f>();
ArrayList<Integer> indices = new ArrayList<Integer>();
try {
BufferedReader meshReader = new BufferedReader(new FileReader(fileName));
String line = new String();
while ((line = meshReader.readL... | 7 |
@Override
public void itemStateChanged(ItemEvent e) {
// TODO Auto-generated method stub
counter++;
if(counter == 2) {
JComboBox box = (JComboBox) e.getSource();
final String str = (String) box.getSelectedItem();
System.out.println("Changer destination");
new Thread(new Runnable() {
... | 2 |
public void rotate()
{
// Create temp copy of block
int[][] temp = new int[BLOCK_SIZE][BLOCK_SIZE];
for(int i = 0; i < BLOCK_SIZE; i++)
for(int j = 0; j < BLOCK_SIZE; j++)
temp[i][j] = block[i][j];
// Rotate block
/*block[0][0] = temp[3][0];
block[0][1] = temp[2][0];
block[0][2] = temp[1][0];
... | 4 |
public void step() throws IncorrectNodeException
{
super.step();
//Get the agent
Object agent = m_tree.getAgent();
GEBT_MarioAgent mario = (GEBT_MarioAgent)agent;
Graph levelGraph = mario.getMap().getGraph();
int marioNodeId = mario.getMarioNodeInM... | 9 |
public void maxify() {
// Find max dice possible.
int max_dice = 0;
for (int i=0; i<moves.size(); i++) {
int this_move_d = ((Move) moves.elementAt(i)).getNumAtomicMoves();
if (this_move_d > max_dice) {
max_dice = this_move_d;
}
}
// Remove those less than max dice.
// Check from end on down, so a... | 4 |
@Override
public void read() {
// TODO process currentEvent through Interpreter, load up next currentEvent?
// How do I handle conditionals?
// Conditionals?
if(currentEvent.isJsonArray()) {
/*if(Interpreter.interpretConditional(currentEvent.getAsJsonArray().get(0).getAsJsonObject())) {
currentEvent ... | 2 |
public boolean equals(Object o) {
if (! (o instanceof IPAddressAttribute))
return false;
IPAddressAttribute other = (IPAddressAttribute)o;
if (! address.equals(other.address))
return false;
if (mask != null) {
if (other.mask == null)
... | 7 |
public void newSongToLibrary()
{
Song newSong; //Create new song object
//Basic song info
String artist = "";
String title = "";
String path = "";
//JChooser for new song file
JFileChooser fileChooser = new JFileChooser(musicPath);
//... | 5 |
public void paint(Graphics2D g2d) {
AffineTransform identity = new AffineTransform();
// draw the page
g2d.setColor(Color.BLACK);
g2d.fillRect(0, 0, getWidth(), getHeight());
// draw the title
g2d.translate(40, 60);
g2d.setColor(Color.WHITE);
g2d.setFont(getFont());
g2d.drawString... | 6 |
@Override
public void getMouseEvent(int button) {
if (button == 0 && canClick){
if (PointMath.distance2Points(xLoc, yLoc, Boot.getPlayer().getX(), Boot.getPlayer().getY()) <= 2){
if (!initialized){
fill();
}
Boot.getGUIHandler().addWindow((new GUIInventoryWindow(-1, "Fridge", this, xLoc, yLoc, 3)... | 4 |
@Override
public void run()
{
ArrayList<Socket> sockets = new ArrayList<Socket>();
init();
while(!stop.get())
{
try
{
Socket clientSocket = serverSocket.accept();
Proxy proxy = new Proxy(clientSocket, config, stop);
sockets.add(clientSocket);
pool.execute(proxy);
}
catch(SocketExc... | 5 |
public LocalInfo getReal() {
LocalInfo real = this;
while (real.shadow != null)
real = real.shadow;
return real;
} | 1 |
public ListNode reverseKGroup(ListNode head, int k) {
ListNode reverseHead = null, reverseTail = null;
ListNode segHead = null, segTail = null;
int count = 1;
if (!canReach(head, k)) {
return head;
}
while (head != null) {
ListNode next = head.n... | 8 |
public void uimsg(String name, Object... args) {
if(name == "ch") {
img = Resource.loadtex((String)args[0]);
}
} | 1 |
public HashMap<Integer, Integer> solution(ArrayList<Integer> input) {
HashMap<Integer, Integer> result = new HashMap<Integer, Integer>();
int pos0 = 0;
int pos2 = input.size() - 1;
for (int i = 0; i < input.size(); i++) {
if (input.get(i) != 0) {
pos0 = i;
break;
}
}
for (int i = input.size() ... | 9 |
public static void recolor(BufferedImage img, int oldcolor, int newcolor){
for(int i = 0; i < img.getWidth(); i++){ // loops through the image's width
for(int i2 = 0; i2 < img.getHeight(); i2++){ // loops through the image's height
if(img.getRGB(i, i2) == oldcolor){
img.setRGB(i, i2, newcolor);
}
}... | 3 |
public Location getDestination(Location location) {
World world = location.getWorld();
double x = location.getX() + 0.5D;
double y = location.getY();
double z = location.getZ() + 0.5D;
while (blockIsAboveAir(world, x, y, z)) {
y -= 1.0D;
}
while (blockIsNotSafe(world, x, y, z)) {
y += 1.0D;
if (... | 3 |
@SuppressWarnings({ "unchecked", "unused" })
@ApiMethod(name = "listDeviceInfo")
public CollectionResponse<DeviceInfo> listDeviceInfo(
@Nullable @Named("cursor") String cursorString,
@Nullable @Named("limit") Integer limit) {
EntityManager mgr = null;
Cursor cursor = null;
List<DeviceInfo> execute = null... | 5 |
private static void makeTet4(SquareColor[][] tet) {
for (int i = 0; i < 4; i++) {
for (int j = 0; j < 4; j++) {
if (((i == 1 || i == 2) && j == 1) || (i == 3 && (j == 0 || j == 1))) {
tet[i][j] = SquareColor.YELLOW;
} else tet [i][j] = null;
... | 8 |
public void craftingComplex(int screen) {
if (screen == 1) {
clearMenu();
menuLine("10", "Cloth", 3224, 0);
menuLine("21", "Vegetable Sack", 5418, 1);
optionTab("Crafting", "Weaving", "Weaving", "Armour", "Spinning",
"Pottery", "Glass", "Jewellery", "Weaponry", "Milestones",
"", "", "", "", "");... | 8 |
private URL getUrlFromString(String text) {
try {
return new URL(text);
} catch (MalformedURLException e) {
return null;
}
} | 1 |
@Override
public void populate(World world, Random random, Chunk chunk) {
int cxx = chunk.getX() << 4;
int czz = chunk.getZ() << 4;
for (int x = 0; x < 16; x++) {
for (int z = 0; z < 16; z++) {
world.setBiome(x + cxx, z + czz, Biome.PLAINS);
for (int y = 0; y < PlotConfiguration.intPlotHeight + 2; y+... | 9 |
public Player(Vec2 pos, Vec2 dim) {
super(pos, dim);
textures = new Texture[Animation.values().length][];
textures[Animation.WALKING.ordinal()] = new Texture[8];
for (int i = 0; i < textures[Animation.WALKING.ordinal()].length; i++) {
try {
textures[Animation.WALKING.ordinal()][i] = TextureLoader.getTex... | 8 |
@Test
public void testInitializationFailures() {
PagedRequest.fromStartWithLimit(0);
PagedRequest.fromStartWithPageSize(0);
PagedRequest.ofOffsetAndLimit(0, 0);
PagedRequest.ofPageNumberAndPageSize(1, 0);
try {
PagedRequest.fromStartWithLimit(-1);
... | 7 |
public void equipArmour() {
// Get all available armour
String[] playerItems = player.getInventory().getArmourTexts();
if (playerItems.length == 0) {
log.println("You have nothing to put on.");
} else {
JPanel panel = new JPanel();
panel.setLayout(new GridLayout(0, 1));
final JRadioButton[] radioBut... | 7 |
public static String doubleToString(double d) {
if (Double.isInfinite(d) || Double.isNaN(d)) {
return "null";
}
// Shave off trailing zeros and decimal point, if possible.
String string = Double.toString(d);
if (string.indexOf('.') > 0 && string.indexOf('e') < 0
... | 7 |
public BigDecimal kurtosisExcess_as_BigDecimal() {
boolean hold = Stat.nFactorOptionS;
if (nFactorReset) {
if (nFactorOptionI) {
Stat.nFactorOptionS = true;
} else {
Stat.nFactorOptionS = false;
}
}
BigDecimal kurtosis = BigDecimal.ZERO;
switch (type) {
case 1:
case 12:
BigDecimal[] bd... | 5 |
private final void method1571(int i, int[] is, byte i_96_) {
try {
if (i_96_ <= 81)
anInt2805 = -46;
for (int i_97_ = 31; i_97_ > 0; i_97_--) {
int i_98_ = 36 * i_97_;
for (int i_99_ = 35; i_99_ > 0; i_99_--) {
if (is[i_99_ - -i_98_] == 0
&& is[i_99_ + i_98_ - 1 + -36] != 0)
is[i_98_ + i_99... | 7 |
public void endElement(String uri, String localName, String qName) throws SAXException {
try {
if ("Title".equals(qName)) {
result.title = buffer.toString();
} else if ("Summary".equals(qName)) {
result.summary = buffer.toString();
... | 8 |
@Override
protected void onPrivateMessage(String sender, String login, String hostname, String message) {
PrivateMessagingListener listener = getPrivateMessagingListener(sender);
if (listener != null)
listener.privateMessageReceived(message);
else if (serverEventsListener != null... | 2 |
private final Worker getWorker()
{
try
{
return(Worker) pool.pop();
}
catch(EmptyStackException x)
{
int maxThreads = XmlRpc.getMaxThreads();
if (workers < maxThreads)
{
workers += 1;
if (workers ... | 3 |
public boolean checkToolTips() {
boolean result;
Class cls;
BeanInfo info;
PropertyDescriptor[] desc;
int i;
Vector<String> missing;
String suffix;
print("Tool tips...");
result = true;
suffix = "TipText";
cls = getObject().getClass();
// ge... | 8 |
public void actionPerformed(ActionEvent e) {
if (e.getSource() == btn_file) {
JFileChooser chooser;
chooser = new JFileChooser();
chooser.setCurrentDirectory(new java.io.File("."));
chooser.setDialogTitle("Select Corpus");
chooser.setAcceptAllFileFilterUsed(false);
if (chooser.showOpenDialog(this)... | 9 |
private ArrayList<ArrayList<String>> getProgramCode() {
ArrayList<ArrayList<String>> code = new ArrayList<ArrayList<String>>();
for (int i = 0; i < tblInput.getRowCount(); i++) {
ArrayList<String> line = new ArrayList<String>();
for (int j = 1; j < tblInput.getColumnCount(); j++) {
String value = (String)... | 4 |
public void changeRectanglePos(int rectId, int result[]){
for(Rectangle rectangle: listRectangles){
if(rectangle.getRectId() == rectId){
rectangle.setX(result[0]);
rectangle.setY(result[1]);
rectangle.repaint();
boolean removed= removeCircleIfExists(result[0], result[1]);
if(removed){
... | 5 |
@Override
public void actionPerformed(ActionEvent e) {
DBAccess = new DALObject();
String name = "";
do {
name = new DialogBox(frame).getText();
} while (!(name != null && !name.isEmpty() && !name.trim().isEmpty()));
int TabTailleX = obj.getUpdatedTab().g... | 6 |
public void clear(){
for(int i=0; i<modes; i++){
mode_param[i]=null;
}
mode_param=null;
for(int i=0; i<maps; i++){ // unpack does the range checking
FuncMapping.mapping_P[map_type[i]].free_info(map_param[i]);
}
map_param=null;
for(int i=0; i<times; i++){ // unpack does the rang... | 8 |
@Test
public void testGetAllTransactionRecordsWithCriteria() {
CardPaymentRequest paymentRequest = getCreditCardPaymentRequest(
getRandomOrderId("TEST_QUERY"), "12.34");
paymentRequest.getCard().setName("Sideshow Bob");
try {
PaymentResponse payment = beanstream.paym... | 3 |
private void InserirNovaMateriaPrima() {
//DAODS A GRAVAR
String nomeMateria = jTextFieldNomeMateriaPrima.getText();
String descricaoMateria = jTextAreaDescricaoMateriaPrima.getText();
String unidadeMateria = jTextFieldUnidadeMateriaPrima.getText();
boolean estadoMP = true;
... | 7 |
private synchronized Double doubleValue() {
if (doubleValue == null) {
doubleValue = number.doubleValue();
}
return doubleValue;
} | 1 |
public static double chiSquareInverseCDF(int nu, double prob) {
if (prob < 0.0 || prob > 1.0) throw new IllegalArgumentException("Entered cdf value, " + prob + ", must lie between 0 and 1 inclusive");
double icdf = 0.0D;
if (prob == 0.0) {
icdf = 0.0;
} else {
if (prob == 1.0) {
icdf = Double.POSITI... | 4 |
@Override
public Query parse() {
if(!this.prepared) {
this.prepared = true;
StringBuilder sB = new StringBuilder();
sB.append("UPDATE ");
sB.append(table.replace("#__", this.db.getPrefix()));
sB.append("\n");
sB.append(" SET ");
int s = this.set.size();
for(int i = 0; i < s; ++i) {
... | 7 |
public List<Monitor.Use> getUse() {
if (use == null) {
use = new ArrayList<Monitor.Use>();
}
return this.use;
} | 1 |
protected void processRequest(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
response.setContentType("text/html;charset=UTF-8");
PrintWriter out = response.getWriter();
String categoryid = request.getParameter("categoryid");
String pr... | 9 |
public void loadData(){
String line = null;
try{
BufferedReader in = new BufferedReader(new InputStreamReader(new FileInputStream(file), encoding));
while ((line = in.readLine()) != null){
if (line.equals("StarDict's dict ifo file")){
continue;
}
if (line.contains("=")){
data... | 6 |
public boolean CheckVert() {
boolean flat = true;
for (int dcnt = 0; dcnt < ninputs; dcnt++) {
flat &= (this.loc[dcnt] == 0.0);
}
//flat &= (pnt.loc[ninputs] != 0.0);
if (flat) {
boolean nop = true;
}
for (int cnt = 0; cnt < ndims; cnt++) {
if (this.loc[... | 4 |
@Override
public void actionPerformed(ActionEvent e) {
if (e.getActionCommand().equals(EditStudentPanel.CHOOSE_STUDENT_FOR_EDIT)) {
this.editStudent(((Student)this.getStudentListModel
().getElementAt(this.getStudentList().getSelectedIndex())));
}
else if (e.getActionCommand().equals(EditStudentPanel.SAVE... | 7 |
@SuppressWarnings("unchecked")
private void refreshGameList() {
try {
sendToServer(Packet.getGameListPacket());
Packet answer = PacketManager.readPacketFromStream(in);
if(answer == null) {
fatalErrorExit("Server co... | 6 |
protected void writeDataToNewFile(Collection<?> input) {
File toWrite = null;
BufferedWriter writer = null;
try {
File dir = new File(getEligibleOutputFolder());
if (!dir.exists())
dir.mkdir();
toWrite = new File(dir, getFileToWriteName());
if (!toWrite.exists())
toWrite.createNewFile();
wr... | 6 |
public boolean checkPassword(String entered_password) {
for(int i=1;i<=3;i++)
if( new User().checkPassword(entered_password))
{
return true;
}
return false;
} | 2 |
private void checkDefRelAddress() {
// iterate through the moduleList
Iterator<ObjectModule> modListIt = moduleList.iterator();
while (modListIt.hasNext()) {
ObjectModule module = modListIt.next();
int currModuleSize = module.codeCount - 1;
// iterate through the current defList,
Iterator<SymbolP... | 4 |
public void variableUnassigned(Variable unassignedVar, int oldAssignment) {
//see if the clause is still satisfied.
//if it is, nothing changes
if(isSatisfied()) return;
//make sure the variable is in this clause
if(! variableInClause(unassignedVar)) return;
//check if someone is unit who shouldn't be
c... | 8 |
public static Color getColor(StockState state) {
if (state.equals(StockState.EARLY)) {
return new Color(0x5d74ff);
}
else if (state.equals(StockState.MINIMUM_OPTIMAL)) {
return new Color(0x3bbb25);
}
else if (state.equals(StockState.OPTIMAL_MAXIMUM)) {
return new Color(0xe7f730);
}
else if (state... | 4 |
public static void alterar_Evento_individual(int opcao2) {
boolean erro = false;
listar();
confirmar_Id();
for (int i = 0; i < list.size(); i++) {
if (list.get(i).getEvento_ID() == opcao) {
if (opcao2 == 1) {
System.out.println("Evento ID:... | 9 |
public ArrayList<Move> getPossibleMoves()
{
ArrayList<Move> possibleMoves = new ArrayList<Move>();
int orientation = getLoyalty() == Loyalty.RED ? 1 : -1;
for(int i = - 1; i <= 1; i += 2)
{
Location currentLoc = new Location(getLoc().getRow() + orientation, getLoc().getCol() + i);
if(getBoard()... | 7 |
public void move(ArrayList<Coordinate> validPaths) {
boolean catMoved = false;
int index = 0;
Coordinate nextCoordinate;
// shuffling the path
java.util.Collections.shuffle(validPaths);
nextCoordinate = validPaths.get(index);
// if only one path is available then move to that coordinate
if(validPath... | 5 |
private Position getSubImagePosition() {
Position position = new Position();
switch (currentType) {
case LIGHT_STONE:
position.x = 0;
break;
case GREEN_STONE:
position.x = 93;
break;
case GREY_STONE:
... | 4 |
private static void bump(ArrayList<ArrayList<Integer>> rows, int w) {
if (rows.size() == 0) {
rows.add(new ArrayList<Integer>());
rows.get(0).add(w);
return;
}
for (ArrayList<Integer> row : rows) {
int i = 0;
while (i < row.size() && ro... | 9 |
public void dumpMeals() {
SimpleMealDaoImpl dao = getSimpleMealDaoImpl();
List<SimpleMeal> result = new ArrayList<>();
Session session = null;
Transaction tx = null;
try {
session = HbUtil.getSession();
//TRANSACTION START
tx = session.beginTr... | 5 |
public FileDownloadItem[] getFileDownloadItems(){
return (FileDownloadItem[]) items.toArray();
} | 0 |
private static String getFileContents(String filename)
throws IOException, FileNotFoundException
{
File file = new File(filename);
StringBuilder contents = new StringBuilder();
BufferedReader input = new BufferedReader(new FileReader(file));
try {
String line = ... | 1 |
@Override
public int subscribe(String nick, String firstName, String lastName, String password, String email) {
Player p = new Player(firstName, lastName, nick, password, email, 0);
//Si le joueur "ordinateur" n'existe pas dans la base
if (em.find(Player.class, "computer") == null) ... | 3 |
public Set<Map.Entry<K, V>> entrySet() {
Set<Map.Entry<K, CachedValue<V>>> entrySet = cache.entrySet();
List<K> expiredKeys = new ArrayList<K>(128);
Set<Map.Entry<K, V>> result = new HashSet<Map.Entry<K,V>>(entrySet.size());
for (Map.Entry<K, CachedValue<V>> entry : entrySet) {
CachedValue<V> cach... | 3 |
public static void crearCliente(HashMap<Integer, Clientes> tablaClientes)
{
String nombre;
String apellidos;
String dni;
int edad = 0;
boolean edadCorrecta = false;
boolean dniCorrecto = true;
Scanner entrada = null;
do // Validacion nombre
{
entrada = new Scanner(System.in);
System.out.p... | 7 |
@Override
public void closeDoors() {
System.out.println("closeDoors");
} | 0 |
public void mouseClicked(MouseEvent me)
{
xpos=me.getX();
ypos=me.getY();
if(xpos>rectlxco && xpos<rectlxco+rectlwidth && ypos>rectlyco&&
ypos<rectlyco+rectlheight) rectlclicked=true;
else
rectlclicked=false;
repaint();
} | 4 |
public static String escapeXMLAttribute(String text) {
text = StringTools.replace(text, "&", "&");
text = StringTools.replace(text, "<", "<");
text = StringTools.replace(text, "\"", """);
return text;
} | 0 |
public static void main(String[] args) {
ApplicationContext context = new ClassPathXmlApplicationContext("spring.xml");
if (context.containsBean("quarantinedDataSource")) {
LOG.info("Using quarantinedDataSource");
} else {
LOG.info("Using normal dataSource");
}
EventService service = context.getBean(E... | 3 |
public static void ChooseJason ()
{
if (Game.characterChoice == 1)
{
Game.CharacterOne = "Jason";
Game.CharacterOneHP = CharacterStats.JasonHP;
Game.CharacterOneAttack = CharacterStats.JasonAttack;
Game.CharacterOneMana = CharacterStats.JasonMana;
Game.CharacterOneRegen = CharacterStats.J... | 2 |
private void expand2(byte[] src, byte[] dst) {
for(int i=1,n=dst.length ; i<n ; i+=4) {
int val = src[1 + (i >> 2)] & 255;
switch(n-i) {
default: dst[i+3] = (byte)((val ) & 3);
case 3: dst[i+2] = (byte)((val >> 2) & 3);
case 2: dst[i+... | 4 |
@Override
public void recordRoll(int pinsKnockedDown)
{
assert 0 <= pinsKnockedDown : "pinsKnockedDown = " + pinsKnockedDown + " < 0!";
assert pinsKnockedDown <= 10 : "pinsKnockedDown = " + pinsKnockedDown + " > 10!";
assert (getCurrentBall() == 1) || ((getCurrentBall() == 2) && (((getCurrentFrame() == 10) && ... | 8 |
public TruncateHelper setCompressWhiteSpace(boolean compressWhiteSpace)
{
this._compressWhiteSpace = compressWhiteSpace;
return this;
} | 0 |
private Command parse(String userInput) {
if (userInput == null) {
return null;
}
StringTokenizer tokenizer = new StringTokenizer(userInput);
if (tokenizer.countTokens() == 0) {
return null;
}
CommandName commandName = null;
String userName = null;
String sellerName = null;
float amount = 0;
... | 9 |
public void run() {
boolean test = false;
if (test || m_test) {
System.out.println("Timer :: run() BEGIN");
}
while (m_running) {
secondInterval();
++m_seconds;
if (m_seconds >= MINUTE) {
++m_minutes;
m_seconds = 0;
}
if (m_minutes >= HOUR) {
++m_hours;
m_min... | 8 |
public double getPesoLlaveEntera(int llave){
double peso = 0;
switch (llave) {
case 0:
peso = this.getPeso(THRESHOLD);
break;
case 1:
peso = this.getPeso(EMBARAZOS);
break;
case 2:
peso = this.getPeso(CONCENTRACION_GLUCOSA);
break;
case 3:
peso = this.getPeso(PRESION_ARTER... | 9 |
@Override
public Seat getResearvedSeat(Passenger passenger) {
for (int i = 0; i < passengerList.size(); i++) {
List<Passenger> _rowIteretor = passengerList.get(i);
for (int j = 0; j < _rowIteretor.size(); j++) {
Passenger _passenger = _rowIteretor.get(j);
... | 3 |
public void popup(MouseEvent e){
if (e.isPopupTrigger()) {
if (e.isPopupTrigger()) {
MainRightClickMenu.pop.show(e.getComponent(), e.getX(), e.getY());
MainRightClickMenu.eBox = e;
}
}
} | 2 |
public int getCountContainKeyWord(String key,String classFile,
Map<Integer, Map<String, Double>> classMap) {
int ret = 0;
Set<Integer> fileList = classMap.keySet();
for (int file : fileList) {
Map<String, Double> map = classMap.get(file);
if (map.containsKey(key)) {
ret++;
}
}
return ret;
} | 2 |
public static double[][] stringToRange(String rangeStr) {
Matcher rangeMatcher = rangePattern.matcher(rangeStr);
List<String> rangeStrs = new ArrayList<String>();
while (rangeMatcher.find()) {
rangeStrs.add(rangeMatcher.group());
}
if (rangeStrs.size() == 0) {
... | 5 |
public Complex mean_as_Complex() {
Complex mean = Complex.zero();
switch (type) {
case 1:
double[] dd = this.getArray_as_double();
double meand = 0.0D;
for (int i = 0; i < length; i++)
meand += dd[i];
meand /= length;
mean = new Complex(meand);
break;
case 12:
BigDecimal[] bd = this.get... | 6 |
public void setProtected(final boolean flag) {
if (this.isDeleted) {
final String s = "Cannot change a field once it has been marked "
+ "for deletion";
throw new IllegalStateException(s);
}
int modifiers = fieldInfo.modifiers();
if (flag) {
modifiers |= Modifiers.PROTECTED;
} else {
modifi... | 2 |
public String getServerStatus() throws SQLException {
for(int i = 0; i < values.length; i++) {
keyWords.put(keys[i], values[i]);
}
DatabaseMetaData metadata = conn.getMetaData();
serverStatusString = ""; // clear string
serverStatusString += "-----------------------Server status-----------------------\n";
... | 5 |
@Test
public void testSetDisplayAnswer3() {
int diff = 1;
answers = new LinkedList<Answer>();
answers.add(new Answer("are roses,"));
answers.add(new Answer("moses supposes"));
answers.add(new Answer("irronically"));
dummyQuestion = new Question(question, answers, diff, type, correct);
try {
dummyQue... | 4 |
@SuppressWarnings("unchecked")
public void reload(){
loadYamlFiles(true);
poisonDuration = config.getInt(Util.concatStrings(Constants.ABILITIES_DATA, ".", Constants.POISON_DURATION));
disorientDuration = config.getInt(Util.concatStrings(Constants.ABILITIES_DATA, ".", Constants.DISORIENT_DURATION));
instance.ge... | 6 |
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.