text stringlengths 14 410k | label int32 0 9 |
|---|---|
public void start_logging() {
++start_logging_count;
} | 0 |
public void paintShape(Graphics2D g2)
{
if (image != null)
{
Dimension dim = label.getPreferredSize();
if (dim.width > 0 && dim.height > 0)
{
label.setBounds(0, 0, dim.width, dim.height);
g2.translate(getX(), getY());
... | 3 |
@Override
public void doAction()
{
QuestionManager.getInstance().setQuestion(QuestionsCache.getNextQuestion());
StateManager.getInstance().setState(new QuestionLoaded());
} | 0 |
private GenericConverter getRegisteredConverter(Class<?> sourceType, Class<?> targetType,
Class<?> sourceCandidate, Class<?> targetCandidate) {
ConvertersForPair convertersForPair = converters.get(new ConvertiblePair(sourceCandidate, targetCandidate));
return convertersForPair == null ? null : conve... | 5 |
public static void handleJoin(String channel) {
if ( !channel.startsWith("#") ) {
appendError("Nesprávná syntaxe příkazu: /join #kanál");
return;
}
getCurrentServerTab().getConnection().joinChannel(channel);
clearInput();
} | 1 |
public static Map<String, String> simpleCommandLineParser(String[] args) {
Map<String, String> map = new HashMap<String, String>();
for (int i = 0; i <= args.length; i++) {
String key = (i > 0 ? args[i-1] : null);
String value = (i < args.length ? args[i] : null);
if (key == null || key.starts... | 9 |
public String getURI() {
return uri;
} | 0 |
public static ArrayList getTotaisOpMes(String data_in, Integer gmp, String arg_prod) throws SQLException, ClassNotFoundException {
ArrayList sts = new ArrayList();
Connection conPol = conMgr.getConnection("PD");
ResultSet rs;
if (conPol == null) {
throw new SQLException("Nume... | 4 |
public static void main(String[] args){
Class c = null;
try{
c = Class.forName("org.jimmy.grammar.FancyToy");
//Can't work.
//c = Class.forName("org.jimmy.grammar.Chap14Q1.FancyToy");
}catch(ClassNotFoundException e){
System.out.println("Can't find FancyToy.");
System.exit(1);
}
printInfo(c);
... | 4 |
public int isWon() {
if(flaggedLocs().size()==numMines)
for(Location L:flaggedLocs())
if(!L.isMined())
{
won=2;
return won;
}
else
won=1;
if(won==1)
return won;
else
for(Location L:minedLocs())
if(L.isClicked())
won=0;
return won;
} | 6 |
public HashMap<String,ArrayList<String>> combineBodyText(ArrayList<String> bodyPieces){
ArrayList<String> bodyText = new ArrayList<String>();
ArrayList<String> bodyPic = new ArrayList<String>();
int i=0,j,k;
while(i<bodyPieces.size()){
String textStr = "";
String ... | 6 |
public Composite<P> setChildren(View<?>... children) {
for (View<?> child : this.children) {
child.setParent(null);
}
this.children.clear();
for (View<?> child : children) {
this.children.add(child);
child.setParent(this);
}
P ownPrese... | 9 |
public static boolean existeCorreo(String correo) {
Connection conn = null;
PreparedStatement stmt = null;
boolean existe = false;
try {
conn = model.ConexionMySQL.darConexion();
stmt = conn.prepareStatement("Select count(*) as count f... | 7 |
public void tick() {
super.tick();
if (level.game.getKeyboard().left) left = true;
else left = false;
if (level.game.getKeyboard().right) right = true;
else right = false;
if (level.game.getKeyboard().up || level.game.getKeyboard().space) {
jump();
... | 4 |
public CheckResultMessage check13(int day) {
int r1 = get(33, 5);
int c1 = get(34, 5);
int r2 = get(36, 5);
int c2 = get(37, 5);
BigDecimal b = new BigDecimal(0);
if (checkVersion(file).equals("2003")) {
try {
in = new FileInputStream(file);
hWorkbook = new HSSFWorkbook(in);
b = getValue(r2 +... | 5 |
@Override
public void setProbabilities(Double[] probabilities) throws NGramException {
/*
* int count = 0;// count the index of string[] probabilities if
* (probabilities == null) { throw new
* NGramException("ERROR: probabilities null or contains!"); } for
* (Double i : probabilities) { if ((i == null)... | 2 |
public void setRadius(double radius) {
this.radius = radius;
} | 0 |
@Basic
@Column(name = "discount_percent")
public int getDiscountPercent() {
return discountPercent;
} | 0 |
public static boolean methodNeedsEvaluatorWrapperP(MethodSlot method) {
{ boolean testValue000 = false;
testValue000 = MethodSlot.methodMustBeEvaluableP(method);
if (testValue000) {
if (((BooleanWrapper)(KeyValueList.dynamicSlotValue(method.dynamicSlots, Stella.SYM_STELLA_METHOD_VARIABLE_ARGUME... | 7 |
@Override
public void processBroadcastMsg(Message m) {
if (m instanceof PackHello) {
((PackHello) m).setHops(hops);
((PackHello) m).setMetric(metricPath);
((PackHello) m).setPaths(pathsToSink);
((PackHello) m).setSinkID(sinkID);
broadcast(m);
statistic.countBroadcastTree();
}
if (m instance... | 3 |
private void findOuterGraph(HashMap<String, String> relevantSPARQLBlocks, int varIndex){
int charIndex = varIndex;
int bracketIndex = 0;
int maxBracketIndex = 0;
while (true){
if (charIndex==0){
String currentLine = getCurrentLine(text, charIndex);
if (addNewGraphBlockMapping(relevantSPARQLBlocks, va... | 8 |
public Object invokeImpl(Object proxy, Method method, Object[] args) throws EvalError {
String methodName = method.getName();
CallStack callstack = new CallStack(namespace);
/*
* If equals() is not explicitly defined we must override the
* default implemented by the This object protocol for scripted
... | 8 |
@Override
public void encode(OutputStream os) throws IOException {
os.write(PREFIX);
for (BencodeType bencodeType : list) {
bencodeType.encode(os);
}
os.write(COMMON_POSTFIX);
} | 1 |
void write(DataOutputStream out) throws IOException {
out.writeShort(accessFlags);
out.writeShort(name);
out.writeShort(descriptor);
if (attribute == null)
out.writeShort(0);
else {
out.writeShort(attribute.size());
AttributeInfo.writeAll(attri... | 1 |
public static void main(String[] args) {
// TODO Auto-generated method stub
int array[]= new int[args.length];
for(int k = 0; k < array.length; k++){
array[k]=Integer.parseInt(args[k]);
}
int array2 [] = {180,15,70,9,7};
System.out.println(Arrays.toString(array2));
// sort(arr... | 1 |
public void setSurrenderPending(boolean pending) {
if (pending) {
surrenderButton.setText(SURRENDER_BUTTON_CONFIRM_TEXT);
surrenderButton.setActionCommand(SURRENDER_BUTTON_CONFIRM_TEXT);
} else {
surrenderButton.setText(SURRENDER_BUTTON_TEXT);
surrenderButton.setActionCommand(SURRENDER_BUTTON_TEXT);
}... | 1 |
private JPanel createRoleAssignmentPanel(Person person) {
JPanel roleAssignmentPanel = new JPanel();
TitledBorder titledBorder = BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), "Zugewiesene Rollen");
roleAssignmentPanel.setBorder(titledBorder);
double size[][] = { { 20, TableLayout.FILL },... | 9 |
private LinkGene crossoverLinkGenes(LinkGene a, LinkGene b){
double weightA = a.getWeight();
double weightB = b.getWeight();
long weightALong = Double.doubleToRawLongBits(weightA);
long weightBLong = Double.doubleToRawLongBits(weightB);
long mask = -1L; // all bits set to 1
... | 7 |
@Override
public void documentAdded(DocumentRepositoryEvent e) {} | 0 |
@Override
public Banker getBank(String chain, String areaNameOrBranch)
{
for (final Banker B : bankList)
{
if((B.bankChain().equalsIgnoreCase(chain))
&&(B.bankChain().equalsIgnoreCase(areaNameOrBranch)))
return B;
}
final Area A=findArea(areaNameOrBranch);
if(A==null)
return null;
for (fina... | 7 |
public static void main(String[] args) throws FileNotFoundException {
File f = new File("src/jobs.txt");
Scanner sr = new Scanner(f);
sr.next();
int i = 0;
for (i = 0; i < 10000; i++) {
jobs[i][0] = sr.nextInt();
jobs[i][1] = sr.nextInt();
jobs[i][2] = jobs[i][0] / jobs[i][1];
}
Sortingbydiffere... | 3 |
public int getDestinationStop() {
return this._destinationStop;
} | 0 |
public void setShips() {
for(int i = 0; i < players.size(); i++) {
ShipPanel s = players.get(i).getShip();
// Set border to player color
if(players.get(i).getNumber() == 1)
s.setBorder(BorderFactory.createLineBorder(GameBoard.PLAYER1));
else if(players.get(i).getNumber() == 2)
s.setBorder(Bord... | 4 |
public void visitFrame(final int type, final int nLocal,
final Object[] local, final int nStack, final Object[] stack) {
buf.setLength(0);
buf.append(ltab);
buf.append("FRAME ");
switch (type) {
case Opcodes.F_NEW:
case Opcodes.F_FULL:
buf.append("FULL [");
appendFrameTypes(nLocal, local);
buf.a... | 7 |
public void testStream () throws IOException {
final int largeDataSize = 12345;
final Server server = new Server(16384, 8192);
server.getKryo().setRegistrationRequired(false);
startEndPoint(server);
server.bind(tcpPort, udpPort);
server.addListener(new Listener() {
public void connected (Connection conn... | 4 |
@Override
public void setProbability(double[] p, Map<String,Integer> stateToIndex) throws IllegalArgumentException {
if( p == null)
throw new IllegalArgumentException("Error: null probability distribution");
double sum = 0.0;
for( int i = 0; i < p.length; ++i) {
sum += p[i];
if( Double.isNaN(p[i]))
... | 7 |
public void removeFrame( JInternalFrame jif )
{
// if( jif.getClass().toString().equalsIgnoreCase( "class ImageFrame" ) //remove ImageFrame
// || jif.getClass().toString().equalsIgnoreCase( "class HistogramFrame" ) ) //remove histogramFrame
if( jif instanceof ImageFrame
|| jif ... | 5 |
private Block parseForRun() throws InterpreterException {
int i = 0;
Block first = null;
Block last = null;
while (i < code_.length) {
String copy[] = new String[code_.length - i];
System.arraycopy(code_, i, copy, 0, copy.length);
ReturnStruct rs = Parser.parseLine(this, code_[i], copy, getLine()
... | 4 |
public byte convertBitsToValue(byte org,int startBit, int endBit, boolean value){
System.out.println("StartBit="+startBit+"/endBit="+endBit);
int mask1 = (255 >> startBit); //for above example, mask 1 = 00000011;
System.out.println("mask1="+String.format("%8s", Integer.toBinaryString(mask1)).replace(' ', '0'))... | 1 |
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
mainContainer = new javax.swing.JPanel();
topSubContainer = new javax.swing.JPanel();
jButton3 = new javax.swing.JButton();
jB... | 0 |
@Override
public ClienteBean get(ClienteBean oClienteBean) throws Exception {
if (oClienteBean.getId() > 0) {
try {
oMysql.conexion(enumTipoConexion);
if (!oMysql.existsOne("cliente", oClienteBean.getId())) {
oClienteBean.setId(0);
... | 6 |
@Test
public void testAsteroidStartingVelocityY() {
for (int i = 0; i < 20; i++) {
p.spawnAsteroids();
}
for (Asteroid a : p.getAsteroids()) {
if (a.getVelY() > -0.5 && a.getVelY() < 0.5) {
assertTrue(false);
}
if (a.getVelY()... | 6 |
@EventHandler(priority = EventPriority.NORMAL)
public void onASyncOnPlayerChatEvent(AsyncPlayerChatEvent event) {
Player player = event.getPlayer();
PlayerFile playerFile = new PlayerFile(player.getName());
if (playerFile.muteMuted) {
String finalTime = (playerFile.muteLength.equals(0) ? AdminEye.messages
... | 8 |
public void draw(GOut og) {
GOut g = og.reclip(tlo, wsz);
Coord bgc = new Coord();
for (bgc.y = 3; bgc.y < wsz.y - 6; bgc.y += bg.sz().y) {
for (bgc.x = 3; bgc.x < wsz.x - 6; bgc.x += bg.sz().x)
g.image(bg, bgc, new Coord(3, 3), wsz.add(new Coord(-6, -6)));
}
... | 5 |
public boolean retrieveWords(File language)
{
try
{
Scanner sc = new Scanner(language, "UTF-8");
if (!isValidLanguageFile(sc))
return false;
words.clear();
while (sc.hasNextLine())
mapWord(sc.nextLine());
... | 3 |
public void setGenre(Genre genre) {
this.genre = genre;
} | 0 |
protected boolean causesCheck(PossibleTile pt, Board b){
Board bClone = b.clone();
bClone.removePiece(pt.getOriginalPiece());
Piece newPiece = pt.getOriginalPiece().clone();
newPiece.setX(pt.getX());
newPiece.setY(pt.getY());
bClone.addPiece(newPiece);
if (pt.hasPieceToRemove()) {
bClone.removePiece(pt... | 8 |
@Override
public void update(Observable board, Object o) {
if (o instanceof NotifyReveal){
System.out.println("********");
}
else if(o instanceof NotifyFlagged){
System.out.println("********");
}
else if(o instanceof NotifyDoubted){
System.out.println("********");
}
else if(o instanceof NotifyUn... | 8 |
public static double squaredMagnitude(List<Double> point) {
double sum = 0;
int size = point.size();
for (int i = 0; i < size; i++) {
double val = point.get(i);
sum += val * val;
}
return sum;
} | 1 |
public static double svm_predict_probability(svm_model model, svm_node[] x, double[] prob_estimates)
{
if ((model.param.svm_type == svm_parameter.C_SVC || model.param.svm_type == svm_parameter.NU_SVC) &&
model.probA!=null && model.probB!=null)
{
int i;
int nr_class = model.nr_class;
double[] dec_val... | 8 |
static void setZeroMatrix( int[][] matrix, int n) {
boolean[][] checker = new boolean[2][n];
for ( int i = 0; i < n; ++i) {
checker[0][i] = false;
checker[1][i] = false;
}
for ( int i = 0; i < n; ++i) {
for ( int j = 0; j < n; ++j) {
if(matrix[i][j] == 0 ) {
checker[0][i] = true;
checker[... | 8 |
public void run(){
try {
InputStream inputStream = loginSocket.getInputStream();
ObjectInputStream objectInputStream = new ObjectInputStream(inputStream);
OutputStream outputStream = loginSocket.getOutputStream();
ObjectOutputStream objectOutputStream = new ObjectOutputStream(outputStream);
String ord... | 5 |
void run() {
BufferedReader reader = new BufferedReader(new InputStreamReader(
System.in));
try {
// 1. creating a socket to connect to the server
requestSocket = new Socket("localhost", 2004);
System.out.println("Connected to localhost in port 2004");
// 2. get Input and Output s... | 4 |
public void paint(Graphics2D g,boolean draw,boolean fill){
if (calcularVar) {
calcular();
calcularVar = false;
}
if (draw && !fill) {
g.draw(path);
}else if(fill && !draw){
g.fill(path);
}else if(draw && fill){
... | 7 |
public static Set<Component> getFocusableComponents(Component currentFocusOwner) {
HashSet<Component> set = new HashSet<Component>();
set.add(currentFocusOwner);
Container rootAncestor = currentFocusOwner.getFocusCycleRootAncestor();
Component comp = currentFocusOwner;
while ((r... | 9 |
public void merge(EasyPostResource obj, EasyPostResource update) {
if (!obj.getClass().isAssignableFrom(update.getClass())) {
return;
}
Method[] methods = obj.getClass().getMethods();
for (Method fromMethod: methods) {
if (fromMethod.getDeclaringClass().equals(obj.getClass()) && ... | 6 |
private Field getField(Object object, String name, Boolean read) throws NullPointerException,
IllegalArgumentException, IllegalAccessException, NoSuchFieldException {
Field field = null;
for(Class<?> c = object.getClass(); c != null; c = c.getSuperclass()) {
for(Field f : c.getDeclaredFields()){
if(f.getN... | 8 |
private static void export(File file, ResultSetReference ref, boolean withHeader) throws IOException, SQLException {
Exporter exporter = Exporter.getExporter(file);
try {
ResultSet rs = ref.getResultSet();
ColumnOrder order = ref.getOrder();
boolean needOrderChange = ... | 7 |
public int init(BinarySearchTree<String,String> tree) throws IndexOutOfBoundsException, IOException {
Properties prop = new Properties();
InputStream istream = getClass().getClassLoader().getResourceAsStream("com/file/resources/searchtree.properties");
List<BinaryNode<String, String>> li =... | 5 |
public void draw (Graphics g) {
for(int i = 0; i < button.length; i++) {
if(button[i].contains(Screen.mse)) {
g.setColor(new Color(0,0,0));
g.fillRect(
button[i].x,
button[i].y,
button[i].width,
button[i].height
);
}
g.drawImage(
Screen.tileset_res[0],
button[i].x,
... | 6 |
@Override
public List<Integer> save(List<TourType> beans, GenericSaveQuery saveGeneric, Connection conn) throws DaoQueryException {
try {
return saveGeneric.sendQuery(SAVE_QUERY, conn, Params.fill(beans, (TourType bean) -> {
Object[] objects = new Object[1];
objec... | 1 |
public void LoadSubGate(ObjectInputStream s) throws IOException, ClassNotFoundException {
int numSignals = s.readInt();
mySignals = new Vector<Signal>();
for (int a = 0; a < numSignals; a++) {
Signal newSignal = new Signal();
newSignal.Set(s.readBoolean());
ne... | 7 |
public static boolean checkSumSign(BinaryFloatingPoint A, BinaryFloatingPoint B) {
return (A.isSign() && B.isSign()) ? true :
(!A.isSign() && !B.isSign()) ? false :
(Math.abs(A.floatValue(false)) >= Math.abs(B.floatValue(false)) && !A.isSign()) ||
(Math.abs(A.floatValue(false)) <= Math.abs(B.floatValue(fal... | 8 |
public MainWindow(final NamiBeitrag namiBeitrag,
final LetterDirectory letterDirectory,
final NamiBeitragConfiguration conf) {
letterGenerator = new LetterGenerator(namiBeitrag.getSessionFactory(),
letterDirectory, conf);
reportViewer = new ReportViewer(namiBeitr... | 8 |
public static ActionType SelectActionComById(int id) throws SQLException {
String query ="";
ActionType Action = new ActionType();
ResultSet resultat;
try {
query = "SELECT * from ACTION_TYPE where ID_ACTION_TYPE=? ";
PreparedStatement pStatement = ConnectionBDD... | 2 |
public void upX(){
x += moveX;
if (x+width>level.getLength()){
x = level.getLength()-width;
}
if (x<0) { // begin lock
x = 0;
}
} | 2 |
public void accessSpace(int space,int buttonType){
//LEFT CLICK:
if(buttonType==1){
/*if(Screen.mouseCommand == 6){
//decide wich ones can be built:
if(canBeBuilt(items.get(space).type)){
Screen.menuItemToBuild = space;
Syst... | 8 |
final public RGB Colour() throws ParseException {
final Expression e1, e2, e3;
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case LBRACKET:
jj_consume_token(LBRACKET);
e1 = FloatExpression();
jj_consume_token(COMMA);
e2 = FloatExpression();
jj_consume_token(COMMA);
e3 = Flo... | 9 |
public void paint(Graphics g2)
{
if (this.applet != null) {
return;
}
int w = getWidth() / 2;
int h = getHeight() / 2;
if ((this.img == null) || (this.img.getWidth() != w) || (this.img.getHeight() != h)) {
this.img = createVolatileImage(w, h);
}
Graphics g = this.img.getGraph... | 9 |
public ArrayList<Integer> maxset(ArrayList<Integer> a) {
ArrayList<Integer> result = new ArrayList<>();
int currstart = 0, currend = 0, maxstart = 0, maxend = 0;
long currsum = 0, maxsum = Integer.MIN_VALUE, seg = 0, maxseg = 0;
for (int i = 0; i < a.size(); i++) {
... | 9 |
@EventHandler
public void onEntityDeath(EntityDeathEvent event){
ItemStack drop = new ItemStack(Material.GOLD_NUGGET, 1);
Entity entity = event.getEntity();
int chance = DeityNether.config.getDropChance();
if(entity instanceof PigZombie && entity.getWorld().getEnvironment() == Environment.NETHER){
event.get... | 4 |
public boolean hasPeerId() {
return this.peerId != null;
} | 0 |
private void rotateLeft(Node<K, V> root) {
Node<K, V> left = root.left;
Node<K, V> pivot = root.right;
Node<K, V> pivotLeft = pivot.left;
Node<K, V> pivotRight = pivot.right;
// move the pivot's left child to the root's right
root.right = pivotLeft;
if (pivotLeft != null) {
pivotLeft.... | 4 |
public void remove(BacklogBean oBacklogBean) throws Exception {
try {
oMysql.conexion(enumTipoConexion);
oMysql.removeOne(oBacklogBean.getId(), "backlog");
oMysql.desconexion();
} catch (Exception e) {
throw new Exception("BacklogDao.remove: Error: " + e.g... | 1 |
public synchronized int getAmount() {
int retVal = amount;
if (retVal != 0) {
if (state == STATE_RELEASED) {
amount = 0;
}
else if (behavior == DETECT_INITAL_PRESS_ONLY) {
state = STATE_WAITING_FOR_RELEASE;
amount = 0;
... | 3 |
public static BufferedImage compress(BMPcontainer bmPcontainer) {
int newWidth;
int newHeight;
double ar = bmPcontainer.getAspectRatio();
if (ar > 1) {
newWidth = 256;
newHeight = (int) (newWidth / ar);
} else {
newHeight = 256;
ne... | 3 |
public static String post(String adress,List<String> keys,List<String> values) throws IOException
{
String result = "";
OutputStreamWriter writer = null;
BufferedReader reader = null;
try
{
String data="";
if(keys != null && values != null)
... | 8 |
public static void main(String[] args)
{
MyFlow myFlow = new MyFlow();
myFlow.go();
} | 0 |
public void play() {
board.drawBoard();
do {
for (Player player : players) {
player.move();
board.drawBoard();
if (board.isFull()) {
printStream.println("Game is a draw");
break;
}
... | 5 |
public void spawn(){
x=rand.nextInt(Level.SIZE);
y=rand.nextInt(Level.SIZE);
while(l.world[x][y]!=TileType.AIR && l.world[x][y]!=TileType.FIRE && l.world[x][y]!=TileType.TORCH){
x=rand.nextInt(Level.SIZE);
y=rand.nextInt(Level.SIZE);
}
} | 3 |
private void randomTeleport(String arena, Player p) {
ArrayList<Location> spawns = ffaconfig.getSpawns(arena);
Random num = new Random();
if (spawns != null && spawns.size() > 0) {
p.closeInventory();
p.teleport(spawns.get(num.nextInt(spawns.size()-1)));
} else {
p.sendMessage(prefix + "Unable to find ... | 2 |
@SuppressWarnings({ "rawtypes", "unchecked" })
public CreateEvent() {
final JFrame eventFrame = new JFrame("New Event");
eventFrame.setAlwaysOnTop(true);
eventFrame.setBackground(Color.WHITE);
eventFrame.setResizable(false);
eventFrame.setVisible(true);
eventFrame.setLocationRelativeTo(CalendarPanel.bullse... | 9 |
public Solution search(State state, int goalN) {
SearchTreeNode init = createSearchTreeNode(state, null, 0, 0);
queue.add(init);
while (!queue.isEmpty()) {
SearchTreeNode node = dequeue();
if (visualize) {
System.out.println(node.toString());
}
if (node.state.isGoal()) {
return new Solution(no... | 4 |
private boolean diagonalDecrementingBlock(int[][] grid, LinkedList<Square> squareStore, boolean pickOne) {
//Block - Diagonal dec
if ((grid[0][0] == 1 && grid[1][1] == 1) && grid[2][2] != 2) {
BuildAndAddSquareTwoTwo(squareStore);
pickOne = updateGridTwoTwo(grid);
} else ... | 9 |
static public void printCoauthorTable() {
Iterator it = Person.iterator();
int coauthors[] = new int[501];
Person pers;
int c;
while (it.hasNext()) {
pers = (Person) it.next();
c = pers.getNumberOfCoauthors();
if (c > 500)
... | 5 |
@Override
public void acceptButtonActionPerformed() {
//Comprobation that closuredTo is a double value is needed
try{
String selectedNames[] = ds.getSelectedData();
DataFrame dataFrame = mainApplication.getActiveDataFrame();
boolean selection[] = dataFrame.getVa... | 9 |
private void cargarCampos(int numAsiento){
try {
r_con.Connection();
ResultSet rs=r_con.Consultar("select * from borrador_asientos where ba_nro_asiento="+numAsiento);
Asiento asiento=null;
renglon=0;
BigDecimal debeTotal=new BigDecimal(0);
... | 5 |
private void showHelp(CommandSender sender) {
sender.sendMessage("Commands:");
sender.sendMessage(" /soundcheck - Plugin administration command");
if (Perms.canUsePlaySound(sender)) {
sender.sendMessage(" /playsound - Play an individual sounds");
}
if (Perms.canUseP... | 4 |
public Frame() {
setBackground(Color.GRAY);
try {
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
} catch (ClassNotFoundException e1) {
} catch (InstantiationException e1) {
} catch (IllegalAccessException e1) {
} catch (UnsupportedLookAndFeelException e1) {
}
setIconImage(To... | 5 |
public String getEmail() {
return email;
} | 0 |
public void resolveBackupDirectory()
{
// Load the backup_location file to get the backup folder path. If it doesn't exist, it's
// the first run
File backup_file = new File("backup_location");
if(backup_file.exists())
{
Scanner in = null;
try
{
// Read the path in, and if it's valid, set the ba... | 8 |
public int getBrakes() {
return brakes;
} | 0 |
public double[] standardizedItemRanges(){
if(!this.dataPreprocessed)this.preprocessData();
if(!this.variancesCalculated)this.meansAndVariances();
return this.standardizedItemRanges;
} | 2 |
public void mousePressed(MouseEvent me)
{
// Track the current tree node selected
// so there by the query token.
JTree tree = (JTree) me.getSource();
if (SwingUtilities.isRightMouseButton(me))
{
int row = tree.getRowForLocation(me.getX(), me.getY());
if (row !... | 8 |
public static void main(String[] args) {
Random rand = new Random(47);
int i = rand.nextInt();
int j = rand.nextInt();
printBinaryInt("-1", -1);
printBinaryInt("+1", +1);
int maxpos = 2147483647;
printBinaryInt("maxpos", maxpos);
int maxneg = -2147483648;
printBinaryInt("maxneg", maxneg);
printBinar... | 0 |
public static void open(String url){
String os = System.getProperty("os.name").toLowerCase();
Runtime rt = Runtime.getRuntime();
try{
if (os.indexOf( "win" ) >= 0) {
// this doesn't support showing urls in the form of "page.html#nameLink"
rt.exec( "rundll32 u... | 7 |
@Override
public float calculateDesire() {
float desire = 0;
//figure out the distance between player and mob
int actorX = ai.getActor().getMapX();
int playerX = registry.getClosestPlayerX(ai.getActor().getCenterPoint(), registry.getScreenWidth());
int distance = Math.abs(pl... | 1 |
public void run() {
boolean hasUpdate = true;
while (hasUpdate) {
hasUpdate = false;
Set<String> keys = new HashSet<String>(this.r.keySet());
for (String rkey : keys) {
double ru = this.r.get(rkey);
try {
BufferedReader reader = new BufferedReader(
new InputStreamReader(new FileInput... | 9 |
public Var intern(Symbol sym){
if(sym.ns != null)
{
throw new IllegalArgumentException("Can't intern namespace-qualified symbol");
}
IPersistentMap map = getMappings();
Object o;
Var v = null;
while((o = map.valAt(sym)) == null)
{
if(v == null)
v = new Var(this, sym);
IPersistentMap newMap = map.ass... | 7 |
public void mouseDragged(Point p) {
//System.out.println("mousedragged");
//insert location mode
if(mode==INSERTLOC){
if(curr!=-1){
mygraph.locations[curr].setPoint(p);
changeNotify();
}
}
//insert path mode
if(mode==INSERTPATH){
lineEndIndex=mygraph.findIndex(p... | 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.