text stringlengths 14 410k | label int32 0 9 |
|---|---|
@Override
public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception {
if (msg instanceof HttpRequest) {
servingFromCache = false;
HttpRequest req = (HttpRequest) msg;
ReferenceCountUtil.retain(req);
requestsQueue.add(req);
... | 4 |
@Override
public void update(final Observable the_arg0, final Object the_arg1)
{
if (my_level > my_last_speed_up)
{
final int time = my_timer.getDelay();
my_timer.setDelay((int) (time * SPEED_RATIO));
my_last_speed_up = my_level;
}
if (the_arg1 instanceof Integer)
{
final... | 7 |
public static void falsepositive(DMatrix[] pointset){
for(int i = 0; i < pointset.length; i++){
System.out.println("NN法" + i + "番目クラス偽陽性");
}
} | 1 |
public void unloadLinked(Game game) {
ready = false;
if (!droppable) {
onUse(game);
return;
}
Pickup pick;
try {
pick = (Pickup) link.newInstance();
} catch (InstantiationException | IllegalAccessException ex) {
return;
... | 6 |
public static String noSpaces(String str) {
String lines[] = str.split("\n");
StringBuilder sb = new StringBuilder();
for (String line : lines)
sb.append(line.trim().replaceAll("\\s", "") + "\n");
if (lines.length == 1) sb.deleteCharAt(sb.length() - 1);
return sb.toString();
} | 2 |
@Override
public void keyPressed(int key, char character, GUIComponent component) {
switch (key) {
case (Keyboard.KEY_ESCAPE) : this.deactivate(); break;
case (Keyboard.KEY_RIGHT) : nextSlide(); break;
case (Keyboard.KEY_LEFT) : previousSlide(); break;
}
} | 3 |
public static double computeAP(int[] positions, int R){
int d = positions.length;
double sum1 = 0;
int sum2;
for(int i = 0; i < d; i++){
if(positions[i] == 1){
sum2 = 0;
for(int j = 0; j < i+1; j++){
if(positions[j] == 1){
... | 5 |
private static Camera restorecam() {
Class<? extends Camera> ct = camtypes.get(Utils.getpref("defcam",
"border"));
if (ct == null)
return (new BorderCam());
String[] args = (String[]) Utils.deserialize(Utils.getprefb("camargs",
null));
if (args == null)
args = new String[0];
try {
return (mak... | 4 |
static void decodeHorizontal(BitStream in, BitStream out, G4State s, Code code) throws IOException {
int rl = 0;
do {
rl = s.white ? findWhite(in, code) : findBlack(in, code);
if (rl >= 0) {
if (rl < 64) {
addRun(rl + s.longrun, s, out);
... | 4 |
public void setup(MasterFrame parent, int myNum){
this.parent = parent;
this.myNum = myNum;
try {
Field field = Color.class.getField(color);
myColor = (Color) field.get(null);
} catch (Exception e) { e.printStackTrace(); }
if(myColor == null) System.out.println("color: " + color);
... | 7 |
public static void main(String[] args) {
File testFile = new File(System.getProperty("user.home") + File.separator + "Desktop" + File.separator + "newFile.txt");
if (!testFile.exists()) {
try {
testFile.createNewFile();
} catch (IOException e) {
e.printStackTrace();
}
}
PrintWriter writer = ... | 7 |
public boolean waitEncryptedDeck(RSAService rsaService,
final PublicKey pubKey) throws IOException, InterruptedException,
InvalidKeyException, IllegalBlockSizeException,
BadPaddingException, NoSuchAlgorithmException {
Notification not = new Notification();
encryptedDeck = null;
final Subscription encS... | 3 |
static void dedupProcess() throws IOException{
int memoryPolicy = 5;
resultRecord.println("Total " + storageLoad() + " entries added into the index");
File[] incomingFile = null;
incomingFile = new File(outputpath).listFiles();
int cacheSizeControl = 0;
// int sampleNum = (int) ((Math.log(2)+Math.log(10000)... | 4 |
public static void main(String[] args) throws IOException {
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
String line = "";
StringBuilder out = new StringBuilder();
while ((line = in.readLine()) != null && line.length() != 0) {
int times = Integer.parseInt(line);
for (int i = 0... | 8 |
public static String escape(String string) {
StringBuilder sb = new StringBuilder(string.length());
for (int i = 0, length = string.length(); i < length; i++) {
char c = string.charAt(i);
switch (c) {
case '&':
sb.append("&");
break... | 6 |
private static void method342(int color, int x, int alpha, int y, int height) {
if (x < Graphics2D.topX || x >= Graphics2D.bottomX) {
return;
}
if (y < Graphics2D.topY) {
height -= Graphics2D.topY - y;
y = Graphics2D.topY;
}
if (y + height > Graphics2D.bottomY) {
height = Graphics2D.bottomY - y;
... | 5 |
@Override
public boolean okMessage(final Environmental myHost, final CMMsg msg)
{
if(!(affected instanceof MOB))
return super.okMessage(myHost,msg);
final MOB mob=(MOB)affected;
if((msg.amITarget(mob))
&&(CMath.bset(msg.targetMajor(),CMMsg.MASK_MALICIOUS))
&&(msg.targetMinor()==CMMsg.TYP_CAST_SPELL)
&... | 9 |
/** @see org.lateralgm.joshedit.FindDialog.FindNavigator#findNext() */
@Override
public void findNext() {
if (FindDialog.wrap.isSelected() && joshText.caret.row == joshText.getLineCount() - 1) {
joshText.caret.col = 0;
joshText.caret.row = 0;
}
// TODO: I have no idea how multiline regexp se... | 9 |
public CheckResultMessage check32(int day) {
return checkReport.check32(day);
} | 0 |
private void initValidColors(){
String colors = "123456789";
validColors = new ArrayList<Character>();
//initialize with all colors available
for(int i = 0; i < colors.length(); i++)
validColors.add(colors.charAt(i));
//check to make sure no other Cell in the Clique already has this color
for(Clique cli... | 3 |
public boolean addFrame(BufferedImage im) {
if ((im == null) || !started) {
return false;
}
boolean ok = true;
try {
if (!sizeSet) {
// use first frame's size
setSize(im.getWid... | 7 |
public String getName() {
return Name;
} | 0 |
public void render(Graphics g)
{
// Graphics2D makes it look pretty
Graphics2D g2 = (Graphics2D)g;
g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
// fill in a green background
g.setColor(new Color(140, 230, 0));
g.fillRect(xMin-20, yMin-20, xMax+40, yMax+125);
... | 3 |
private void untidy(double di, double wa){
for (int i=0;i<w;i++)
for (int j=0;j<h;j++){
double d = r.nextDouble();
if (d<di){
net[i][j]=DIRTY;
anet[i][j]=CLEAN;
}else if (d<di+wa){
net[i][j]=WALL;
anet[i][j]=CLEAN;
}
if (i==0 || j==0 || i==w-1 || j==h-1){
net[i][j]... | 8 |
public String findSavedGameSize() {
File file;
file = new File("Saved_Games.txt");
Scanner scanner;
String line;
try {
scanner = new Scanner(file);
while(scanner.hasNextLine()) {
line = scanner.nextLine();
if(line.equals(user.getUsername())) {
scanner.nextLine();
return scanner.nextLin... | 3 |
private static ArrayList<String> loadLines(String fileName) throws IOException {
System.out.println("Reading file");
BufferedReader br = new BufferedReader(new FileReader(fileName));
ArrayList<String> ret = new ArrayList<String>();
String line;
while ((line = br.readLine()) != nu... | 1 |
public void updateUser() throws SQLException {
String query = ""
+ "UPDATE user "
+ "SET Email = ?, Name = ?, Surname = ?, Type = ? ";
if (u.getPassword() != null && !u.getPassword().equals("")) {
query += ", Password = ? ";
}
query += "WHERE ... | 6 |
public void atualizar() {
jComboBoxEstadoUF.removeAllItems();
jComboBoxCidade.removeAllItems();
jComboBairro.removeAllItems();
jComboBoxDDD.removeAllItems();
jComboBoxTelefone.removeAllItems();
jComboBoxCelular.removeAllItems();
jComboBoxEstadoUF.addItem("Todos"... | 6 |
public void tryToGetData(){
try {
byte[] receiveData = new byte[1024];
DatagramPacket receivePacket = new DatagramPacket(receiveData, receiveData.length);
serverSocket.receive(receivePacket);
boolean allreadyingame = false;
... | 6 |
private boolean checkQualifier(QualifiedValue<?> value, Enum<?>... qualifiers) {
boolean contained = true;
for (Enum<?> qualifier : qualifiers) {
if (!value.getQualifiers().contains(qualifier)) {
contained = false;
break;
}
}
return... | 5 |
public ArrayList<DuplicateMusicObject> getDuplicatesOnContent() {
ArrayList<MusicObject> allMusic = getAllSongs();
ArrayList<MusicObject> temp = null;
HashMap <String,ArrayList<MusicObject>> byteDuplicates = new HashMap<String,ArrayList<MusicObject>>();
for (MusicObject song : allMusic) {
if ... | 7 |
public Vector3f getVector3f( String name )
{
Vector3f result = vector3fHashMap.get( name.toLowerCase() );
if ( result != null )
return result;
return new Vector3f( 0, 0, 0 );
} | 1 |
private void playUser(Scanner sc){
System.out.println("There are "+m.count()+" marbles in the pile.");
System.out.println("How many marbles do you want to remove?");
try{
m.remove(sc.nextInt());
player = false;
}
catch(Marbles.NotValid e){
System.err.println(e.getMessage());
}
... | 3 |
public RequeteRaster() throws SQLException {
srids=RequeteUnion.getSrids();
tableaux=FenetreRaster.getTableauTailles();
for(int fg=0;fg<tableaux.size();fg++){
String test34[][]=tableaux.get(fg);
String taillePixels=test34[fg][1];
taillePixel.add(taillePixels);
String nomCouche=test34[fg][0];
no... | 9 |
public static Set<RepairedCell> readTruth(String fileRoute) {
File file = new File(fileRoute);
Set<RepairedCell> truth = new HashSet<RepairedCell>();
if(!file.exists()){
System.out.println(fileRoute+"文件不存在,无法测试!");
return truth;
}
try {
FileReader fr = new FileReader(file);
BufferedReader br = ... | 5 |
public boolean setType(int n)
{
if ((n != NetworkSimulator.TIMER_INTERRUPT) &&
(n != NetworkSimulator.FROM_LAYER_5) &&
(n != NetworkSimulator.FROM_LAYER_3))
{
type = -1;
return false;
}
type = n;
return true;
} | 3 |
public String getInitialFilePath() {
StringBuilder initialFilePath = new StringBuilder();
String userHome = System.getProperty("user.home");
if(userHome != null) {
initialFilePath.append(userHome);
}
String osName = System.getProperty("os.name").toUpperCase();
String fileSeparator = System.getProper... | 8 |
public void handleConf(CSTAEvent event) {
if ((event == null) || (event.getEventHeader().getEventClass() != 5)
|| (event.getEventHeader().getEventType() != this.pdu)) {
return;
}
if (this.pdu == 30) {
this.enable = ((CSTAQueryDndConfEvent) event.getEvent())
.isDoNotDisturb();
}
this.device.re... | 9 |
@Override
public boolean equals(Object obj) {
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final TabelOutletSize other = (TabelOutletSize) obj;
if (!Objects.equals(this.kodeSize, other.kodeSize)) {
... | 3 |
public String getSeqID() {
return seqID;
} | 0 |
public void generationControlee(){
int nbP;
int nbA;
Date date = new Date();
TachePeriodique tacheP;
Tache tacheA; //Tache apériodique
Scanner sc = new Scanner(System.in);
//Stockage du nombre de tache a générer
System.out.println("Nombre de taches périodiques controlées à générer : ");
nbP = sc.nextI... | 4 |
public VueListe getVueListe() {
return panelListe;
} | 0 |
private static boolean isBSTHelper(TreeNode<Integer> t, int max, int min) {
if (t == null) {
return true;
}
if (t.data > max || t.data < min) {
return false;
}
/*
* current data is the max value of left subtree and min value of right
* subtree
*/
return isBSTHelper(t.left, t.data, min)
... | 4 |
protected static void processRoomRelinks(List<String> reLinkTable, String areaName, Map<String, Room> areaHashedRoomSet, Map<String, Room> hashedRoomSet)
{
// try to re-link olde room links
if(reLinkTable!=null)
{
for(int r=0;r<reLinkTable.size();r++)
{
final String link=reLinkTable.get(r);
String ... | 8 |
public Vec3D getIntermediateWithYValue(Vec3D var1, double var2) {
double var4 = var1.xCoord - this.xCoord;
double var6 = var1.yCoord - this.yCoord;
double var8 = var1.zCoord - this.zCoord;
if(var6 * var6 < 1.0000000116860974E-7D) {
return null;
} else {
double var10 = (va... | 3 |
private void switchInputStream() throws IOException {
if(getInputStream() != null)
getInputStream().close();
if(filenames.isEmpty())
throw new IOException("All files in the playlist were marked as bad");
if(random)
current = (int)(Math.random() * filenames.size());
else
current = (current + 1) % fil... | 4 |
public void shrink() {
if (c.length == length) {
return;
}
char[] newc = new char[length];
System.arraycopy(c, 0, newc, 0, length);
c = newc;
} | 1 |
private void updatePatch(final MeshPatch old, final float time) {
if (! (old.updateMesh || old.updateRoads || old.updateDirt)) return ;
final int x = old.x, y = old.y ;
final boolean init = old.inceptTime == TIME_INIT ;
final MeshPatch patch = init ? old : new MeshPatch() ;
if (init) {
ol... | 9 |
public void test_04() {
System.out.println("\n\nSuffixIndexerNmer: Add & overlap test");
String fastqFileName = "tests/short.fastq";
// Create indexer
SuffixIndexerNmer<DnaAndQualitySequence> seqIndexNmer = new SuffixIndexerNmer<DnaAndQualitySequence>(new DnaQualSubsequenceComparator(true), 15);
// Add & ov... | 3 |
@Override
public AxisState draw(Graphics2D g2,
double cursor,
Rectangle2D plotArea,
Rectangle2D dataArea,
RectangleEdge edge,
PlotRenderingInfo plotState) {
// if the axis is no... | 8 |
public static String getUrlFileType(String url){
if(url.endsWith(FileType.jpg.getType())){
return FileType.jpg.getType();
} else if(url.endsWith(FileType.jpg.getType())){
return FileType.png.getType();
}
log.warn("System could not analyze this url's file type: " + url);
return null;
} | 2 |
public static void main(String[] args) {
//System.setProperty("webdriver.chrome.driver", "/L/tmp/chromedriver");
Options options = new Options();
options.addOption("c", "config", true, "Path ot config to use");
options.addOption("d", "driver", true, "Driver to use");
options.addO... | 9 |
public static void main(String[]args){
String Train = args[0];
//String Test = args[1];
//Naive naive = new Naive();
topwords naive = new topwords();
try {
naive.train(Train);
} catch (IOException e) {
e.printStackTrace();
}
//naiv... | 7 |
public static void main(String[] args) {
//Please input the value of "String[] args" from the settings of Java application.
Class<?> c;
ArrayList classList = null;
try {
c = Class.forName(args[0]);
TypeDesc desc = new TypeDesc();
for(String name : args){
desc.printType(c, 0, TypeDesc.basic);
cl... | 5 |
@Override
public double calculateFractalWithoutPeriodicity(Complex pixel) {
iterations = 0;
double temp = 0;
Complex tempz = new Complex(pertur_val.getPixel(init_val.getPixel(pixel)));
Complex tempz2 = new Complex(init_val2.getPixel(pixel));
Complex[] complex = new Complex[... | 8 |
private void jButtonOKActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonOKActionPerformed
ctrlP.chercher();
}//GEN-LAST:event_jButtonOKActionPerformed | 0 |
@Override
public void run() {
if(workflow.getContext() == null) {
workflow.setContext(new Context());
}
if (AzotConfig.GLOBAL.DEBUG) {
System.out.println("Reading " + workflowFile + "...");
}
final List<Variable> contextVariables = workflow.getContext().getVariables();
for (final Variable ... | 9 |
public void render(int bufp, float[][] buf, long nsamples, float buf2, boolean add) {
//public void render(ByteBuffer buf, long nsamples, float buf2, boolean add) {
//System.out.println("Rendering " + nsamples + " samples...");
long todo = nsamples;
int bufpp = 0;
while (todo != 0) {
if (tickd == 0) {
t... | 9 |
private final static Map<String, InstrumentType> buildMap() {
final Map<String, InstrumentType> map_ = new HashMap<>();
try {
for (final Field f : InstrumentType.class.getFields()) {
final InstrumentType t = (InstrumentType) f.get(null);
for (final String key : t.keys) {
map_.put(key, t);
}
... | 3 |
@Override
public int castingQuality(MOB mob, Physical target)
{
if(mob!=null)
{
final Room R=mob.location();
if(R!=null)
{
if((R.domainType()&Room.INDOORS)>0)
return Ability.QUALITY_INDIFFERENT;
if((R.domainType()==Room.DOMAIN_OUTDOORS_CITY)
||(R.domainType()==Room.DOMAIN_OUTDOORS_SPACEP... | 8 |
public void remove() {
Connection conn = null;
PreparedStatement ps = null;
try
{
conn = iConomy.getiCoDatabase().getConnection();
ps = conn.prepareStatement("DELETE FROM " + Constants.SQLTable + "_BankRelations WHERE bank_id = ? AND account_name = ?");
ps.setInt(1, this.BankId);
... | 5 |
public int minPathSum(int[][] grid) {
// Start typing your Java solution below
// DO NOT write main() function
int m = grid.length;
if (m == 0)
return 0;
int n = grid[0].length;
if (n == 0)
return 0;
int[][] res = new int[m][];
int i = 0, j = 0;
for (i = 0; i < m; i++)
res[i] = new int[n];
... | 7 |
private boolean processAsCommand(String input) {
input = input.trim();
if (!input.startsWith(":"))
return false;
input = input.substring(1).trim();
String[] parts = input.split("\\s+");
if (parts.length == 0)
System.out.println("missing command!");
else if ("context".startsWith(parts[0]))
cmdConte... | 8 |
public List<List<Point>> mutation(List<List<Point>> nextGen) {
Random random = new Random();
for (int i = 0; i < nextGen.size(); i++) {
int minInCircles = getMinInCircles(nextGen.get(i));
for (int j = 0; j < nextGen.get(i).size(); j++) {
if (circleContainMin(n... | 4 |
public synchronized ArrayList<Intron> introns() {
if (introns == null) {
introns = new ArrayList<Intron>();
Exon exBefore = null;
for (Exon ex : sortedStrand()) {
if (exBefore != null) {
// Create intron
Intron intron;
int rank = introns.size() + 1;
// Find intron start and end
... | 5 |
public Object display(int size) {
// TODO Auto-generated method stub
if(size==0)
return this.head.getElement();
else
return this.head.getNext().getElement();
} | 1 |
private static int readn(InputStream in, byte buf[], int c)
throws IOException
{
int i = 0;
while (i < c) {
int n = in.read(buf, i, c - i);
if (n == -1)
return i;
i += n;
}
return c;
} | 2 |
@SuppressWarnings("rawtypes")
private void configRowMapper(Method method) {
MongoMapper mapper = method.getAnnotation(MongoMapper.class);
Class<? extends BeanMapper> mapperType = AutoDetectBeanMapper.class;
if (mapper != null) {
mapperType = mapper.value();
}
if (AutoDetectBeanMapper.class.equals(mapperT... | 6 |
public final double getTotalAfterDiscount() {
double total = 0.0;
for (LineItem item : lineItems) {
total += item.getDiscount();
}
return total;
} | 1 |
public static void ex7() throws NumberFormatException, IOException{
System.out.print("Dimensió del array => ");
int dim=Integer.parseInt(stdin.readLine());
int[] array=new int[dim];
for(int i=0; i<dim; i++){
array[i]=(int)(Math.random()*10);
System.out.print(array[i]+" , ");
}
boolean creixent=true;
boolean ... | 6 |
public void setup(Main p) {
con = new File(p.getDataFolder(), "config.yml");
config = p.getConfig();
if (!p.getDataFolder().exists()) {
p.getDataFolder().mkdir();
}
loc = new File(p.getDataFolder(), ".yml");
... | 3 |
public void testConstructor_int_int() throws Throwable {
YearMonth test = new YearMonth(1970, 6);
assertEquals(ISO_UTC, test.getChronology());
assertEquals(1970, test.getYear());
assertEquals(6, test.getMonthOfYear());
try {
new YearMonth(Integer.MIN_VALUE, 6);
... | 4 |
@SuppressWarnings("unchecked")
@Override
public T mapper(DBObject o) {
T result = (T) ReflectUtils.newInstance(clazz);
if (result == null) {
return result;
}
Map<String, Object> resultMap = o.toMap();
for (Entry<String, Object> entry : resultMap.entrySet()) {
String key = entry.getKey();
Objec... | 3 |
private void createD(String in1, String out)
{
DFlipFlop d = new DFlipFlop();
// Connect the first input
// Check if the in wire is an input
if (stringToInput.containsKey(in1))
{
Wire inWire = new Wire();
stringToInput.get(in1).connectOutput(inWire);
d.connectInput(inWire);
}
// Check if the in... | 5 |
@Override
public void endAddSubContainer(Container c) {
containerStack.remove(containerStack.size() - 1);
AbstractPreferencesPanel.addSingleItemCentered((JComponent) c, getCurrentContainer());
} | 0 |
private static void printTerrainTable(ArrayList<ParkerPaulTaxable> taxables) {
double totalTaxes = 0.00; // total taxes for items
double minTaxes = -1.00; // min taxes for items
double maxTaxes = 0.00; // max taxes for items
int count = 0; // count of items
printTerrainHeader()... | 2 |
public static void main(String [] args)
{
String[] paths = new String[]{
"samples/testseq100000.gif",
"samples/testseq100007.gif",
"samples/testseq100136.gif",
"samples/testseq100192.gif",
};
try
{
for (String path : paths)... | 2 |
public void readCommand()
throws InvalidComException, IncorrectNumException{
if (command[0].equals("addplayer")) {
comAddplayer(true);
} else if (command[0].equals("removeplayer")) {
comRemoveplayer();
} else if (command[0].equals("editplayer")) {
comEditplayer();
} else if (command[0].equals("rese... | 9 |
public void finishLoadingGeography() {
Vector<VTD> features = featureCollection.features;
System.out.println(features.size()+" precincts loaded.");
getMinMaxXY();
System.out.println("Initializing wards...");
featureCollection.initFeatures();
dlbl.setText("Setting min and max coordinates...");
... | 8 |
public static Stella_Object lookupDeferredQueryOption(Stella_Object queryoroptions, Keyword key, Surrogate coercetotype) {
{ PropertyList options = null;
PropertyList deferredoptions = null;
Stella_Object value = null;
Stella_Object coercedvalue = null;
boolean processeddeferredoptionP = fal... | 8 |
public void stateChanged(String s)
{
if (s.equals(VisibleTimer.START))
{
enableEdits(false);
String answerList[] = new String[answers.length];
for (int i = 0; i < answerList.length; i++)
answerList[i] = answers[i].getAnswer();
model.broadcastQuestion(question.getText(), answerList);
if (!time... | 7 |
public MealyNondeterminismDetector()
{
} | 0 |
public void update(Graphics g) {
Dimension dim = getSize();
Insets insets = getInsets();
g.setColor(getBackground());
int x = insets.left;
int y = insets.top;
int w = dim.width - insets.left - insets.right;
int h = dim.height - insets.top - insets.bottom;
g.fillRect(x, y, w, h);
float scale = w / (... | 9 |
public int promptRemoveDirectoryFromPath(String directory,Exception e) {
if (e instanceof NullPointerException) {
return jopDependency.showConfirmDialog(null, String.format("Couldn't match the following path with any environment variables. Do you wish to remove it?\n%s", directory), "Remove invalid ... | 2 |
public void test_append_Printer_nullParser() {
DateTimeFormatterBuilder bld = new DateTimeFormatterBuilder();
bld.appendLiteral('Y');
DateTimePrinter p = bld.toPrinter();
try {
DateTimeFormatterBuilder bld2 = new DateTimeFormatterBuilder();
bld2.append(p,... | 1 |
@Override
public void Execute(Session mSession, String[] Arguments)
{
if (Arguments.length == 0)
{
mSession.SendAlert("You didn't specify a plugin to destroy!", null);
return;
}
if (Grizzly.GrabPluginHandler().DestructPlugin(mSession, Arguments[0]))
{
mSession.GrabActor().Speak("*Disables the pl... | 2 |
private static void processClientChoice(int choice) {
String testName;
String studentName;
String studentSurname;
switch (choice) {
case 1:
listTests();
break;
case 2:
System.out.println("Enter test name:");
... | 5 |
public static void main(String args[]) {
try {
for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
if ("Nimbus".equals(info.getName())) {
javax.swing.UIManager.setLookAndFeel(info.getClassName());
... | 6 |
public boolean findPath(int X, int Y, ArrayList<Point> path, Hashtable<Point, Boolean> cache) {
Point p = new Point(X, Y);
if (cache.containsKey(p))
return cache.get(p); // already visit the cell
if (X == 0 && Y == 0)
return true; // already find a path
boolean success = false;
if (X >= 1 && isFree... | 9 |
@Override
public void actionPerformed(final ActionEvent e) {
if (e.getSource() == bHint) {
ArrayList<Integer> moves = client.getAIMove();
int pcx = moves.get(0);
int pcy = moves.get(1);
int pct = moves.get(2);
String pcc = "any";
if (moves.get(3) == 0) {
pcc = "RED";
} else if (moves.get(3) ... | 5 |
private void favorite(HttpServletRequest request, HttpServletResponse response,UserBean user) throws ServletException, IOException {
List<String> errors = new ArrayList<String>();
FavoriteForm form = new FavoriteForm(request);
if (!form.isPresent() && form.getFavoriteId() == null) {
outputLi... | 8 |
private void rotateRight(Node u)
{
int hookType;
if (root == u) hookType = 0;
else if (u == u.parent.left) hookType = -1;
else hookType = 1;
Node nodesLeft = u.left;
Node leftsRight = nodesLeft.right;
nodesLeft.right = u;
if (hookType == 0) ro... | 5 |
public int getTotalBlocksPlaced(String playerName) {
int totalBlocksPlaced = 0;
try {
ResultSet rs = _sqLite.query("SELECT total(blocks_placed) "
+ "AS total_blocks_placed "
+ "FROM player, login "
+ "WHERE player.playername = '" + playerName + "' "
+ "AND player.i... | 3 |
public static void main(String args[]){
Deal deal=new Deal();
PrestataireDeService p = new PrestataireDeService();
p.setIdUser(2);
deal.setDescriptif("un descriptif test");
deal.setCategorie("mm");
deal.setTypeDeal("Produit");
deal.setDateDebut("27/02/2013");
... | 1 |
public void fromJSONObject(JSONObject o) {
try {
setFirstName((String) o.remove(KEY_FIRST_NAME));
setLastName((String) o.remove(KEY_LAST_NAME));
setID((String) o.remove(KEY_ID));
setPoints(Utils.numToInt(o.remove(KEY_POINTS)));
String id = (String) o.remove(KEY_WEEKLY_PICK_ID);
Contestant c = null;... | 3 |
protected void _setConfigFile(File config_file) {
this.config_file = config_file;
} | 0 |
protected boolean ist_angrenzendes_Land_verschieben(Land frage_Land, Spieler aktuellerSpieler, List<Land> gepruefte_laender){
for (int i=0;i<angrenzendeLaender.length; i++){
if (angrenzendeLaender[i]==frage_Land) return true;
}
gepruefte_laender.add(this);
boolean ist_angrenzend=false;
for (int i=0;i<an... | 6 |
public void setTotal(double total) {
this.total = total;
} | 0 |
public Location(int row, int col)
{
this.row = row;
this.col = col;
} | 0 |
public void reserveRoundTripTicket() {
try {
Class.forName("com.mysql.jdbc.Driver");
} catch (ClassNotFoundException e) {
System.out.println("Where is your MySQL JDBC Driver?");
e.printStackTrace();
}
PreparedStatement ps = null;
Connection co... | 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.