text stringlengths 14 410k | label int32 0 9 |
|---|---|
@RequestMapping(value="/image/upload", method=RequestMethod.POST)
@ResponseStatus(value = HttpStatus.OK)
public void handleFileUpload(@RequestParam("hashTagText") String hashTagText,
@RequestParam("file") MultipartFile file,
... | 3 |
public static void setSoundMode(SoundMode mode)
{
if(AudioHandler.soundSystem == null || AudioHandler.isShutDown())
return;
AudioSwitcher.soundMode = mode;
if(currentSound != null)
{
AudioHandler.stop(currentSound);
currentSound = null;
}
switch(soundMode)
{
case TITLE:
currentSound = Au... | 7 |
private final void method648(boolean bool, int i) {
if ((6 * anInt5616 ^ 0xffffffff) >= (aGLToolkit5692.aFloatBuffer6661.buffer.length ^ 0xffffffff)) {
aGLToolkit5692.aFloatBuffer6661.offset = 0;
} else {
aGLToolkit5692.aFloatBuffer6661 = new FloatBuffer((anInt5616 - -100) * 6);
}
anInt5632++;
FloatBuff... | 9 |
public void checkClientTrusted(X509Certificate[] chain, String authType)
throws CertificateException {
try {
sunJSSEX509TrustManager.checkClientTrusted(chain, authType);
} catch (CertificateException excep) {
// do any special handling here, or rethrow exception.
... | 1 |
public static String css(){
return "<style>\n"+
"#hor-minimalist-b\n" +
" {\n" +
" font-family: \"Lucida Sans Unicode\", \"Lucida Grande\", Sans-Serif;\n" +
" font-size: 12px;\n" +
" background: #fff;\n" +
... | 0 |
private void createActivity(JobMetaData meta, Allocation alloc) {
ArrayList<IJob> list = new ArrayList<IJob>();
HashMap<Integer, HashMap<Integer, String>> allocs = alloc.getAllocations();
for (Integer vmId : allocs.keySet()) {
SlaveVM vm = this.pool.getVMById(vmId);
SocketSender sender = new SocketSen... | 3 |
private void criaEventoTextField() {
textFieldConta.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
if (textFieldConta.getText() != null) {
Integer agenciaSelecionada = new Integer(textFieldConta
.getText());
agenciaSelecionada--;
//... | 7 |
@Override
public V get(Object key) {
if (key instanceof String) {
return super.get(((String) key).toLowerCase());
}
else {
return null;
}
} | 1 |
private List<Method> findMethodsByMappedColumnName(Object targetObject, String mappedColumnName) {
List<Method> methods = new ArrayList<>();
for (Method method : targetObject.getClass().getDeclaredMethods()) {
if (method.isAnnotationPresent(XlsxColumnName.class)) {
XlsxCo... | 7 |
private static long getSmallestMultiple(int number)
{
if (number < 0)
{
return 0;
}
if (number <= 2)
{
return number;
}
boolean[] isPrimes = new boolean[number];
for (int i = 0; i < number; ++i)
{
isPrimes[i] = true;
}
for (int i = 2; i < number; ++i)
{
if (isPrimes[i])
{
fo... | 9 |
public ArrayList<BusinessObject> getSelectedObjects() {
int[] rows = getSelectedRows();
ArrayList<BusinessObject> businessObjectArrayList = new ArrayList<>();
for(int row : rows) {
BusinessObject businessObject = (BusinessObject) model.getValueAt(row, 0);
businessObjectAr... | 2 |
@Override
public boolean equals(Object obj) {
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final TDatdprPK other = (TDatdprPK) obj;
if (!Objects.equals(this.transNo, other.transNo)) {
return... | 4 |
public boolean containsNearbyDuplicate(int[] nums, int k) {
if(k<1){
return false;
}
if(nums==null ){
return false;
}
boolean res =false;
HashMap s = new HashMap<>();
for(int i=0;i<nums.length;i++){
Object idx = s.get(nums[i]);
if(idx==null){
s.put(nums[i],i);
}else{
int iidx = (in... | 5 |
public static void make() {
if (!Bank.isOpen()) {
if (Inventory.getCount(Variables.gemToCut) > 0) {
if (gemInterface()) {
Crafting.clickStart();
final Timer gemTimer = new Timer(20000);
while (gemTimer.isRunning()
... | 6 |
private void actualizarJuga(int j1,int j2){
if (j1==Jugador.HUMANO)
jLabelJug1.setText("Humano");
else{
if (j1 == OthelloHexagonal.FACIL)
jLabelJug1.setText("Maquina-Principiante");
if (j1 == OthelloHexagonal.MEDIO)
jLabelJug1.setText("... | 8 |
@Override
public void add(E elem) {
if (root == null) {
root = new Node(elem, null, null, null);
} else {
for (Node start = root; start != null; ) {
if (start.item.compareTo(elem) > 0) {
if (start.left != null) {
sta... | 6 |
public Dimension getMinimumSize(JComponent c) {
return getPreferredSize(c);
} | 0 |
public BrowserLauncher getBrowserLauncher(String browser, String sessionId, RemoteControlConfiguration configuration, BrowserConfigurationOptions browserOptions) {
if (browser == null) {
throw new IllegalArgumentException("browser may not be null");
}
String executablePath = null;
... | 7 |
@Override
public boolean activate() {
return (!validate(Constants.WAITFOR_WIDGET)
&& !Inventory.contains(Settings.bar.getFirstId())
&& Inventory.contains(Settings.bar.getBarId())
&& !Bank.isOpen()
&& !Widgets.get(13, 0).isOnScreen());
} | 4 |
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 |
void createOffscreenImage(boolean discard_image) {
d=getSize();
if(discard_image) {
img=null;
imgsize=null;
}
if(img == null || imgsize == null || imgsize.width != d.width || imgsize.height != d.height) {
img=createImage(d.w... | 8 |
public static void deleteFiles(File dir, FilenameFilter filter) {
// validations
if(dir == null) {
throw new DataUtilException("The delete directory parameter can not be a null value");
} else if(!dir.exists() || !dir.isDirectory()) {
throw new DataUtilException("The dele... | 8 |
public static Type max(Type p1, Type p2) {
if (!numeric(p1) || !numeric(p2)) {
return null;
} else if (p1 == Type.Fixed || p2 == Type.Fixed) {
return Type.Fixed;
} else if (p1 == Type.Integer || p2 == Type.Integer) {
return Type.Integer;
} else {
... | 6 |
@XmlElementDecl(namespace = "http://www.w3.org/2000/09/xmldsig#", name = "X509Data")
public JAXBElement<X509DataType> createX509Data(X509DataType value) {
return new JAXBElement<X509DataType>(_X509Data_QNAME, X509DataType.class, null, value);
} | 0 |
@Override
public String toString() {
if (seqChange == null || marker == null) return null;
String pos = pos();
if (pos == null) return null;
String protChange = "";
switch (seqChange.getChangeType()) {
case SNP:
case MNP:
return snpOrMnp();
case INS:
protChange = ins();
break;
case DEL:
... | 7 |
private Table getTableAyantId(int tableId) {
for (Table table : tables) {
if (table.getTableId() == tableId)
return table;
}
return null;
} | 2 |
public void recalcHeightMap()
{
for (int x = 0; x < 16; x++)
for (int z = 0; z < 16; z++)
{
int y = MAP_HEIGHT - 1;
while (Blocks.getBlockOpacity(getBlock(x, y, z)) == 0 && y > 0)
y--;
y++;
setHeight(... | 4 |
public void make(Piece[][] board) {
Piece1 = board[x1][y1];
//System.out.println("Make: " + (Piece1.x == x1 && Piece1.y == y1));
if (board[x2][y2] != null) {
Piece2 = board[x2][y2];
}
board[x2][y2] = board[x1][y1];
board[x1][y1] = null; ... | 1 |
public double calculateDistance(DataPoint other) {
if (this.equals(other))
return 1;
HashMap<Integer, Double> minHash, maxHash;
HashMap<Integer, Double> current = getVector(), otherHashMap = other
.getVector();
if (current.size() < otherHashMap.size()) {
minHash = current;
maxHash = otherHashMap;
... | 6 |
public String getResultString() {
// String resultString;
// String filter = this.getFileFilter().getDescription();
String path = null;
// boolean isDirMode = (this.getFileSelectionMode() == DIRECTORIES_ONLY);
boolean isMulti = this.isMultiSelectionEnabled();
if (isMulti) {... | 6 |
protected void convertMapsToSections(Map<?, ?> input, ConfigurationSection section) {
for (Map.Entry<?, ?> entry : input.entrySet()) {
String key = entry.getKey().toString();
Object value = entry.getValue();
if (value instanceof Map) {
convertMapsToSections((... | 8 |
private static int memoryLocation(int abv) {
switch (abv) {
case ABV_MEMSIZE:
return 0;
case ABV_DEFENSE:
return 1;
case ABV_OFFENSE:
return 2;
case ABV_SIZE:
return 3;
case ABV_ENERGY:
return 4;
case ABV_PASS:
return 5;
case ABV_TAG:
return 6;
case ABV_POSTURE:
return 7;
def... | 8 |
private boolean checkNeedE( int res1, int res1AANum, int res1RotNum, int res2, int res2AANum, int res2RotNum ){
//Returns if we need to compute the given shell or pairwise energy
if(!compCETM)//Need all energies for normal energy matrices
return true;
... | 8 |
@Test
public void testNoAgregarEntidad() {
Sistema sistema = Sistema.getInstance();
String nombre = "Alicates";
int tamAnterior = sistema.getEntidades().size();
try {
CONTROL.agregarEntidad(new Long(3000), nombre, new Double(nombre));
} catch (NumberFormatExceptio... | 1 |
public String getTeams() {
return "For todays game we hate the " + this.team1 + " versus the " + this.team2;
} | 0 |
public static String addLeadingZero(String s) {
// If it's length is one, then add a zero
if (s.length() == 1)
return "0" + s;
// Otherwise just return it as it is
return s;
} | 1 |
@Override
public V compute(final A arg) throws InterruptedException {
while (true) { // 重试机制:无限次!
Future<V> f = cache.get(arg);
if (f == null) { // 首先检查某个计算是否已经开始
Callable<V> eval = new Callable<V>() {
@Override
public V call() throws Exception {
return c.compute(arg);
}
};
... | 5 |
private String readFileAsString(String filename) throws Exception {
StringBuilder source = new StringBuilder();
FileInputStream in = new FileInputStream(filename);
Exception exception = null;
BufferedReader reader;
try {
reader = new BufferedReader(new InputStreamReader(in, "UTF-8"));
Exception inne... | 9 |
static void printSpiralMatrix(int[][] matrix, int rows, int columns){
int columnIndex1 = 0;
int columnIndex2 = columns-1;
int rowIndex1 = 0;
int rowIndex2 = rows-1;
int indexVisited = 1;
int i;
while(indexVisited <= columns*rows){
for(i = columnIndex1;... | 9 |
public void handleRequest() {
Thread pollQueue = new Thread(new Runnable() {
public void run() {
while (true) {
FolderWatcherQueue s = changes.poll();
// System.out.println("The size of the " + changes.size());
if (s != null) {
String eventType = s.getEventType();
if (eventType.equa... | 5 |
* @param improvementType a <code>TileImprovementType</code> value
*/
public void changeWorkImprovementType(Unit unit,
TileImprovementType improvementType) {
if (!requireOurTurn()) return;
if (!unit.checkSetState(UnitState.IMPROVING)
|| impr... | 7 |
public int Open(String Filename, int NewMode)
{
int retcode = DDC_SUCCESS;
if ( fmode != RFM_UNKNOWN )
{
retcode = Close();
}
if ( retcode == DDC_SUCCESS )
{
switch ( NewMode )
{
case RFM_WRITE:
try
{
file = new RandomAccessFile(Filena... | 8 |
public Colgroup(HtmlMidNode parent, HtmlAttributeToken[] attrs){
super(parent, attrs);
for(HtmlAttributeToken attr:attrs){
String v = attr.getAttrValue();
switch(attr.getAttrName()){
case "align":
align = Align.parse(this, v);
break;
case "char":
charr = Char.parse(this, v);
break... | 7 |
protected Transition initTransition(State from, State to)
{
return new MealyTransition(from, to, "", "");
} | 0 |
public void skipRemaining() throws IOException {
while (length > 0) {
int skipped = (int) skip(length);
if (skipped == 0)
throw new EOFException();
length -= skipped;
}
} | 2 |
public Analizer() {
} | 0 |
@Override
public String toString() {
String result = "\n\t\t<s id=\"" + id + "\">";
result += "\n\t\t\t<graph root=\"" + rootIDref + "\">";
result += "\n\t\t\t\t<terminals>";
terminals = Helper.sortByKey(terminals);
for (Node terminal : terminals.values()) {
result += terminal;
}
result += "\n\t\t\t\t... | 3 |
private void createScrollPane(Attributes attrs) {
scrollPane = new ScrollPane(scrollpaneDef);
// loop through all attributes, setting appropriate values
for (int i = 0; i < attrs.getLength(); i++) {
if (attrs.getQName(i).equals("x"))
scrollPane.getStartPoint().setX(
Integer.valueOf(attrs.getValue(i))... | 9 |
public void ChangeDoor(int ArrayID) {
int objectID = server.objectHandler.ObjectOriID[ArrayID];
int objectX = server.objectHandler.ObjectX[ArrayID];
int objectY = server.objectHandler.ObjectY[ArrayID];
int Face = server.objectHandler.ObjectFace[ArrayID];
int Type = server.objectHandler.ObjectType[ArrayID];
... | 5 |
public boolean canMoveExact( int playerColor) {
if (! legitPlayerColor(playerColor)) {
throw new IllegalArgumentException("Bad color '" + playerColor + "'");
}
if ((myDice.isDoubles( )) && (myDice.getDoubletMovesCountdown( ) < 1)) {
return false;
}
// ?? n... | 9 |
public static ArrayList<Adress> getAll() {
try {
if(conn == null || conn.isClosed()){
conn = DatabaseConnection.getConnection();
}
} catch (SQLException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
ArrayList<Adress> adressList = new ArrayList<Adres... | 5 |
public boolean lautaValmis() {
int nro = 1;
for (int i = 0; i < getKorkeus(); i++) {
for (int j = 0; j < getLeveys(); j++) {
if (i == getKorkeus() - 1 && j == getLeveys() - 1) {
return true;
}
if (getNappula(i, j).getTunnis... | 5 |
@Override
public void setMovement(Board b) {
int x = getLocation().getX();
int y = getLocation().getY();
movement.setSize(0);
movement.trimToSize();
if (y > 6 || b.getCell(new Location(x, y+1)) != null) {
} else {
movement.add(new Location(x, y+1));
... | 9 |
public void hyperlinkUpdate(HyperlinkEvent e)
{
if (e.getEventType() == HyperlinkEvent.EventType.ACTIVATED) {
history.addFirst(editor.getPage());
Cursor c = editor.getCursor();
Cursor waitCursor = Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR);
editor.se... | 1 |
public BmgPanelCustom(BmgFrame fen) {
super();
this.fen = fen;
this.setLayout(new BorderLayout());
JPanel panHaut = new JPanel();
panHaut.setLayout(new GridLayout(3, 2));
// Labels
JLabel label1 = new JLabel("| Nom de l'exercice : ");
JLabel label2 = n... | 9 |
@Override
public boolean onCommand(CommandSender sender, Command cmd, String cmdLabel, String[] args) {
if (!sender.hasPermission("VanishCommand.list")) {
sender.sendMessage(ChatColor.RED + "No permission!");
return true;
}
if (args.length != 0)
return false;
if (this.plugin.getHiders().isEmpty()) ... | 5 |
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Account other = (Account) obj;
if (name == null) {
if (other.name != null... | 9 |
private boolean parse(String line){
boolean retVal = true;
StringTokenizer st = new StringTokenizer(line , ",");
String command = st.nextToken();
System.out.println("SERVER : The command is : " + command);
if(command.equals("REQ")){
int numDep = Integer.parseInt(st.nextToken());
int numArr = Integer.p... | 6 |
static String readCommand(String cmd) throws Exception {
boolean error = false;
cmd = cmd.replace(" ", "");
// Check if only allowed chars
if(Pattern.matches(PATTERN, cmd)) {
// This chunk here checks balancing brackets
LinkedList<Character> stack = new LinkedLi... | 8 |
@Override
public void endTransaction() {
if(commit()){
this.transaction = false;
}
} | 1 |
public static AngleData getInterpolatedAngleData(List<AngleData> dataBase,int n,int index,double target)
{
int gpsWeek = dataBase.get(0).getTime().getWN();
int offset = 0;
double []towArray = new double[n];
double []leftAngleArray = new double[n];
double []rightAngleArray =... | 8 |
@Override
public Object getValueAt(int row, int column) {
int index = 0;
for (Entry<Integer, Boolean> e : pu.entrySet()) {
if (row == index) {
if (column == 0)
return e.getKey();
else
return e.getValue() ? "Active" : "Inactive";
}
index++;
}
return "";
} | 4 |
private ArrayList<String> fetchMatchingSpelproject() {
String searchFor = tfSpelprojectSearch.getText();
ArrayList<HashMap<String, String>> temp = null;
try {
temp = DB.fetchRows("select * from spelprojekt");
} catch (InfException e) {
e.getMessage();
}
... | 5 |
public static String getPreferredJavaType(int sqlType, int size, int decimalDigits) {
if ((sqlType == Types.DECIMAL || sqlType == Types.NUMERIC) && decimalDigits == 0) {
if (size == 1) {
return "Boolean";
} else if (size < 3) {
return "Byte";
} else if (size < 5) {
return "Short";
} else if (s... | 9 |
private void checkvault() {
Plugin p = getServer().getPluginManager().getPlugin("Vault");
if (p == null) {
sendtoserver(":δҵVault");
sendtoserver("Trd.");
setEnabled(false);
} else {
return;
}
} | 1 |
public MyMap(){
int i;
registers=new HashMap<String,Integer>();
opcodes=new HashMap<String,Integer>();
opcodes_tail=new HashMap<String,Integer>();
Labels=new HashMap<String,Integer>();
for(i=0;i<8;i++){
registers.put("r"+i,i);
registers.put("R"+i,i... | 1 |
private void cleanupEdge(final Block src, final Block dst) {
dst.visit(new TreeVisitor() {
public void visitPhiJoinStmt(final PhiJoinStmt stmt) {
final Expr operand = stmt.operandAt(src);
if (operand != null) {
operand.cleanup();
// Remove the operand associated with src
// from a PhiJoinS... | 1 |
public static Command toCommand(String str, String prefix, String botnick) {
// Use this function to get the enum value for a string
String command;
String [] commandList;
commandList = str.split(" ");
command = commandList[0].toUpperCase();
if(prefix ==... | 9 |
public void AddToMenu() {
if (Glob.instance != null && Glob.instance.paginae != null)
if (!Glob.instance.paginae.contains(res)) Glob.instance.paginae.add(res);
} | 3 |
public static void main(String[] args) {
Parameters.load();
try {
// Set System L&F
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
} catch (UnsupportedLookAndFeelException e) {
// handle exception
} catch (ClassNotFoundException e) {
// handle exception
} catch (Instantiation... | 4 |
public String cryptanalyseCle(IMessage clair, IMessage crypte) {
long d=new Date().getTime();
int j=0;
boolean trouve=false;
while(j<clair.taille() && !trouve) {
if((char)(33+(clair.getChar(j)+47-33)%93)!=crypte.getChar(j) && clair.getChar(j)!=crypte.getChar(j)) {
trouve=true;
}
j++;
}
if(!trou... | 5 |
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Ex25Java other = (Ex25Java) obj;
if (age != other.age)
return false;
if (name == null) {
if (other.name != null)
return false;
} el... | 7 |
public boolean solved(){
for(Cell[] rows : puzzle)
for(Cell cell : rows)
if(cell.getColor() == '.') return false;
return true;
} | 3 |
public void resize(int x, int y) {
if (x < 1 || y < 1)
return;
Tile newMap[][] = new Tile[x][y];
initTab(newMap);
if (x <= tab.length && y <= tab[0].length) {
copy(newMap, tab, x, y);
}
else if (x > tab.length && y <= tab[0].length) {
copy(newMap, tab, tab.length, y);
}
else if (x <= tab.... | 8 |
private void read(BufferedReader reader) throws IOException
{
String line;
// Header
line = reader.readLine();
if(!"Item".equals(line)) {
throw new IOException("Wrong header: " + line);
}
// Version
line = reader.readLine();
if(!"v.1".e... | 8 |
public boolean checkColision(int x1, int y1, int x2, int y2){
if(alive){
if(colidate(x1, y1, x2, y2) ){
if(!getProtect().isActive()){
lives--;
imgLives.setText("x"+lives);
alive = false;
explosionTime = 0;
exp = true;
SoundManager.playExplosion();
}
return true;
}
}
... | 3 |
@SuppressWarnings("unchecked")
@Override
public HashMap<String, JOSObject<?, ?>> getObjects() {
return (HashMap<String, JOSObject<?, ?>>) DATA.clone();
} | 4 |
protected Automaton createEmptyAutomaton(Document document)
{
return new MealyMachine();
} | 0 |
public static void main(String[] args) {
int[] candidates ={7,12,5,10,9,4,6,8};
int target = 32;
List<List<Integer>> list = new Combination_Sum().combinationSum(candidates, target);
for(int i =0 ;i< list.size();i++){
System.out.println(Arrays.toString(list.get(i).toArray()));... | 1 |
/* */ public static boolean ClassListEqual(Class<?>[] l1, Class<?>[] l2) {
/* 167 */ boolean equal = true;
/* */
/* 169 */ if (l1.length != l2.length)
/* 170 */ return false;
/* 171 */ for (int i = 0; i < l1.length; i++) {
/* 172 */ if (l1[i] != l2[i]) {
/* 173 */ equal = fals... | 5 |
public String getFullAlias() {
if (parent != null) {
String parentAlias = parent.getFullAlias();
String alias = getAlias();
if (alias.length() == 0)
return parentAlias;
else if (parentAlias.length() == 0)
return alias;
else
return parentAlias + "." + alias;
}
return "";
} | 3 |
public static boolean getYesOrNoAnswer(){
Scanner scanner = new Scanner(System.in);
String answer;
while (true){
answer = scanner.nextLine();
if (answer.equals("yes")){
return true;
}
if (answer.equals("no")){
return... | 3 |
public static RepSmartList UPDATE_SMART_LIST(OVSmartList ovSmartList) throws SQLException {
RepSmartList rep = new RepSmartList();
Connection connexion = GET_CONNECTION();
try {
for (OVListeProduit ovListeProduit : ovSmartList.getProduitsSmartList()) {
int coche =... | 5 |
private static byte[] combineCD(byte[] C, byte[] D) {
byte[] CD = new byte[7];
// get 28 first bits from C
for(int bit = 0; bit < 28; bit++) {
ByteHelper.setBit(CD, bit, ByteHelper.getBitInt(C, bit));
}
// get 28 next bits from D
for(int bit = 28; bit < 56; bi... | 2 |
public void setNodePlacer(NodePlacer placer) {
this.nodePlacer = placer;
invalidate();
} | 0 |
public UndoableDocumentAttributeChange(JoeTree tree, String oldKey, Object oldValue, boolean oldReadOnly, String newKey, Object newValue, boolean newReadOnly) {
this.tree = tree;
this.oldKey = oldKey;
this.oldValue = oldValue;
this.oldReadOnly = oldReadOnly;
this.newKey = newKey;
this.newValue = newValue;
... | 0 |
public int findKthSortedArrays(int A[], int sA, int B[], int sB, int k){
int eA = A.length - 1;
int eB = B.length - 1;
if(eA - sA > eB - sB){
return findKthSortedArrays(B, sB, A, sA, k);
}
if(sA > eA) return B[sB+k-1];
if(k==1) return Math.min(A[sA],B[sB]); //... | 5 |
public Player(int x, int y, Cell landlord) {
super(x, y, landlord);
try {
img = ImageIO.read(new File("res/img/RaphiLangu.png"));
} catch (IOException e) {
}
} | 1 |
@Test
public void testGetTipoInteres() {
System.out.println("getTipoInteres");
Cuenta instance = new Cuenta();
float expResult = 0.0F;
float result = instance.getTipoInteres();
assertEquals(expResult, result, 0.0);
// TODO review the generated test code and remove the... | 0 |
public void addCell(cell ecoli, int x, int y){
int myx; int myy;
if(x >= xmin && x < xmax){myx = x-xmin;}else{myx = -1;}
if(y >= ymin && y < ymax){myy = y-ymin;}else{myy = -1;}
if(myy == -1 || myx == -1){ }
else{culture[myx][myy] = null;
culture[myx][myy] = ecoli;
if(ecoli.getOption("Mirror")){}else{ culture... | 7 |
public void updateScreens() {
// GameScreen g = screens.get(screens.size()-1);
List<GameScreen> screensToInput = new ArrayList<GameScreen>();
for (int i = screens.size() - 1; i >= 0; i--) {
if (screens.get(i).state != ScreenState.HIDDEN) {
screensToInput.add(screens.get(i));
}
}
GameScreen s1 = s... | 4 |
public static void main(String[] args) {
// TODO Auto-generated method stub
String[] fruits = {"Pine Apple", "Mango", "Banana", "Apple"};
Arrays.sort(fruits);
for(String temp: fruits){
System.out.println(temp);
}
} | 1 |
private void readXML(String fileName)
{
Document document;
DocumentBuilder documentBuilder;
DocumentBuilderFactory documentBuilderFactory;
NodeList nodeList;
File folder;
File[] xmlInputFiles;
ArrayList<ShotData> shots;
String currentDoc = "";
... | 5 |
private Class<? extends Event> getRegistrationClass(Class<? extends Event> clazz) throws IllegalAccessException {
try {
clazz.getDeclaredMethod("getEventList");
return clazz;
} catch (NoSuchMethodException e) {
if (clazz.getSuperclass() != null
&& ... | 6 |
private ArrayList<Integer> print(int[][] matrix, int top, int left, int bottom, int right) {
ArrayList<Integer> result = new ArrayList<Integer>();
// top
if (top <= bottom) {
for (int i = left; i <= right; i++) {
result.add(matrix[top][i]);
}
}
// right
if (right >= left) {
for (int i = top + 1... | 9 |
public void visit_ifnull(final Instruction inst) {
if (longBranch) {
final Label tmp = method.newLabel();
addOpcode(Opcode.opc_ifnonnull);
addBranch(tmp);
addOpcode(Opcode.opc_goto_w);
addLongBranch((Label) inst.operand());
addLabel(tmp);
} else {
addOpcode(Opcode.opc_ifnull);
addBranch((Lab... | 1 |
public static Type preserveType(Type currentType, Type newType) {
Type result = newType;
if (newType != null && currentType != null &&
currentType.getObjectClass() == newType.getObjectClass()) {
if (newType.getGenericType().getGenericType() instanceof Class &&
!(c... | 9 |
public void removeDocument(Document doc) {
openDocuments.remove(doc);
// Fire Event
fireDocumentRemovedEvent(doc);
// Unregister the Document
doc.setDocumentRepository(null);
// Select the last non-iconified document in the window menu and
// change to it. Otherwise change to an iconified doc. O... | 5 |
private Combination<Colors> generateAttemptCombination3() {
List<Token<Colors>> attemptTokens = new ArrayList<Token<Colors>>();
attemptTokens.add(new Token<Colors>(Colors.P));
attemptTokens.add(new Token<Colors>(Colors.W));
attemptTokens.add(new Token<Colors>(Colors.R));
attemptTokens.add(new Token<... | 0 |
private void lblUpdateMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lblUpdateMouseClicked
// check so eveything is ok
if (!Validate.tfEmpty(tfBenamning) && !Validate.tfEmpty(tfProducent)) {
if (Validate.notOverSize(tfBenamning) && Validate.notOverSize(tfProducent) && Validat... | 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.