text stringlengths 14 410k | label int32 0 9 |
|---|---|
public void clearDisplay() {
if(userValues !=null && systemValues !=null) {
for(int row = 0; row < systemValues.length; row++) {
for(int col = 0; col < systemValues[row].length; col++) {
userValues[row][col] = 0;
}
}
updateD... | 4 |
private static boolean withinGrid(int x, int y, Boolean[][] walkways) {
return y >= 0 && x >= 0 && x < walkways.length && y < walkways[x].length;
} | 3 |
private final String getChunk(String s, int slength, int marker)
{
StringBuilder chunk = new StringBuilder();
char c = s.charAt(marker);
chunk.append(c);
marker++;
if (isDigit(c))
{
while (marker < slength)
{
c = s.charAt(marker... | 5 |
private ObjectDef method457()
{
int i = -1;
try {
if(anInt1601 != -1)
{
VarBit varBit = VarBit.cache[anInt1601];
int k = varBit.anInt648;
int l = varBit.anInt649;
int i1 = varBit.anInt650;
int j1 = client.anIntArray1232[i1 - l];
i = clientInstance.variousSettings[k] >> l & j1;
} el... | 6 |
public boolean authenticateOwnerPassword(String ownerPassword) {
// Step 1: Computer an encryption key from the supplied password string,
// as described in steps 1 to 4 of algorithm 3.3.
byte[] encryptionKey = calculateOwnerPassword(ownerPassword,
"", true);
// Step 2: ... | 9 |
@Override
public boolean equals(Object object) {
// TODO: Warning - this method won't work in the case the id fields are not set
if (!(object instanceof Prueba)) {
return false;
}
Prueba other = (Prueba) object;
if ((this.idPrueba == null && other.idPrueba != null... | 5 |
@Override
public boolean okMessage(final Environmental myHost, final CMMsg msg)
{
if((affected==null)||(!(affected instanceof Room)))
return super.okMessage(myHost,msg);
final Room R=(Room)affected;
if(msg.targetMinor()==CMMsg.TYP_DAMAGE)
{
final Set<MOB> H=msg.source().getGroupMembers(new HashSet<MOB... | 8 |
public Float getFeatureValueByName(String name) {
Float result = null;
for (int i = 0; i < QuestionData.featureNames.size(); i++) {
if (QuestionData.featureNames.get(i).equals(name)) {
result = featureValues.get(i);
break;
}
}
if (result == null) {
throw new RuntimeException("Unexistent Feature... | 3 |
protected int widestDim(double[][] nodeRanges, double[][] universe) {
final int classIdx = m_Instances.classIndex();
double widest = 0.0;
int w = -1;
if (m_NormalizeNodeWidth) {
for (int i = 0; i < nodeRanges.length; i++) {
double newWidest = nodeRanges[i][WIDTH] / universe[i][WIDTH];
... | 7 |
private static void buildTillageForage(Statement in, Statement outA, Statement outB, String inTbl, String outTbl, String outTblHru, int type, int[] data, boolean isConv, Connection c) {
try {
ResultSet inRs = in.executeQuery("SELECT * FROM " + inTbl + ";");
ResultSet outRs = outA.execute... | 8 |
public static void main(String[] args) {
sc = new Scanner(System.in);
do{
System.out.print("Username: ");
owner = sc.nextLine();
System.out.print("Password: ");
String p = sc.nextLine();
boolean a = (JDBC.logIn(owner, p));
if (!a) {
System.out.println("Wrong username or password.");
contin... | 9 |
public void setHolder(Mob holder)
{
if(holder != null && holder.getClient() != null)
return;
this.holder = holder;
this.holder.setClient(this);
} | 2 |
*/
public Iterator<K> keys() {
return new Iterator<K>() {
int bucketIndex = 0;
LinkedList<MyEntry> bucket = table[bucketIndex];
Iterator<MyEntry> listIt = bucket.iterator();
MyEntry cur;
/**
* Finds whether or not there is a next MyEntry object in the array.
* @return
*/
... | 8 |
public static void main(String args[]) throws IOException {
short val;
if ((args.length != 3) || (args[0].charAt(0) != '-')) {
System.out.println("Usage: Genfile2 <option> <filename> <size>" +
"\nOptions ust be '-a' for ASCII, or '-b' for binary." +
"\nSize i... | 9 |
public int addChannel(String id1, String id2, float tr, float dp){
int index = 0;
Nodo source = null, destination = null;
while(index < _network.size() && (source == null || destination == null)){
if(source == null && _network.elementAt(index).getId().equals(id1)){
so... | 9 |
final int[][] method1274(int i, int j) {
int ai[][] = super.aClass112_3320.method1036(-110, i);
if (super.aClass112_3320.aBoolean1822) {
int ai1[][] = method1280(i, -109, 0);
int ai2[] = ai1[0];
int ai3[] = ai1[1];
int ai4[] = ai1[2];
int ai5[]... | 5 |
public Cache(int s, int l, int m, boolean writeThrough,
boolean writeAround, int cycles) {
this.s = s;
this.l = l;
this.m = m;
this.c = s / l;
this.i = (int) (Math.log(c / m) / Math.log(2));
this.offset = (int) (Math.log(l) / Math.log(2));
this.t = 16 - (i + offset);
cache = new HashMap<String, Set>(... | 1 |
public int countOpponents(int P, int K) {
int i = 1;
int ans;
while(true){
ans = (i / 3) + (i / K) * 3;
if(ans >= P)break;
i++;
}
if(ans == P){
return i;
}else{
return -1;
}
} | 3 |
private void openFAT() {
JFileChooser fileChooser = new JFileChooser("./");
int answer = fileChooser.showDialog(null, "Октрыть файл FAT");
if (answer == JFileChooser.APPROVE_OPTION) {
extractor = new BaseExtractor();
boolean checkFAT = extractor.openFAT(fileChooser.getSel... | 2 |
private void startNextTrialGroup() {
if (experimentPhase == PHASE_TRAINING) {
//we're in the first block's training phase
if (!Trial.trainingTrialGroups.isEmpty()) {
//start next training block
startTrialGroup(Trial.trainingTrialGroups.remove(0));
} else {
//all training blocks shown, ... | 7 |
public double classify(Instance inst)
{
Instance tInst;
// fill in missing values
fillMissing(inst);
// Conservative
if (m_classificationMode == CLASSIFICATION_CONSERVATIVE)
{
for(int i=0; i < rules.size(); i++)
{
tInst = (Instance)rules.elementAt(i);
... | 9 |
String getState() {
StringBuffer commands = new StringBuffer("# connections;\n");
String cmd;
if (reportFormalCharges) {
Hashtable ht = new Hashtable();
for (int i = 0; i < atomCount; i++)
StateManager.setStateInfo(ht, i, i, "set formalCharge " + atoms[i].getFormalCharge());
commands.append(StateMana... | 7 |
public void addResults(String label) {
// Create results array
double[] res = new double[size()];
for (int i = 0; i < res.length; i++) {
Entity e = entities.get(i);
if (e.hasOutput()) res[i] = e.getOutput();
else res[i] = Double.NaN;
}
// Add to results
results.add(res);
labels.add(label);
} | 2 |
private boolean containsNullValue() {
Entry[] tab = this.table;
for (int i = 0; i < tab.length; i++)
for (Entry e = tab[i]; e != null; e = e.next)
if (e.value == null) return true;
return false;
} | 3 |
public static void main(String[] args) {
Random rand = new Random(47);
SortedSet<Integer> intset = new TreeSet<Integer>();
for (int i = 0; i < 10000; i++)
intset.add(rand.nextInt(30));
System.out.println(intset);
} | 1 |
private Set<Card> fourFlushWithStraight() {
return convertToCardSet("AS,KS,QS,JS,TC,KC,QC");
} | 0 |
private List getNeighbors(int location) {
List neighbors = new ArrayList();
// if location is not on left side, then add neighbors from left
if (location%(10)!=0) {
neighbors.add(new Integer(location-1));
if (location>9) {
neighbors.add(new Integer(location-11));
}
if (location<90) {
neigh... | 8 |
public Marker (AbstractPlay play){
this.relatedPlay=play;
} | 0 |
public boolean canEnter(Entity entity) {
return entering.size() == 0 && occupying.size() == 0 && leaving.size() == 0;
} | 2 |
public int loadRunTimeStack(int offset) {
return runStack.load(offset);
} | 0 |
JNotifyWatchKey(Integer assignedWatchKey, String folderPath) {
this.watchKey = assignedWatchKey;
this.setFolderPath(folderPath);
} | 0 |
@Override
public void paint(Graphics graphics) {
// BASIC SETTINGS
Graphics2D g = (Graphics2D) graphics;
AffineTransform normal = g.getTransform();
AffineTransform rotated = g.getTransform();
rotated.quadrantRotate(3);
AffineTransform FLIP_X_COORDINATE =
new AffineTransform(1, 0, 0, -1, 0, getHeight()... | 9 |
public String nextName() throws IOException {
int p = peeked;
if (p == PEEKED_NONE) {
p = doPeek();
}
String result;
if (p == PEEKED_UNQUOTED_NAME) {
result = nextUnquotedValue();
} else if (p == PEEKED_SINGLE_QUOTED_NAME) {
result = nextQuotedValue('\'');
} else if (p == P... | 4 |
public byte[] getMD5Sum() {
if (MD5Sum == null) {
MD5Sum = Base64.decodeBase64(MD5SumString);
}
return MD5Sum;
} | 1 |
public void setTrackLength(int trackNumber, int lengthInSeconds) throws SQLException
{
Track t = null;
for (Track track : getTracks())
if (track.getFormTrackNumber() == trackNumber)
if (t == null)
t = track;
else
return;
t.setLengthInS... | 3 |
@Override
public void performEvent(ActionEvent e)
{
if ("password".equals(e.getActionCommand())) if (password.getText().replaceAll(" ", "").isEmpty())
{
password.setForeground(Color.RED);
password.setText("Invalid New Password!");
}
else if (oldPassword.getText().equals(Save.FILE_PASSWORD))
{
new W... | 4 |
public static int dehexchar(char c) {
if (c >= '0' && c <= '9') {
return c - '0';
}
if (c >= 'A' && c <= 'F') {
return c - ('A' - 10);
}
if (c >= 'a' && c <= 'f') {
return c - ('a' - 10);
}
return -1;
} | 6 |
public ChatClient( String serverName, int serverPort ) {
System.out.println( "Establishing connection. Please wait ..." );
try {
socket = new Socket( serverName, serverPort );
System.out.println( "Connected: " + socket );
start();
} catch( UnknownHostExcepti... | 4 |
public boolean enregistrer() throws IOException{
try{
FileOutputStream fichier = new FileOutputStream(this.nomFichier);
propriete.store(fichier, "-Enregistrement config-");
fichier.close();
return true;
}
catch(FileNotFoundException e){
... | 1 |
private void modifyPanelInit() {
modifyPanel = new JPanel();
//generates panels formatted layout of components
generator.createRigidSpace(modifyPanel, 15);
final JTable allClients = new JTable(allClientsModel.getTableModel(2));
allClients.removeColumn(allClients.getColumn("ID Number"));
allClients.setPre... | 7 |
public void stopServer() {
try {
serverIsRaning = false;
socket.close();
// socket = null;
// clientSocket.close();
} catch (Exception e) {
// TODO Автоматически созданный блок catch
e.printStackTrace();
}
} | 1 |
public synchronized void run()
{
if (_responseQueue != null)
System.out.println(getName() + " : starting dispatch");
if (_responseQueue == null)
{
while (_isRunning)
{
try
{
wait();
}
... | 6 |
public void removeLesson(Lesson l) {
int i = this.timeTable.getSlots().indexOf(l);
this.timeTable.getSlots().remove(i);
this.timeTable.getSlots().add(i, l.getSlot());
this.timeTable.checkForDuplicates();
if (this instanceof Group) {
((Group)this).done.put(l.getField(), false);
}
} | 1 |
public pgrid.service.corba.CorbaRoutingTable routingTable ()
{
org.omg.CORBA.portable.InputStream $in = null;
try {
org.omg.CORBA.portable.OutputStream $out = _request ("_get_routingTable", true);
$in = _invoke ($out);
pgrid.service.corba.CorbaRo... | 2 |
public static byte[] encrypt(byte[] in,byte[] key){
Nb = 4;
Nk = key.length/4;
Nr = Nk + 6;
int lenght=0;
byte[] padding = new byte[1];
int i;
lenght = 16 - in.length % 16;
padding = new byte[lenght];
padding[0] = (byte) 0x80;
for (i = 1; i < lenght; i++)
padding[i] = 0;
... | 6 |
@Override
public boolean vorbedingungErfuellt(ServerKontext kontext, Spieler spieler,
Befehlszeile befehlszeile)
{
Raum aktuellerRaum = kontext.getAktuellenRaumZu(spieler);
boolean hasKuchen = false;
for(Item item : aktuellerRaum.getItems())
{
if(isKuchen(item))
{
hasKuchen = true;
break;
... | 3 |
public String getNewText() {
return this.newText;
} | 0 |
public static <GInput> Filter<GInput> disjunctionFilter(final Filter<? super GInput> filter1, final Filter<? super GInput> filter2)
throws NullPointerException {
if (filter1 == null) throw new NullPointerException("filter1 = null");
if (filter2 == null) throw new NullPointerException("filter2 = null");
return n... | 5 |
public static final Map<Byte, String> agentOptionsToMap(byte[] buf) {
if (buf == null) {
return null;
}
Map<Byte, String> map = new LinkedHashMap<Byte, String>();
int i = 0;
while (i < buf.length) {
if (buf.length - i < 2) {
... | 4 |
public String getStringForStates(State[] states) {
StringBuffer buffer = new StringBuffer();
for (int k = 0; k < states.length - 1; k++) {
buffer.append(Integer.toString(states[k].getID()));
buffer.append(",");
}
buffer.append(Integer.toString(states[states.length - 1].getID()));
return buffer.toString(... | 1 |
public float[] getXY(float t) {
return new float[] { (float) (this.x0 + Math.cos(this.radian) * t),
(float) (this.y0 + Math.sin(this.radian) * t) };
} | 0 |
private int[] getTurns(int dir)
{
switch(dir)
{
case Directions.NORTH:
case Directions.SOUTH:
if (originalDirection == Directions.EAST)
return new int[] { Directions.EAST };
if (originalDirection == Directions.WEST)
return new int[] { Directions.WEST };
return new int[] { Directions.... | 8 |
public Cost getCost() {
return cost;
} | 0 |
public void closeConection(){
isConected =false;
try {
socket.close();
} catch (IOException e) {
// TODO Автоматически созданный блок catch
e.printStackTrace();
}
} | 1 |
public static String findcachedirORIG() {
String as[] = { "c:/windows/", "c:/winnt/", "d:/windows/", "d:/winnt/",
"e:/windows/", "e:/winnt/", "f:/windows/", "f:/winnt/", "c:/",
"~/", "/tmp/", "", "c:/rscache", "/rscache" };
if (storeid < 32 || storeid > 34)
storeid = 32;
String s = ".file_store_" + sto... | 8 |
public Bid getLatestBid() {
return bidsCatalog.get(bidsCatalog.size() - 1);
} | 0 |
public void run() {
if (this.monitor.isSlaComplient(System.currentTimeMillis() - parameters.getStartTime())) {
if (this.monitor.isAvailable()) {
this.monitor.registerRequest(true);
} else {
this.monitor.registerRequestOnDowntime();
}
} else {
if (this.monitor.isAvailable()) {
this.monitor.re... | 3 |
private static void addTopLevelBrowser(Browser browser) {
if(topLevelBrowsers == null)
topLevelBrowsers = new ArrayList<Browser>();
topLevelBrowsers.add(browser);
} | 1 |
public static void initialize() {
Scanner scanner = null;
try {
scanner = new Scanner(new File("postaggerkey"));
} catch (FileNotFoundException e) {
}
while (scanner.hasNextLine()) {
int indexRow = 0, indexCol = 0;
@SuppressWarnings("resourc... | 8 |
public List<Planet> MyPlanets() {
List<Planet> r = new ArrayList<Planet>();
for (Planet p : planets) {
if (p.Owner() == 1) {
r.add(p);
}
}
return r;
} | 2 |
public static void gotoPreviousLevel(GameStateManager gsm){
World cw = (World)gsm.getGameState(gsm.getCurrentState());
if(index == 0){
cw.getPlayer().setVector(4, 0);
return;
}
//save world we are currently in
Save.writeWorld(cw, index);
Save.writePlayerData(cw.getPlayer());
//get gametime to tr... | 4 |
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (!(o instanceof AbstractFlower)) {
return false;
}
AbstractFlower other = (AbstractFlower) o;
if (id != other.id) {
return false;
}
if ... | 7 |
void print(Node t, int n, boolean p)
{
if (p)
{
t.getCar().print(-n, false);
System.out.println();
printLambda(t.getCdr(), n);
}
else
{
if (n > 0)
{
for (int i = 0; i < n; i++)
Sy... | 3 |
public void mouseClicked(MouseEvent e) {
checked = !checked;
if(checked) {
textColor = "white";
}
CheckBox.this.fireEvent(new ActionEvent());
} | 1 |
private void move() {
xa = 0;
ya = 0;
int px = (int)level.getPlayerAt(0).getX();
int py = (int)level.getPlayerAt(0).getY();
Vector2i start = new Vector2i((int)getX() >> 4, (int)getY() >> 4);
Vector2i destination = new Vector2i(px >> 4, py >> 4);
if(time % 3 == 0) path = level.findPath(start, destination);... | 9 |
@Override
/**
* Movement allowed, stopping to the first obstacle[non VOID] : TOP-DOWN-LEFT-RIGHT
* RETURNS true if the move is allowed
*/
public boolean checkMove(int Px, int Py,Player J,Piece[] B){
int Dx = Px - getPosx();
int Dy = Py - getPosy();
boolean W = J.isWhite();
boolean moveok = false;
//Lo... | 7 |
public int getSerializedSize() {
int size = memoizedSerializedSize;
if (size != -1) return size;
size = 0;
if (((bitField0_ & 0x00000001) == 0x00000001)) {
size += com.google.protobuf.CodedOutputStream
.computeBytesSize(1, getTeamNameBytes());
}
if (((bitField0_ & ... | 5 |
public static void main(String args[]) {
/* Set the Nimbus look and feel */
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
/* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
* For details see http://down... | 6 |
private void loadFeatureFromFile(String featureFile) throws IOException
{
FileReader fr = new FileReader(featureFile);
BufferedReader br = new BufferedReader(fr);
String line = null;
while((line = br.readLine()) != null)
{
String[] tks = line.trim().split("[\t]+");
int fid = Integer.parseInt(tks[0]);
... | 2 |
private static void swap(String[] a, int i, int j) {
String temp = a[i];
a[i] = a[j];
a[j] = temp;
} | 0 |
protected void toggleResizable() {
setResizable(!this.isResizable);
} | 0 |
protected static void search(ProcessSearchFlights processSearchFlights) {
StringBuffer stringBuffer = new StringBuffer(TravelSDK.INSTANCE.getSettingsResult().getWsUrl());
stringBuffer.append("?prgm=flight.search");
TravelSDK.appendStandartServiceParameters(stringBuffer);
stringBuffer.append("&offset=0&limit=").... | 7 |
public Integer getTier() {
Integer tier = 1;
if (!parents.isEmpty()) {
int tmpTier = 0;
int maxTier = 0;
for (Long parentId : parents) {
tmpTier = nodes.get(parentId).getTier();
if (maxTier < tmpTier) {
maxTier = tmp... | 3 |
public Connection getConnection() {
Connection connection = null;
DbConfiguration dbConfiguration = new DbConfiguration();
String driver = dbConfiguration.getDbProperty(DRIVER);
String className = dbConfiguration.getDbProperty(CLASS_NAME);
String datasurce = dbConfiguration.getDbProperty(DATA_SOURCE);
m_log... | 2 |
public final void mergePuzzlePieces(final SlidingPuzzleBoard newGameBoard,
final List<SlidingPuzzlePiece> puzzlePiece) {
for (int i = 0; i <= mergeProcedures; i++) {
SlidingPuzzlePiece firstPiece = SlidingPuzzlePiece.getPuzzlePiece()
.get(randomDigit(0, SlidingPuzzl... | 1 |
@Override
public void process(OurSim ourSim) {
ActiveEntity monitoredObj = ourSim.getGrid().getObject(monitored);
if (monitoredObj != null && monitoredObj.isUp()) {
Monitor reverseMonitor = monitoredObj.getMonitor(interested);
if (isCreatingConnection && reverseMonitor == null) {
reverseMonitor = Mon... | 6 |
@SuppressWarnings("unchecked")
public static void updateSwitch(Switch sw) throws JSONException{
String dpid = sw.getDpid();
List<Port> ports = new ArrayList<Port>();
JSONObject obj, portObj = null, featuresObj = null;
Map<String, Future<Object>> stats;
// Start the rest calls, true is passed since we are ... | 6 |
public static void sendResponse(String output, Long id, Long prdetailsId) {
try {
post = new HttpPost(prop.getString("BSSServerQuery").trim() + "/" +id);
post.setHeader("Authorization", "Basic " + new String(encoded));
post.setHeader("Content-Type", "application/json");
post.addHeader("X-Mifos-Platform... | 4 |
private static String escapeJSON(String text) {
StringBuilder builder = new StringBuilder();
builder.append('"');
for (int index = 0; index < text.length(); index++) {
char chr = text.charAt(index);
switch (chr) {
case '"':
case '\\':
... | 8 |
public List<? extends Piece> getAvailablePieces() {
return availablePieces;
} | 1 |
@Override
public boolean equals(final Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
BotMessage other = (BotMessage) obj;
if (me... | 6 |
public void releaseBuffer(ByteBuffer bb){
if(this.createCount.intValue() > maxBufferPoolSize && (this.usableCount.intValue() > (this.createCount.intValue() / 2) ) ){
bb = null;
this.createCount.decrementAndGet();
}else{
this.queue.add(bb);
this.usableCount.incrementAndGet();
}
} | 2 |
private int getOctaveOfHindustaniNote(String h) {
if (h.charAt(0) != '.' || h.charAt(h.length()) != '.') {
return wBaseOctave;
} else {
if (h.charAt(0) == '.') {
int count = 0;
while... | 6 |
public void stateChanged(ChangeEvent arg0)
{
if (arg0.getSource().equals(roundSpinner))
config.setMaxRounds(((Integer) ((JSpinner) arg0.getSource()).getValue()).intValue());
else if(arg0.getSource().equals(numLightsSpinner))
config.setNumLights(((Integer) ((JSpinner) arg0.getSource()).getValue()).intValue())... | 5 |
public void vieillir() {
super.vieillir();
loterie = new Random();
if (age <= 15 && poids < 50)
grossir(loterie.nextInt(4) + 2);
if (age > 15 && poids < 40)
esperancevie = age + 1;
} | 4 |
protected void setup() {
try {
Thread.sleep(10000);
} catch(InterruptedException ex) {
Thread.currentThread().interrupt();
}
// if (logger.isLoggable(jade.util.Logger.WARNING))
// logger.log(jade.util.Logger.WARNING, "greetings from setup()");
System.out.println("Hello Eclips... | 1 |
private static void routeDirLog() throws Exception{
try{
File myRouteDir = new File(dayDir + "/Route");
myRouteDir.mkdir();
routeLogDir = myRouteDir.getAbsolutePath();
}catch(Exception e){
throw new Exception (e);
}
} | 1 |
private static void writeByte(int x) {
assert x >= 0 && x < 256;
// optimized if byte-aligned
if (N == 0) {
try { out.write(x); }
catch (IOException e) { e.printStackTrace(); }
return;
}
// otherwise write one bit at a time
for (int i... | 4 |
public void run() throws UnknownJobException, IOException, JSchException {
switch (type) {
case COMBINE:
executeCombineJob((CombineJob) job);
break;
case COMPRESS:
executeCompressJob((CompressJob) job);
break;
case DOWNLOAD:
executeDownloadJob((DownloadJob) job);
break;
case FORWARD:
exec... | 6 |
public static void main(final String[] args) throws IOException {
final Document doc = Jsoup.connect("http://en.wikipedia.org/wiki/World_War_II_casualties").get();
final Elements els = doc.getElementsByClass("wikitable");
// fourth table in the article is the terrorist stuff
final Element ww2CasualtiesTable =... | 8 |
public void addTransition(Transition t) {
try {
int ttapes = ((TMTransition) t).tapes();
if (tapes == 0)
tapes = ttapes;
if (ttapes != tapes)
throw new IllegalArgumentException("Transition has " + ttapes
+ " tapes while TM has " + tapes);
super.addTransition(t);
} catch (ClassCastException... | 3 |
public void initialize(int numInputs, int numHiddenNodes, int numHiddenLayers) throws Exception {
Layer inputLayer = new Layer();
inputLayer.ID = 0;
Layer[] hiddenLayers = new Layer[numHiddenLayers];
Layer outputLayer = new Layer();
outputLayer.ID = numHiddenLayers + 1;
if (numHiddenLayers == 0) {
... | 9 |
public static String escape(String str) {
String r = str;
for (char c: TO_ESCAPE.toCharArray()) {
r = r.replaceAll("\\" + c, "\\\\" + c);
}
return r;
} | 1 |
public Object dequeue() {
if(first != null) {
Object item = first.data;
first = first.next;
size--;
return item;
}
return null;
} | 1 |
public static int run_AI_BASIC()
{
System.out.println("BASIC AI Initiated");
int temp=(int)(Math.random()*4);
if(enemyLockedMove!=-1)
temp=enemyLockedMove;
//while(!Mechanics.enemyHasPP(enemy[enemyIndex].move[temp])&&(temp<0||temp>3))
while((temp<0||temp>3)||enemy[enemyIndex].move[temp]==Pokemon.Move.N... | 7 |
@SuppressWarnings({ "rawtypes", "unchecked" })
public Room(RealClient p_client, Object[] p_data, String p_name, int p_width, boolean p_in)
{
this.client = p_client;
this.width = p_width;
this.name = p_name;
this.setLayout(new BorderLayout(0, 0));
menuBar = new JMenuBar();
this.add(menuBar, BorderLayout.NO... | 8 |
private ScoreObject modop(ScoreObject a, ScoreObject b) {
if (a.isNumeric() && b.isNumeric()) {
if (a.isFloat() || b.isFloat())
return new ScoreObject(a.getAsFloat() % b.getAsFloat());
// must both be int then
else if (a.isInt() && b.isInt())
return new ScoreObject(a.getInt() % b.getInt());
}
thr... | 6 |
public void direction() {
if (untouchable > 0) {
Dolphin dolphin = (Dolphin) getWorld().getObjects(Dolphin.class).get(0);
if (dolphin.direction == 0) {
setRotation(0);
}
else if (dolphin.direction == 1) {
setRotation(-45);
... | 9 |
public static String constructSymbolConstantName(GeneralizedSymbol symbol) {
{ String prefix = null;
String environmentname = "";
if (((Module)(symbol.homeContext)) != null) {
environmentname = ((Module)(symbol.homeContext)).moduleName + "-";
}
if (!(Stella.incrementalTranslationP()... | 6 |
@Override
public String getFeature(int wordId, int... fields) {
String[] allFeatures = getAllFeaturesArray(wordId);
if (allFeatures == null) {
return null;
}
StringBuilder sb = new StringBuilder();
if (fields.length == 0) { // All features
for (String feature : allFeatures) {
sb.append(CSVUtil.quot... | 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.