text stringlengths 14 410k | label int32 0 9 |
|---|---|
private static Map<String, Double> sortByComparator(Map<String, Double> unsortMap, final boolean order)
{
List<Entry<String, Double>> list = new LinkedList<Entry<String, Double>>(unsortMap.entrySet());
// Sorting the list based on values
Collections.sort(list, new Comparator<Entry<String, Double>>... | 2 |
@Override
public int attack(double agility, double luck) {
if(random.nextInt(100) < luck)
{
System.out.println("I just created an earthquake!");
return random.nextInt((int) agility) * 2;
}
return 0;
} | 1 |
public void close_connection()
{
try
{
this.connection.close();
this.res_set.close();
this.connected = false;
}
catch(SQLException sqlEx)
{
System.err.println(sqlEx.getMessage());
}
} | 1 |
@Override
@SuppressWarnings("unchecked")
public int getHolidayIndex(String named)
{
final Object resp=getHolidayFile();
if(resp instanceof String)
{
return -1;
}
List<String> steps=null;
if(resp instanceof List)
steps=(List<String>)resp;
else
return -1;
Vector<String> lineV=null;
String l... | 8 |
@EventHandler
public void onPlayerMoveIn(PlayerMoveEvent event){
final Player p = event.getPlayer();
String worldName = p.getWorld().getName();
if(worldName.contains("zombieRun")||worldName.equals("world")){
Material blockIsIn = p.getLocation().getBlock().getType();
World world = p.getWorld();
Location ... | 6 |
protected void quantize(String path, int numColors) throws IOException {
File file = new File(path).getCanonicalFile();
if (file == null || !file.exists() || !file.isFile() || !file.canRead()) {
throw new FileNotFoundException(path);
}
path = file.getAbsolutePath();
//Dither to DS colors
BufferedImage... | 9 |
public boolean checkSave()
{
if (hasChanged())
{
int c = JOptionPane.showConfirmDialog(frame,
Resources.getString("Jeie.UNSAVED_MESSAGE"),
Resources.getString("Jeie.UNSAVED_TITLE"),
JOptionPane.YES_NO_CANCEL_OPTION);
if (c == JOptionPane.CANCEL_OPTION) return false;
if (c == JOptionPane.Y... | 4 |
public static boolean collidesWithRegion(SpaceRegion region, Vec3 position, Vec3 direction) {
// This is where the shit hits the fan
if ( region.isInside( position ) && direction.isValid() && !direction.isZero() ) {
//ok, that was easy. Even if very small, having a non-zero, valid,
//direction and being in... | 7 |
public GameLogging(Class<?> clazz) {
logger = LoggerFactory.getLogger(clazz);
} | 1 |
@Override
public double getDoubleVal()
{
Object pob = null;
Double d = null;
try
{
pob = getValue();
if( pob == null )
{
log.error( "Unable to calculate Formula at " + getLocation() );
return java.lang.Double.NaN;
}
d = (Double) pob;
}
catch( ClassCastException e )
{
try
{
... | 8 |
public String magnitudeString(int strength){
String convertedStrength;
if (strength == Relationship.HIGH){convertedStrength = "High";}
else if (strength == Relationship.MEDIUM){convertedStrength = "Med";}
else if (strength == Relationship.LOW){convertedStrength = "Low";}
else con... | 3 |
protected ListPanel getAlarmByFiremanId(int firemanId)
{
ArrayList<Time_Sheet> timeSheet = new ArrayList<Time_Sheet>();
ListPanel list = new ListPanel(parent.getWidth());
ArrayList<Alarm> alarms = new ArrayList<Alarm>();
try{
timeSheet = tsa.getTimeSheetsbyFirema... | 5 |
private void assignAvailableMoves(){
// Track how many are available
int count = 0;
// Check every spot
for (int i = 0; i < 4; i++){
for (int j = 0; j < 12; j++){
// Anywhere is legal on first turn
if (turn == 0) {
available_locations[i][j] = true;
}
// If the spot is taken t... | 9 |
public void setGuardAngle(float angle) {
if(angle < 0) {
guardAngle = angle + MathUtil.PI * 2;
}
else {
guardAngle = angle;
}
} | 1 |
static final public void select_statement() throws ParseException {
String str;
String path;
jj_consume_token(SELECT);
System.out.println("Select\ubb38 \ud638\ucd9c!");
str = select_regex();
label_1:
while (true) {
jj_consume_token(39);
select_regex();
switch ((... | 3 |
protected void forward(DatasetExample example) {
int size = example.size();
// Initialize the alpha[0] values.
Vector<Double> first = alpha.get(0);
if (tagged[0]) {
// Set all state probabilities to zero.
for (int state = 0; state < numStates; ++state)
first.set(state, 0.0);
// Get the correct st... | 9 |
@Override
public boolean equals(Object obj) {
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final WorkType other = (WorkType) obj;
if (this.id != other.id) {
return false;
}
i... | 5 |
private IService initService(Class<?> serviceClass, Properties properties) throws ServiceException{
if (IService.class.isAssignableFrom(serviceClass)){
IService service;
try {
service = (IService) serviceClass.newInstance();
service.init(properties);
return service;
} catch (InstantiationExceptio... | 5 |
@Override
public Iterator<Data<?>> iterator() {
return data.iterator();
} | 1 |
private void calcula(String operador, String numero) {
int num = Integer.parseInt(numero);
switch (operador) {
case "+":
CALCULADO += num;
break;
case "-":
CALCULADO -= num;
break;
case "*":
... | 4 |
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
PeriodSBU other = (PeriodSBU) obj;;
if (name == null) {
if (other.name != null)
return false;
} else if (!name.equals(other.name))
re... | 9 |
public byte[] getEContent() {
SignerInfo signerInfo = getSignerInfo(signedData);
ASN1Set signedAttributesSet = signerInfo.getAuthenticatedAttributes();
ContentInfo contentInfo = signedData.getEncapContentInfo();
byte[] contentBytes = ((DEROctetString) contentInfo.getContent())
.getOctets();
if (signedAt... | 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 static SocketBase zmq_socket (Ctx ctx_, int type_)
{
if (ctx_ == null || !ctx_.check_tag ()) {
throw new IllegalStateException();
}
SocketBase s = ctx_.create_socket (type_);
return s;
} | 2 |
public static boolean removePreLive(final String name) {
if (CallGraph.preLive == null) {
CallGraph.init();
}
return (CallGraph.preLive.remove(name));
} | 1 |
private static Instances clusterInstances(Instances data) {
XMeans xmeans = new XMeans();
Remove filter = new Remove();
Instances dataClusterer = null;
if (data == null) {
throw new NullPointerException("Data is null at clusteredInstances method");
}
//Get the... | 7 |
public List<Jvm> parse(String[] processes)
{
List<Jvm> jvms = new ArrayList<Jvm>();
for(String process : processes)
{
if(!process.isEmpty()
&& !process.contains("process information unavailable"))
{
String[] datas = process.split(" ... | 6 |
@Override
public boolean isMine(String command) {
if (super.isMine(command)) {
if ((command.indexOf("(") == -1) || (command.indexOf(")") == -1)) {
error = hint;
return false;
}
types = command.substring(command.indexOf("("), command.lastInd... | 3 |
private void shrinkBase()
{
while (this.base != 0 && this.base % 10 == 0)
{
this.base /= 10;
this.factor--;
}
} | 2 |
@Override
public boolean supportsMoveability() {return true;} | 0 |
public AssetTransactionEditDialog(JFrame parent, String title, TransactionPanel transactionPanel,
TransactionRecord transaction) {
super(parent, title, Dialog.ModalityType.DOCUMENT_MODAL);
setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
this.tran... | 8 |
public int getNewKeys() {
int allNewSize = 0;
for (int i = 0; i < 256; ++i) {
allNewSize += files[i].getNewKeys();
}
return allNewSize;
} | 1 |
public String getMBS32(String key)
{
long now = System.currentTimeMillis();
String tmp = "";
System.out.println("panjang " + key.length());
for(int i = 0; i < key.length(); i++)
{
tmp = "" + this.getSHA("" + key.charAt(i));
}
String a1 = this.getSH... | 1 |
public double run() {
double nextStartNumber, nextEndNumber, currentEndNumber;
boolean stopped = false;
pi = 4;
nCompletedCalculations = 0;
/*
* Create a threadpool have fixed number of threads
*/
executor = Executors.newFixedThreadPool(nThreads);
taskPool = createTaskPool();
Iterator<Algorithm... | 8 |
private void gameRender(Graphics2D gScr) {
countFramesForAttackingHero++;
// Hintergrund faerben
gScr.setColor(Color.black);
gScr.fillRect(0, 0, pWidth, pHeight);
gScr.setFont(font);
gScr.setColor(Color.black);
switch(state) {
case INTRO :
state = state.MENU;
... | 9 |
public boolean updateVecs(Equation e, Integer i) {
if (e.TypeSel.getSelectedIndex() == Equation.posCartLine) {
float[] out = getInput(e.cartLInputs);
vecs[i] = createCartLine(out);
return true;
}
if (e.TypeSel.getSelectedIndex() == Equation.posVecLine) {
float[] out = getInput(e.vecLInputs);
vec... | 6 |
public void connecterServeur(CallbackListener callback) throws IOException {
coucheReseau = new InterfaceReseau(Protocole.TCP, Constantes.IPDistante, portLocal, Constantes.portDistantTCP);
coucheReseau.envoyer("INIT "+portLocal);
if((reponse = coucheReseau.recevoir()).equals("2... | 5 |
@Override
protected void generateFrameData(ResizingByteBuffer bb)
throws FileNotFoundException, IOException {
// TODO: generate, don't reload
bb.put(this.reload());
} | 0 |
static int dateDiff(int type, Calendar fromDate, Calendar toDate, boolean future) {
int diff = 0;
long savedDate = fromDate.getTimeInMillis();
while ((future && !fromDate.after(toDate)) || (!future && !fromDate.before(toDate))) {
savedDate = fromDate.getTimeInMillis();
fr... | 5 |
static void project( Region src, float x, float y, Region dest, int destX, int destY ) {
dest.clear();
final int rayCount=512;
for( int i=0; i<rayCount; ++i ) {
// 64 rays!
float angle = i*(float)Math.PI*2/rayCount;
float dx = (float)Math.cos(angle);
float dy = (float)Math.sin(angle);
float cx =... | 9 |
public void setCliente(int cliente) {
this.cliente = cliente;
} | 0 |
static double term(Reader in, Set<Integer> terminators) throws ParserException, IOException {
boolean negative = false;
if (read(in) == '-') {
negative = true;
} else {
in.reset(); //return to mark
}
Set<Integer> multTerminators = new HashSet<>(terminator... | 9 |
public GenericContainer() {
} | 0 |
protected void initializeFilepaths(){
filePaths = new String[mapSizeY][mapSizeX];
int n = 1;
for(int i = 0; i < mapSizeY; i++){
for(int j = 0; j < mapSizeX; j++){
filePaths[i][j] = filePath + "testLevel" + n;
n++;
}
}
} | 2 |
public void move() {
if (isVisible == true && (lovelyStrip == 0 || lovelyStrip == 3)){
area.x += moveX;
if(!isInsideStripArea()){
isVisible = false;
}
} else if(isVisible == true){
area.x -= moveX;
if(!isI... | 6 |
@Override
public void caseAParaComando(AParaComando node)
{
inAParaComando(node);
if(node.getVariavel() != null)
{
node.getVariavel().apply(this);
}
if(node.getIPara() != null)
{
node.getIPara().apply(this);
}
if(node.getPas... | 5 |
public static void compare( final int ARRAY_SIZE, final int iterations, SortAlgorithm[] algos ) {
int size = algos.length;
long means[] = new long[ size ];
for(int i = 0; i < size; means[i++] = 0) {
// nothing to do
}
for(int i = 0; i < iterations; ++i) {
System.out.print("Iteration " + (i+1) + "...... | 4 |
public void setStartVariable(String variable) {
myStartVariable = variable;
} | 0 |
public static Double[][] randCostArray(int n)
{
n = n < 2 ? randInt(5,1000):n;
Double[][] array = new Double[n][n];
for(int i = 0; i < n; i++)
{
for(int j = 0; j < n; j++)
{
if( j > i)
array[i][j] = (double) randInt(1, 100);
else if( i == j)
array[i][j] = 0.0;
else
array[i][... | 5 |
public void logToFile(String message)
{
try {
warnLog = new File(dataFolder + File.separator + "WarnLog.txt");
//Bukkit.broadcastMessage("Test1: " + warnLog.getPath());
File dataFolder = getDataFolder();
if (!dataFolder.exists()) {
dataFolder.mkdir();
}
if (!warnLog.exists()) {
warnLog.... | 3 |
public static void CheckEndGame() {
// TODO: Implement game checking code here.
int winningPlayer = -1;
switch(Instance.gameMode) {
case DOMINATION : //First player to control >= 75% of all planets in the game.
float limit = (float) (Instance.numPlanets) * 0.75f;
for(int i = 0; i < TurnManager.numPlayers;... | 8 |
public static <T> CycList<T> makeDottedPair(final T normalElement, final T dottedElement) {
if (CycObjectFactory.nil.equals(dottedElement)) {
return new CycList<T>(normalElement);
}
final CycList<T> cycList = new CycList<T>(normalElement);
cycList.setDottedElement((T) dottedElement);
return cy... | 1 |
static final public Behavior behavior() throws ParseException {
Behavior result; Token name; MessageHandler handler;
jj_consume_token(BEHAVIOR);
name = jj_consume_token(BEHAVIORIDENT);
result = new Behavior(name.image);
jj_consume_token(LPAREN);
... | 4 |
public boolean add(VetVisit visitX)
{
boolean visitAdded = false;
if(visitX.equals(null))
return visitAdded; //returns false
/* check to verify visitX isn't already in the list. if it isn't already in the
* list, proceed to add visitX to list (if visit... | 5 |
private boolean isHovering(MouseEvent e) {
Rectangle r1 = new Rectangle(sRect1.x + (int)sXPos - 1, sRect1.y + (int)sYPos - 1, sRect1.width+2, sRect1.height+2);
Rectangle r2 = new Rectangle(sRect2.x + (int)sXPos - 1, sRect2.y + (int)sYPos - 1, sRect2.width+2, sRect2.height+2);
Rectangle w1 = new Rectangle(wRect1.x + ... | 7 |
public static void main(String[] args){
Scanner in = new Scanner(System.in);
int n = in.nextInt();
int[] a = new int[n];
for(int i=0;i<n;i++){
a[i]=in.nextInt();
}
String result = check(a);
System.out.println(result);
if(result.equals("yes"))
System.out.println(range[0]+" "+range[1]);
... | 2 |
@Override
public Object getTransferData(DataFlavor flavor) throws UnsupportedFlavorException {
if (DATA_FLAVOR.equals(flavor)) {
return this;
}
throw new UnsupportedFlavorException(flavor);
} | 1 |
public byte mean(String fileName) throws IOException {
FileInputStream is = null;
DataInputStream dis = null;
BufferedWriter br = new BufferedWriter(new FileWriter("mean_bin.txt"));
NumberFormat formatter = new DecimalFormat();
formatter = new DecimalFormat("0.000E00");
try {
is = new FileInputStre... | 7 |
public void setBackgroundWithoutHandling(Path img) {
if (FileUtil.control(img)) {
this.imgBackground = img;
this.backgroundImgChanged = true;
} else {
this.imgBackground = null;
this.backgroundImgChanged = false;
}
somethingChanged();
... | 1 |
@EventHandler
public void SpiderInvisibility(EntityDamageByEntityEvent event) {
Entity e = event.getEntity();
Entity damager = event.getDamager();
String world = e.getWorld().getName();
boolean dodged = false;
Random random = new Random();
double randomChance = plugin.getSpiderConfig().getDouble("Spider.In... | 6 |
private void createSuggestionButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_createSuggestionButtonActionPerformed
String subject = subjectTextField.getText();
String description = descriptionTextArea.getText();
boolean success;
if(suggestion != null && suggest... | 3 |
public void startFile(String logfile) {
File parent = new File(logfile).getParentFile();
if (!parent.isDirectory() && !parent.mkdirs()) {
logger.warning("Could not create log folder: " + parent);
}
Handler fileHandler = new RotatingFileHandler(logfile);
fileHandler.se... | 2 |
public static void main(String[] args) {
try {
AppGameContainer app = new AppGameContainer(new main());
app.setDisplayMode(1280, 768, false); //was 960 and 1080
app.setTargetFrameRate(60);
app.setFullscreen(false);;
app.start();
} catch (SlickException e) {
e.printStackTrace();
}
} | 1 |
public boolean isEmpty(int checkId) {
ListElement currentRobot = this.robotPlace.getHead();
while (currentRobot != null) {
if (currentRobot.getId() == checkId) {
return false;
}
currentRobot = currentRobot.getNext();
}
return true;
... | 2 |
public static void arrayDisplay(int x[][]){
//loops through the rows, then loops through the columns if there is any
for(int row = 0; row < x.length; row++){
System.out.println("Row: " + row);
if(x[row].length <= 1)//detects the amount of columns the row in the array has
{
System.out.println("Th... | 3 |
public synchronized static void setDone(boolean done) {
RaceCondition2.done = done;
} | 0 |
protected Document parseXmlResponse (String xmlString) throws Exception {
Document xmlDoc;
try {
xmlDoc = XmlUtils.parseXmlString(xmlString);
}
catch (SAXParseException e1) {
throw new ServiceException(INVALID_WEB_SERVICE_RESPONSE, "Error parsing xml", e1);
}
... | 9 |
public void analyseLargestComponentMembership(String dir){
File[] files = new File(dir).listFiles();
String line;
String[] parts;
int[] monthsT = new int[files.length];
int index =0;
Map<Integer,File> fileMap = new HashMap<Integer,File>();
for(File file : files)
... | 8 |
public void start() {
if (running)
return;
running = true;
beater = new Beater(this);
beater.start();
} | 1 |
public void vuoro(int x, int y, int rivi, int sarake) {
if (this.logiikka.getVuoro() == 1) {
this.logiikka.suoritaVuoro(1, rivi, sarake);
if (this.logiikka.getRistinAsetus() == 1) {
this.piirtoalusta.piirraNormaaliRisti(x, y);
} else {
this.pii... | 3 |
public void place(String string, World world) {
this.loadFromFile(string, world);
for (Blocks bl : blocks) {
bl.set();
}
} | 1 |
public void render() {
bg.bind();
Molybdenum.GLQuad(0, 0, Display.getWidth(), Display.getHeight());
Molybdenum.setAwtColor(Color.WHITE);
Molybdenum.getText().drawStringS("Molybdenum | Properties", 16, 16, Text.LEFT, 3f,4);
Molybdenum.setAwtColor(Color.DARK_GRAY);
Molybdenum.getText().drawString("Version "... | 6 |
@Override
public boolean equals(Object that) {
if (this == that) {
return true;
}
if (that == null) {
return false;
}
if (getClass() != that.getClass()) {
return false;
}
if (userId != null) {
return userId.equals(((User) that).userId);
}
return super.equals(that);
} | 4 |
public void printSccs() {
Iterator<Integer> it = sccsOfLeader.keySet().iterator();
int j = 0;
while (it.hasNext() && j < 10) {
int leaderVertex = it.next();
System.out.print((leaderVertex + 1) + ":");
for (int i = 0; i < sccsOfLeader.get(leaderVertex).size(); i++) {
System.out.print((sccsOfLeader.get... | 3 |
int[] LIS(int[] num) {
ArrayList<Integer> trace = new ArrayList<Integer>(); // for back-tracing
ArrayList<Integer> lis = new ArrayList<Integer>(); // recording the current optimal LIS
trace.add(-1);
lis.add(0);
for (int i = 1; i < num.length; i++) {
int l = 0, r = lis.size() - 1;
while (l <= r) {
in... | 7 |
public boolean canPlace() {
if (! super.canPlace()) return false ;
for (Tile t : Spacing.perimeter(area(), origin().world)) if (t != null) {
if (t.owningType() >= this.owningType()) return false ;
}
return true ;
} | 4 |
private boolean isPacketLine(String line)
{
if (line.isEmpty())
{
return false;
}
if (this.accumulator == null && line.length() < 32)
{
return false;
}
for (char c : line.toCharArray())
{
if ((c < '0' || c > '9') &... | 8 |
@Override
public void flush() {
for (int i = 0; i < printStreams.length; i++){
printStreams[i].flush();
};
} | 1 |
public int[] findZ(int base){
int[] z = new int[2];
int pos = base-1;
while (true){
if (this.getN(pos) == 0){
z[0] = pos;
break;
}else{
--pos;
}
}
pos = base + 1;
while (true){
... | 4 |
public Updater(Plugin plugin, int id, File file, UpdateType type, boolean announce) {
this.plugin = plugin;
this.type = type;
this.announce = announce;
this.file = file;
this.id = id;
this.updateFolder = plugin.getServer().getUpdateFolder();
final File pluginFile... | 8 |
private int countG (Point currentCell) {
Point localCell = currentCell;
int G = 0;
while (!localCell.equals(startCell)) {
Point parentCell = field[localCell.x][localCell.y].getParent();
if (localCell.x == parentCell.x || localCell.y == parentCell.y) {
G ... | 3 |
public void setCount(int count) {
if (count < 1) {
throw new ComponentException("Illegal number of test cases: " + count);
}
this.count = count;
} | 1 |
public static int romanValueOf(String roman) {
roman = roman.toUpperCase();
if (roman.length() == 0)
return 0;
for (int i = 0; i < symbol.length; i++) {
int pos = roman.indexOf(symbol[i]);
if (pos >= 0)
return value[i] - romanValueOf(roman.substring(0, pos))
+ romanValueOf(roman.substring(pos +... | 3 |
public int getBitsPerPixel() {
return bitsPerPixel;
} | 0 |
public static void startGame() {
GameGUI.song.play();
GameGUI.song.loop();
// This allows us to restart the game without quitting the program
if (gui != null){ // Is a replay, close the old game, clear the disks prompt, show it
gui.close();
}
// Contents of dialogue
final String[] options = {"... | 9 |
static private int jjMoveStringLiteralDfa0_0()
{
switch(curChar)
{
case 40:
return jjStopAtPos(0, 12);
case 41:
return jjStopAtPos(0, 13);
case 42:
return jjStopAtPos(0, 7);
case 43:
return jjStopAtPos(0, 5);
case 45:
return jjStopAtPos(0,... | 7 |
public long getSeatType() {
return this._seatType;
} | 0 |
@Override
public void draw(Graphics g) {
g.setColor(Color.black);
g.fillRect(0, 0, width, height);
if(!ready){
esm.panel.add(initiationLabel);
esm.panel.updateUI();
} else if(ready){
drawFixationCross(g);
if(drawSaccadeCrossOne){
drawSaccadeCross(g, 1);
}
if(drawSaccadeCr... | 4 |
public ConnectFourPanel(ConnectFourPiece[][] pieces) {
//Initialise m_pieces
m_pieces = new ConnectFourPiece[BOARD_WIDTH][BOARD_HEIGHT];
updatePieces(pieces);
//Load board image
ImageIcon boardImage;
try {
boardImage = new ImageIcon(this.getClass()
... | 5 |
* @param nodeSet the set of desired nodes
* @param weight the score multiplier
*/
protected void bestSpot2AwayFromANodeSet(Hashtable nodesIn, Vector nodeSet, int weight)
{
Enumeration nodesInEnum = nodesIn.keys();
while (nodesInEnum.hasMoreElements())
{
Intege... | 9 |
public void aloitaUusiPeli(){
this.pause = false;
this.jatkuu = true;
this.pisteet = 0;
this.taso = 1;
this.rivit = 0;
this.alkutaso = 0;
this.viive = 2000;
this.pelipalikat = new Palikka[20][];
for (int i = 0; i < 20; i++) {
pelipalika... | 1 |
public static void main(String[] args) throws UnknownHostException, IOException, NumberFormatException, InterruptedException {
// Connect to the server
socket = new Socket("localhost", PORT);
// Write and read from the server through sockets
out = new PrintWriter(socket.getOutputStream(), true);
in = new B... | 3 |
public void addDefaultBalances() {
Balance resultBalance = createResultBalance(accounts);
Balance relationsBalance = createRelationsBalance(accounts);
Balance yearBalance = createClosingBalance(accounts);
try {
addBusinessObject(resultBalance);
addBusinessObject(... | 2 |
public static void creer(String pseudo, String motDePasse, String courriel, byte[] avatar, String avatarType, HttpServletRequest requete)
throws ChampInvalideException, ChampVideException, UtilisateurExistantException, MessagingException {
EntityTransaction transaction = UtilisateurRepo.get().trans... | 4 |
@Test
public void testAdjacentCell() {
System.out.println("adjacentCell");
Cell instance = new Cell(2,2);
int[] result = instance.adjacentCell(0);
assertEquals(2, result[0]);
assertEquals(3, result[1]);
result = instance.adjacentCell(1);
asse... | 0 |
private AbstractBarcodeBean createBarcode(BarcodeTypes barcodeType)
throws NotSupportedException {
AbstractBarcodeBean bean = null;
if (barcodeType == BarcodeTypes.CODE39) {
bean = new Code39Bean();
((Code39Bean)bean).setWideFactor(3);
}
else if (barcodeType == BarcodeTypes.CODE128) {
bean = new Co... | 9 |
private void addEmployee() throws EndDataEntry {
try {
System.out.print("Enter the employee's name: ");
String name = IOGeneric.getString();
if (name.length() == 0)
throw new EndDataEntry();
System.out.print("Enter the employee's ID: ");
... | 5 |
public void setTitleForAudioPlayer(String streamName, String title, boolean isErrorMessage) {
if(title != null && audioPanel != null)
{
String gesTitle = streamName + " : " + title;
//if the title is empty, change the title to
//the program name
if(title == null || title.trim().equals(""))
... | 6 |
public static String getProjectName() {
if (GuiPackage.getInstance() == null)
return null;
String projectPath = GuiPackage.getInstance().getTestPlanFile();
String filename = "untitled";
if (projectPath != null) {
filename = new File(projectPath).getName();
... | 4 |
private void create_hash(String k,HashMap<String,Character> map)
{
String k_u=k.toUpperCase();
boolean[] filled=new boolean[26];
int total_cnt=0;
for(char c:k_u.toCharArray())
{
int pos=c-'A';
if(!filled[pos])
{
String d=get_alphabet_morse(total_cnt);
map.put(d, Character.valueOf(c));
fi... | 4 |
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.