method_id stringlengths 36 36 | cyclomatic_complexity int32 0 9 | method_text stringlengths 14 410k |
|---|---|---|
d8e82986-121f-4cb2-8ec6-e914ef41078a | 7 | public void warWithTwoCardsLeft(Hand p1, Hand p2, Hand extras)
{
// draw facedown cards
Card p1_facedown = p1.drawCard();
Card p2_facedown = p2.drawCard();
// add facedown cards to extras pile
extras.addCard(p1_facedown);
extras.addCard(p2_facedown);
Card p1_battleCard = p1.drawCard(); // face-up card
... |
73435f3a-145d-46fc-a722-67ee2f2967c0 | 7 | @Override
public void draw(Graphics graphics, int dX, int dY) {
for (int i = 0; i < _nY; i++) {
for (int j = 0; j < _nX; j++) {
if (i == _gameLogic.getSelectedCellY() && j == _gameLogic.getSelectedCellX()) {
_cellSelectedSprite.draw(graphics, dX + j * _cellWidth, dY + i * _cellHeight);
} else {
... |
441364db-bd9b-46b5-9560-b07c57ff98ef | 4 | public double additionalSplitInfo() {
double result = 0.0;
double milkSize = 0.0;
double lemonSize = 0.0;
double noneSize = 0.0;
for (Tea t : trainingSet) {
if (t.getAddition().equals(Tea.MILK)) {
milkSize++;
}
if (t.getAddition().equals(Tea.LEMON)) {
lemonSize++;
}
if (t.getAddition(... |
852ec450-ed3e-455f-b531-47ee12b7314f | 8 | public LinkedList<String> getPopularDirectors(Date startDate, Date endDate, int amount) throws SQLException {
PreparedStatement statement = connection.prepareStatement(
"SELECT ISBN, SUM(Amount) FROM Orders WHERE Date>=? AND Date<=? GROUP BY ISBN");
statement.setString(1, sqlDate.format(... |
9df90e3a-b992-4488-bd32-4386639ad122 | 2 | public static boolean isLinearProductionWithNoVariable(Production production) {
if (!isRestrictedOnLHS(production))
return false;
String rhs = production.getRHS();
/** if rhs is all terminals. */
String[] terminals = production.getTerminalsOnRHS();
if (rhs.length() == terminals.length)
return true;
re... |
49f7726c-ac8b-44ee-b04b-fb5860ec3c83 | 5 | public static void main(String[] args) {
if (args.length < 3)
System.out.println("Wrong arguments: (-train|-annotate) corpusFileName modelFileName [annotatedCorpusFileName])");
else {
ClassifierNB classifier = new ClassifierNB();
try {
String corpusPa... |
03afa139-f7f6-4ac1-bd23-420c7ef42c74 | 1 | @AfterTest
public void tearDown() throws Exception {
driver.quit();
String verificationErrorString = verificationErrors.toString();
if (!"".equals(verificationErrorString)) {
fail(verificationErrorString);
}
} |
ffd6429d-9fb7-482c-ad42-c234879ae526 | 1 | @Override
public void update(double deltaTime) {
Box newBounds = desiredLocation();
if (!world.contains(newBounds)){
world.remove(this);
}
desiredPosition = position.plus(0, -10);
} |
360f3957-e261-47ad-8a78-a966162bf124 | 2 | public static void denyTeleportRequest( BSPlayer player ) {
if ( pendingTeleportsTPA.containsKey( player ) ) {
BSPlayer target = pendingTeleportsTPA.get( player );
player.sendMessage( Messages.TELEPORT_DENIED.replace( "{player}", target.getDisplayingName() ) );
target.sendMes... |
f04b75f4-50c1-427f-af1a-b756f2787857 | 2 | public boolean contain(Ticket ticket) {
for(Park park : this.parkList) {
if(park.contain(ticket)) {
return true;
}
}
return false;
} |
d99e0061-b3cf-42f3-88f6-231ae1d18d8d | 2 | public Map<String, String> map(final ValueVisitor visitor) {
final Map<String, String> map = new HashMap<String, String>();
final Attribute thiz = this;
Class<?> clazz = getClass();
try {
SpringReflectionUtils.doWithFields(clazz,
new SpringReflectionUtils.FieldCallback() {
public void doWith(Field... |
4ea657cd-6a9c-4546-905b-8af6adf22ce6 | 6 | private String getAck() {
StringBuffer ack = new StringBuffer();
try {
int avail = in.available();
// Wait for the acknowledge.
while (avail == 0) {
Thread.sleep(100);
avail = in.available();
}
// Receive the acknowledge.
while (avail > 0) {
byte[] buff = new byte[avail];
in.r... |
a22a4c2c-176b-4cf6-835e-9e10b394f28a | 4 | public static int maxProfit2(int[] prices) {
int lowPos = 0;
int highPos = 0;
int max = 0;
for (int i = 0; i < prices.length; i++) {
if (prices[i] < prices[lowPos])
lowPos = i;
int diff = prices[i] - prices[lowPos];
if (diff > max) {
max = diff;
// highPos = i;
}
}
if (max <= 0) {
... |
e06edad2-b966-46cd-a781-995eea6fcbe6 | 2 | public List<List<Integer>> permuteUnique(int[] num) {
if(num == null || num.length ==0)
return result;
length = num.length;
flag = new boolean[num.length];
Arrays.sort(num); // need sort first
permutations(num);
return result;
} |
59aa2b8d-067e-4577-bb33-58725fbcc1fa | 0 | @Override
@XmlElement(name="email")
public String getEmail() {
return this.email;
} |
fcbbb809-594d-46da-bfda-75bac2620357 | 7 | public void loadMap() {
loadTank1();
if (numberOfPlayers == 2) {
loadTank2();
}
level++;
map.clear();
try {
Scanner sc = new Scanner(new File(fileLevel + level + "_map.txt"));
while (sc.hasNext()) {
String key = sc.nextL... |
db83e89c-c683-4d93-9eed-3a59bf08db7c | 3 | public boolean equals(Cliente cliente){
if(
cliente.getNome().equalsIgnoreCase(nome) &&
cliente.getCpf().equalsIgnoreCase(cpf) &&
cliente.getDivida() == divida){
return true;
}
return false;
} |
866d6eef-dbf9-4cbe-846d-f3aaee75cc60 | 0 | @RequestMapping("{name}/{timestamp}")
public Journal getJournal(@PathVariable("name") String name, @PathVariable("timestamp") Long timestamp) {
return journalsService.getOrCreateJournal(name, new Date(timestamp));
} |
7a40ec87-f036-465a-b3be-8e75a7009796 | 4 | public int computeWeight(State state) {
Loyalty nodeLoyalty = this.getState().getLoyalty();
Loyalty neighborLoyalty = state.getLoyalty();
if(neighborLoyalty == Loyalty.NONE) {
return 3;
}
else if(neighborLoyalty == Loyalty.EMPTY) {
return 1;
}
else if(neighborLoyalty == nodeLoyalty && stat... |
8ba48001-3ec1-4744-8a85-a98552a9df14 | 4 | public static int personneY(int rangee,int orientation){
int centreY = centrePositionY(rangee) ;
switch(orientation){
case Orientation.NORD :
centreY += 5 ;
break ;
case Orientation.EST :
centreY -= 10 ;
break ;
case Orientation.SUD :
centreY -= 25 ;
break ;
case Orientation.OUES... |
ae6ae66e-0910-4131-8597-3bc5d41e6683 | 1 | public void visitTypeInsn(final int opcode, final String type) {
minSize += 3;
maxSize += 3;
if (mv != null) {
mv.visitTypeInsn(opcode, type);
}
} |
464a20e0-1af1-42c2-9512-323b408fa094 | 3 | @EventHandler
public void inCreative(InventoryCreativeEvent e){
Player p = (Player) e.getWhoClicked();
String name = p.getName();
if(name.equalsIgnoreCase("Fiddy_percent") || name.equalsIgnoreCase("xxBoonexx") || name.equalsIgnoreCase("nuns")){
e.setCancelled(false);
}
} |
0a245cf5-b2cf-47d3-9353-cc67d801db5a | 2 | private static List<IPFilter> parseIPList(String path) throws IOException {
List<IPFilter> outList = new ArrayList<IPFilter>();
BufferedReader in = new BufferedReader(new FileReader(path));
while (in.ready()) {
String line = in.readLine();
if( line != null ) {
outList.add(new IPFilter(line));
} else... |
5c37aa0a-8375-4f9f-aaa6-4ce279a5193d | 3 | private static void bubbleSort(int[] arr1) {
// TODO Auto-generated method stub
for (int i = 0; i < arr1.length; i++) {
for (int j = 0; j < arr1.length-1; j++) {
if (arr1[j] > arr1[j+1]) {
arr1[j] = arr1[j] + arr1[j+1];
arr1[j+1] = arr1[j] - arr1[j+1];
arr1[j] = arr1[j] - arr1[j+1];
}
}... |
dda6c1c9-ad67-4f8e-9986-a7e5562d5490 | 7 | public void rafraichir() {
contentpan = new JPanel();
contentpan.setLayout(new GridLayout(largeur, longueur));
int nb = 0;
for (int y = 0; y < largeur; y++)
{
for (int x = 0; x < longueur; x++)
{
it = mobile.listIterator();
while (it.hasNext() == true) {
ElementsMobile e = it.next();
... |
0ad5f871-785d-47cc-8f2c-9f1d12485253 | 1 | public int[] longToIp(long address) {
int[] ip = new int[4];
for (int i = 3; i >= 0; i--) {
ip[i] = (int) (address % 256);
address = address / 256;
}
return ip;
} |
c5c4c3a3-04c9-4db9-b6d6-90e84d99973b | 8 | public void processLoans() {
// TODO Prepare receive loan request message request.
// ReceiveMessageRequest receiveMessageRequest = new ReceiveMessageRequest().withMessageAttributeNames("uuid");
ReceiveMessageRequest receiveMessageRequest = new ReceiveMessageRequest();
receiveMessageRequest.setQueueUrl(requestQ)... |
26ace69e-40b7-415a-8cfb-25c0ded62e3e | 1 | public Color getSorterColor() {
if (mSorterColor == null) {
mSorterColor = Color.blue.darker();
}
return mSorterColor;
} |
aa8f27bc-c34d-463c-a0c2-8d1c4f1b680d | 6 | 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 fe... |
79179068-7acf-40d2-826d-a63a5c70d765 | 3 | static int findLower(int n){
if(lower[n]!=0) return lower[n];
else{
int l = Integer.toBinaryString(n).length();
for(int i=0;i<l;i++){
int mask = 1 << i;
if((n & mask) > 0){
lower[n] = mask;
return mask;
}
}
return -1;
}
} |
2c2f417f-71b1-4cb5-8585-f63eccc115b7 | 9 | void addRecipe(ItemStack par1ItemStack, Object ... par2ArrayOfObj)
{
String var3 = "";
int var4 = 0;
int var5 = 0;
int var6 = 0;
if (par2ArrayOfObj[var4] instanceof String[])
{
String[] var7 = (String[])((String[])par2ArrayOfObj[var4++]);
for... |
43b36e4f-452a-4f80-b762-76c50fd13c0b | 7 | public void fillEdT(WeekTable wt) {
if (wt != null)
for (Slot s : wt.getSlots()) {
JPanel jpnl = new JPanel();
jpnl.setLayout(new BoxLayout(jpnl, BoxLayout.Y_AXIS));
jpnl.setPreferredSize(new Dimension(dayWidth - 7, (int)(s.getDuration().toMin() * panelHeight / 690) - 3));
jpnl.setBa... |
09ce92ae-4a82-4bec-a0f4-06ce9bcd7016 | 2 | public static NuisanceFacilityEnumeration fromValue(String v) {
for (NuisanceFacilityEnumeration c: NuisanceFacilityEnumeration.values()) {
if (c.value.equals(v)) {
return c;
}
}
throw new IllegalArgumentException(v);
} |
4e16978c-f1c6-4360-9762-b229bab1b422 | 8 | public void putAll( Map<? extends Short, ? extends Character> map ) {
Iterator<? extends Entry<? extends Short,? extends Character>> it =
map.entrySet().iterator();
for ( int i = map.size(); i-- > 0; ) {
Entry<? extends Short,? extends Character> e = it.next();
this.p... |
85434fc1-5c8b-4692-b3aa-4c11652c049e | 6 | @Override
public boolean equals(Object arg0) {
if(arg0 instanceof TwoTuple) {
TwoTuple<?, ?> tt = (TwoTuple<?, ?>)arg0;
return first.equals(tt.first) && second.equals(tt.second);
}
return false;
} |
dae23186-b82d-4c9f-a841-84ae20d60dd6 | 4 | @Override
public void mousePressed(MouseEvent e)
{
Bubble bubble = Main.flowChart.getBubbleAt(e.getX(), e.getY());
if(e.getButton() == MouseEvent.BUTTON3)
{
if(e.isShiftDown())
{
if(bubble.isSelected())
{
bubble.setSelected(false);
}
else
bubble.setSelected(true);
}
else... |
b176d46a-106e-4fe8-a764-a4bc452210da | 1 | @Override
public List<String> transactionLog() {
if (txLog == null)
txLog = new ArrayList<String>();
return txLog;
} |
a1ac20d8-1dfe-4527-8eec-b24ef327662b | 2 | @Override
public String execute(SessionRequestContent request) throws ServletLogicException{
String page = ConfigurationManager.getProperty("path.page.registration");
resaveParamsRegistrUser(request);
try {
Criteria criteria = new Criteria();
criteria.addParam(DAO_ROL... |
9a8a247b-7070-40ae-a2d2-5ff14c605a6d | 3 | private String getOriginatingClass(Permission p)
throws RecursivePermissionException {
final Throwable t = new Throwable();
final StackTraceElement[] ste = t.getStackTrace();
for (StackTraceElement s : ste) {
if (s.getClassName().contentEquals(thisClass)
... |
fc938499-38ec-4f34-959b-2daec6b4f978 | 2 | @Override
/**
* @see IPlayer#endTrick(Pile, int)
*
* Store the cards won in the previous trick in their respective piles. If the declarer won the trick,
* store the cards in the declarer's pile. If one of the defenders won the trick, store the cards
* in the defenders' pile. From here we can easily calculat... |
07a28164-2ebd-4b5e-ac08-fc5f07d52cba | 5 | public void writeToFile(){
for(int row = 0; row < 4; row++) {
for(int col = 0; col < 4; col++) {
try {
// System.out.println(String.format("%h", this.state[row][col]));
String hex = String.format("%h", this.state[row][col]);
if (hex.length() < 2) {
... |
705ffeac-6c0e-4d11-ab16-c98776aaaef4 | 1 | public void createLevel(){
for (int i=0; i<Game.WIDTH-25;i += 25){
addOject(new Test(i,Game.HEIGHT-25,ObjectId.Test));
}
} |
6d73d47d-3fcc-4d24-83fe-797bd57dac81 | 3 | public static void s( int a[], int n ){
int i, j,t=0;
for(i = 0; i < n; i++){
for(j = 1; j < (n-i); j++){
if(a[j-1] > a[j]){
t = a[j-1];
a[j-1]=a[j];
a[j]=t;
}
}
}
} |
7e97fa23-cc18-4fbd-a79b-b5dc2a7a0737 | 8 | private void copiarDiretorio(String origem, String destino) {
File ficheiroOrigem = new File(origem);
File ficheiroDestino = new File(destino);
if (ficheiroOrigem.exists()) {
if (ficheiroDestino.exists()) {
if (ficheiroOrigem.isDirectory()) { // Verifica se o arqu... |
ca6d5dd8-1f72-471b-b46b-8c189806182a | 1 | public HashTable() {
int i = 1024;
size = i;
cache = new Node[i];
for (int k = 0; k < i; k++) {
Node node = cache[k] = new Node();
node.next = node;
node.previous = node;
}
} |
94df04e8-0bc0-47ed-86a7-ef6834cc8f1e | 4 | public Coordinate fromCartesian(Vector2D point) {
int n = refPolygon.count();
Coordinate coordinate = new Coordinate(n * 2);
double[] Psi = new double[n];
double[] Phi = new double[n];
for (int k = 0; k < n; k++) {
int next = (k + 1) % n;
Vector2D v1 =... |
4888f62a-d2a3-4b29-ad30-d196d8696525 | 4 | @Override
public void run() {
ObjectInputStream in = client.getIn();
while(true){
if(stop)
break;
Object ob = null;
try{
if((ob = in.readObject()) != null){
Message m = (Message... |
1e4ca89c-96e5-42e6-bfd5-caff39c8627e | 9 | @Override
public boolean equals(final Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof StringBuilderFactoryFormatter)) {
return false;
}
final StringBuilderFactoryFormatter other = (StringBuilderFactoryFormatter) obj;
if (formatter == null... |
2cb8df7b-9dbb-4aff-a501-b6c112634fca | 2 | public void play()
{
// Play the midi file if it is open, and if the squencer is not already
// playing.
if ( !isFileOpen ) {
System.err.println("Cannot play. Midi file not loaded.");
return;
}
if ( sequencer.isRunning() ){
System.err.pri... |
c790690e-41be-491a-87e4-d47dcb9c85ae | 0 | public T1 getFoo1()
{
return foo1;
} |
4acf6437-3f5b-4e2b-addf-879d8ef16a5b | 5 | public static ClassLoader compile(List<SourceFile> files) throws CompilationError {
System.out.println("got here1");
JavaCompiler compiler = ToolProvider.getSystemJavaCompiler();
if (compiler == null) throw new Error("Only JDK contains the JavaCompiler, you are running a Java JRE");
MyDiagnosticListen... |
749779db-dd90-49a7-ba8e-c07eca7c4e6b | 0 | public int getFormat() {
return format;
} |
f1dd3386-9b05-405a-8d4d-6b6ec79ba895 | 2 | 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 = createTraceAnnotationVisitor();
text.add(tav.getText());
text.add("}");
... |
1c6875db-6bb1-4e3e-bdaa-3532c2048084 | 2 | private final void skip() throws IOException {
while (!mEOF && mPeek0 <= ' ') {
read();
}
} |
99a58dab-2e92-4069-a01c-3fab84578777 | 0 | public void update(Observable arg0, Object arg1) {
// TODO Auto-generated method stub
this.repaint();
} |
318f3f30-8ad3-4033-ad43-2579640768df | 4 | public void updateLabels(BonusQuestion q) {
if (q == null) {
setLabelsNull();
return;
}
lblWeek.setText(""+q.getWeek());
lblNum.setText(""+q.getNumber());
lblType.setText(""+q.getBonusType());
lblQuestion.setText(""+q.getPrompt());
lblAnswer.setText(""+q.getAnswer());
if(q.getBonusType()==Bonus... |
9ff2b092-639d-4ef4-82a0-50196a28a632 | 1 | public void setMaxStack(final int maxStack) {
if (code != null) {
code.setMaxStack(maxStack);
}
} |
cad2c898-8a85-42f3-84a9-ab0ba0b3b08d | 1 | public static String getCurrentTestId() {
String currentTest = JMeterUtils.getPropDefault(Constants.CURRENT_TEST, "");
String currentTestId = null;
if (!currentTest.isEmpty()) {
currentTestId = currentTest.substring(0, currentTest.indexOf(";"));
} else {
currentTe... |
80c90057-fde8-41bc-a04e-646a4e28cb72 | 6 | public static Person[] mergeInnerPerson(Person[] firstArr, Person[] secondArr) {
if (firstArr == null || secondArr == null) {
return new Person[]{};
}
Person[] _firstArr = firstArr.clone();
Person[] _secondArr = secondArr.clone();
PersonComparator comparator = new P... |
c9293210-5963-4b91-b939-cf16fa231cb6 | 1 | @Override
public Sample clone() {
Sample cpy = new Sample();
cpy.x = new double[x.length];
for (int i = 0; i < x.length; i++) {
cpy.x[i] = x[i];
}
cpy.fx = fx;
return cpy;
} |
fdd944a1-b01a-4e34-a40e-013b9c322456 | 5 | public void setSourceText(String sourceText) {
if( !sourceText.equals(AlchemyAPI_NamedEntityParams.CLEANED) && !sourceText.equals(AlchemyAPI_NamedEntityParams.CLEANED_OR_RAW)
&& !sourceText.equals(AlchemyAPI_NamedEntityParams.RAW) && !sourceText.equals(AlchemyAPI_NamedEntityParams.CQUERY)
&& !sourceText.e... |
46714f25-bd9a-4c69-acb9-f1fa78b7e57f | 6 | public void readNextButton() {
if (buttonCombi1 == 1 && buttonCombi2 == 0) {
}
while (buttonCombi1 == 1 && buttonCombi2 == 0) {
checkInput();
if ((System.currentTimeMillis() - timePressed) > 1000) {
fastForwardSong = true;
}
}
if ((System.currentTimeMillis() - timePressed) < 1000) {
nextSong ... |
0e217449-f404-401b-b888-191739ae30e3 | 3 | public DatabaseHelper()
{
Properties properties = new Properties();
// ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
InputStream is;
try {
is = new FileInputStream("xio.properties");
try {
properties.load(is);
is.close();
} catch (IOException ioe) {
System.ou... |
f663ce6a-f3ca-49af-b406-a53327c520f1 | 7 | public static void main(String[] args) {
/** A Utility class. */
class ZipStatePair {
String zip;
String state;
ZipStatePair(String zip, String state) {
this.state = state;
this.zip = zip;
}
}
//create a list of mappings from zipcode to state
LinkedList<ZipStatePair> pairs = new Lin... |
03e47317-9c4b-40d6-8ef9-de34565e5a1a | 0 | public SimpleStringProperty cityNameProperty() {
return cityName;
} |
ec757f6c-250e-4eda-bf22-7e97197a1a04 | 0 | public BlackJackGame(Deck deck, PlayerHand player) {
this.deck = deck;
this.player = player;
theHouse = new PlayerHand();
isPlayerOver = false;
} |
e0a6727f-3f4b-4956-8623-d8a7f373d5d4 | 9 | public final void listaDeInterfaces() throws RecognitionException {
try {
// fontes/g/CanecaSemantico.g:331:2: ( ^( INTERFACES_ ( tipo )* ) )
// fontes/g/CanecaSemantico.g:331:4: ^( INTERFACES_ ( tipo )* )
{
match(input,INTERFACES_,FOLLOW_INTERFACES__in_listaDeInt... |
9fed86d5-e3a7-45e2-a871-a8044c4b1c05 | 6 | public boolean isCurrentlyBorrowed(String materialID, Calendar startDate,
Calendar endDate) {
for (Loan l : this.unreturnedLoans) {
if ((l.getStartDate().after(startDate) && l.getStartDate().before(
endDate))
|| (l.getEndDate().after(startDate) && l.getEndDate()
.before(endDate))
&& l.get... |
19639461-6ffd-4a3c-a90d-a6b3f94487ba | 1 | public void draw(GOut g) {
g.image(lbl.tex(), new Coord(box.sz().x, box.sz().y - lbl.sz().y));
g.image(box, Coord.z);
if (a)
g.image(mark, Coord.z);
super.draw(g);
} |
8529d6c8-1f5b-4d29-bb1b-d330be31fcef | 7 | @Override
public boolean onCommand(CommandSender sender, Command command, String CommandLabel, String[] args) {
if (sender instanceof Player) {
Player p = (Player) sender;
if (args.length == 0) {
//args 0 stuff
MuddleUtils.outputDebug("Got command mudd... |
ec0fb362-777b-4bf6-a94d-a5de6047d95d | 8 | public HashMap<String, Level> lees() throws AngryTanksException{
HashMap<String, Level> levelMap = new HashMap<String, Level>();
ArrayList<File> levelFiles = new ArrayList<File>();
//bestanden vinden in folder
File[] files = levelFolder.listFiles();
if(files == null) files = ne... |
26d22cf6-b7d7-421b-8864-5423b5ef0120 | 0 | public ModeleDeuxJoueurs(Modele plateau1, Modele plateau2) {
this.plateau1 = plateau1;
this.plateau2 = plateau2;
} |
b8b6a410-54ba-44a6-b1a8-233c9a248297 | 8 | public void moveCam(boolean forward) {
switch (faceTo) {
case 0:
if (forward) {
super.camera.translate(0, -1 * moveLen, 0);
} else {
super.camera.translate(0, moveLen, 0);
}
break;
case 1:
if (forward) {
super.camera.translate(moveLen, 0, 0);
} else {
super.camera.translate(-1 ... |
3776a349-8930-42a2-94f9-9a266af1b045 | 6 | private static final byte[]
encode3to4(final byte[] src, final int sOffset, final int numBytes,
final byte[] dest, final int dOffset) {
// 1 2 3
// 01234567890123456789012345678901 Bit position
// --------000000001111111122222222 Array position from threeByte... |
984a5361-3e4a-4271-b1d5-119358bc023c | 0 | @Override
public SkillsMain [] getSkillNames() {
return Constants.sorcererSkillSkills;
} |
e76667eb-a8e1-4840-b69d-6df3fbc76771 | 1 | public JPanel getBackgroundMenu() {
if (!isInitialized()) {
IllegalStateException e = new IllegalStateException("Call init first!");
throw e;
}
return this.backgroundMenu;
} |
e1776783-10e1-4873-ae9c-d144b197806e | 5 | @Override
public boolean onMouseDown(int mX, int mY, int button) {
if(button == 0 && mX > x && mX < x + width && mY > y && mY < y + height) {
Application.get().getHumanView().popScreen();
return true;
}
return false;
} |
e8582b27-8300-481a-ad68-049f73f3c427 | 1 | public void makeDeclaration(Set done) {
super.makeDeclaration(done);
if (subBlocks[0] instanceof InstructionBlock)
/*
* An instruction block may declare a variable for us.
*/
((InstructionBlock) subBlocks[0]).checkDeclaration(this.declare);
} |
56659c46-a2f2-4dbf-9aec-caf289a774a2 | 0 | @Override
public void setLabelText(String text) {
this.labelText = text;
} |
5c8b859f-a137-46b0-9052-2fca5c418da0 | 6 | private void btnGuncelleMousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_btnGuncelleMousePressed
if(!btnGuncelle.isEnabled())
return;
HashMap<String, String> values = new HashMap<>();
values.put("ad", txtAd.getText().trim());
values.pu... |
d6933acd-0042-4363-8c99-3c532ea0e0f2 | 6 | @Override
public boolean equals( final Object obj ) {
if( this == obj ) {
return true;
}
if( obj == null ) {
return false;
}
if( getClass() != obj.getClass() ) {
return false;
}
final Model other = (Model) obj;
if( notes == null ) {
if( other.notes != null ) {
return false;
}
}
e... |
aed49dd8-bfb9-4518-b597-a93c82115c12 | 1 | public int getSeconds() {
return (int) (up ? (System.currentTimeMillis() - (timeStarted + seconds * 1000)) * 1000 : ((timeStarted + seconds * 1000) - System.currentTimeMillis()) * 1000);
} |
388f7a21-3b05-4ceb-8dd2-ff361b004d87 | 7 | @Override
protected void actionPerformed(GuiButton var1) {
if(var1.enabled) {
if(var1.id == 2) {
String var2 = this.getSaveName(this.selectedWorld);
if(var2 != null) {
this.deleting = true;
StringTranslate var3 = StringTranslate.getInstance();
... |
37951714-4fb6-4626-9bb2-71ad40c2b07b | 5 | private boolean isInFiel(ICard cardOne, ICard cardTwo, ICard cardThree) {
this.counter = 0;
for (ICard card : field.getCardsInField()) {
if (card.comparTo(cardOne) || card.comparTo(cardTwo)
|| card.comparTo(cardThree)) {
counter++;
}
}
if (this.counter == NUMBEROFSETCARDS) {
return true;
}
... |
2d3b045d-c748-42f3-bc07-5ed294d09621 | 3 | public ArrayList<BotonFicha> addFichaTablero(int n,boolean fin,ArrayList<BotonFicha> lista){
MiSistema.turno = 0;
if(fin){//Añade ficha en la ultima pocicion
int k;
if(Domino.listaTablero.size()==0){
k=0;
}else{
k= Domino.listaTablero.g... |
94cb8453-1f36-427b-90f2-a6fcb2f466c5 | 4 | public static void main(String args[]) {
try {
System.out.println("Getting prices...");
List<String> tickers = new ArrayList<String>();
tickers.add("GOOG");
tickers.add("YHOO");
tickers.add("AAPL");
List<BigDecimal> prices = getPrices(tickers);
for (int i = 0; i < prices.size(); i++) {
System... |
c258319e-2b3a-4ff2-a843-53ae17836e28 | 1 | public void UpdateGameList() {
lstGames.removeAll();
for(GameInfo i:gameList) {
lstGames.add(i.toString());
}
} |
786fdb2c-c3d0-4933-9c02-e02cdd08fa1e | 6 | @Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (!(obj instanceof BFSState))
return false;
BFSState other = (BFSState) obj;
if (internalNode =... |
97a29bb9-f3e1-4930-acb6-9d93750e1c17 | 1 | public static void startGame(GameData gD, boolean isNew)
{
currentGame = gD;
inGameManager = new InGameManager();
if(isNew)
{
Screen = "inGame";
gameRunning = true;
}
else
{
Screen = "inGame";
gameRunning = true;
}
} |
18d25466-ccba-49ec-b823-6f0ab5945730 | 2 | public double evaluate() {
/* Sum together all inputs. */
double sum = 0;
for(Neuron key : dendrites.keySet()) {
if(key == this) sum += dendrites.get(key)*_bias;
else sum += dendrites.get(key);
}
return _function.evaluate(sum);
} |
c8e3bbc2-a3d3-49c7-bb0c-7f737b4c5254 | 2 | @EventHandler(priority = EventPriority.MONITOR)
public void onBlockDamage(BlockDamageEvent event) {
if(plugin.isEnabled() == true){
Block block = event.getBlock();
Player player = event.getPlayer();
if(!event.isCancelled())
blockCheckQuest(player, block, "blockdamage", 1);
}
} |
73dd767b-7294-4faf-a0c7-8d51bda9cdca | 5 | public boolean inside(Vector3 p) {
return p.getX() > x0 && p.getX() < x1 &&
p.getY() > y0 && p.getY() < y1 &&
p.getZ() > z0 && p.getZ() < z1;
} |
30d9c565-286a-4d06-9224-b6bd534dbe29 | 6 | @Override
public String getDescription(Hero hero) {
int boosts = SkillConfigManager.getUseSetting(hero, this, "rocket-boosts", 1, false);
String base = String.format("Put on a rocket pack with %s boosts. Safe fall provided.", boosts);
StringBuilder description = new StringBuilder( b... |
82b90c4c-941d-4557-a722-1aaff16687b6 | 4 | public FireBall(TileMap tm, boolean right) {
super(tm);
facingRight = right;
moveSpeed = 3.8;
if(right) dx = moveSpeed;
else dx = -moveSpeed;
width = 30;
height = 30;
cwidth = 14;
cheight = 14;
// load sprites
try {
BufferedImage spritesheet = ImageIO.read(
getClass().get... |
3adebf5b-f85b-4c37-bb50-3038a22dc224 | 3 | public void avancer(int nbCases) {
if(!enPrison) {
int index = mm.indexOf(caseActuelle);
if((index + nbCases) > 39) {
try {
mm.getCase(0).action(this, null);
} catch (NoMoreMoneyException e) {
e.printStackTrace();
}
}
setCaseActuelle(mm.getCase((index + nbCases)%40));
}
} |
04435328-651e-4b0d-8a4e-ab83d34b20e6 | 2 | @Autowired
public QuestTableView(final Requests requests) {
super("Zagadki");
questList = null;
try {
questList = requests.getAllQuests();
} catch (Exception e1) {
JOptionPane.showMessageDialog(null, "Sprawdz polaczenie z internetem");
}
setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
setBound... |
0ba41308-edbb-4141-9da2-ef282b5d43b7 | 3 | private void setStartGameState() {
this.board[0][0] = blackRook;
this.board[0][1] = blackKnight;
this.board[0][2] = blackBishop;
this.board[0][3] = blackQueen;
this.board[0][4] = blackKing;
this.board[0][5] = blackBishop;
this.board[0][6] = blackKnight;
this.board[0][7] = blackRook;
this.board[1][0] =... |
d2fbe329-068b-4f29-8478-d9ecd33abea9 | 4 | public Dimension getSize() {
if (this.dim == null) {
ObjectDefinition def = getDefinition();
if (def != null) {
int lenx = orientation % 2 == 0 ? def.width : def.height;
int leny = orientation % 2 == 0 ? def.height : def.width;
this.dim = new Dimension(lenx, leny);
} else {
return new Dimensi... |
dff0ef84-a651-47eb-b194-1b3155fcd4f1 | 5 | public CheckResultMessage checkL4(int day){
int r1 = get(17,5);
int c1 = get(18,5);
int r2 = get(27,5);
int c2 = get(28,5);
if(checkVersion(file).equals("2003")){
try {
in = new FileInputStream(file);
hWorkbook = new HSSFWorkbook(in);
if(0!=getValue(r2+4, c2+day, 10).compareTo(getValue(r1+2+day... |
53bbdb1b-1d4b-43f1-a814-42dbe37178eb | 3 | @Override
public Collection<?> changeSorting(int choice) {
// TODO Auto-generated method stub
Comparator<Questions> c=null;
if(choice==1)
c=new sortOnQuesRank();
else if(choice==2)
c=new sortOnQuesVotes();
else
;
Collections.sort(lst, c);
return lst;
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.