text stringlengths 14 410k | label int32 0 9 |
|---|---|
@Override
public void mouseEntered(MouseEvent paramMouseEvent) {/**/} | 0 |
private void diffOffering(ArrayList<Change> list, OffRec oldRecord,
HashMap<String, Object> session) {
String newString = (String) session.get("homeLink");
if (Change.fieldChanged(oldRecord.getLink(), newString))
list.add(OfferingChange.setLink(oldRecord, newString));
boolean newActive = (Boolean) session.g... | 7 |
public int next() {
lock.lock();
try {
++currentEvenValue;
Thread.yield(); // Cause failure faster
++currentEvenValue;
return currentEvenValue;
} finally {
lock.unlock();
}
} | 0 |
public static void start(String username, String ip) throws Exception {
String title = "Network Communicator : " + username;
final String name = username;
final int port = 6000;
String IP = ip;
final JFrame frame = new JFrame(title);
JPanel contentPane = new JPanel(new B... | 9 |
public void addItem(Object obj, String name)
{
WidgetChooserButton button;
if (checkable && selectedNo != -1) {
button = (WidgetChooserButton)(layout.itemAt(selectedNo).widget());
button.setChecked(false);
}
button = new WidgetChooserButton(obj, name, true);
if (checkable) {
button.setCheckable(t... | 3 |
private void listaArgumentos() {
// <lista_argumentos> ::= <argumento> <prox_argumento> | “vazio” “)”
// <prox_argumento> ::= “,” <argumento> <prox_argumento> | ")"
// <argumento> ::= <id> <compl_tipo_parametro>
// <compl_tipo_parametro> ::= <acesso_campo_registro> | <acesso_matriz>
// ... | 6 |
public String[] UDP2String(Packet packet) { //Creates a string array with udpPackets
UDPPacket udpPacket = (UDPPacket) packet; //Creates a udp packet out of the packet
EthernetPacket ethernetPacket = (EthernetPacket) packet.datalink;
//Creates and ethernet packet for layer 2 information
src_macInEnglish = e... | 1 |
public void joinChannel(Player p, String channelName) {
// Sanity-Check..
if (!ChannelsConfig.getChannels().contains("channels." + channelName)) {
Messenger.tell(p, Msg.CUSTOM_CHANNELS_NULL);
return;
}
// Make sure channel is joinable, or if a player has a bypass permission.
if (isJoinable(channelNam... | 6 |
protected Calendar getCalendarFromArg(String dateString) {
Calendar result = null;
if (banUntilDate) {
try {
result = Calendar.getInstance();
result.setTime(banDateParser.parse(dateString));
} catch (ParseException e) {
log.log(Leve... | 2 |
public static void openURL(String url) {
String os = System.getProperty("os.name").toLowerCase();
Runtime rt = Runtime.getRuntime();
try {
if (os.indexOf("win") >= 0) {
rt.exec("rundll32 url.dll,FileProtocolHandler " + url);
} else if (os.indexOf("mac") >= 0) {
rt.exec("open " + url);
} else if... | 7 |
@Override
protected void drawInternalU(UGraphic ug, Area area, boolean withShadow) {
final Dimension2D dimensionToUse = area.getDimensionToUse();
final StringBounder stringBounder = ug.getStringBounder();
final int textHeight = (int) getTextHeight(stringBounder);
ug.getParam().setColor(getForegroundColor());
... | 8 |
public static boolean containsSubstring(final String[] arr, String search) {
if (search == null)
return false;
search = search.toLowerCase();
for (String s : arr) {
if (s == null) continue;
s = s.toLowerCase();
if (s.contains(search) || search.contains(s))
return true;
}
return false;
} | 5 |
private void doubleArray() {
Object[] tempArray = new Object[array.length * 2];
for (int i = 0; i < size(); i++) {
tempArray[i] = array[i];
}
array = tempArray;
} | 1 |
public void setConsignmentId(int consignmentId) {
this.consignmentId = consignmentId;
} | 0 |
public String getIpAddress() {
return this.ipAddress;
} | 0 |
public BufferedImage[] getPaintImages(String theme) {
BufferedImage[] images = null;
String line;
ArrayList imageNames = new ArrayList();
try {
InputStream in = getClass().getResourceAsStream(GameController.CONFIG_DIR + config);
BufferedReader br = new BufferedRe... | 9 |
public LinkedList<Diff> diff_lineMode(String text1, String text2,
long deadline) {
// Scan the text on a line-by-line basis first.
LinesToCharsResult b = diff_linesToChars(text1, text2);
text1 = b.chars1;
text2 = b.chars2;
List<String> linearray = b.lineArray... | 9 |
public static String unescape(String string) {
int length = string.length();
StringBuffer sb = new StringBuffer();
for (int i = 0; i < length; ++i) {
char c = string.charAt(i);
if (c == '+') {
c = ' ';
} else if (c == '%' && i + 2 < length) {
... | 6 |
void NNIupdateAverages( double[][] A, edge e, edge par, edge skew,
edge swap, edge fixed )
{
node v;
edge elooper;
v = e.head;
//first, v
A[e.head.index][e.head.index] =
(swap.bottomsize*
((skew.bottomsize*A[skew.head.index][swap.head.index]
+ fixed.bottomsize*A[fixed.head.index][swap.head.ind... | 5 |
private boolean cmdGlobalRules(CommandSender sender) {
try {
String[] rules = WebUtils.readContentsToArray(new URL("http://server.mcforge.net/gcrules.txt"));
for (int i = 0; i < rules.length; i++) {
sender.sendMessage(rules[i].replace('&', ChatColor.COLOR_CHAR));
}
rules = null;
}
catch (IOExcept... | 2 |
private void append(int x, int y, String s)
{
if (!isValidPosition(x,y))
return;
if (!w[x][y].contains(s))
{
w[x][y] += s;
}
} | 2 |
public void simulateOneStep()
{
step++;
// Provide space for newborn actors.
List<Actor> newActors = new ArrayList<Actor>();
// avoid being being interrupted
try{
if (actors != null)
{
// Let all actors act.
for(Iterator<Actor> it... | 7 |
@Override
public boolean invoke(MOB mob, List<String> commands, Physical givenTarget, boolean auto, int asLevel)
{
MOB target=mob;
if((auto)&&(givenTarget!=null)&&(givenTarget instanceof MOB))
target=(MOB)givenTarget;
if(target.fetchEffect(this.ID())!=null)
{
mob.tell(target,null,null,L("<S-YOUPOSS> sk... | 8 |
public List<Recipe> getRecipeList() {
if (recipeList == null) {
recipeList = restClientBean.getRecipeClient().getAll();
}
return recipeList;
} | 1 |
public void render(Screen screen) {
if (Player.target != null) {
if (!Player.target.removed) {
screen.renderItem(Player.target.x - 16, Player.target.y - 16, Sprite.crosshairs);
} else {
Player.target = null;
}
}
//Drawing a circle:
if (Player.aiming) {
screen.renderItem(Mouse.mse.x - 16, M... | 8 |
public static void main(String[] args) throws IOException,
AccumuloException, AccumuloSecurityException, TableExistsException,
TableNotFoundException
{
Instance mock = new MockInstance();
Connector connector = mock.getConnector("root", new PasswordToken(
new b... | 7 |
@Override
public void execute(CommandSender sender, String[] args)
{
if(args.length == 1) {
if(args[0].equalsIgnoreCase("version") || args[0].equalsIgnoreCase("ver")) {
//output version
PluginDescription desc = MojangStatus.getInstance().getDescription();
sender.sendMessage(ChatColor.DARK_AQUA + (Cha... | 9 |
public void insertItem (int val) {
if (root==null) root = new Leaf(val);
else {
Leaf temp = root;
while (true) {
if (val <= temp.value) {
if (temp.left != null) temp=temp.left;
else {
temp.left = new ... | 5 |
public void crearPublicacion(){
ccp = new ControlCrearPublicacion();
//La funcion trim() elimina espacios antes y despues del valor
String tpub = thisRequest.getParameter("tPub").trim();
String tit1 = thisRequest.getParameter("tArt1").trim();
String tit2 = thisRequest.getParameter("tArt2").trim();
... | 7 |
public static boolean isEmpty(Object[] array) {
return (array == null || array.length == 0);
} | 1 |
private void formScreen(String action,
Connection database,
HttpSession session,
HttpServletRequest request,
PrintWriter webPageOutput)
{
int descriptionNumber=0;
String description="";
Routines.tableStart(false,webPageOutput);
if("Change Description".equals(action))
... | 7 |
public final void run() {
runningThread = Thread.currentThread();
String threadNameOriginal = runningThread.getName();
if (threadNameOriginal == null) threadNameOriginal = "T" + getClass().getSimpleName();
if (threadName != null && !threadName.isEmpty()) runningThread.setName(threadName);
else threadName =... | 9 |
public void genOperationToRConversion(StringBuffer buff, Operation o) {
StringBuilder funcbuff = new StringBuilder();
// R operation
funcbuff.append(String.format("r.%s<-function(", o.name));
if (o.parameters != null) {
Request r = o.parameters.request;
if (r.par... | 8 |
public static void main(String[] args) {
System.out.println(Byte.MIN_VALUE); // 127
System.out.println(Byte.MAX_VALUE); // -128
System.out.println(Short.MIN_VALUE); // 32767
System.out.println(Short.MAX_VALUE); // -32768
System.out.println(Integer.MIN_VALUE); // 2147483647
System.out.println(Int... | 0 |
public static boolean hasAtLeastOneMethodWithName(Class<?> clazz, String methodName) {
Assert.notNull(clazz, "Class must not be null");
Assert.notNull(methodName, "Method name must not be null");
Method[] declaredMethods = clazz.getDeclaredMethods();
for (Method method : declaredMethods) {
if (method.getName... | 8 |
public MongoClient abrirConexion()
{
if(mongo != null)
{
return mongo;
}
try
{
mongo = new MongoClient(host, puerto);
db = mongo.getDB(nombredb);
}
catch (UnknownHostException e)
{
e.printStackTrace();
}
return mongo;
} | 2 |
public static Point invertDirection(Point direction) {
Point newDirection = (Point) direction.clone();
newDirection.x *= -1;
newDirection.y *= -1;
return newDirection;
} | 0 |
public void setPaniculata(int paniculata) {
this.paniculata = paniculata;
} | 0 |
public synchronized void stepOut()
{
// First we run until the current frame has been evaluated.
// Note that we keep holding on to the same frame for testing,
// the one that was on the top when this method was called.
final Eval2.StackFrame lFrame = getStack().top();
stepcount = ... | 7 |
@Test
public void testEmptyArray() {
Conversions.debug = debug;
double[] arr = Conversions.convert("{}", double[].class);
Assert.assertTrue(arr != null && arr.length == 0);
arr = Conversions.convert(" { } ", double[].class);
Assert.assertTrue(arr != null && arr.length == 0);
arr = Conversions.convert(" {} ... | 4 |
@Override
public void handleOpenEndedAt( int x, int y ) {
if( !itemShown ){
itemShown = true;
parent.addItem( line );
}
line.setPoint2( x, y );
} | 1 |
public static void deleteDups2(LinkedListNode n) {
if(n == null)
return;
for(LinkedListNode i = n ; i.next != null ; i = i.next) {
int original = i.val;
for (LinkedListNode j = i; j.next != null;) {
if(j.next.val == original)
j.next = j.next.next;
else
j = j.next;
}
}
} | 4 |
public void update()
{
for(Entity entity : this.entities)
entity.update();
this.player.update();
for(int i = 0; i < this.entities.size(); i++)
if(this.entities.get(i).shouldRemove)
{
this.entities.remove(i);
i--;
}
this.lifetime++;
if(this.player.gifts == this.KIDS)
{
Game.inst... | 4 |
public void run() {
try{
while (!client.isClosed()) { // while client is not closed
String messageToSend;
synchronized(client) {
messageToSend = client.getMessageOut(); // Get the message
client.setMessageOut("");
}
if (client.isClosed()) // Check again if client is closed... | 8 |
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 |
public ArrayList<Tile> getAdjacentTiles(Tile tile)
{
ArrayList<Tile> adjacentTiles = new ArrayList<Tile>();
for (Direction direction : Direction.values()) {
Tile nextTile = getTile(tile.getGridX() + direction.getXOffset(), tile.getGridY() + direction.getYOffset());
if (nextTile != null) { //null implies that... | 2 |
public void addQuizText(String title,int quizId,ArrayList<String> imageList, ArrayList<Boolean> imageInventoryList,ArrayList<String> soundList,
ArrayList<Boolean> soundInventoryList, int narration,
String paragraphList, String preNote, String postNote,String goTo, int points, String date, ArrayList<String> ... | 2 |
@Override
public String confirmationMessage()
{
Entity e = editor.getMap().getEntityList().getEntityWithUUID(u);
String name = e.name;
if(name.equals(""))
name = "Untitled";
String ret = "Are you sure you would like to edit "+name+"?";
if(e.getPrefabPath() != null)
ret += " This entity is currently a... | 3 |
public UDPThread(DatagramSocket socket,int size) {
this.socket=socket;
this.size=size;
} | 0 |
private void updateStateRecipeName(List<Keyword> keywords, List<String> terms) {
RecipeLearningState nextState;
//TODO recipe already exists
if (terms.size() > 0) {
//I doubt that this code will work, what if last dialog was RA but the user just wants to teach the robot
//a new recipe -> further modification nee... | 4 |
public double[] solve(double[] rowValues){ // FIGURE OUT HTF THIS WORKS
double A[][] = this.clone().elements;
double[] values = new double[this.rowCount];
int N = rowValues.length;
for (int k=0; k<N; k++){
int max = k;
for (int i = k+1; i<N;i++){
i... | 5 |
public static void fix(int[] values) {
int aux = 0;
for (int i = 0; i < values.length; i++)
values[i]--;
if (values[1] > values[3]) {
aux = values[1];
values[1] = values[3];
values[3] = aux;
}
if (values[0] > values[2]) {
aux = values[0];
values[0] = values[2];
values[2] = aux;
}
} | 3 |
public Map<MetaEnum, Object> getMeta() {
return meta;
} | 0 |
private void setControl(byte val) {
// System.out.println("SetControl:" + ByteFormatter.formatBits((byte)val));
chr4KMode = ((val & 0x10) == 0x10);
int prgMode = ((val >> 2) & 0x3);
if (prgMode < 2) {
using32PRGBank = true;
lowBankFixed = false;
} else if (... | 7 |
protected void disconnectInterface( String hostId, String ifId ) {
Host h = hosts.get( hostId );
if( h == null ) return;
String linkId = h.interfaceLinkIds.get(ifId);
if( linkId == null ) return;
Link l = links.get(linkId);
if( l != null ) {
if( hostId.equals(l.host1) && ifId.equals(l.if1) ) {
l.host... | 7 |
private Object setValueByType(String param, Class paramType){
if(paramType == String.class){
return param;
}else if(paramType == char.class){
return Character.valueOf(param.charAt(0));
}else if(paramType == short.class){
return Short.valueOf(param);
}else if(paramType == int.class){
return Integer.v... | 7 |
public Type checkType(TypeMap tm)
{
Type t = new Type();
t.typeid = Type.TypeEnum.t_error;
Type tmp = e.checkType(tm);
if(tmp.OK())
{
if(tmp.typeid == Type.TypeEnum.t_pair)
{
t.typeid = tmp.t2.typeid;
}
else
{
if(Type.isDebug)
{
System.out.println("TypeError! snd: "+tmp.typeid... | 3 |
public final void initializeLookAndFeels() {
// if in classpath thry to load JGoodies Plastic Look & Feel
try {
LookAndFeelInfo[] lnfs = UIManager.getInstalledLookAndFeels();
boolean found = false;
for (int i = 0; i < lnfs.length; i++) {
if (lnfs[i].ge... | 6 |
private JSONObject parseResponse(final String query) throws NameResolverException {
assert query != null;
LOG.log(Level.INFO, "Call IAS name resolver: {0}", query);
final ClientResourceProxy proxy = new ClientResourceProxy(query, Method.GET);
final ClientResource client = proxy.getClientResource();
... | 4 |
@Override
public void run() {
if(game != null) {
final Color color;
final PlayerStatus status;
if(game.getWinner() != Player.NONE) {
color = UIPlayer.getPlayer(game.getWinner()).getForeground();
status = game.getPlayerStatus(game.getWinner());
}
else {
color = UIPlayer.getPlayer(game.getCu... | 9 |
@Override
public void caseAIdentifier(AIdentifier node)
{
for(int i=0;i<indent;i++) System.out.print(" ");
indent++;
System.out.println("(Identifier[ " + node + "]");
inAIdentifier(node);
if(node.getId() != null)
{
node.getId().apply(this);
}
... | 3 |
@Override
public Boolean call() throws IOException {
InputStream is = null;
is = updateURL.openStream();
prop.load(is);
String version = prop.getProperty("version");
int currentVersion = (normalizeVersion(version));
int runningVersion = (normalizeVersion(GrooveJaar.version));
/*for (byte i =0;i<runn... | 1 |
public UIFile(Path uitextfile, Path script, Path authuiTmp, Path basebrdTmp) {
if (!FileUtil.control(uitextfile)) {
IllegalArgumentException iae = new IllegalArgumentException("The uitextfile must not be null!");
Main.handleUnhandableProblem(iae);
}
this.authuiTmp = auth... | 1 |
public void alertObservers(Event e) {
for (ColorObserver co : wantsToKnow) {
System.out.println("Alerted.");
co.alert((ColorEvent) e);
}
} | 1 |
private void restore(int start, String[] ip, int curNum, String s) {
if (start > s.length() || curNum >= 4) {
return;
}
if (curNum == 3) {
String last = s.substring(start);
if (isValid(last)) {
ip[3] = last;
String oneResult = "";
for (int i = 0; i < ip.length; i++) {
oneResult += String... | 8 |
public void go_temps_reel(){
new Thread(){
public void run(){
while(!terminer){
//si il y a de nouveaux messages dans la file depuis la derni�re mise � jour :
if (dernier_nb_messages != filemessages.size()) {
vue.maj();
}
dernier_nb_messages = filemessages.size();
try {
... | 3 |
public static boolean isTresspass(int s) {
if(s==52465)
return true;
return false;
} | 1 |
private Object getValue(Field field) throws Throwable {
field.setAccessible(true);
Class<?> type = field.getType();
if (type == int[][].class) {
return Arrays.toString((int[][]) field.get(this));
} else if (type == int[].class) {
return Arrays.toString((int[]) field.get(this));
} else if (type == byte[]... | 8 |
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
SymbolicName other = (SymbolicName) obj;
if (attributes == null) {
if (other.attributes != null)
return false;
} else if (!attributes.eq... | 9 |
public List<StudentObj> getStudentNotSubmitted(String classname, int objId, int topicId) {
List<StudentObj> items = new LinkedList<StudentObj>();
String sql = "select Student.classname, Student.rollNo, fullname, email from Student inner join Class on Student.classname = Class.classname "
... | 6 |
void takeBack() {
//Step 1: Reset sides.
side ^= 1;
xside ^= 1;
//Step 2: Using our history values, reset the piece, color an board states.
--hply;
Project2_Move_Thompson m = histDat[hply].m;
castle = histDat[hply].castle;
ep = histDat[hply].ep;
fifty = histDat[hply].fifty;
color[(int)m.from] = side;
if... | 9 |
private static int areaWasted(Rectangle first, Rectangle second) {
if (first.width > 0 && first.height > 0 && second.width > 0 && second.height > 0) {
long combinedArea = (long) first.width * (long) first.height + (long) second.width * (long) second.height;
Rectangle union = first.union(second);
long unionAr... | 4 |
public void actionPerformed(ActionEvent e) {
//Handle open button action.
if (e.getSource() == openButton) {
int returnVal = fc.showOpenDialog(FileChooserDemo.this);
if (returnVal == JFileChooser.APPROVE_OPTION) {
File file = fc.getSelectedFile();
... | 4 |
public Object getValueAt(int row, int column) {
Variable variable = variableList.get(row);
if (column == 0) {
return variable.getName();
} else if (column == 1) {
return variable.getReplacementName();
} else if (column == 2) {
return variable.isObfuscable();
}
return null;
} | 3 |
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((janela == null) ? 0 : janela.hashCode());
result = prime * result + ((luigi == null) ? 0 : luigi.hashCode());
result = prime * result + ((mario == null) ? 0 : mario.hashCode());
return result;
} | 3 |
public GrammarToAutomatonConverter() {
} | 0 |
int wrap(Graphics g, int width, ArrayList<String> list) {
int lastNewLine = 0, lastSpace = 0, w = 0, maxw = 0;
for (int i = 0; i < info.length(); ++i) {
if (info.charAt(i) == ' ') {
w += g.getFontMetrics().stringWidth(info.substring(lastSpace, i + 1));
... | 4 |
void eliminates(K data) {
if (data == getRoot().data &&
getRoot().right == null &&
getRoot().left == null) {
root = null;
} else {
AVLNode<K> nodetoremover = nodeToRemover(data, getRoot());
System.out.println("Nodo a eliminar " + node... | 8 |
private static String fromTime(long time) {
int days = (int) TimeUnit.MILLISECONDS.toDays(time);
int hours = (int) TimeUnit.MILLISECONDS.toHours(time - TimeUnit.DAYS.toMillis(days));
int minutes = (int) TimeUnit.MILLISECONDS.toMinutes(time - TimeUnit.DAYS.toMillis(days) - TimeUnit.HOURS.toMillis(hours));
int se... | 6 |
private String ensureFilterType(){
String filterType = null;
if(EQ.startsWith(filterName)){
filterType = EQ;
}else if(LT.startsWith(filterName)){
filterType = LT;
}else if(GT.startsWith(filterName)){
filterType = GT;
}else if(CONTAINS.startsWith(filterName)){
filterType = CONTAINS;
}else if(EMPT... | 9 |
protected static String getSyncedDelayString(StructStorageStat[] storageStats, StructStorageStat currentStorageStat) {
long maxLastSourceUpdate = 0;
for (StructStorageStat storageStat : storageStats) {
if (storageStat != currentStorageStat && storageStat.getLastSourceUpdate().getTime() > max... | 8 |
@Override
public boolean processEndTag(String tag)
{
boolean ready = false;
Boolean inSituationRecord = inTagMap.get(TrafficData.TAG_SITUATION_RECORD);
if (inSituationRecord != null)
{
if (tag.equals(TrafficData.TAG_SITUATION_RECORD))
{
ready = true;
}
else if (inSituationRecord && tag.e... | 9 |
public void toggleKey(int KeyCode, boolean isPressed) {
if (KeyCode == KeyEvent.VK_W) {
up.toggle(isPressed);
}
if (KeyCode == KeyEvent.VK_S) {
down.toggle(isPressed);
}
if (KeyCode == KeyEvent.VK_A) {
left.toggle(isPressed);
}
if (KeyCode == KeyEvent.VK_D) {
right.toggle(isPressed);
}
if(... | 5 |
public List<Double> readPointFrames(File svlFile) {
List<Double> pointFrames = new ArrayList<>();
BufferedReader fReader = null;
try {
fReader = new BufferedReader(new FileReader(svlFile));
String data = "";
int index = 0;
while((data = fReader.readLine()) != null) {
if (data.contains("<poin... | 5 |
@Override
public int hashCode() {
int hashKey = key != null ? key.hashCode() : 0;
int hashValue = value != null ? value.hashCode() : 0;
return (hashKey + hashValue) * hashValue + hashKey;
} | 2 |
public boolean solapamentTeoriaPractica(Element e) {
boolean grupTeoria = false;
if ((e.getGrupo() % 10) == 0) {
grupTeoria = true;
}
for (int i = 0; i < assignacions.size(); ++i) {
if (assignacions.get(i).getAssignatura().equals(e.getAssignatura())) { // si es la... | 7 |
private void MonthBoxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_MonthBoxActionPerformed
int m = MonthBox.getSelectedIndex() + 1;
int y = YearBox.getSelectedIndex() + (Calendar.getInstance().get(Calendar.YEAR) - CountYears);
int n = m !=... | 7 |
private void jButton5ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton5ActionPerformed
Transferable clipboardContent = getToolkit().getSystemClipboard().getContents(this);
if ((clipboardContent != null)
&& (clipboardContent.isDataFlavorSupported(DataFlavor.str... | 3 |
public void undo(CardPanel panel) {
System.out.println(history);
if (!history.isEmpty()) {
CardMove toUndo = history.peek();
if (toUndo.undo(this, panel)) {
history.pop();
}
}
} | 2 |
public void render(Screen screen){
for(int y = 0; y < (screen.height / 32) + 32; y++){
for(int x = 0; x < (screen.width / 32); x++){
screen.renderTile(x * 32, y * 32, -1, Tile.rockTile);
}
}
font.render("Character Select", -1, 10, 0xffffffff, 2, true, screen);
for(int i = 0; i < 3; i++){
rend... | 4 |
@NotNull
public static Expression parse(@NotNull String expression) {
ImmutableList.Builder<Label> includes = ImmutableList.builder();
ImmutableList.Builder<Label> excludes = ImmutableList.builder();
String[] split = expression.split("\\s+");
if(split != null && split.length > 0) {
for (String labelString ... | 6 |
private int handleException(Exception e) {
int errno;
e.printStackTrace();
if (e instanceof FuseException) {
errno = handleErrno(((FuseException) e).getErrno());
if (log != null && log.isDebugEnabled()) {
log.debug(e);
}
} else if (e i... | 7 |
public static double[][] FrequencyDomain(double[] x) {
double[] y = new double[x.length];
int m = (int) (Math.log(x.length) / Math.log(2));
int n, i, i1, j, k, i2, l, l1, l2;
double c1, c2, tx, ty, t1, t2, u1, u2, z;
n = x.length;
i2 = n >> 1;
j = 0;
// adapted from Paul Bourke's implementation
// of ... | 9 |
public Object nextValue() throws JSONException {
char c = this.nextClean();
String string;
switch (c) {
case '"':
case '\'':
return this.nextString(c);
case '{':
this.back();
return new JSONObject(this);
... | 7 |
public int smallestMultiple() {
boolean found = false;
int smallestMultiple = 0;
for (int i = 2520; !found; i++) {
if (isEvenlyDivisible(i)) {
found = true;
smallestMultiple = i;
}
}
return smallestMultiple;
} | 2 |
@Override
public void close() throws IOException {
super.close();
s.close();
} | 0 |
public void startGather(Vector x, DistVector y) {
if (x.size() != y.size())
throw new IllegalArgumentException(
"Vectors must be of the same global size");
// Assemble the arrays to send
for (int i = 0; i < comm.size(); ++i)
if (i != comm.rank())
... | 8 |
public static String shortToLong( String name, Map<String,String> nsAbbreviations ) throws XMLParseException {
int lo = name.indexOf(':');
String nsShort, subName;
if( lo == -1 ) {
nsShort = "";
subName = name;
} else if( lo < 1 || lo == name.length()-1 ) {
throw new XMLParseException("Can't parse '" +... | 5 |
public Direction getFacing() {
return (isMoving() || isCancelingMove() || isRecoveringFromCanceledMove() ? moveDirection : facingDirection);
} | 3 |
public void _jspService(HttpServletRequest request, HttpServletResponse response)
throws java.io.IOException, ServletException {
PageContext pageContext = null;
HttpSession session = null;
ServletContext application = null;
ServletConfig config = null;
JspWriter out = null;
Object page ... | 6 |
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.