text stringlengths 14 410k | label int32 0 9 |
|---|---|
public static void renew(final LogGildedAltar script) {
script.options.status = "Renewing familiar";
if (script.ctx.summoning.summoned()) {
script.ctx.summoning.renew();
} else {
script.ctx.summoning.summon(script.options.beastOfBurden);
Condition.wait(new Callable<Boolean>() {
@Override
public ... | 4 |
@EventHandler
public void MagmaCubeNightVision(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.getMagmaCubeConfig().getDouble("Magm... | 6 |
@Override
public Set<String> getUsers() throws DataLoadFailedException {
return getList("users", "name");
} | 0 |
public void play() {
stop();
try {
bitStream.reset();
} catch (IOException e) {
// ignore if no mark
}
player = new Thread() {
public void run() {
try {
playStream(Thread.currentThread());
} catch (InternalException e) {
e.printStackTrace();
}
try {
bitStream... | 3 |
public void convertGedcom(File file) {
try {
Gedcom gedcom = parser.parseGedcom(file);
OutputStream out = (gedcomOut != null ? new FileOutputStream(new File(gedcomOut, file.getName())) :
new ByteArrayOutputStream());
writer.write(gedcom, ... | 5 |
public boolean generate(World var1, Random var2, int var3, int var4, int var5) {
for(int var6 = 0; var6 < 10; ++var6) {
int var7 = var3 + var2.nextInt(8) - var2.nextInt(8);
int var8 = var4 + var2.nextInt(4) - var2.nextInt(4);
int var9 = var5 + var2.nextInt(8) - var2.nextInt(8);
... | 4 |
public void paintComponent(Graphics g){
if(histData == null || histData.length == 0)
{
return;
}
Graphics2D g2 = (Graphics2D)g;
RenderingHints rh = new RenderingHints(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
g2.setRenderingHints(rh)... | 8 |
static final void method3309(Animable animable, Node_Sub29[] node_sub29s) {
if (Class239.aBoolean2932) {
int i = animable.method819(node_sub29s, 1);
CacheNode_Sub18.aGraphicsToolkit9607.a(i, node_sub29s);
}
if (Class368.aPlaneArray4548 == Class320_Sub10.aPlaneArray8300) {
int i;
int i_1_;
if (anima... | 9 |
public void load() throws TemplateException {
// set label
try {
label = "t" + Integer.toString(Integer.valueOf(id));
}
catch (Exception e) {
label = "t" + id;
}
String baseURL = "http://www.radreport.org/xml/xml.php?id=" + id;
URL url;
try ... | 5 |
public static void writeXmlBean(XMLBean xmlBean) throws IOException {
if (null != xmlBean) {
File file = new File(xmlBean.getPath());
if (!file.exists()) {
// file.mkdirs();
file.getParentFile().mkdirs();
file.createNewFile();
}
if (file.canWrite()) {
Strin... | 9 |
public int getProcessMode() {return processMode;} | 0 |
private void insertServers() throws SQLException {
for (String data : proxy.getServers().keySet()) {
if (!utils.serverExists(data)) {
utils.createServer(data);
cl.cLog("&2 Server " + data + " added to database!");
}
}
cl.cLog("&6 -" + proxy.getServers().values().size() + " Servers loaded");
... | 2 |
public String getMainClassName() throws IOException {
URL u = new URL("jar", "", url + "!/");
JarURLConnection uc = (JarURLConnection)u.openConnection();
Attributes attr = uc.getMainAttributes();
return attr != null ? attr.getValue(Attributes.Name.MAIN_CLASS) : null;
} | 1 |
public static JulianDate jauUt1utc(double ut11, double ut12, double dut1) throws JSOFAIllegalParameter, JSOFAInternalError
{
double utc1, utc2;
boolean big1;
int i;
double duts, u1, u2, d1, dats1, d2, fd, dats2, ddats, us1, us2, du;
/* UT1-UTC in seconds. */
... | 8 |
public static String camelCaseToUnderscore(String camelCase) {
StringBuilder builder = new StringBuilder();
char[] chars = camelCase.toCharArray();
for (int j = 0; j < chars.length; j++) {
if (Character.isUpperCase(chars[j])) {
if (j != 0) {
builder.append('_');
}
builder.append(Character.toLo... | 3 |
private static void liftBreakLabels(Statement stat) {
for (Statement st : stat.getStats()) {
liftBreakLabels(st);
}
while (true) {
boolean found = false;
for (StatEdge edge : stat.getLabelEdges()) {
if (edge.explicit && edge.labeled && edge.getType() == StatEdge.TYPE_BREAK) {
... | 8 |
void onReceiveFromRemote(final MuxClientRemote remote, final MuxPacket msg) { // Remote is MUX
if (msg.syn()) { // New SubChannel
Log.info(this.getClass().getSimpleName() + "::onReceiveFromRemote " + msg);
openLocal(msg.getIdChannel(), msg.getIdEndPoint(), msg.getSourceAddress());
} else if (msg.fin()) { ... | 8 |
public static void createRandomPlanets(ResourceManager rm, TileMap t, int numPlanets){
int mapWidth = t.getWidth();
int mapHeight = t.getWidth();
Random r = new Random();
int tileFromEdge = 5;
for(int n = 0; n < numPlanets; n++){
int newX = r.nextInt((mapWidth-tileFromEdge)-tileFromEdg... | 2 |
private void initialize() {
for (int i = 0; i < id.length; i++) {
id[i] = i;
siz[i] = 1;
}
} | 1 |
public static void main(String[] args)
{
int i = 1, j = 1;
switch(i)
{
// case 0,1 : j = 1;
case 1 :j = -1; break;
case 2 : j = 2;
default : j = 0;
}
System.out.println("j=" + j);
System.out.println("------------------------");
System.out.println("value = " + switchlt(2));... | 2 |
public Shell()
{
env = new EnvironmentImpl();
defaultId = "User";
inReader = new InputStreamReader(System.in);
bufReader = new BufferedReader(inReader);
fileManager = new FileManager();
contentArchiveDir = new File(contentDirectoryPath);
if (!(contentArchiveD... | 4 |
public static String getPrettyString(String cmdLineArg) {
String result = null;
if (cmdLineArg == null || cmdLineArg.isEmpty()) {
return result;
}
String rawCmdLine = cmdLineArg.trim();
if (rawCmdLine.startsWith("\"") && rawCmdLine.endsWith("\"")) {
resu... | 4 |
public void actionPerformed( ActionEvent e )
{
String username = textFieldId.getText();
String password = String.valueOf(textFieldPassword.getPassword()); //transfer char[] type to String
if(e.getSource() == btnShowReservationCard)
{
cardManager = (CardLayout) pnlCardDeck.getLayout();
card... | 8 |
public synchronized void update(long elapsedTime) {
if (frames.size() > 1) {
animTime += elapsedTime;
if (animTime >= totalDuration) {
animTime = animTime % totalDuration;
currentFrame = 0;
}
while (animTime > getFrame(currentFrame).endTime) {
currentFrame++;
}
}
} | 3 |
public JPanel getShutdownFrameMenu() {
if (!isInitialized()) {
IllegalStateException e = new IllegalStateException("Call init first!");
throw e;
}
return this.shutdFrame;
} | 1 |
protected void writePIDOut(double output) {
Robot.driveTrain.tankDrive(output, -output);
} | 0 |
public Teaches(ClassGroup c, Teacher t) {
if (c == null || t == null)
throw new IllegalArgumentException();
this.teacher = t;
this.classTaught = c;
} | 2 |
public Word get(Word word){
Node current = root;
while (current != null){
int d = current.data.compareTo(word);
if (d == 0)
return (Word) current.data;
else if (d > 0)
current = current.left;
else
current = current.right;
}
... | 3 |
private static void appendJSONPair(StringBuilder json, String key, String value) throws UnsupportedEncodingException {
boolean isValueNumeric = false;
try {
if (value.equals("0") || !value.endsWith("0")) {
Double.parseDouble(value);
isValueNumeric = true;
... | 5 |
private static byte reverse(byte v) {
byte r = 0;
if ((v & 0x01) != 0)
r |= 0x80;
if ((v & 0x02) != 0)
r |= 0x40;
if ((v & 0x04) != 0)
r |= 0x20;
if ((v & 0x08) != 0)
r |= 0x10;
if ((v... | 8 |
private void btnBuscarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnBuscarActionPerformed
String text = txtBuscar.getText().toString();
PrestamosCRUD pdao = new PrestamosCRUD(MyConnection.getConnection());
ArrayList<Prestamos> rows = new ArrayList<>();
Prestamos ... | 2 |
final public CycVariable metaVariable(boolean requireEOF) throws ParseException {
CycVariable val = null;
Token t = null;
t = jj_consume_token(META_VARIABLE);
val = new CycVariable(t.image);
eof(requireEOF);
{if (true) return val;}
throw new Error("Missing return statemen... | 1 |
public static void WeekEight() throws IOException
{
System.out.println("So what did Damon learn this week?");
boolean next = false;
BufferedReader r = new BufferedReader (new InputStreamReader(System.in));
while (!next)
{
System.out.println("Knowledge: " + DamonStats.Knowledge);
System.out.print... | 5 |
public KeyNodeStringPair dealWithPromote(String newKey, Node rightChild,
InternalNodeString node) {
// if new key is greater than the key in the last element of list
// insert child into the node
if (newKey.compareTo(node.getKeys().get(node.size() - 1)) > 0) {
node.getKeys().add(newKey);
node.getChildre... | 6 |
public GameScreen(JFrame parent) {
this.parent = parent;
this.width = parent.getContentPane().getWidth();
this.height = parent.getContentPane().getHeight();
super.setSize(width, height);
this.width -= 10;
super.setBackground(Color.BLACK);
keys = new boolean[256];
... | 1 |
public static void main(String args[]) {
try {
t = PdfUtilities.chooseFolder();
// TODO: create a method which tests if the file is an
// ok-to-the-end-PDF to work with
if (t != null) {
ArrayList<File> files = PdfUtilities.getPaths(new File(t),
new ArrayList<File>());
if (files != null) {
... | 8 |
public void setAlive(boolean alive) {
aliveDirty = true;
lifeDirty = true;
if (this.alive == false && alive) {
this.setLife(1);
for (WeaponInfo wi : getWeaponsData()) {
wi.resetAmoAmount();
}
}
this.alive = alive;
} | 3 |
private boolean clickedOnHand(MouseEvent e) {
return e.getX() >= handXStart() && e.getX() <= handXEnd() && e.getY() >= handYStart() && e.getY() <= handYEnd();
} | 3 |
public static void main(String[] args) throws Exception
{
InputStreamReader is = new InputStreamReader(System.in);
BufferedReader br = new BufferedReader(is);
String str;
while(null !=(str = br.readLine()))
{
System.out.println(str);
}
} | 1 |
protected void doGet(HttpServletRequest request,
HttpServletResponse response) throws ServletException, IOException {
try {
Library library = new Library();
if (request.getParameter("cardNumber") != null) {
request.getSession().setAttribute("patron",
library.getPatron(Integer.parseInt(
requ... | 3 |
public ArrayList regresaCatalogo(String catalogo) {
String res = "";
ArrayList lista = new ArrayList();
try {
Class.forName(driver);
Connection con = DriverManager.getConnection(connectString, user, password);
PreparedStatement query = con.prepareStatement("se... | 2 |
protected void createSubbands()
{
int i;
if (mode == Frame.SINGLE_CHANNEL)
for (i = 0; i < num_subbands; ++i)
subbands[i] = new SubbandLayer1(i);
else if (mode == Frame.JOINT_STEREO)
{
for (i = 0; i < header.intensity_stereo_bound(); ++i)
subbands[i] = new SubbandLayer1Stereo(... | 6 |
public static boolean setConsulta(Consulta consulta) {
Connection connect = connect();
if(connect != null){
try {
connect.setAutoCommit(false);
PreparedStatement statement = connect.prepareStatement("insert into consultas (paciente, detalhes, data_inicio, data_fim) values (?, ?, ?, ?)", Statement.RETURN_... | 7 |
public void insertBack(Node node) {
if (node.previous != null) {
node.unlink();
}
node.previous = head.previous;
node.next = head;
node.previous.next = node;
node.next.previous = node;
} | 1 |
private void collectClosedParents(TreeRow row, Set<TreeContainerRow> parents) {
TreeContainerRow parent = row.getParent();
if (parent != null) {
if (!isOpen(parent)) {
parents.add(parent);
}
collectClosedParents(parent, parents);
}
} | 2 |
public void run() {
while (NATBox.RUNNING) {
/* Wait time */
try {
Thread.sleep(NATBox.REFRESH_TIME);
} catch (InterruptedException e) {
e.printStackTrace();
}
/* Reset counter for removed entries */
int removed_entries = 0;
/* Find and remove old entries */
for (String key : NAT... | 4 |
public GroupRequestBuilder setCount(Integer count) {
// TODO make via logger
if (count != null && count > 1000) {
System.out.println("WARN: Cannot be greater then 1000");
}
request.count = count;
return this;
} | 2 |
public int maxStreak(){
int max_streak = 1, cur_streak = 1;
for (int i=1; i<cards.length; i++){
if (cards[i] == cards[i-1]+1)
cur_streak++;
else{
if (cur_streak > max_streak)
max_streak = cur_streak;
cur_streak = 1;
}
}
return max_streak;
} | 3 |
public static int changePassword(String userid, String oldpassword, String newPassword){
PreparedStatement pst = null;
Connection conn=null;
boolean result = false;
try {
conn=ConnectionPool.getConnectionFromPool();
PreparedStatement pst2 =conn.prepareStatement("SELECT COUNT(*) FROM PERSON WHERE USER... | 6 |
public double dameGananciaMedia(Nodo n) {
int ganancia = 0;
int num = 0;
for (Nodo ady : memoria.getAdjacents(n)) {
if (!ady.isEstimacion()) {
ganancia += ady.ganancia;
num++;
}
}
if (num != 0) {
return ganancia / num;
}
return 0;
} | 3 |
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
/**
* Servlet ottaa vastaan asiakkaan henkilö- sekä toimitustiedot.
* Tietoja voi muokata seuraavan sivun Muokkaa-linkin kautta,
* mikäli niihin lipsahti jokin virhe.
*/
// Onko se... | 1 |
public Node simplify(Node n)
{
leafNodes.clear();
matches.clear();
n.clearMarks();
if(!q_simplify(n)) //if it can not be simplified with this DynamicFormula, return as it is
return n;
Node target = match_node; //get Node where the match is found
if( target.equals(n) ) //if matc... | 9 |
public static Runnable launchAppropriateHandler(String[] args)
{
if (args == null || args.length == '0') {
System.err.println("Invalid Input");
return null;
}
try
{
if(args[0].toString().equalsIgnoreCase("PM") && args.length == 3) //Commands to start a Process Manag... | 7 |
public static List<Peer> findRutgersPeers(List<Peer> peers)
{
List<Peer> rutgersPeers = Collections.synchronizedList(new ArrayList<Peer>());
for(Peer p : peers)
{
String pIP = p.getIP();
if(pIP.equals("128.6.171.131") && p.getPeerId().contains("-AZ5400-"))
{
rutgersPeers.add(p);
}
else if ... | 4 |
@Override
public void attackFinished() {
if (this.currentFlashFrame == this.numOfFlashTextures - 1) {
this.frameNum = 0;
this.currentFlashFrame = -1;
this.isAttacking = false;
if (this.isCrouching) {
if (xProectionSign) {
ch... | 7 |
public int[] getSubstitutions() {
return subs;
} | 0 |
@Override
public void execute(CommandSender sender, String[] arg1) {
if (!CommandUtil.hasPermission(sender, PERMISSION_NODES)) {
sender.sendMessage(plugin.NO_PERMISSION);
return;
}
HashSet<String> list = plugin.getChatPlayer(sender.getName()).getIgnores();
String message = ChatColor.DARK_AQUA + "Ignor... | 2 |
public static void main(String[] args) {
//Instantiate Scanner
Scanner scanner = new Scanner (System.in);
//Ask user how many students they want to enter. Use that response to instantiate an object array.
System.out.println("How many students would you like to enter?");
int num = scanner.nextInt();
//Instanti... | 2 |
private static void setupVirtualServerAndToolkit() {
final int MAX = 30;
int i;
File target;
final String DISPLAY;
final Runtime runtime;
try {
/*
* This seems quite the kludge, but apparently this is the
* algorithm used by X itself... | 7 |
private FileBlock[] getFileAllocation(String DFSFileName, int no_of_blocks){
Logger.log("no of blocks:" + no_of_blocks);
Collections.sort(dataNodeList);
Logger.log("Nodes after sorting: ");
for(DataNodeInfo s: dataNodeList)
Logger.log(s.getId()+ " | Stores: " + s.getsizeOfStoredFiles() +" | FREE: "+ s.getFr... | 6 |
@Override
public void set(long i, Object o)
{
if (o == null) {
if (ptr != 0) {
objectLengths.setShort(i, (short) -1);
} else {
if (isConstant()) {
throw new IllegalAccessError("Constant arrays cannot be modified.");
... | 8 |
private void initDimensions() throws InvalidInput {
String[][] rows = CSVHelper.getTrimmedTable(dimensionsToTestCSV);
if (CSVHelper.isInputsEmpty(rows))
return;
if (!CSVHelper.isTableConsistent(rows) || rows[0].length != 3)
throw new WrongFileStructure("Rows are not consistent", INPUT_AREA);
for (int i=0;... | 9 |
@Override
public boolean update(Hotelier x)
{
Statement stm = null;
try
{
String req = "UPDATE hotelier SET \n" +
"email=\""+x.getEmail()+"\",\n" +
"motdepasse=\""+x.getMotDePasse()+"\",\n" +
"siteweb=\... | 4 |
@Override
public void run() {
cpu.start();
dispositivo.start();
if (cpu != null){
while(simulacion){
numTicks++; /* Paso del tiempo */
/* Notificacion del paso del tiempo */
cpu.notifica();
dispositivo.notifica();
... | 3 |
@Override
public String toString() {
String entryString = "";//Arrays.toString(entries.toArray());
for (byte entry: entries){
entryString += ","+(char)entry;
}
return "" + (char) id + "(" + (entries.length==0?"":entryString.substring(1, entryString.length())) + ")";
} | 2 |
public void transform(JavaClass javaClass) {
if (javaClass.className.equals("Heaper")) {
return;
}
boolean foundEmptyConstructor = false;
boolean foundRcvrConstructor = false;
for (Iterator iter = javaClass.methods.iterator(); iter.hasNext();) {
JavaMethod method = (JavaMethod) iter.next();
if (metho... | 9 |
public void add(String sana) {
Node uusi = getChild(sana.charAt(0));
String loput = sana.substring(1);
if (uusi == null) {
uusi = new Node();
uusi.setName(sana.charAt(0));
if (juuri.isEmpty()) {
juuri.add(uusi);
} else {
... | 4 |
public static void scheduleRecurringEvent( String method, Object target, long delay, Object... parameters )
{
Event event = new Event();
try
{
if ( parameters != null )
{
Class< ? >[] paramClasses = new Class< ? >[ parameters.length ];
... | 5 |
private boolean jj_scan_token(int kind) {
if (jj_scanpos == jj_lastpos) {
jj_la--;
if (jj_scanpos.next == null) {
jj_lastpos = jj_scanpos = jj_scanpos.next = token_source.getNextToken();
} else {
jj_lastpos = jj_scanpos = jj_scanpos.next;
}
} else {
jj_scanpos = jj_... | 9 |
private boolean runTestCase(File dir) throws IOException {
File xmlDir = new File(dir, toDir);
File compactDir = new File(dir, COMPACT_DIR);
File outputDir = new File(dir, OUT_DIR);
File correct = new File(compactDir, CORRECT_SCHEMA_NAME + COMPACT_EXTENSION);
File incorrect = new File(compactDir, IN... | 9 |
@Override
public void mouseClicked(MouseEvent e) {} | 0 |
public static void main(String[] args) throws IOException {
BufferedReader keyboard = new BufferedReader(new InputStreamReader(System.in));
System.out.print("Enter a regexp: ");
String regexp = keyboard.readLine();
ConvertRegexpToNFA nfaBuilder = new ConvertRegexpToNFA(regexp);
FiniteAutomaton a = nfaBuilder... | 8 |
public Object nextEntity(char ampersand) throws JSONException {
StringBuffer sb = new StringBuffer();
for (;;) {
char c = next();
if (Character.isLetterOrDigit(c) || c == '#') {
sb.append(Character.toLowerCase(c));
} else if (c == ';') {
... | 5 |
public int getActionType() {
return actionType;
} | 0 |
public static Configuration loadConfiguration() {
if (instance == null)
instance = new Configuration();
return instance;
} | 1 |
private void placeLightGrenades() {
while(grid.getLightGrenadeCoverage() < 5){
int randomX = (int) Math.round(Math.random() * grid.getHorLength());
int randomY = (int) Math.round(Math.random() * grid.getVerLength());
LightGrenade lg = new LightGrenade(new Position(randomX, randomY));
if (grid.canHaveA... | 2 |
public void testWithers() {
TimeOfDay test = new TimeOfDay(10, 20, 30, 40);
check(test.withHourOfDay(6), 6, 20, 30, 40);
check(test.withMinuteOfHour(6), 10, 6, 30, 40);
check(test.withSecondOfMinute(6), 10, 20, 6, 40);
check(test.withMillisOfSecond(6), 10, 20, 30, 6);
try... | 2 |
public void setRotation(Rotation rotation) {
switch(rotation) {
case BOTTOM:
this.rotation = 0;
break;
case LEFT:
this.rotation = 90;
break;
case TOP:
this.rotation = 180;
break;
case RIGHT:
this.rotation = 270;
break;
}
} | 4 |
private long removeRefOfferDataNym(long lIndex) {
//
// loop through the elements in the actual container, in order to find the one
// at lIndex. Once it is found, then loop through the reference list and remove
// the corresponding reference for that element.
//
OfferDataNym refActualElement = GetOfferDataNym(l... | 5 |
public static void main(String[] args) {
// TODO Auto-generated method stub
//�����v�f��*�����āA�t�B�{�i�b�`����̍ŏ��̕�̗v�f��\������
System.out.println("��ǃt�B�{�i�b�`����");
String[] stringImprovedFibonacci = new String[MAX_INDEX];
int lo = 1;
int hi = 1;
String mark;
stringImprovedFibonacc... | 3 |
private boolean rightEdge(int particle, int cubeRoot) {
for(int i = 0; i < cubeRoot; i++){
for(int k = 1; k < cubeRoot; k++){
if(particle == i * cubeRoot * cubeRoot + cubeRoot - 1 + k * cubeRoot){
return true;
}
}
}
return false;
} | 3 |
public static void main(String[] args) throws Exception
{
HashSet<String> set = getMatchingSequences();
System.out.println(set);
System.out.println(set.size());
BufferedReader reader = new BufferedReader(new InputStreamReader(
new GZIPInputStream( new FileInputStream( ConfigReader.getVanderbiltDir() + ... | 8 |
public void searchAvailableCells(){
int numB1 = 1 ;
int numB2 = 1 ;
int numB3 = 1 ;
int numB4 = 1 ;
for (int i = 0; i < 28; i++) {
if (i < 7) {
if (this.testAvailabe(numB1 , 0, i)){
numB1++;
}else{
this.FilterAvailable(i, 7);
i = 7 ;
continue;
}
} else if (i < 14... | 9 |
public void run()
{
try
{
while (alreadyRunning)
{
Socket socket = incoming.accept();
log.debug(name + ": Accepting connection...");
new EventHandler(this, socket);
Thread.sleep(1500);
}
}
catch (Exception e)
{
log.error("Error in communication protocol! ", e);
}
} | 2 |
private void handleNumericAttribute(Instances trainInstances)
throws Exception {
m_c45S = new C45Split(m_attIndex, 2, m_sumOfWeights, true);
m_c45S.buildClassifier(trainInstances);
if (m_c45S.numSubsets() == 0) {
return;
}
m_errors = 0;
Instances [] trainingSets = new Instances [m... | 9 |
@Override
public ExecuteResult start() {
String currentActionName = startActionName;
Map<String, Action> actions = getActionMap();
while (true) {
// 如果没有提前预置标志结束的ActionName,则使用end。如果当前actionName等于标志结束的ActionName,则退出并认为引擎成功结束
if (StringUtils.equals(currentActionName, endActionName)) {
log.info("Meet act... | 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 |
private void setupBlock() throws IOException {
if (this.data == null) {
return;
}
final int[] cftab = this.data.cftab;
final int[] tt = this.data.initTT(this.last + 1);
final byte[] ll8 = this.data.ll8;
cftab[0] = 0;
System.arraycopy(this.data.unzftab... | 6 |
public FeatureMap(File file,int idxOfName,int idxOfIndex,String sep,int offset){
BufferedReader br = null;
int idxError = 0;
int intFormatError =0;
try {
// 构造BufferedReader对象
br = new BufferedReader(new FileReader(file));
String line = null;
while ((line = br.readLine()) != null) {
String[] co... | 7 |
public String login(String userId, String password, int department) {
User user = validateUser(userId);
if (user == null) {
m_logger.debug("userId " + userId + " is not valid");
return ResponseMessages.USER_DOES_NOT_EXIST;
}
if (!password.equals(user.getPassword())) {
m_logger.debug("password for " + u... | 3 |
void CardTypes_Show (javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, javax.servlet.http.HttpSession session, javax.servlet.jsp.JspWriter out, String sCardTypesErr, String sForm, String sAction, java.sql.Connection conn, java.sql.Statement stat) throws java.io.IOException ... | 9 |
public void createNewKey(String username, boolean client,ObjectInputStream in, ObjectOutputStream out) {
try {
System.out.println("Initiating the key agreement protocol ...");
System.out.println("Generating a Diffie-Hellman KeyPair...");
KeyPairGenerator kpg = KeyPairGenerator.getInstance("DH");
kpg.initi... | 4 |
public static void style(Component comp) {
comp.setForeground(theme.getForeground());
comp.setBackground(theme.getBackground());
if (!(comp instanceof Container)) {
return;
}
Component[] comps = ((Container) comp).getComponents();
for (int i = 0; i < comps.length; i++) {
style(comps[i]);
}
} | 2 |
* @param terminal Cell state that represents the terminal.
* @param source Boolean indicating if the terminal is the source or target.
*/
public mxConnectionConstraint getConnectionConstraint(mxCellState edge,
mxCellState terminal, boolean source)
{
mxPoint point = null;
Object x = edge.getStyle()
.get... | 6 |
@Override
public boolean testPermission(CommandSender target) {
if (testPermissionSilent(target)) {
return true;
}
if (getPermissionMessage() == null) {
target.sendMessage(ChatColor.RED + "I'm sorry, but you do not have permission to perform this command. Ple... | 4 |
private int[][] initCellValues(int rows, int columns)
{
int[][] values = new int[rows][columns];
int totalPoints = 0;
for (int r = 0; r < rows; r++) {
for (int c = 0; c < columns; c++) {
int value = map.getCellValue(r, c);
values[r][c] = v... | 3 |
private void buildMenu() {
boolean exit = false;
int type = findType(id);
if (type == TYPE_PATIENT) {
System.out.println("Welcome patient " + id
+ " here is the list of your record(s):");
patientMenu(id, id);
} else if (type == TYPE_DOCTOR) {
System.out.println("Welcome doctor, what would you like... | 9 |
public static int getSailplaneVelocityUnit() throws ClassNotFoundException {
int velocityUnit = 0;
try{
//Class derbyClass = RMIClassLoader.loadClass("lib/", "derby.jar");
Class.forName(driverName);
Class.forName(clientDriverName);
}catch(java.lang.ClassNotFoun... | 4 |
private void disconnect(int id, boolean status) {
ServerClient c = null;
for (int i = 0; i < clients.size(); i++)
if (clients.get(i).getID() == id) {
c = clients.get(i);
clients.remove(i);
break;
}
String message = "";
if (status) {
message = "Client " + c.name.trim() + " (" + c.getID() + "... | 3 |
public void financeManager(){
if (turretBuilder.size() != 0){
if (turretBuilder.get(turretsPlaced).buy()+turretsPlaced*5 > player.getGold()){
turretBuilder.remove(turretsPlaced);
}
else{
player.moneyLoss(turretBuilder.get(turretsPlaced).buy()+turretsPlaced*5);
int loop;
for(loop = 0; loop < 5... | 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.