text stringlengths 14 410k | label int32 0 9 |
|---|---|
public GetDataBySubjectPanel(JFrame frame, QueryDefinition query) throws Exception {
super(frame, query, new GetDataBySubject(query.getDocument()));
JTabbedPane panel = new JTabbedPane();
//
// Defines the "Subject IDs" tab.
/////////////////////////////
ItemSet<SubjectID> subItems = new ItemSet<Subject... | 8 |
public void notifyOfRowModification(Row row, Column column) {
for (OutlineModelListener listener : getCurrentListeners()) {
listener.rowWasModified(this, row, column);
}
} | 1 |
public static boolean verify(byte[] data, String publicKey, String sign)
throws Exception {
// 解密由base64编码的公钥
byte[] keyBytes = SecurityCoder.base64Decoder(publicKey);
// 构造X509EncodedKeySpec对象
X509EncodedKeySpec keySpec = new X509EncodedKeySpec(keyBytes);
// KEY_ALGORITHM 指定的加密算法
KeyFactory keyFactory... | 0 |
private void updateView() {
if (this.nodes == null || this.nodes.length > 1
|| !this.nodes[0].exists()) {
this.titleBorder.setTitle("-");
this.jzvStat.setStat(null);
this.taUpdate.setText("");
this.taChildData.setText("");
this.jbUpdate... | 4 |
public void act() {
if (enabled) {
boolean last = hover;
boolean lastP = pressed;
if (Greenfoot.mouseMoved(this)) {
hover = true;
} else if (Greenfoot.mouseMoved(null)) {
hover = false;
}
if (Greenfoot.mousePressed(this)) {
pressed = true;
}
if (Greenfoot.mouseClicked(this) /* && h... | 9 |
private void jLabel15MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabel15MouseClicked
jTextPane1.insertIcon(new ImageIcon(getClass().getResource("/picture/3.jpg")));
pos.add(jTextPane1.getText().toString().length()-1);
pic.add("|");
}//GEN-LAST:event_jLabel15MouseCl... | 0 |
private void calculateToExit()
{
int newDirection = 0;
if (getColumn() > HOME_COLUMN) {
newDirection = 3;
} else if (getColumn() < HOME_COLUMN) {
newDirection = 1;
} else if (getRow() > HOME_ROW) {
newDirection = 0;
} else {
isA... | 3 |
public final String getFirstParameter(String name) {
List<String> list = getParameter(name);
if (list != null) {
return list.isEmpty() ? "" : list.get(0);
}
return null;
} | 2 |
public String getreasontext(){
return reason;
} | 0 |
public static void main(String[] args) {
if(args.length > 0){
String name = "./" + args[0];
File file = new File(name);
BufferedReader in = null;
try {
in = new BufferedReader(new FileReader(file));
String line... | 4 |
@Override
public int attack(double agility, double luck) {
if(random.nextInt(100) < luck)
{
System.out.println("I just did a guided attack!");
return random.nextInt((int) agility) * 2;
}
return 0;
} | 1 |
public boolean isCellEditable(int row, int col)
{
if (col > 1 && row != getRowCount() - 1 || col == 0)
{
return true;
}
return false;
} | 3 |
public void updateInterface() {
ItemStack is = null;
this.inventory.clear();
if(this.sort_mode == DeckEditor.SORT_NUMBER) {
Collections.sort(this.deck);
} else if(this.sort_mode == DeckEditor.SORT_ABC) {
Collections.sort(this.deck, DeckEditor.SORTER_ABC);
} else if(this.sort_mode == DeckEditor.SORT_ATK)... | 8 |
public int next() {
int nextPos = index;
char c = desc.charAt(nextPos);
if (c == '(') {
++index;
c = desc.charAt(++nextPos);
param = true;
}
if (c == ')') {
++index;
c = desc.char... | 5 |
public AlumnoBean loadId(AlumnoBean oAlumno) throws NumberFormatException {
try {
if (request.getParameter("id") != null) {
oAlumno.setId(Integer.parseInt(request.getParameter("id")));
} else {
oAlumno.setId(0);
}
} catch (NumberFormatE... | 2 |
static void readFile(String filename) throws IOException {
Scanner reader = new Scanner(new FileReader(filename));
String currentLine = reader.next();
boolean read1 = true;
boolean read2 = false;
Vertice currentVertice;
while (reader.hasNext()) {
if (!reader.hasNext("arestas") && read1) {
curr... | 5 |
@Override
public void execute(DebuggerVirtualMachine dvm) {
} | 0 |
public static int getTotalAchievementRecord() {
int totalRecords = 0;
try {
String statement = new String("SELECT COUNT(id) FROM " + DBTable);
PreparedStatement stmt = DBConnection.con.prepareStatement(statement);
ResultSet rs = stmt.executeQuery();
if (rs.next())
totalRecords = rs.getInt("COUNT(id)... | 2 |
private byte[] createChecksum() {
try {
InputStream fis = new FileInputStream(file);
byte[] buffer = new byte[1024];
MessageDigest complete = MessageDigest.getInstance("MD5");
int numRead;
do {
numRead = fis.read(buffer);
... | 5 |
public void input_samples(float[] s)
{
for (int i=31; i>=0; i--)
{
samples[i] = s[i]*eq[i];
}
} | 1 |
@Test
public void insertAddsAtTheBeginningOfList() {
l.insert(a);
l.insert(b);
assertEquals(b, l.min());
} | 0 |
public void dumpInstruction(TabbedPrintWriter writer)
throws java.io.IOException {
if (label != null) {
writer.untab();
writer.println(label + ":");
writer.tab();
}
writer.print("switch (");
instr.dumpExpression(writer.EXPL_PAREN, writer);
writer.print(")");
writer.openBrace();
for (int i = 0;... | 2 |
public static void main(String[] args){
try{
BufferedReader in=null;
if(args.length>0){
in = new BufferedReader(new FileReader(args[0]));
}
else{
in = new BufferedReader(new InputStreamReader(System.in));
}
ArrayList<String> input = new ArrayList<String>();
String inp = in.readLine();
... | 6 |
private boolean agregaCatalogo(HttpServletRequest request, HttpServletResponse response) throws IOException {
ConexionBD con = new ConexionBD();
String descripcion = request.getParameter("descripcion");
String catalogo = request.getParameter("elegirCatalogo");
String tipo_familia = reque... | 6 |
static final int method1382(int i, int i_6_) {
anInt2463++;
if (i != 6406) {
if (i != 6409) {
if (i == 32841)
return 1;
if (i != 6410) {
if (i == 6407)
return 3;
if ((i ^ 0xffffffff) == -6409)
return 4;
} else
return 2;
} else
return 1;
} else
return 1;
if (i_6_ ... | 7 |
public Combination<Colors> getLastAttempt () {
Row lastRow = this.grid.get(grid.size() - 1);
return lastRow.getAttempt();
} | 0 |
public void union(int p, int q) {
if (!connected(p, q)) {
int pRoot = this.getRoot(p);
int qRoot = this.getRoot(q);
id[pRoot] = qRoot;
}
} | 1 |
public int getSmart() { // method422
int i = payload[offset] & 0xff;
if (i < 0x80) {
return getUnsignedByte();
} else {
return getUnsignedShort() - 0x8000;
}
} | 1 |
private void process_bmpcache2(RdpPacket_Localised data, int flags,
boolean compressed, Options option) throws RdesktopException,
IOException {
Bitmap bitmap;
int y;
int cache_id, cache_idx_low, width, height, Bpp;
int cache_idx, bufsize;
byte[] bmpdata, bitmap_id;
bitmap_id = new byte[8]; /* prevent... | 9 |
private void buttonServerControllerActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonServerControllerActionPerformed
if (!Server.isRunning) {
try {
server = new Server();
serverThread = new Thread(server);
serverThread.start();
... | 5 |
public PeakData(String[] data) {
clear();
peakNum = data.length;
if (data.length == 1) {
if (data[0].split("\t")[0].equals("0") && data[0].split("\t")[1].equals("0")) {
peakNum = 0;
}
}
mz = new double[peakNum];
intensity = new int[peakNum];
selectPeakFlag = new boolean[peakNum];
String[] w... | 4 |
protected void UnpackArchives(JProgressBar progressCurr,JProgressBar progressBarTotal)
{
for(int i=0;i<FileCount;i++)
{
System.out.println(i+" Unzip "+ FileList[i]);
try {
Utils.deleteDirectory(getWorkingDirectory() + File.separator + GlobalVar.itemsServers[GlobalVar.CurrentSe... | 5 |
@Override
public boolean run() {
if (verbose) Timer.showStdErr("Checking database using CDS sequences");
// Load config
if (config == null) loadConfig();
// Read CDS form file
if (verbose) Timer.showStdErr("Reading CDSs from file '" + cdsFile + "'...");
readCdsFile(); // Load CDS
if (verbose) Timer.sho... | 9 |
public String getHoraEncargo() {
return horaEncargo;
} | 0 |
public Game(CLayout layout, JPanel panelContainer ){
// Point to the files you would like to use for the display
// To switch levels all you have to do is change these three lines
String dir = layout.getDirectory("level");
if( layout.level1 ){
abovePath = dir + "Level1-Over.p... | 3 |
private void renderMenu(Graphics g){
FontUtils.drawCenter(TowerGame.ricasso30, "Peachtree Tower", 165, 60, 470, Color.white);
FontUtils.drawCenter(TowerGame.ricasso20, "Start Game", 165, 125, 470, Color.gray);
FontUtils.drawCenter(TowerGame.ricasso20, "Options", 165, 155, 470, Color.gray);
switch (main){
c... | 2 |
void hookExampleWidgetListeners () {
if (logging) {
Widget[] widgets = getExampleWidgets ();
for (int i = 0; i < widgets.length; i++) {
hookListeners (widgets [i]);
}
Item[] exampleItems = getExampleWidgetItems ();
for (int i = 0; i < exampleItems.length; i++) {
hookListeners (exampleItems [i])... | 5 |
private void genericTest(int rows, int columns,String chessPiecesStr,
String[] expectedRepresentationString){
List<Piece> pieces;
pieces = ChessTools.getPiecesFromString(chessPiecesStr);
Cell[] chessBoard;
... | 3 |
public boolean isConstExpression() {
if (target != null || src != null) {
return false;
}
if (lValue != null && rValue != null) {
return true;
}
return lValue != null;
} | 4 |
public static Keyword continueAntecedentsProof(ControlFrame frame, Keyword lastmove) {
{ Iterator iterator = ((Iterator)(KeyValueList.dynamicSlotValue(frame.dynamicSlots, Logic.SYM_STELLA_ITERATOR, null)));
boolean firsttimeP = iterator == null;
boolean reversepolarityP = frame.reversePolarityP;
... | 9 |
private void cull() {
Node child;
outer: for (Iterator<Node> i = children.iterator(); i.hasNext();) {
child = i.next();
for (Node otherChild : children) {
if (otherChild == child)
continue;
... | 5 |
public List<Account> findDeliquentAccounts() throws Exception {
ArrayList<Account> delinquentAccounts = new ArrayList<>();
List<Account> accounts = accountDao.findAllAccounts();
Date thirtyDaysAgo = daysAgo(30);
for (Account account : accounts) {
boolean owesMoney = account.... | 3 |
public static PeopleData createNewPeopleData(String key, String value, UUID person_id) {
if (key != null && value != null && person_id != null) {
return new PeopleData(key, value, person_id);
} else if (key != null) {
return new PeopleData(key, null, person_id);
} else if... | 6 |
public void simulate() {
Gdx.app.log("Funding", funding+"");
if(!unused) {
Random r = new Random();
population+=(10000*funding*(1-(parent.getSurvivabiliy()/100.0f)));
Gdx.app.log("POPULUS", population+"pp");
if(r.nextFloat()<(1-(parent.getSurvivabiliy()/100.0f))) {
if(r.nextInt(100)<=40-(funding/10.0f)) ... | 7 |
private MenuScreen()
{
super("img/menu/bgmenu.png", "img/menu");
curseur = new CursorMenu("img/menu/cursor.png");
stage = new Stage();
curseur.setPosition(curseur.getX(), curseur.getY());
sprite = new Sprite(new Texture(Gdx.files.internal("img/menu/bgmenu2.png")));
sprite.setPosition(0, 0);
stage.addLis... | 8 |
public SessionList getSessions(String asLastModified, int aiMaxSize) {
String lsParam = "";
if (aiMaxSize > 0) {
lsParam += "&max_size=" + Integer.toString(aiMaxSize);
}
if (UtilityMethods.isValidString(asLastModified)) {
lsParam += "&last_modified=" + asLastModif... | 3 |
private boolean camposNecesarios () {
if ((jTextField1.getText().length()==0) ||
(jTextField2.getText().length()==0) ||
(jTextField3.getText().length()==0) ||
(jTextField4.getText().length()==0) ||
(jTextField5.getText().length()==0) ||
(jTextField6.ge... | 6 |
public void main(){
Scanner s = new Scanner(System.in);
PiggyBank_HIWHD pb = new PiggyBank_HIWHD();
boolean cont = true;
while (cont){
System.out.println("1. Show total in bank.");
System.out.println("2. Add a penny.");
System.out.println("3. Add a nic... | 8 |
public String longestPalindrome2(String s) {
if (s == null || s.length() == 0) {
return s;
}
mapping = new boolean[s.length()][s.length()];
calculated = new boolean[s.length()][s.length()];
for (int k = s.length() - 1; k >= 0; k--) {
for (int i = 0; i < s... | 5 |
private void setupUndoRedo() {
// Listen for undo and redo events
doc.addUndoableEditListener(new UndoableEditListener() {
public void undoableEditHappened(UndoableEditEvent evt) {
undo.addEdit(evt.getEdit());
}
});
// Create an undo action and add it to the text component
lyricBox.getA... | 4 |
double test7( ) throws MiniDB_Exception{
double points = 0;
// IN_SOLUTION_START
MiniDB db = new MiniDB( "minidb.test7" );
BufMgr bm = db.getBufMgr();
int size = 8;
BPlusTree bpt = db.createNewBPlusTreeIndex( "table", "val", 8 );
int iters = 300;
java.util.Hashtable val2blk = new java.... | 6 |
public void cargarArbol() {
int count = 0;
int aux = 1;
int entre = 0;
Enumeration e = root1.breadthFirstEnumeration();
while (e.hasMoreElements()) {
parent1 = (DefaultMutableTreeNode) e.nextElement();
if (count >= aux) {
CLS_ITEM_CONTA obj... | 6 |
private void addClassesInFolder(List<String> classes, File folder, String packageName, boolean recurse) {
for (File f : folder.listFiles()) {
if (!f.isDirectory()) {
if (f.getName().endsWith(".class")) {
classes.add(packageName + "." + f.getName().substring(0, f.getName().length() - 6));
}
} else i... | 5 |
@Override
public Rule getSimmilarRule(Rule rule) {
List<Rule> possibleResults = new ArrayList<Rule>();
for (Rule r : rules) {
if (r.isSimmilar(rule)) {
possibleResults.add(r);
}
}
if (possibleResults.isEmpty()) {
return rule;
} else {
return possibleResults.get((new Random()).nextInt(possible... | 3 |
private HashMap<String, String> transformAttributes(String string)
{
// Prepare the attribute-map!
HashMap<String, String> map = new HashMap<String, String>(2);
// Consume the String word by word...
while(string.length() > 0)
{
// Trim whitespaces, if there are any.
string = string.trim();
... | 7 |
private void searchJyusyo1(String jyusyo1) {
comboTodoufuken.removeAllItems();
comboTodoufuken.addItem("絞り込み");
comboTodoufuken.setSelectedIndex(0);
lstM.clear();
//CSVファイルの読み込み
File csv = null;
try {
csv = new File("KEN_ALL.CSV");
Buffered... | 8 |
public void setHistoryLocation(int i) {
this.history_location = i;
if (this.history_location <= 0) {
this.prevButton.setEnabled(false);
} else {
this.prevButton.setEnabled(true);
}
//System.out.println(this.history_location + ":" + history.getSize());
if (this.history_location >= history.getSize() ... | 2 |
@Override
public void update(long deltaMs) {
switch(firingMode) {
case FIRE_AT_ACTOR_MODE:
targetActor();
break;
case FIRE_AT_LOCATION_MODE:
targetLocation();
break;
}
} | 2 |
public static void exhaustiveAntiGoalRefineAnalysis(RequirementGraph req_model, ActorAssociationGraph actor_model, int visual_type, int scope) throws IOException, ScriptException {
// first empty the potential security goal set.
req_model.ag_elems.clear();
req_model.ag_links.clear();
String expression_file =... | 9 |
private void loop(){
while(true){
try{
lastTime = curTime;
curTime = System.currentTimeMillis();
totalTime += curTime - lastTime;
if(totalTime > 1000){
totalTime -= 1000;
fps = frames;
frames = 0;
}
++frames;
beginTime = System.currentTimeMillis();
//Dra... | 5 |
String checkSecurity(int iLevel, javax.servlet.http.HttpSession session, javax.servlet.http.HttpServletResponse response, javax.servlet.http.HttpServletRequest request){
try {
Object o1 = session.getAttribute("UserID");
Object o2 = session.getAttribute("UserRights");
boolean bRedirect = false;
... | 7 |
protected void processWindowEvent(
WindowEvent event )
{
if ( event.getID() == WindowEvent.WINDOW_CLOSING )
actionExit();
super.processWindowEvent(event);
} | 1 |
private static NodeList getNodeList() {
NodeList nList = null;
try {
File fXmlFile = new File(path);
DocumentBuilderFactory dbFactory = DocumentBuilderFactory
.newInstance();
DocumentBuilder dBuilder = dbFactory.newDocumentBuilder();
D... | 1 |
public void connect() throws ConnectionException, IOException {
BufferedReader bufferedReader = null;
try {
bufferedReader = new BufferedReader(new InputStreamReader(new FileInputStream(playlist)));
}
catch(IOException e) {
throw new ConnectionException(e);
}
String filename;
while((filename = buffe... | 7 |
@Override
public void run() {
int found = 0;
int number = 11;
int answer = 0;
while(found < 11) {
if(PrimeUtil.isPrime(number)) {
String num = String.valueOf(number);
boolean allPrimes = true;
int i = 1;
while(i < num.length()) {
if(!PrimeUtil.isPrime(Long.valueOf(num.substring(i)).long... | 7 |
public static void RememberMeSave(boolean state, int ID, String Username, int Code, String Password, String Ticks, String Destination){
Code = Code/LoginWindow.verificationcode;
String gameFolderPath, gameFilePath;
gameFolderPath = System.getenv().get("APPDATA") + "\\TFrame";
gameFilePath = gameFolderPath + "\\... | 6 |
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 LoadingFrame()
{
try {
setIconImage(ImageIO.read(new File("assets/Icon48.png")));
} catch (IOException ex) {
Logger.getLogger(MainFrame.class.getName()).log(Level.SEVERE, null, ex);
}
setTitle("Map of Denmark");
setDefaultCloseOperat... | 1 |
public void draw(Graphics2D g, TreeNode node) {
Color c = g.getColor();
if (isSelected(node))
g.setColor(c.darker());
super.draw(g, node);
g.setColor(c);
} | 1 |
public static void main(String[] args) throws Exception {
ExecutorService exec = Executors.newCachedThreadPool();
ServerSocket server = new ServerSocket(8080);
InetSocketAddress isa = new InetSocketAddress("localhost", 8080);
SocketChannel sc1 = SocketChannel.open(isa);
SocketChannel sc2 = SocketChannel.open(... | 1 |
private static int doStatements(
DatabaseConnection connection,
String label,
Collection<String> statements,
boolean ignoreErrors,
boolean returnsNegative,
boolean expectingZero)
throws SQLException
{
int stmtC = 0;
for (String statement : stat... | 8 |
protected static String getLine(int length, char c) {
StringBuilder b = new StringBuilder();
for (; length > 0; length--) {
b.append(c);
}
return b.toString();
} | 1 |
public void receive(Object obj) {
Event event = (Event) obj;
switch(event.type) {
case "assign player":
Helper.log("ConnectionToGameServer: RECEIVED ASSIGN PLAYER EVENT");
gameScreen.engine.player = (Player) event.data;
if (gameScreen.gui.user.username.equals(ThinkTankGUI.GUEST_ACCOUNT)) {
gameScre... | 9 |
public static String displayInput(String question, String title) {
while (true) {
String s = JOptionPane.showInputDialog(null, question, title,
JOptionPane.PLAIN_MESSAGE);
if (s == null) {
System.exit(0);
}
if (s.length() > 0) {
return s;
}
}
} | 3 |
public void fine(String message) {
log(Level.FINE, message);
} | 0 |
public static Game GetGame() throws Exception
{
if(game == null)
{
throw new Exception();
}
return game;
} | 1 |
public void setTrainingId(int trainingId) {
this.trainingId = trainingId;
} | 0 |
@Test
public void testReplaceFood() {
System.out.println("replaceFood");
World instance = new World();
instance.generateRandomContestWorld();
instance.replaceFood();
int expResult = 0;
int result = instance.getFoodNum();
assertEquals(expResult, result... | 0 |
public Object opt(String key) {
return key == null ? null : this.map.get(key);
} | 1 |
@Override
public Connection getConnection() {
if (connection == null) {
try {
InitialContext context = new InitialContext();
DataSource ds = ((DataSource) context.lookup("30Resource"));
connection = ds.getConnection();
} catch (NamingEx... | 2 |
public static int runToAddressR(int limit, Gameboy gbL, Gameboy gbR, int... addresses) {
if (!gbR.onFrameBoundaries) {
int add = dualStepUntilR(gbL, gbR, 0, 0, addresses);
if (add != 0)
return add;
}
int steps = 0;
while (steps < limit) {
int add = dualStepUntilR(gbL, gbR, 0, 0... | 4 |
public void mouseExited(MouseEvent e) {
if (!b.isEnabled()) return;
if (b instanceof javax.swing.JToggleButton && b.isSelected())
return;
b.setBorder(inactive);
b.setBorderPainted(false);
} | 3 |
public String result(boolean gui){
if((house.isBusted()||
player.getHandValue()>house.getHandValue())
&&!player.isBusted())
return player.win();
else if(player.isBusted()||
!house.isBusted()&&
player.getHandValue()<house.getHandValue())
return player.lose();
else
return player... | 6 |
@Override
public int getRemainDays() throws ServiceException {
try {
UriBuilder builder = UriBuilder.fromPath(
baseResourceUri + REMAIN_DAYS_PATH);
URI uri = builder.build();
GetMethod getMethod = requestGetMethodFactory
.newPlainTe... | 3 |
void processBondCrossingUnderPBC() {
if (!(model instanceof MolecularModel))
return;
MoleculeCollection molecules = ((MolecularModel) model).molecules;
if (molecules.isEmpty())
return;
double x0 = getX();
double y0 = getY();
double dx = getWidth();
double dy = getHeight();
double x1 = x0 + dx;
d... | 9 |
public void csvImport(String filename) {
try {
log.info("Importing from file \"{}\"", filename);
int inserted = 0, updated = 0;
db.beginTransaction();
try (CSVReader reader = new CSVReader(new InputStreamReader(new FileInputStream(filename), "UTF-8"))) {
... | 7 |
public StrictBounds<OrderedElement<T>> findNewBound(Iterable<T> stream, long kOrder, Bounds<OrderedElement<T>> oldBounds) {
ArrayList<OrderedElement<T>> current = new ArrayList<>(levelSize);
List<ArrayList<OrderedElement<T>>> levels = new ArrayList<>(levelSize);
long elementOrder = 0;
lo... | 8 |
public AnnotationVisitor visitParameterAnnotation(final int parameter,
final String desc, final boolean visible) {
if (!ClassReader.ANNOTATIONS) {
return null;
}
ByteVector bv = new ByteVector();
if ("Ljava/lang/Synthetic;".equals(desc)) {
// workaround for a bug in javac with synthetic parameters
/... | 5 |
private boolean instrucaoRetorno() {
/*
<inst_retorno> ::= “retorno” <argumento_retorno> “;”
<argumento_retorno> ::= <valor> | <argumento> | “vazio”
//<valor> ::= <numero> | <booleano> | <char> | <cadeia>
<numero> ::= <inteiro> | <real>
<argumento> ... | 9 |
int insertKeyRehash(double val, int index, int hash, byte state) {
// compute the double hash
final int length = _set.length;
int probe = 1 + (hash % (length - 2));
final int loopIndex = index;
int firstRemoved = -1;
/**
* Look... | 9 |
protected void drawShape(DrawableItem di, Graphics2D g) {
Stroke oldstrk = null;
if (di.getIsSelected()) {
oldstrk = g.getStroke();
g.setStroke(new BasicStroke(2));
if (di instanceof PathItem) {
g.setStroke(new BasicStroke(((PathItem) di).getThickness... | 5 |
public static void main(String[] args)
{
EdgeWeightedDigraph G = new EdgeWeightedDigraph(new In(args[0]));
int s = Integer.parseInt(args[1]);
AcyclicLP sp = new AcyclicLP(G, s);
for (int t = 0; t < G.V(); t++)
{
System.out.print(s + " to " + t + " ("
+ String.format("%.2f", sp.distTo(t)) + ") : ");
... | 3 |
public GenericDAO<Assignment> getAssignmentsDAO()
{
if (_assignmentsDAO == null)
{
_assignmentsDAO = new GenericDAO<Assignment>(Assignment.class);
}
return _assignmentsDAO;
} | 1 |
public static void addToTeam(TeamType type, Player player) {
if (isInGameTeam(player)) {
ChatUtils.send(player, "Du bist schon in einem Team!");
return;
}
switch (type) {
case LOBBY:
lobby.add(player.getName());
break;
case INNOCENT:
lobby.remove(player.getName());
innocents.add(player.getNa... | 6 |
private Rama_Hoja buscarSacarEntreDesconectado(String pID){
Rama_Hoja resp = null;
for(Nodo<Rama_Hoja> iteradorTree = _compuertasDesconectadas.getHead(); iteradorTree != null; iteradorTree = iteradorTree.getSiguiente()){
if(iteradorTree.getDato().getIdentificador() == pID)
r... | 2 |
public SecuredMessageTriggerBean executeProblem(SecuredMessageTriggerBean message) throws GranException {
String text = message.getDescription();
SecuredTaskBean task = message.getTask();
EggBasket<SecuredUDFValueBean, SecuredTaskBean> refs = AdapterManager.getInstance().getSecuredIndexAdapterMa... | 5 |
public String getUrl(){
return url;
} | 0 |
private static void gerarProfilesSeriais(List<Profile> profilesSeriais, List<File> listaTxt, List<File> listaBin, List<String> listaZip) {
long inicio;
long fim10;
long fim50;
long fim100;
Profile p;
for (int i = 0; i < ITERACOES; i++) {
for (File txt : listaTxt) {
inicio = Calendar.getInstance().get... | 9 |
private int ssMedian5 (final int Td, final int PA, int v1, int v2, int v3, int v4, int v5) {
final int[] SA = this.SA;
final byte[] T = this.T;
int T_v1 = T[Td + SA[PA + SA[v1]]] & 0xff;
int T_v2 = T[Td + SA[PA + SA[v2]]] & 0xff;
int T_v3 = T[Td + SA[PA + SA[v3]]] & 0xff;
int T_v4 = T[Td + SA[PA + SA[v4]]... | 6 |
public int getMove() {
int currentMove = BASE_MOVE;
if (hasStatus(UnitStatus.Type.HASTED)) {
currentMove += Ability.HASTE.getProperty(Ability.Property.MOVE_BONUS);
}
if (hasStatus(UnitStatus.Type.SLOWED)) {
currentMove -= Ability.SLOW.getProperty(Ability.Property.MOVE_PENALTY);
}
return currentMove;
... | 2 |
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.