text stringlengths 14 410k | label int32 0 9 |
|---|---|
private boolean canFlipHorizontal(long binPosition, boolean goesRight){
boolean hasFlippableDisk = false;
long searchPosition = binPosition;
if(goesRight && (binPosition & 0x0101010101010101l) == 0)
searchPosition = binPosition >> 1;
else if( !goesRight && (binPosition & 0x... | 9 |
public static void withOpen(String filePath, String mode, EAction1<RandomAccessFile> block) {
RandomAccessFile recordFile = null;
try {
recordFile = new RandomAccessFile(filePath, mode);
block.call(recordFile);
}
catch (Throwable e) { throw new RuntimeException(e); }
finally {
try {
if (recordFil... | 3 |
public void setPosition(PositionY pY, PositionX pX) {
Dimension screenS = Toolkit.getDefaultToolkit().getScreenSize();
int x = 0, y = 0;
switch (pX) {
case LEFT:
x = 0;
break;
case CENTER:
x = screenS.width / 2 - getWidth() / 2;
break;
case RIGHT:
x = screenS.width - getWidth();
break;
}... | 6 |
public static void main(String[] args)
{
int a = AGE;
System.out.println(a);
output();
} | 0 |
@Override
public Dimension maximumLayoutSize(Container parent) {
long height = 0;
long width = (mColumns - 1) * mHGap;
synchronized (parent.getTreeLock()) {
Insets insets = parent.getInsets();
int compCount = parent.getComponentCount();
int[] widths = new int[mColumns];
int rows = 1 + (compCount - 1... | 9 |
final void initializeApplet(int i, int i_15_, int i_16_, int i_17_, int i_18_,
String string, int i_19_) {
anInt25++;
try {
if (Class348_Sub40_Sub9.anApplet_Sub1_9169 != null) {
Class348_Sub51.loadedCounter++;
if (Class348_Sub51.loadedCounter >= 3)
method82(112, "alreadyloaded");
else
getApp... | 5 |
public EvolvingGraph replaceNode(int nOut, int nIn){
EvolvingGraph graphIn = new EvolvingGraph(sample);
if(nIn > original.getNumOfNodes() || nOut > original.getNumOfNodes())
fail("Node numbers given should be between 0...NNodes-1");
if(sampledNodes.indexOf(nOut) == -1)
fail("The node to be taken out does no... | 9 |
public String getPermutation(int n, int k) {
int[] FACTORIAL = { 1, 2, 6, 24, 120, 720, 5040, 40320, 362880 };
int len = n;
boolean[] used = new boolean[len];
for (int i = 0; i < len; i++) {
used[i] = false;
}
StringBuilder sb = new StringBuilder();
while (n-- > 1) {
int tims = k / FACTORIAL[n - 1];... | 8 |
public StronglyConnectedComponents(Digraph G)
{
marked = new boolean[G.V()];
id = new int[G.V()];
OrderDirectedDFS order = new OrderDirectedDFS(G);
for (int v : order.reversePostOrder())
if (!marked[v])
{
dfs(G.reverse(), v);
count++;
}
} | 2 |
@Test
public void shouldThrowError() {
//when
String message = "Dies ist eine Fehlermeldung.";
ValidBean validBean = new ValidBean(false, new GOLException(message));
//then
try {
throw validBean.getExceptionOnInvalid();
} catch (Exception e) {
... | 1 |
public static void main(String[] args) throws IOException, ClassNotFoundException, InterruptedException {
Configuration conf = new Configuration();
String[] otherArgs = new GenericOptionsParser(conf, args).getRemainingArgs();
if (otherArgs.length != 2) {
System.err.println("Usage: H... | 2 |
private String toJavaCase( String value ) {
String line = value;
if ( value.length() > 0 )
line = line.substring( 0, 1 ).toLowerCase() + line.substring( 1 );
return line;
} | 1 |
public SwitchGate getCellGate(int x, int y) {
for (int i = 0; i < switchGates.length; i++) {
if (switchGates[i] == null)
continue;
for (int j = 0; j < switchGates[i].getGateSize(); j++) {
if (switchGates[i].getNearGate(x, y)) {
return switchGates[i];
}
}
}
return null;
} | 4 |
protected final Logger getLogger() {
return LoggerFactory.getLogger(this.getClass());
} | 0 |
public void addNode(int pos, long nodeId){
if (nodes.size()>pos)
nodes.get(pos).add(nodeId);
} | 1 |
public void setKey(String key) {
this.key = key;
} | 0 |
private ArrayList<Tile> findAxisX(int x, int y) {
ArrayList<Tile> word = new ArrayList<Tile>();
// First let's check left
if ( x != 0 ) {
if ( !this._board.isEmpty(y, x-1, true) ) {
int starting = x;
while ( starting-1 >= 0 && !this._board.isEmpty(y, starting-1, true) ) {
word.add(0, this._boar... | 9 |
public PermissionHandlerWrapper(Permission permission) {
this.permissionBase = permission;
} | 0 |
private static <K, V> Map<String, Object> serializeMap(Map<K, V> map) {
Map<String, Object> data = new HashMap<String, Object>();
data.put("T", "L");
data.put("class", map.getClass().getName());
List<List<Object>> pairs = new ArrayList<List<Object>>(map.size());
for (Map... | 1 |
@Override
public void run() {
long delta = 0;
game = new Game();
game.start();
while (true) {
long start = System.currentTimeMillis();
game.update((int) delta);
BufferStrategy bs = getBufferStrategy();
if (bs == null) {
createBufferStrategy(3);
continue;
}
render(bs.getDrawGraphics... | 5 |
@Override
protected Void doInBackground() throws Exception {
Client client = new Client();
client.getKryo().register(PacketLogin.class);
client.getKryo().register(PacketLoginResponse.class);
client.getKryo().register(PacketRequestCaptcha.class);
client.getKryo().register(Pac... | 2 |
public static int getmax(int[] l, int[] t) {
int count = l.length;
int res = 0;
if (count <= 2)
return count;
for (int i = 0; i < count; i++) {
for (int j = i+1; j < count; j++) {
int test1 = t[i];
int test2 = t[j];
int tempcount = 0;
for (int k = 0; k < count; k++) {
if (test1 >= t[k... | 9 |
private void initMap() {
listFieldNbSourisSorti.clear();
listNbSourisSorti.clear();
listNodeDepart.clear();
listNodeFromage.clear();
listDepartToFromage.clear();
fieldVitesse.setText("500");
nbPorte = 0;
nbTour = 0;
nbDeplacement = 0;
nbSourisEnCours = 0;
nbSourisArrivees = 0;
nbSourisSorties... | 3 |
public static AbstractDictionary dictionary(Surrogate collectiontype, Cons alternatingkeysandvalues) {
{ AbstractDictionary dictionary = ((AbstractDictionary)(Surrogate.createObject(collectiontype, Stella.NIL)));
Stella_Object key = null;
Stella_Object value = null;
Cons copy = Stella.NIL;
C... | 9 |
public static String getHoraMSUtilDate(java.util.Date date){
if(date==null)
return "";
String strDate="";
if(getHora(date)<10)
strDate+="0"+getHora(date);
else
strDate+=getHora(date);
if(getMinutos(date)<10)
strDate+=":"+"0"+(getMinutos(date));
else
strDate+=":"+getMinutos(date);
if(getSegu... | 4 |
public OrderByIterable(Iterable<T> source, Comparator<T> comparator)
{
this._source = source;
this._comparer = comparator;
} | 0 |
@Override public boolean equals(Object obj)
{
return (obj instanceof LngLatAlt) && (((LngLatAlt)obj).getLatitude() == latitude) && (((LngLatAlt)obj).getLongitude() == longitude);
} | 2 |
static synchronized public InputStream getResourceAsStream(String name)
{
InputStream is = null;
if (hook!=null)
{
is = hook.getResourceAsStream(name);
}
else
{
Class cls = JavaLayerUtils.class;
is = cls.getResourceAsStream(name);
}
return is;
} | 1 |
@Override
public final void addFooterLines(String... lines) {
if (lines != null && lines.length > 0) {
for (String line : lines) {
if (line == null) {
footer.add("#; ");
}
else if (line.startsWith("#;")) {
fo... | 5 |
public boolean shapeValido (){
if (cultivo == null)
return true;
if (cultivo.equals("VT"))
return false;
else
return true;
} | 2 |
public JScrollPane getjScrollPane2() {
return jScrollPane2;
} | 0 |
public static int numpadToX(char num){ //returns the x direction of each keypad input. default is zero because a non-directional key doesn't allow movement.
switch(num){
case('1'):
return -1;
case('2'):
return 0;
case('3'):
return 1;
case('4'):
return -1;
case('6'):
return 1;
case('7'):
... | 8 |
@Path("/admin/profiles.json")
@Produces(MediaType.APPLICATION_JSON)
@PUT
public String updateProfiles(
@Context HttpServletRequest request,
@Context HttpServletResponse response,
@QueryParam("json") String json ) {
if( !checkHostInfo(request.getRemoteHost(),
AdminProperties.getHttp_allowed()) ) {
... | 5 |
private void fillAllRoles(TheaterPlay play) {
for (Act act : play.getActs()) {
for (Scene scene : act.getScenes()) {
Role allRole = scene.getAllRole();
if (allRole != null) {
allRole.setPseudoRole(true);
for (Paragraph paragraph : scene.getParagraphs()) {
if (paragraph instanceof Passage) {... | 7 |
public static String fixName(String s)
{
if(s.length() > 0)
{
char ac[] = s.toCharArray();
for(int j = 0; j < ac.length; j++)
if(ac[j] == '_')
{
ac[j] = ' ';
if(j + 1 < ac.length && ac[j + 1] >= 'a' && ac[j + 1] <= 'z')
ac[j + 1] = (char)((ac[j + 1] + 65) - 97);
}
if(ac[0] >= ... | 8 |
private static boolean testPfamToGoMapping() {
try {
final PfamToGoMapping pg0 = new PfamToGoMapping( new DomainId( "A" ), new GoId( "GO:0000001" ) );
final PfamToGoMapping pg1 = new PfamToGoMapping( new DomainId( "A" ), new GoId( "GO:0000001" ) );
final PfamToGoMapping pg2 =... | 9 |
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Transducer that = (Transducer) o;
if (lowerRangeLimit != that.lowerRangeLimit) return false;
if (type != that.type) return false;
if (u... | 7 |
public void buildClassifier(Instances instances) throws Exception {
// can classifier handle the data?
getCapabilities().testWithFail(instances);
// remove instances with missing class
instances = new Instances(instances);
instances.deleteWithMissingClass();
double sumOfWeights = 0;
m... | 8 |
public void testMinus_int() {
Years test2 = Years.years(2);
Years result = test2.minus(3);
assertEquals(2, test2.getYears());
assertEquals(-1, result.getYears());
assertEquals(1, Years.ONE.minus(0).getYears());
try {
Years.MIN_VALUE.minus(1);... | 1 |
public OrgaEinheit erstelleOrgaEinheit(int idUeberOrgaEinheit, String OrgaEinheitBez, String Leitername,
int idLeiterBerechtigung, boolean Zustand, int idMitarbeiterBerechtigung){
OrgaEinheit rueckgabe = null;
try {
rueckgabe = new OrgaEinheit(idUeberOrgaEinheit, OrgaEinheitBez, Leitername,
idLeiterBerecht... | 1 |
public TemperatureSet(String stationId, HashMap<String, String> minSet, HashMap<String, String> maxSet, BufferedWriter out)
{
_stationId = stationId;
for (String s : minSet.keySet())
{
TemperatureDate td = new TemperatureDate();
if (minSet.get(s) != null) td._min = Float.parseFloat(minSet... | 5 |
public BitMatrix cut(int s, int i, int j)
{
if (s<=0 || s>n)
throw new Error("s = " + s);
if (i+s>n || j+s>n)
throw new Error("Cut overflow");
BitMatrix M = empty(s);
for (int r=0;r<s;r++)
{
BitSet src = m[i+r];
BitSet trg = M.m[r];
for (int c=0;... | 6 |
private String scanTagHandle (String name) {
char ch = peek();
if (ch != '!') throw new TokenizerException("While scanning a " + name + ", expected '!' but found: " + ch(ch));
int length = 1;
ch = peek(length);
if (ch != ' ') {
while (ALPHA.indexOf(ch) != -1) {
length++;
ch = peek(length);
}
... | 4 |
public DataModule getDataModuleContaining(String segment){
for(int i = fragments.size(); i > 0; i--){
DataModule dataModule = getDataModule(fragments.get(i - 1));
if(dataModule.getDataAt(segment).isEmpty()){
continue;
}
return dataModule;
}
return null;
} | 2 |
private void initField(Field[][] fields) {
for (int i = 0; i < sizeX; i++) {
for (int j = 0; j < sizeY; j++) {
fields[i][j] = new Field(this, i + j * sizeX);
}
}
for (int i = 0; i < sizeX; i++) {
fields[i][0] = new BorderField(fields[i][0]);
... | 6 |
@Override
public void run() {
if (tryContinue()) return;
// 6 before enter, 7 while talk
// 8 after ladder
if (!npc().valid()) {
enter();
}
if (stage() >= 8 || ctx.chat.visible("It's time to enter some caves")) {
leave();
return;
}
super.run();
} | 4 |
@Override
public boolean activate() {
return (Game.getClientState() != Game.INDEX_MAP_LOADED
|| (Game.getClientState() == Game.INDEX_MAP_LOADED && Ivy.stop == 1000)
|| Ivy.client != Bot.client()
|| (Walking.getEnergy() == 100 && !Walking.isRunEnabled())
|| Widgets.get(640, 30).isOnScreen()
);
} | 6 |
public static final boolean isJS(String fileName) {
for (String file : JS) {
if (file.equals(fileName)) {
return true;
}
}
return false;
} | 2 |
public Object getAdapter(Class type) {
if (type == org.eclipse.ui.views.properties.IPropertySheetPage.class) {
return new UndoablePropertySheetPage(getCommandStack(),
getActionRegistry().getAction(ActionFactory.UNDO.getId()),
getActionRegistry().getAction(ActionFactory.REDO.getId()));
}
if (type == G... | 8 |
public static void main(String[] args) {
@SuppressWarnings("resource")
Scanner in = new Scanner(System.in);
System.out.println("Enter first string");
String leftString = in.next();
System.out.println();
System.out.println("Enter second string");
String rightString = in.next();
if (leftString =... | 9 |
public static Mesh load(File file) throws IOException, FileNotFoundException {
BufferedReader reader = new BufferedReader(new FileReader(file));
MeshBuilder m = new MeshBuilder();
String line;
int type = -1;
m.startMesh();
while((line = reader.readLine()) != null) {
//remove additional whitespaces... | 6 |
void generatePrimes_03(int min, int max){
for( int integer= min<2?2:min ; integer < max+1 ; integer++ ){
boolean isPrime = true;
if( !primeNumbers.contains(integer)){
int check = 2;
int maxCheck = integer;
while(integer>2 && check < maxCheck){
if(integer%check == 0... | 8 |
@Override
public String readString(String encoding, int length) throws IOException
{
Charset charset = Charset.forName(encoding);
CharsetDecoder dec = charset.newDecoder();
ByteBuffer bin = ByteBuffer.allocate(8);
CharBuffer bout = CharBuffer.allocate(1);
String ret = "";... | 7 |
public void update(GameContainer gc, StateBasedGame sbg, int delta) throws SlickException{
if(input.isKeyPressed(Input.KEY_ENTER)){
sbg.enterState(1);
}
if(input.isKeyPressed(Input.KEY_ESCAPE)){
gc.exit();
}
} | 2 |
public static String GetTaskday(Task t)
{
int x = (int) DateUtils.getDiffInDays(Calendar.getInstance(), t.getStartDate(), false);
byte i = 1 ;
initMaps();
if (!t.getModelStatus().isEndUserStatus())
{
i = -1;
}
days.put(ALL,(byte) (days.get... | 5 |
@Override
public void execute(CommandSender sender, String gateName, List<String> args) {
this.sender = sender;
Object[] gatesArray = plugin.getGates().namesArray();
java.util.Arrays.sort(gatesArray);
String gateList = "";
for (Object gateObj : gatesArray) {
String thisGateName = (String) gateObj;
... | 3 |
public static void fillDP() {
dp = new int[1000001];
int con = 1, lim = 0, ch = (int) 'A';
for (int i = 0; i < dp.length; i++) {
if (ch > (int) 'Z')
ch = (int) 'A';
if (lim == con) {
dp[i] = ch;
lim = 0;
con++;
ch++;
} else {
lim++;
dp[i] = ch;
}
}
} | 3 |
public void checkNode(GameState nodeToCheck) {
if(valid(nodeToCheck)){
System.out.println("Found shortest way");
System.out.println("Die Weglaenge ist: "+(nodeToCheck.getaStarG()-1));
System.out.println("Der weg ist: ");
while(nodeToCheck.getPredecessor() != null){
System.out.println(nodeToCheck.toStr... | 5 |
private static ArrayList<LineAnaVO> setHindex(ArrayList<LineAnaVO> lList, int code) {
ArrayList<LineAnaVO> newOne=new ArrayList<LineAnaVO>();
int size=lList.size();
while(newOne.size()<size){
int max=-1;
int tmp=-1;
int index=-1;
for(int i=0;i<lList.size();i++){
LineAnaVO vo = lList.g... | 7 |
public boolean getGifts(int index,float sum, int n)
{
if((sum>=0&&n==0))
{
if(sum<minSum)
{
gift_list.clear();
ArrayList<Products>tmp = new ArrayList<Products>();
for(int i=0;i<gift.size();i++)
{
tmp.add(gift.get(i));
}
gift_list.add(tmp);
minSum = sum;
... | 9 |
public ArrayList<Trajet> getTrajetByConducteur(Membre m){
ArrayList<Trajet> res = new ArrayList<Trajet>();
for(Trajet t : listeTrajets){
if(m==t.getConducteur())
res.add(t);
}
return res;
} | 2 |
public static int mst(int[][] nabomatrise){
int start = 0;
ArrayList<int[]> edgeList = findEdges(nabomatrise[start], start);
ArrayList<Integer> noderSett = new ArrayList<Integer>();
int max = Integer.MIN_VALUE;
noderSett.add(start);
while (noderSett.size() < nabomatrise.length) {
int[] currentEdge = new ... | 4 |
public Integer getPlainValue() {
return plainValue;
} | 0 |
public String verifica_estruturas(){
String str = "";
str+="Circulo\n";
for (Circulo c : ctrCirculo.circulos_desenhados) {
str+=c.toString();
str+="\n";
}
str+="Arco Circulo\n";
for (Circulo c : ctrCirculo.arcos_desenhados){
str+=c.toString();
str+="\n";
}
str+="Elipse\n";
for (Elips... | 8 |
@EventHandler(priority = EventPriority.NORMAL)
public void onEntityExplode(EntityExplodeEvent event) {
if (event.isCancelled())
return;
// plugin.debug(event.getEventName());
for (Block block : event.blockList()) {
if (plugin.isProtected(block)) {
plugin.debug("Blocking explostion at " + block.getWorl... | 3 |
public static void main(String[] args) {
try {
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
} catch (ClassNotFoundException e) {
e.printStackTrace();
} catch (InstantiationException e) {
e.printStackTrace();
} catch (IllegalAcce... | 4 |
public static IClienteDAO getClienteDAO(){
if(clienteDAO == null){
clienteDAO = new ClienteDAOImpl();
}
return clienteDAO;
} | 1 |
public WorkThread(Runnable target, AtomicInteger counter) {
this.target = target;
this.counter = counter;
} | 0 |
final public void Function_return_declaration() throws ParseException {
/*@bgen(jjtree) Function_return_declaration */
SimpleNode jjtn000 = new SimpleNode(JJTFUNCTION_RETURN_DECLARATION);
boolean jjtc000 = true;
jjtree.openNodeScope(jjtn000);
jjtn000.jjtSetFirstToken(getToken... | 8 |
public void run () {
try {
getNPCData();
Thread.sleep(15000);
while (true) {
for (Integer i = 0; npcData.size() > i; i++) {
String isPathfind = "does";
if (!doPathfind(i))
isPathfind = isPathfind ... | 4 |
private TypeMirror getTypeMirrorOf(final Declaration decl) {
TypeMirror typeMirror = null;
if (decl instanceof FieldDeclaration) {
typeMirror = ((FieldDeclaration) decl).getType();
}
if (decl instanceof ParameterDeclaration) {
typeMirror = ((ParameterDeclaration) ... | 3 |
@Override
public ProductModel createBook(BookModel book) throws WebshopAppException {
int generatedId = ProductModel.DEFAULT_PRODUCT_ID;
if (isValidBook(book, "CREATE_BOOK")) {
try (Connection conn = getConnection()) {
conn.setAutoCommit(false);
try {
generatedId = super.insertProduct(conn, boo... | 3 |
public Transition modifyTransition(Transition t, TableModel model) {
//EDebug.print("ModifyTransitionCalled");
String s = (String) model.getValueAt(0, 0);
try {
return new FSATransition(t.getFromState(), t.getToState(), s);
} catch (IllegalArgumentException e) {
reportException(e);
return null;
}
} | 1 |
* @param xxx
* @param yyy
* @param zzz
*/
public void renderSimpleRail(int textureId, int xxx, int yyy, int zzz, BlockType block, int tex_offset) {
float x = xxx + this.x*16;
float z = zzz + this.z*16;
float y = yyy;
byte data = getData(xxx, yyy, zzz);
byte powered = data;
powered >>= 3;
if (po... | 7 |
public int compare(Object a, Object b) throws ClassCastException
{
if(a == null){
return -1;
}
else if(b == null){
return 1;
}
else if(a == null && b == null ){
return 0;
}
else{
MessageBid bida = (MessageBid... | 4 |
public static void createWindow( int width, int height, String title )
{
Display.setTitle( title );
try
{
Display.setDisplayMode( new DisplayMode( width, height ) );
Display.setVSyncEnabled( true );
Display.setResizable( true );
Display.create( new PixelFormat( 0, 0, 0, 8 ) );
Keyboard.create();
... | 1 |
private void acao131() throws SemanticError {
contextoExpressao = ContextoExpressao.IMPRESSAO;
if (!Tipo.isImprimivel(tipoExpressao))
throw new SemanticError("Tipo inválido para impressão");
// Gerar código
} | 1 |
protected Boolean tryCheckVLine3(boolean remove) {
for (int i = 0; i < 6; i++) {
for (int j = 0; j < 6; j++) {
int count = (gemArray[i][j]);
if (j + 1 <= 5) {
if (count == gemArray[i][j + 1]) {
if (remove) {
... | 5 |
static final boolean method1130(r var_r, int i, int i_1_, int i_2_,
boolean[] bools) {
boolean bool = false;
if (aa_Sub1.aSArray5191 != Class332.aSArray4142) {
int i_3_
= Class348_Sub1_Sub1.aSArray8801[i].method3986(i_1_, i_2_,
(byte) -109);
int i_4_ = 0;
for (/**/; i_4_ <= i; i... | 5 |
private static void parseBuildings(GameField field, Scanner scanner)
throws MapLoaderException {
if (!scanner.next().equals("BUILDINGS")) {
throw new MapLoaderException("Buildings section not found.");
}
char buildingChar;
int x;
int y;
int numberOfBuildings = scanner.nextInt();
for (int i = 0; i <... | 6 |
public void setId(String id) {
this.id = id;
} | 0 |
public Enemy (float startx, float starty){
x = startx;
y = starty;
} | 0 |
double determineRotation(BufferedImage img, double initialRotation, int blackWhiteBoundary) {
int w = 0;
int h = 0;
if (img.getWidth() > img.getHeight()) {
w = MAX_DIM;
h = MAX_DIM * img.getHeight() / img.getWidth();
} else {
w = MAX_DIM * img.getWidth() / img.getHeight();
h = MAX_DIM;
}
Buffere... | 6 |
public boolean saveChunks(boolean par1, IProgressUpdate par2IProgressUpdate)
{
int var3 = 0;
for (int var4 = 0; var4 < this.chunkList.size(); ++var4)
{
Chunk var5 = (Chunk)this.chunkList.get(var4);
if (par1)
{
this.saveChunkExtraData(var5... | 7 |
public int xgettrust(int kind, String fmsId) throws IOException {
if (!supportsXGETTRUST()) {
return -1; // Freetalk doesn't support trust extensions.
}
send(String.format("XGETTRUST %s %s", trustKindToString(kind), fmsId));
String reply = read();
StatusResponse respo... | 7 |
private void step6_7(Beat beat) {
System.out.println("6-7: Find chord");
//List<ChordMark> chords = Chord.getChords(beat);
//boolean foundChord = chords.size() > 0;
ChordMark chordMark = Chord.getChord(beat.getToneMap(), beat);
boolean foundChord = chordMark != null;
// ak je to zakladny akord tj. +,... | 9 |
@Override
public boolean equals(Object that) {
if (this == that) {
return true;
}
if (that == null) {
return false;
}
if (getClass() != that.getClass()) {
return false;
}
if (id != null) {
return id.equals(((GroupBE) that).id);
}
return super.equals(that);
} | 4 |
protected Class findClass( String name )
throws ClassNotFoundException
{
// Deal with this cast somehow... maybe have this class use
// ClassManagerImpl type directly.
// Don't add the method to BshClassManager... it's really an impl thing
ClassManagerImpl bcm = (ClassManagerImpl)getClassManager();
// ... | 8 |
public static pgrid.service.corba.simulation.SimulationHandle unchecked_narrow (org.omg.CORBA.Object obj)
{
if (obj == null)
return null;
else if (obj instanceof pgrid.service.corba.simulation.SimulationHandle)
return (pgrid.service.corba.simulation.SimulationHandle)obj;
else
{
org.o... | 2 |
@Override
public void onDelete(Level l, int index, Server server) {
if (_level != l)
return;
_level.ticks.remove(this);
} | 1 |
public String readAndDecrypt(String key) throws GeneralSecurityException, IOException {
int content;
BufferedReader br;
br = new BufferedReader(new InputStreamReader((FileInputStream)this));
StringBuilder sb = new StringBuilder();
String line;
while ((line = br.readLine()... | 3 |
public GrilledSandwich() {
this.setName("GrilledSandwich");
this.setPrice(new BigDecimal(30));
} | 0 |
public static void main(String[] args) {
IntStats intStats = new IntStats();
// Default input is STDIN
InputStream in = System.in;
// Input from file?
if( args.length > 0 ) try {
in = new FileInputStream(new File(args[0]));
} catch(FileNotFoundException e1) {
throw new RuntimeException("Error openin... | 4 |
@Override
public void run() {
try {
// Eclipse doesn't support System.console()
BufferedReader console = new BufferedReader(new InputStreamReader(System.in));
ConfigManager config = NetBase.theNetBase().config();
String server = config.getProperty("net.server.ip");
if ( server == null ) {
Sys... | 9 |
public final Map<String, Integer> getSkillStats(final int itemId) {
if (SkillStatsCache.containsKey(itemId)) {
return SkillStatsCache.get(itemId);
}
if (!(itemId / 10000 == 228 || itemId / 10000 == 229)) { // Skillbook and mastery book
return null;
}
final... | 8 |
@Override
public Word getMemoryCell(DCPU dcpu, OperandMode mode) {
Register register;
switch (this.value) {
case 0x08:
register = Register.A;
break;
case 0x09:
register = Register.B;
break;
case 0x0A:... | 8 |
@Override
public void keyPressed(KeyEvent ke) {
if (isWin==false) {
switch (ke.getKeyCode()) {
case KeyEvent.VK_LEFT:
left();
break;
case KeyEvent.VK_DOWN:
down();
... | 5 |
public Land getFirstLand() {
return first_land;
} | 0 |
@Override
public String execute(HttpServletRequest request, HttpServletResponse response) throws Exception {
String data;
try {
ArrayList<FilterBean> alFilter = new ArrayList<>();
if (request.getParameter("filter") != null) {
if (request.getParameter("filterop... | 7 |
public static int[][] getHistogram(int[][] imagematrix) {
ArrayList<int[]> histogram = new ArrayList<int[]>(); //dynamic array size
boolean isNewColor;
for(int[] imColumn: imagematrix) {
for(int imCell: imColumn) {
isNewColor = true;
for(int[] hgRow : histogram) {
if(hgRow[0]==imCell) {
hgRo... | 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.