text stringlengths 14 410k | label int32 0 9 |
|---|---|
public static <T extends DC> Set<Pair<T,PT<Integer>>> codom(Set<Pair<Pair<T,PT<Integer>>,Pair<T,PT<Integer>>>> phiMax)
{ if(phiMax!=null)
{ if(phiMax.getNext()!=null)
{ return new Set(phiMax.getFst().snd(),codom(phiMax.getNext()));
}
else
{ return new Set(phiMax.getFst().snd(),null);
... | 2 |
@Override
public boolean sureUzat(int siraID, int saat, int dakika) {
try {
/*
HbmIslemler hbm = new HbmIslemler();
Sira siraBilgisi = (Sira) hbm.bilgiGetir(siraID , this.getClass());
* */
Sira siraBilgisi = siraBul(siraID);
if(siraBi... | 3 |
private void parseModuleImport() throws XPathException {
QueryModule thisModule = (QueryModule)env;
Import mImport = new Import();
String prefix = null;
mImport.namespaceURI = null;
mImport.locationURIs = new ArrayList(5);
nextToken();
if (t.currentToken == Token.... | 9 |
public void dumpInstruction(TabbedPrintWriter writer)
throws java.io.IOException {
/*
* Only print the comment if jump null, since otherwise the block isn't
* completely empty ;-)
*/
if (jump == null)
writer.println("/* empty */");
} | 1 |
public void addCategory(Category c) {
Connection conn = null;
PreparedStatement ps = null;
//Do nothing if category is not properly instantiated
if(c == null)
return;
try {
conn=DriverManager.getConnection("jdbc:mysql://localhost:3306/librarysystem?user=admin&password=123456");
//Insert attributes f... | 6 |
public void info(String message)
{
if (this.logLevel >= Logger.INFO)
{
log(" INFO ", message);
}
} | 1 |
private void button4MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_button4MouseClicked
if(numberofpins < 4)
{
if(numberofpins == 0)
{
Login_form.setString1("0");
}
if(numberofpins == 1)
{
Login_form.setString2("0");
}
if(numberofpins == 2)
{
Login_... | 5 |
public Tiedote validateID() throws ValidointiPoikkeus {
// luodaan wrapper virheiden kuljettamista varten
ValidointiVirheet virheet = new ValidointiVirheet();
// luodaan validoija
Validator validoija = new Validator();
Tiedote tiedote = new Tiedote();
// tiedoteID:n validointi
if (validoija.validateInt(... | 2 |
public void setCbLabo(JComboBox cbLabo) {
this.jComboBoxLabo = cbLabo;
} | 0 |
private Item Itemvalidate(Item item){
if(!paidTransaction(Accesscreate(),item) )
return null;
return item;
} | 1 |
private void btnConnectActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnConnectActionPerformed
if((!txtFrnd.getText().equals(""))){
try {
String frnIP = database.getFrndIp(txtFrnd.getText());
switch(chat.getFriend(frnIP, txtFrnd.getText())){
... | 4 |
private void transcribeVerticesAndTriangles(HashMap<Integer, MarchingCubes.Node3f> vertexMap, ArrayList<MarchingCubes.Triangle> triangleList)
{
int idIter = 0;
Iterator<Entry<Integer, MarchingCubes.Node3f>> mapIterator = vertexMap.entrySet().iterator();
Entry<Integer, MarchingCubes.Node3f> ... | 7 |
private void findPathes() {
if(MAZE.getHeight() == 0 || MAZE.getWidth() == 0 || !MAZE.isRoad(0, 0)){
log("No pathes");
return;
}
List<List<? extends Point>> pathes = findPathesRecursive();
log("Found: " + pathes);
log("Count: " + pathes.size());
} | 4 |
private void removeMobs(){
for(ListIterator<Mob> i = mobs.listIterator(); i.hasNext();){
Mob mob = i.next();
if(mob.isDead()){
((HostileMob)mob).getSpawner().remove(1);
i.remove();
for(int j = 0; j < 5; j++) addParticle(new BloodParticle(getParticles().size(), mob.getX(), mob.getY(), 0xff6E2120, 8, ... | 3 |
@Override
public void run() // read server messages and act on them.
{
try {
DatagramSocket socket = new DatagramSocket(udpPort);
serverReceiveThread = new ServerReceiveThread(registry, gameController, socket, udpPort);
serverReceiveThread.start();
} catch (IO... | 2 |
private boolean ifStatement()
{
if (accept(NonTerminal.IF_STATEMENT))
{
enterScope();
expression0();
statementBlock();
if (accept(Token.Kind.ELSE))
{
statementBlock();
}
exitScope();
}
return false;
} | 2 |
public static synchronized SkiPassSystem getInstance() {
if (instance == null) {
instance = new SkiPassSystem();
}
return instance;
} | 1 |
@Override
public void run() {
while(true){
repaint();
}
} | 1 |
public int maxSubArray(int[] A) {
int max = 0;
int NegetiveMax = Integer.MIN_VALUE;
int len = A.length;
boolean allNegetive = true;
for(int i=0;i<len;i++) {
if(A[i] > 0) {
allNegetive = false;
} else {
if(A[i] > NegetiveMax) {
... | 7 |
private List<Pregunta> corregirExamen(HttpServletRequest request, HttpServletResponse response) {
List<Pregunta> questList = new ArrayList<Pregunta>();
String listId = request.getParameter("listId");
String[] ids = listId.split(",");
for (int i = 0; i < ids.length; i++) {
... | 7 |
public String toString() {
// Number of items in each list to print
int n = 10;
String output = "The word list ";
output += isPruned ? "has been pruned:" : "has not been pruned:";
if (isPruned) {
output += "\n\tPruned word list: (showing first " + n + " items for each word length)";
for (Integer k... | 9 |
@Override
public Feature[] analyze(String hpId, String mpId) {
String[] hpSyns = OntologyLoader.getHPSynonyms(hpId);
if(hpSyns.length == 0) return null;
String[] mpSyns = OntologyLoader.getMPSynonyms(mpId);
if(mpSyns.length == 0) return null;
int count = 0;
for(String hpSyn: hpSyns){
for(String mpSyn:... | 7 |
public static Stella_Object access_PLProposition_Slot_Value(PLProposition self, Symbol slotname, Stella_Object value, boolean setvalueP) {
if (slotname == GuiServer.SYM_GUI_SERVER_PropositionName) {
if (setvalueP) {
self.PropositionName = ((StringWrapper)(value)).wrapperValue;
}
else {
... | 8 |
public int maxDepth(treeNode root) {
if (root == null)
return 0;
if (root.leftLeaf == null && root.rightLeaf == null)
return 1;
if (root.leftLeaf != null && root.rightLeaf != null) {
int maxLeft = maxDepth(root.leftLeaf);
int maxRight = maxDepth(root.rightLeaf);
return maxLeft <= maxRight ? (max... | 7 |
private void enableType(int type) {
bitsLbl.setEnabled(false);
arrayLbl.setEnabled(false);
enumLbl.setEnabled(false);
typeType.setEnabled(false);
array.setEnabled(false);
enumData.setEnabled(false);
switch (type) {
case TYPE_DISABLE:
break;
case TYPE_ARRAY: {
typeType.setEnabled(true);
... | 6 |
protected Map<String, Long> writeFileList(String destination, long offset) {
Map<String, Long> filePathMap = new HashMap<String, Long>();
String innerPath, rawPath;
VDKRandomAccessFile raf = null;
try {
raf = new VDKRandomAccessFile(destination, "rw");
for(VDKInnerDirectory d : getChildren()... | 4 |
public void checkDialogs() {
if(dialogQueue.size() > 0) {
inputEnabled = false;
currentDialogBox = dialogQueue.remove();
} else {
inputEnabled = true;
currentDialogBox = null;
if(dialogCallback != null) {
dialogCallback.onClose();
}
}
} | 2 |
private static String addHTMLFontColor(final String text, final boolean isExceptional) {
return "<html><body><font color=" + (isExceptional ? "red" : "green") + ">" + text + "</font></body></html>";
} | 1 |
protected static Ptg calcRoundDown( Ptg[] operands ) throws CalculationException
{
if( operands.length < 1 )
{
return PtgCalculator.getNAError();
}
double[] dd = PtgCalculator.getDoubleValueArray( operands );
if( dd == null )
{
return new PtgErr( PtgErr.ERROR_NA );//20090130 KSC: propagate error
}
... | 7 |
public void dispose()
{
if (disposed)
return;
disposed = true;
charCache = null;
bufferPixels = null;
fontMetrics = null;
Graphics2D gfx = bufferGraphics;
if (gfx != null)
{
bufferGraphics = null;
try
{
gfx.dispose();
}
catch (Exception ex) { }
}
BufferedImage img = buffer;
... | 5 |
public List<Employee> getTeamMembers(String managerId) {
String uniqueUserSql = SELECT_MANAGER_TEAM_DETAIL + managerId + "'";
Connection connection = new DbConnection().getConnection();
List<Employee> teamMembers = new ArrayList<Employee>();
ResultSet resultSet = null;
Statement statement = null;
try {
s... | 7 |
public void visit_iflt(final Instruction inst) {
stackHeight -= 1;
if (stackHeight < minStackHeight) {
minStackHeight = stackHeight;
}
} | 1 |
public void endRound() {
int winnersInd = 0;
numberOfRounds++;
cardsPlayedInRound = 0;
ItalianDeckCard winnersCard = currentStack[winnersInd];
int score = 0;
for (int i = 0; i < currentStack.length; i++) {
int comp = BriscaCardComparator.compare(winnersCard,
currentStack[i], this.life.getSuit());
... | 8 |
@Test
public void testTargetsAlongWalkways() {
// Initialize lists of where everything should be.
int[] targets4 = new int[] {307, 331, 333, 357, 381, 383, 405, 403, 429, 431, 455, 481, 457, 507, 483, 433, 409, 385, 411};
int[] targets3 = new int[] {190, 216, 242, 268, 196, 220, 170, 144, 118, 192, 168, 194, 218... | 4 |
public void run()
{
try
{
// Wrapper for Threaded calling
System.out.println(this.clsName+","+this.mtdName);
Class<?> cls = Class.forName(this.clsName);
System.out.println("Class is "+cls);
Method[] mtds = cls.getMethods();
System.out.println("Methods are "+Arrays.deepToString(mtds));
Met... | 8 |
private boolean isIdentifier(char c)
{
return (c > 47 && c < 58) // Zahl
|| (c > 64 && c < 91) // Groß A-Z
|| (c > 96 && c < 123) // Klein a-z
|| (c == '_') || (c == '$'); // Sonderzeichen
} | 7 |
public void setFullNameFromTextField(String fullName) {
String[] nameParts = fullName.split(" ");
if (nameParts.length > 0) {
Name.getInstance().setFirstName(nameParts[0]);
if (nameParts.length > 1) {
Name.getInstance().setMiddleName(nameParts[1]);
for (int index = 2; index < nameParts.length; inde... | 3 |
@RequestMapping("/home")
public ModelAndView home(HttpServletRequest request) {
HttpSession session = request.getSession();
String currRole = session.getAttribute("currRole").toString();
ClassPathXmlApplicationContext ctx = new ClassPathXmlApplicationContext("spring-config.xml");
if(currRole.equals("studen... | 6 |
@Test
public void canDetermineTheCellFitnessOfAGrid() {
for (int sudokuPower = 1; sudokuPower < 10; sudokuPower++) {
// all cells are valid but the first one
for (int cellIndexX = 0, size = sudoku.getSudokuSize(); cellIndexX < size; cellIndexX++) {
for (int cellIndex... | 5 |
public void setId(int id)
{
this.id = id;
} | 0 |
public void update() {
checkMove();
if (x == targetX)
xa = 0;
if (y == targetY)
ya = 0;
move(xa, ya);
if ((x <= targetX + 5 && x >= targetX - 5) && (y <= targetY + 5 && y >= targetY - 5)) {
checkHit();
this.removed = true;
}
} | 6 |
public ArrayList<ArrayList<Move>> parseOpenings(){
ArrayList<ArrayList<Move>> allOpeningMoves = new ArrayList<ArrayList<Move>>();
List<PGNGame> games = null;
BufferedReader reader = null;
String pgn = "";
try {
reader = new BufferedReader(new FileReader(db));
int j = 0;
StringBuilder sb ... | 7 |
public double evaluateSolution(String solutionFileName) {
double score = 0.0;
BufferedReader br = null;
ArrayList<Double> locations = new ArrayList<Double>();
ArrayList<Boolean> validity = new ArrayList<Boolean>();
ArrayList<Boolean> flips = new ArrayList<Boolean>();
try {
br = new Bu... | 8 |
public void setPos5(int val){ if (val == 1){p5 = true;} else { p5 = false; }} | 1 |
public static String formatSceond(long second) {
long time = second / 1000;
if(time < 86400 && time >= 3600 ) {
long h = time / 3600;
long m = (time - (h * 3600)) / 60;
long s = time - h * 3600 - m * 60;
return h + "时" + m + "分" + s + "秒";
}
if(time < 3600 && time >= 60) {
long m = time / 60;
... | 4 |
private static boolean createUser(){
Prints.printWithColor("YELLOW","Usuario: ");
String user = rd.next();
if (searchUser(user) == null){
Prints.printWithColor("YELLOW","Contraseña: ");
String pass = rd.next();
Prints.printWithColor("YELLOW... | 1 |
private static void rotateBilinear(int dd) {
ImageData imageData = original.getImageData();
int[][] matrix = new int[imageData.height][imageData.width];
for (int i = 0; i < imageData.height; i++) {
for (int j = 0; j < imageData.width; j++) {
matrix[i][j] = imageData.getPixel(j, i);
}
}
int[] pixel... | 4 |
private Vehicule rechercherVehicule(String immatriculation){
System.out.println("ModeleLocations::rechercherVehicule()") ;
Vehicule vehicule = null ;
for(Vehicule unVehicule : this.vehicules){
if(unVehicule.getImmatriculation().equals(immatriculation)){
vehicule = unVehicule ;
}
}
return vehicule ;
... | 2 |
public DocumentInfo getDocumentInfo() {
return this.docInfo;
} | 0 |
private void printData(Items providers){
for(Item provider : providers.getCloudProviders()){
System.out.println("PROVIDER: "+ provider.getName());
System.out.println(" - Category: "+ provider.getCategory());
System.out.println(" - license: "+ provider.getLicense());
System.out.println(" - monitor... | 9 |
public void merge(List<String> inputFileNames, String fileNameDestination) {
try {
xmlWriter.write(xmlReader.read(inputFileNames), fileNameDestination);
} catch (IOException e) {
logger.error("error occurred during merge", e);
}
} | 1 |
@Override
public String toString() {
StringBuilder res = new StringBuilder();
for (Map.Entry e : stats.entrySet()){
res.append("<");
res.append(e.getKey());
res.append(" = ");
res.append(e.getValue());
res.append(">");
}
ret... | 1 |
public GUI(){
JPanel panel = new JPanel();
JFrame _frame = new JFrame();
Board _board = new Board();
JTextArea _box = new JTextArea("Player 1 :"+" Score: "+" Player 2: "+" Score: ");
JPanel board = new JPanel();
board.setLayout(new GridLayout(20,20));
panel.setLayout(new BorderLayo... | 6 |
public int compareTo(Object other)
{
Location otherLoc = (Location) other;
if (getRow() < otherLoc.getRow())
return -1;
if (getRow() > otherLoc.getRow())
return 1;
if (getCol() < otherLoc.getCol())
return -1;
if (getCol() > otherLoc.getCol(... | 4 |
@Override
public Node removeItem(int key) throws EmptyTreeException,
KeyNotFoundException, InvalidTreeOperation {
if (isEmpty())
throw new EmptyTreeException();
Node item = findItem(key);
Node next = nextInorder(item);
Node removedNode = null;
if (item == null)
throw new KeyNotFoundException("Key ... | 9 |
public String getSector() {
return addressCompany.getSector();
} | 0 |
@Override
public void paintComponent( Graphics g ) {
super.paintComponent( g );
if ( game_completed ) {
Font font = new Font( "Cooper black", Font.BOLD, 14 );
g.setFont( font );
g.drawString( "Game completed!", 130, 130 );
} else {
level.drawLe... | 1 |
protected synchronized Runnable getTask()
throws InterruptedException
{
while (taskQueue.size() == 0) {
if (!isAlive) {
return null;
}
wait();
}
return (Runnable)taskQueue.removeFirst();
} | 2 |
public void marshEffect(Player p){
int n = -1;
int lb = 0;
int ub = 3;
bansheeDamage();
spectralCloakShield(p);
String head;
String textBlock;
ArrayList<String> strList = new ArrayList<String>();
head = "Spectral Marsh";
if((p.inventory.contains(Card.gauntlet) || p.inventory.contains(Card.gauntletii... | 9 |
public static Account narrow (org.omg.CORBA.Object obj)
{
if (obj == null)
return null;
else if (obj instanceof Account)
return (Account)obj;
else if (!obj._is_a (id ()))
throw new org.omg.CORBA.BAD_PARAM ();
else
{
org.omg.CORBA.portable.Delegate delegate = ((org.omg.CORBA... | 3 |
public void removeRegionRef(String id) {
if (members != null) {
GroupMember toRemove = null;
for (Iterator<GroupMember> it = members.iterator(); it.hasNext(); ) {
GroupMember member = it.next();
if (member instanceof RegionRef) {
if (((RegionRef)member).getRegionId().equals(id)) {
toRemove = ... | 5 |
public static final int highNeighbour(int[] v, int x) {
int min=Integer.MAX_VALUE, n=0;
for(int i=0; i<v.length && i<x; i++) {
if(v[i]<min && v[i]>v[x]) {
min=v[i];
n=i;
}
}
return n;
} | 4 |
public boolean insert_Into_Inventory(Item item){
//is the item already in the inventory
//is the stack size not full
for(Slot slot : slots){
if(slot.getItem() == item && slot.getStack_Count() < item.getMax_Stack_Count()){
slot.setStack_Count(slot.getStack_Count()+1);
return true;
}
}
for(Slot sl... | 5 |
public static void loadPlugin(File dir) throws SlickException, ClassNotFoundException, FileNotFoundException, IOException, InstantiationException, IllegalAccessException, IllegalArgumentException, InvocationTargetException, NoSuchMethodException, SecurityException{
Class<Plugin> plugin = null;
Properties properties... | 8 |
@Override
//assumes that there is nothing in the buffer from other stuff
//make sure other methods accessing the streams
//are also synchronized
public void run() {
PrintWriter out;
InputStreamReader reader;
while(true) {
//wait until ONE client connects
synchronized(monitor) {
try {
// S... | 9 |
@EventHandler
public void onCrazyMagicMove(PlayerMoveEvent pME) {
Player player = pME.getPlayer();
if(CrazyFeet.CrazyMagic.contains(player)) {
Location to = pME.getTo();
Location from = pME.getFrom();
Location loc = player.getLocation();
if(to.getX() != from.getBlockX() || to.getY() != fr... | 4 |
public static boolean printQuickCount(StringBuilder saveAsText) {
String[] sections = saveAsText.toString().replaceAll("@", " ")
.split(" ");
StringBuilder build = new StringBuilder();
for (String s : sections) {
build.append(" " + s.split("_").length);
}
// System.out.println(build);
return build.to... | 1 |
public CheckResultMessage checkSum1(int i,int j){
return checkReport1.checkSum1(i,j);
} | 0 |
@SuppressWarnings("unchecked")
private void loadTheme()
{
try
{
final Class<? extends Theme> clazz = (Class<? extends Theme>) MCLauncher.class
.getClassLoader().loadClass(
config.getString("window.theme"));
final Constructor... | 4 |
@Override
public boolean process(Player player) {
if (ingredients == Ingredients.TORSTOL && otherItem.getId() != VIAL) {
if (!player.getInventory().containsOneItem(15309)
|| !player.getInventory().containsOneItem(15313)
|| !player.getInventory().containsOneItem(15317)
|| !player.getInventory().cont... | 9 |
public void actionPerformed(ActionEvent e) {
if (e.getActionCommand().equals("OK"))
System.exit(0);
} | 1 |
public void updateMouse() {
nextMB = Mouse.isButtonDown(0) ;
nextMP.x = Mouse.getX() ;
nextMP.y = Mouse.getY() ;
if (mouseB && (! nextMB)) {
mouseState = HOVERED ;
}
if ((! mouseB) && nextMB) {
mouseState = CLICKED ;
dragMP.setTo(nextMP) ;
}
if (mouseB && nextMB &&... | 8 |
public void paint(Graphics g)
{
//screen dimensions 296,45,298,217
g.drawImage(my_gif,0,0,this);
if(track==99)
{
g.setFont(bigFont);
g.drawString("Press Play",350,150);
}
if(track==0)
{
g.setFont(bigFont);
g.drawImage(issues_cover,296,45,298,217,this);
g.drawString("King of Amarillo"... | 5 |
private void readyForTermination() {
addKeyListener( new KeyAdapter() {
public void keyPressed(KeyEvent e)
{ int keyCode = e.getKeyCode();
if ((keyCode == KeyEvent.VK_ESCAPE) || (keyCode == KeyEvent.VK_Q) ||
(keyCode == KeyEvent.VK_END) ||
((keyCode == KeyEvent.VK_C) && e... | 7 |
static String toUnsignedHex8String(long pValue)
{
String s = Long.toString(pValue, 16);
//force length to be eight characters
if (s.length() == 0) {return "00000000" + s;}
else
if (s.length() == 1) {return "0000000" + s;}
else
if (s.length() == 2) {return "000000" + s;}
else
if (s... | 8 |
public void filter(Set<Item> usedItems, boolean filterTransitions) {
if (filterTransitions) {
Set<Transition> removeTrans = new ShareableHashSet<Transition>();
Set<Transition> usedTrans = new ShareableHashSet<Transition>();
for (Transition t : transitions) {
if (t.reverse.size() > 0) { // only derives... | 8 |
public JScrollPane getGUI(){
JPanel p1=new JPanel();
getExam();
GroupLayout groupLayout=new GroupLayout(p1);
groupLayout.setAutoCreateContainerGaps(true);
groupLayout.setAutoCreateGaps(true);
GroupLayout.ParallelGroup horizontalGroup_P = groupLayout.crea... | 1 |
private boolean readFeed()
{
try
{
// Set header values intial to the empty string
String title = "";
String link = "";
// First create a new XMLInputFactory
XMLInputFactory inputFactory = XMLInputFactory.newInstance();
// Setup... | 8 |
public double getSpeedRpm() {
return _speedSensor.getSpeedRpm();
} | 0 |
public static User getUserByXMLElem(XMLElement root) {
String username = new String("Username Not Specified");
String password = new String("Password Not Set");
String url = new String("URL missing");
int permission = IS_NORMAL;
if (root.attributeMap.containsKey("permission")) {
String permissionStr = r... | 7 |
public String getClientId() {
return clientId;
} | 0 |
private void button3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_button3ActionPerformed
if (order1code4tf.getText().equals("1001"))
{
o1c4destf.setText("Chicken Nugget");
}
if (order1code4tf.getText().equals("1002"))
{
o1c4de... | 9 |
public void cargarVentas() {
try {
String sql = "SELECT t1.idVentas AS id_venta, t2.nombre AS empleado, t1.precio_total "
+ "FROM ventas AS t1, empleados AS t2 "
+ "WHERE t1.empleados_idempleados = t2.idempleados";
Connection conn = Conexion.GetCon... | 2 |
private void writeInteger32ToByteArray(int value) {
//byte[] intBytes = new byte[4];
//I allocated the this buffer globally so the GC has less work
intBytes[3] = (byte)value; value >>>= 8;
intBytes[2] = (byte)value; value >>>= 8;
intBytes[1] = (byte)value; value >>>= 8;
intBytes[0] = (byte)value;
try {
... | 1 |
@Override
protected int processRecord (int recordCounter, byte[] recordData, short recordAttributes, int recordUniqueID)
{
// local vars
int processResult = SUCCESS ;
int relations = 0 ;
String nodeTitle = null;
int titleLength = 0 ;
String nodeNote = null;
int noteLength = 0 ;
String nodeM... | 9 |
private ArrayList<SequencePart> parseDomainParts(List<String> lines,
String type) {
ArrayList<SequencePart> ret = new ArrayList<SequencePart>();
for (String line : lines) {
String fromStr = line.substring(15, 20).trim();
String toStr = line.substring(21, 27).trim();
if (fromStr.contains... | 7 |
private void gameInit(){
score1 = 0;
score2 = 0;
level = startingLevel;
if (unlimitedLives){
if (isSinglePlayer){
player1 = new Player(screenWidth/2,screenHeight/2, 0,0,0,0,-1,0);
player2 = null;
}else{
player1 = new Player(screenWidth/4, screenHeight/2, 0,0,0,0,-1,0);
player2 = new Player... | 3 |
public Produto Abrir(int id) throws ErroValidacaoException, Exception{
try{
PreparedStatement comando = bd.getConexao()
.prepareStatement("SELECT * FROM produtos WHERE id = ? ");
comando.setInt(1, id);
ResultSet consulta = comando.executeQuery();
... | 2 |
public static void main(String[] arg) {
try {
JSch jsch = new JSch();
String host = null;
if (arg.length > 0) {
host = arg[0];
} else {
host = JOptionPane.showInputDialog("Enter username@hostname", System.getProperty("user.name")
+ "@localhost");
}
String user = host.substring(0, host... | 8 |
public Read(){
this.path = Params.testFolder + this.separator;
this.graf = new ArrayList<Long>();
} | 0 |
@Override
public void actionPerformed(ActionEvent e) {
try {
BmTestManager bmTestManager = BmTestManager.getInstance();
GuiPackage guiPackage = GuiPackage.getInstance();
if (Utils.isTestPlanEmpty()) {
JMeterUtils.reportErrorToUser("Test-plan should have at... | 4 |
private String lineStyle2Dot(Styles.LineStyle lineStyle) {
switch (lineStyle) {
case Dashed:
return "dashed";
case Dotted:
return "dotted";
case Bold:
return "bold";
case Solid:
default:
r... | 4 |
public synchronized void addMessage(String paramString)
{
if ((this.LastMessage == null) || (paramString.compareTo(this.LastMessage) != 0))
{
this.LastMessage = paramString;
TextContainer localTextContainer = new TextContainer();
localTextContainer.setPackedHeight(true);
localTextCont... | 3 |
private void printSequenceRecursive(int k, int n, int position, int[] array){
if(position == array.length){
System.out.println(Arrays.toString(array));
return;
}
int startingNumber;
if(position == 0){
startingNumber = 1;
}
else{
startingNumber = array[position - 1] +1;
}
for(int i = st... | 3 |
@Override
public boolean equals(Object obj) {
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final IndividualAgent other = (IndividualAgent) obj;
if (this.id != other.id) {
return false;
... | 3 |
private static JToolBar buildToolbar(Item[] items)
{
JToolBar bar = new JToolBar();
for (Item item : items)
{
if (item == Item.SEPARATOR)
bar.add(new JToolBar.Separator());
else if (item.icon != null)
{
AbstractButton button = null;
if (item.setting ... | 5 |
public boolean load() {
FileInputStream is = null;
File f = null;
try {
f = new File(FileLocation);
is = new FileInputStream(f);
} catch (FileNotFoundException e) {
logger.info(e.getMessage() + ", creating new persistence file:" + f.getAbsolutePath());... | 3 |
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
ClassMetadata other = (ClassMetadata) obj;
if (qualifiedName == null) {
if (other.qualifiedName != null)
return false;
} else if (!quali... | 6 |
@Override
public JSONObject main(Map<String, String> params, Session session)
throws Exception {
JSONObject rtn = new JSONObject();
Venue[] aVenue = Venue.findAll();
rtn.put("rtnCode", this.getRtnCode(200));
{
JSONArray venueJa = new JSONArray();
for(int i=0; i<aVenue.length; i++) {
venueJa.put(a... | 1 |
private boolean HLIDRoundTripConversionTest(Object obj) {
try {
String apiId = null;
if (obj instanceof String) {
apiId = CompactHLIDConverter.converter().toCompactHLId((String) obj);
} else if (obj instanceof Number) {
apiId = CompactHLIDConverter.converter().toCompactHLId((Number... | 3 |
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.