text stringlengths 14 410k | label int32 0 9 |
|---|---|
public boolean func_para_num_wrong(String func_name,int number){
int num = gt.function_table.function_name.size();
for (int i = 0; i < num; i++) {
if (gt.function_table.function_name.get(i).toString().equals(func_name)) {
int n =(Integer)gt.function_table.function_parameter_n... | 3 |
public int characterAt(int at) throws JSONException {
int c = get(at);
if ((c & 0x80) == 0) {
return c;
}
int character;
int c1 = get(at + 1);
if ((c1 & 0x80) == 0) {
character = ((c & 0x7F) << 7) | c1;
if (character > 0x7F) {
... | 8 |
private int minPathSumMN(int m, int n, int[][] s, int[][]grid){
if(m == 0 && n == 0 ){
return grid[0][0];
}
else if(m == 0){
if(s[m][n-1] != -1){
s[m][n] = s[m][n-1] + grid[m][n];
}
else{
s[m][n] = minPathSumMN(m, n-1, s, grid) + g... | 9 |
@Override
public void mouseDragged(MouseEvent mouse) {
Tool tool = controls.getTool();
if (begin == null && selectedMessage == null) {
graph.canvas.offX = oldOffX + (mouse.getX() - preClickX);
graph.canvas.offY = oldOffY + (mouse.getY() - preClickY);
GUI.gRepaint(... | 6 |
public static void killMetaInf () {
File inputFile = new File(Settings.getSettings().getInstallPath() + "/" + ModPack.getSelectedPack().getDir() + "/minecraft/bin", "minecraft.jar");
File outputTmpFile = new File(Settings.getSettings().getInstallPath() + "/" + ModPack.getSelectedPack().getDir() + "/mine... | 6 |
public static String getLongestPalindrome(String s){
char[] T = preProcess(s).toCharArray();
int n = T.length;
int[] P = new int[n];
int C = 0, R = 0;
for (int i = 1; i < n-1; i++) {
int i_mirror = 2*C - i; // equals to i' = C - (i-C)
if ( i < R ) {
... | 9 |
public boolean hasPermission(CommandSender sender, String permission) {
if( sender instanceof ConsoleCommandSender )
return true;
// from here forward it must be a player object to pass
if( !(sender instanceof Player) )
return false;
Player p = (Player) sender;
if( usePermissions && vaultPerms != null... | 5 |
public static boolean validClass(Class<?> clazz) {
try {
Method serialize = clazz.getDeclaredMethod("serialize");
if (!serialize.getReturnType().equals(String.class)) {
System.out.println("Class '" + clazz.getCanonicalName() + "' is not serializable because it does not return a String");
return false;
... | 8 |
public int placeWords(String matchString, String[] matchWords){
int n = matchString.length();
int m = 0;
for(int i=0; i<n; i++){
if(m<matchWords[i].length()) m = matchWords[i].length();
}
int min = Integer.MAX_VALUE;
for(int i=0; i<m; i++){
int cos... | 8 |
public synchronized void m4t2() {
int i = 5;
while (i-- > 0) {
System.out.println(Thread.currentThread().getName() + " : " + i);
try {
Thread.sleep(500);
} catch (InterruptedException ie) {
}
}
} | 2 |
@Override
public boolean invoke(MOB mob, List<String> commands, Physical givenTarget, boolean auto, int asLevel)
{
MOB target=this.getTarget(mob,commands,givenTarget);
if(target==null)
return false;
Room R=CMLib.map().roomLocation(target);
if(R==null)
R=mob.location();
if(!super.invoke(mob,commands,g... | 9 |
private static void getConfigLocations(File dir, String curPath,
String cfgFileName, String filePrefix, List<String> files,
boolean isFullPath) {
String[] fileNames = dir.list();
if (fileNames == null)
return;
String filePath = dir.getPath();
for (int i = 0, len = fileNames.length; i < len; i++) {
i... | 8 |
public void initMatrix()
{
set0ButtonActionPerformed(null);
float m[][] = filter.getMatrix();
int size = m[0].length;
int start_position = 0;
switch(size)
{
case 3 : start_position = 2; jComboBox1.setSelectedIndex(0); break;
case 5 : start... | 6 |
public void copyDataFrom(CPColorBmp bmp) {
if (bmp.width != width || bmp.height != height) {
width = bmp.width;
height = bmp.height;
data = new int[width * height];
}
System.arraycopy(bmp.data, 0, data, 0, data.length);
} | 2 |
private void jMenuItem4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem4ActionPerformed
Desktop dt = Desktop.getDesktop();
try
{
dt.open( new File("help.html") );
} catch (IOException e) {//exception handling?
}
}//GEN-LAST:event_jM... | 1 |
public static final ISignature getInstance(String ssa) {
if (ssa == null) {
return null;
}
ssa = ssa.trim();
ISignature result = null;
if (ssa.equalsIgnoreCase(Registry.DSA_SIG) || ssa.equals(Registry.DSS_SIG)) {
result = new DSSSignature();
} else if (ssa.equalsIg... | 5 |
public int getACC() {
return acc;
} | 0 |
protected Behaviour getNextStep() {
if (actor.mind.home() == newHome) return null ;
if (verbose) I.sayAbout(actor, "Getting next site action ") ;
if (! newHome.inWorld()) {
if (! canPlace()) { abortBehaviour() ; return null ; }
final Tile goes = actor.world().tileAt(newHome) ;
final A... | 4 |
private void generarArchivoAutomata() {
FileWriter archivoAutomata = null;
PrintWriter pw = null;
this.nombreAutomata = "AFN_TXT\\" + JOptionPane.showInputDialog("Por favor, indique el nombre del archivo que almacena al automata")+".txt";
try {
archivoAutomata = ... | 4 |
public Integer next() {
current++;
return current - 1;
} | 0 |
public void register(Object value) {
if (JSONzip.probe) {
int integer = find(value);
if (integer >= 0) {
JSONzip.log("\nDuplicate key " + value);
}
}
if (this.length >= this.capacity) {
compact();
}
this.list[this.le... | 4 |
public void actionPerformed(ActionEvent e) {
// Reset all labels
userView.lblUserName.setText("* User Name");
userView.lblUserName.setForeground(Color.BLACK);
userView.lblPassword.setText("* Password");
userView.lblPassword.setForeground(Color.BLACK);
userView.lblFirstName.setText("* First Name");
... | 8 |
@Override
public List<Integer> sort() {
int i, j, k, h, x;
int[] spalten = { 271, 111, 41, 13, 4, 1 };
for (k = 0; k < 6; k++) {
h = spalten[k]; // Sortiere die "Spalten" mit Insertionsort
for (i = h; i < list.size(); i++) {
x = list.get(i);
j = i;
while (j >= h && list.get(j - h) > x) {
l... | 4 |
@Override
public boolean isDataFlavorSupported(DataFlavor flavor)
{
DataFlavor[] flavors = getTransferDataFlavors();
for (int i = 0; i < flavors.length; i++)
{
if (flavors[i] != null && flavors[i].equals(flavor))
{
return true;
}
}
return false;
} | 3 |
public void scrollCellToView(JTable table, int rowIndex, int vColIndex) {
if (!(table.getParent() instanceof JViewport)) {
return;
}
JViewport viewport = (JViewport) table.getParent();
Rectangle rect = table.getCellRect(rowIndex, vColIndex, true);
Rectangle viewRect =... | 9 |
private int amtBet(int minBet, int maxBet){
double betAmt = 0;
//Decide if its worth being aggressive
if(match.tableCards.size()==0){
if(match.abs_prob_win < AGGRESSION_THRESHOLD){
return -1;
}else{
betAmt = match.abs_prob_win*match.pot;
}
}else if(match.tableCards.size()==3){
if(opponent.b... | 8 |
public void service(){
while(true){
Socket socket = null;
try {
socket = serverSocket.accept();
System.out.println("New connections accepted" + socket.getInetAddress() + " : " + socket.getPort());
Thread.sleep(5000);
} catch (IOException e) {
e.printStackTrace();
} catch (InterruptedExcept... | 5 |
public static void parse(String t, int lineNum) {
acceptingStates = new ArrayList<String>();
if (lineNum == NFA.STATES.lineNum()) {
numStates = Integer.parseInt(t);
} else if (lineNum == NFA.LANGUAGE.lineNum()) {
language = t;
} else if (lineNum == NFA.CARDINALITY.lineNum()) {
numAcceptingStates = Int... | 9 |
public int getValue() {
return value;
} | 0 |
public RandomListNode copyRandomList(RandomListNode head) {
if(head == null)
return null;
else{
RandomListNode headNew = copyNext(head);;
copyRandom(headNew,head);
return headNew;
}
} | 1 |
public static void main(String[] args) {
// abort program if correct number of command-line argument is not given
if ( args.length != 1 ){
System.out.println(args.length);
System.out.println("Usage : RunZeroGameSolver output.dat");
System.exit(0);
}
final int m0 = 2;
final int increment = 1;
... | 6 |
public static boolean Pase(Cancha cancha, int equipoA, int jugadorA, int jugadorR,int equipoD,int jugadorD, Pelota pelota){
float pase=cancha.getEquipoX(equipoA).getJugadorX(jugadorA).getPase();
pase=pase*Factorf.factorF();
//se multiplican datos por valores aleatorios
float bloque=(Fact... | 5 |
private void destroyNeighbors(Brick[][] array, int y, int x) {
triggerPower(powers[y][x]);
array[y][x].blowUp();
if (isBlockAbove(array, y, x)) {
if (array[y - 1][x].getType() == BrickType.EXPLOSIVE) { // above explosive?
destroyNeighbors(array, y - 1, x);
}
array[y - 1][x].blowUp();
score ... | 8 |
public String getWebPage() {
return WebPage;
} | 0 |
private void updateStateFound(List<Keyword> keywords, List<String> terms) {
for (Keyword kw: keywords) {
for (DialogState d : kw.getReference()) {
if (d.getCurrentState() == Start.S_USER_FOUND) {
getCurrentSession().setCurrentUser(new User((UserData)(kw.getKeywordData().getDataReference().get(0))));
... | 3 |
private final String getChunk(String s, int slength, int marker)
{
StringBuilder chunk = new StringBuilder();
char c = s.charAt(marker);
chunk.append(c);
marker++;
if (isDigit(c))
{
while (marker < slength)
{
c = s.charAt(marker... | 5 |
File getFile() {
return file == newFile ? null : file;
} | 1 |
@Test
public void getListProductPreferredAllClients() {
Map<Client, List<Product>> currentList = null;
Product book = new Product("Book", 1234, 2.30, 100);
Product table = new Product("Table", 4321, 3.00, 100);
Product printer = new Product("Printer", 4321, 3.00, 100);
facade.addProduct(book);
facade.ad... | 3 |
AIMove onTestPuckFriction(AIHockeyist hockeyist) {
AIManager manager = AIManager.getInstance();
AIRectangle rink = manager.getRink();
int currentTick = manager.getCurrentTick();
AIPuck puck = manager.getPuck();
AIMove move = new AIMove();
if (manager.isPuckOwner(hockeyis... | 8 |
@EventHandler(ignoreCancelled = true, priority = EventPriority.LOW) // override protection plugins
public void onBlockBreak(final BlockBreakEvent broken) {
if (broken instanceof KioskRemove) return;
if (!Kiosk.SIGN_BLOCKS.contains(broken.getBlock().getTypeId())) return;
final Sign state = (... | 5 |
public void info() {
List<Host> newList = new ArrayList<Host>(network_.size());
for (Host host : network_) {
try {
newList.add(simulation_.info(host));
} catch (CommunicationException e) {
logger_.warn("{}", e.getMessage());
}
... | 4 |
public static long runQuery(final String query, final PrintStream p, final DBHandle handle) throws SQLException {
final Statement stmt = handle.createReadStatement();
final RSIterator source = new RSIterator(stmt.executeQuery(query));
final String sep = "\t";
boolean first = true;
long rowNum = 0;
while(sou... | 6 |
public void closePopUp() {
Parent parentRoot = ((Stage) stage.getOwner()).getScene().getRoot();
if (parentRoot instanceof StackPane) {
((StackPane) parentRoot).getChildren().remove(mask);
}
stage.close();
} | 1 |
public void morrisTraverse(TreeNode root) {
while (root != null) {
if (root.getLeft() == null) {
System.out.println(root.getData());
root = root.getRight();
} else {
TreeNode ptr = root.getLeft();
while (ptr.getRight() != null && ptr.getRight() != root)
ptr = ptr.getRight();
if (ptr.... | 5 |
protected void buildClassifierWithWeights(Instances data)
throws Exception {
Instances trainData, training;
double epsilon, reweight;
Evaluation evaluation;
int numInstances = data.numInstances();
Random randomInstance = new Random(m_Seed);
// Initialize data
m_Betas = new double [m_C... | 8 |
private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton4ActionPerformed
if (jTable1.getSelectedRow()==-1)
{
JOptionPane.showMessageDialog(this, "Select a search item to check in");
return;
}
if (jTable1.getSelectedRowCount(... | 6 |
private void createGui() {
sendButton.setText(settings.getLanguage().getLabel("button_send"));
outputTextArea.setEditable(false);
setInputsEnabled(false);
JPanel inputPanel = new JPanel();
inputPanel.setLayout(new BoxLayout(inputPanel, BoxLayout.LINE_AXIS));
JScrollPane inputScrollPane = new JScroll... | 0 |
public synchronized void runTask(Runnable task) {
if (!isAlive) {
throw new IllegalStateException();
}
if (task != null) {
taskQueue.add(task);
notify();
}
} | 2 |
public String getParameterString(){
String retString = super.getParameterString();
try{
if(sourceText!=null) retString+="&sourceText="+sourceText;
if(cQuery!=null) retString+="&cquery="+URLEncoder.encode(cQuery,"UTF-8");
if(xPath!=null) retString+="&xpath="+URLEncoder.encode(xPath,"UTF-8");
}
catch(Uns... | 4 |
private boolean calulateBrightnessContrast(ij.process.ImageProcessor ip) {
boolean brightnesscontrast = false;
int w = ip.getWidth();
int h = ip.getHeight();
//set image as current window
ImagePlus bc_imp;
bc_imp = WindowManager.getCurrentImage();
//calculate histogram values
int []hist = ne... | 8 |
@Override
public boolean equals(Object obj) {
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final Square other = (Square) obj;
if (this.xmin != other.xmin) {
return false;
}
i... | 6 |
public String strStr(String haystack, String needle) {
// Start typing your Java solution below
// DO NOT write main() function
assert (haystack != null && needle != null);
if (needle.length() == 0) {
return haystack;
}
int i = 0;
while (i < haystack.... | 8 |
public static boolean existeUsuario(String username) {
username = username.trim();
Connection conn = null;
PreparedStatement stmt = null;
boolean existe = false;
try {
conn = model.ConexionMySQL.darConexion();
stmt = conn.pr... | 7 |
public Authentication(AdminClient parent) {
super("resources/UmbrellaSignIn.png");
this.parent = parent;
this.parent.setTitle("Authentication");
if(AdminClient.client == null) {
try {
AdminClient.client = new Client("127.0.0.1", 1234);
}catch (IOException e) {
javax.swing.SwingUtilities.invokeLate... | 2 |
public static void main(String[] args) {
try {
Sys.savePID(new ClinicClient().getPidFile());
Log.init();
App form = new App();
form.setUploadRunnable(new Runnable() {
@Override
public void run() {
try {
... | 9 |
private String joinTypeToString(QbJoinType joinType)
{
switch (joinType)
{
case DEFAULT:
return "";
case LEFT_OUTER:
return "LEFT OUTER";
case RIGHT_OUTER:
return "RIGHT OUTER";
case INNER:
case OUTER:
case LEFT:
case RIGHT:
default:
return joinType.toString();
}
} | 7 |
private void processPaging(MapHttpServletRequest request) {
String path = request.getRequestURI();
int index = path.lastIndexOf("/page/");
if (index != -1) {
String url = path.substring(0, index);
String[] elements = path.substring(index + 6).split("/");
if ... | 8 |
public DefaultParser(final String fileName) throws DaoException {
super();
file = DefaultParser.class.getResourceAsStream(fileName);
if (file == null) {
throw new DaoException("file not found:" + fileName);
}
} | 1 |
private void bump(int x, int y){
int[][] bumpvals = {new int[] {2,3,4,5}, new int[] {6, 7, 8, 9}, new int[] {10,11,12,13}, new int[] {14,15,16,17}, new int[] {18,19,20,21}};
for(int i = 0 ; i< bumpvals.length; i++){
for(int j : bumpvals[i]){
if(j == terrain[x][y]){
switch(i){
case 0:
bumpKey(... | 8 |
public Node execute (SearchProblemInterface problem) {
Node result = null, node, shallowestNode = null;
resetStatistics();
openlist.add(initialNode(problem));
/* Loop until openlist is empty, search is cancelled, or
* solution is found. */
while (true) {
node = openlist.poll();
if (node == null) {
r... | 8 |
public static void main(String[] args)
{
long SEED = 287848937;
int NumberOfPackets = 10 ;
//*************************
double mean = 10;//2.9;
//*************************
System.out.println("Packets arrival distributions: ");
//for packet... | 2 |
public void createEmpire()
{
beginGame();
properEmpire();
initializeTime();
EmpireDrawer.createDrawableEmpire();
SoundsOfEmpire.playBackgroundMusic();
createBarbarianMotherfuckers();
while(true)
{
if(Empire.getInstance().SETTLEMENTS.size() >0)
{
}
else... | 3 |
public int threeSumClosest(int[] num, int target) {
Arrays.sort(num);
int n = num.length;
if(n < 3) {
int sum = 0;
for(int i : num) {
sum+=i;
}
return sum;
}
int closest = 0;
for(int i=0; i<3; i++){
... | 8 |
private void seleccionarArchivos() {
int resultado = selectorArchivo.showOpenDialog(this);
if (resultado == JFileChooser.CANCEL_OPTION)
return;
File archivo = selectorArchivo.getSelectedFile();
if (archivo.isDirectory())
explorador = new ExploradorRecursivoArchivos(EXTENSIONES_TODAS);
else {
// Si es... | 8 |
public static <E extends Comparable<? super E>> Node<E> partitionList(Node<E> head, E value) {
Node<E> oh = null;
Node<E> ot = null;
Node<E> h = null;
Node<E> t = null;
Node<E> curr = head;
while (curr != null) {
if (curr.data.compareTo(value) < 0) {
... | 6 |
public Usuario Logar(String Email, String Senha) throws SQLException, excecaoLogin {
Usuario userLogado = new Usuario();
LoginDAO LoginDAO = new LoginDAO();
userLogado = LoginDAO.selectLogin(Email, Senha);
if (userLogado == null) {
throw new excecaoLogin();
} else... | 1 |
private static int partition(int[] arr, int left, int right) {
int pivot = arr[left]; // any number
while (left < right) {
while (left < right && arr[right] > pivot) {
right--;
}
if (left < right) {
arr[left++] = arr[right];
}
while (left < right && arr[left] <= pivot) {
left++;
}
i... | 7 |
@Override
public Position getNextPosition() {
if(reader == null) {
if(super.getParamString().equals("")) {
reader = PositionFileIO.getPositionFileReader(null);
} else {
reader = PositionFileIO.getPositionFileReader(super.getParamString());
}
}
return PositionFileIO.getNextPosition(reader);
} | 2 |
public boolean matches( Class<?> clazz )
{
return this.a.matches( clazz ) && this.b.matches( clazz );
} | 2 |
@Override
public Object invoke(final Object proxy, final Method method,
final Object[] args) throws Throwable {
if (IOHandler.this.master.isInterrupted()
&& !method.equals(this.interruptMethod)) {
if (Thread.currentThread() != IOHandler.this.master) {
throw new InterruptedException();
... | 4 |
private void botonEliminarEliminarProductoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_botonEliminarEliminarProductoActionPerformed
// TODO add your handling code here:
Producto p = controlador.buscarProducto(txtCodigoEliminarProducto.getText());
if (p != null) {
... | 4 |
public static int countOccurrencesOf(String str, String sub) {
if (str == null || sub == null || str.length() == 0 || sub.length() == 0) {
return 0;
}
int count = 0;
int pos = 0;
int idx;
while ((idx = str.indexOf(sub, pos)) != -1) {
++count;
pos = idx + su... | 5 |
private void isGameStable() {
if (play.getGameStatus().equals(GameResult.GameStable)) engine.startDay();
if (play.getGameStatus().equals(GameResult.MafiaWins)) engine.endGame(GameResult.MafiaWins);
if (play.getGameStatus().equals(GameResult.VillagerWins)) engine.endGame(GameResult.VillagerWins);... | 3 |
@Override
protected boolean xhas_in ()
{
// We may already have a message pre-fetched.
if (prefetched)
return true;
// Try to read the next message to the pre-fetch buffer.
prefetched_msg = xxrecv (ZMQ.ZMQ_DONTWAIT);
if (prefetched_msg == null && ZError.is(... | 3 |
public int getInt(String key) throws JSONException {
Object object = this.get(key);
try {
return object instanceof Number ? ((Number) object).intValue()
: Integer.parseInt((String) object);
} catch (Exception e) {
throw new JSONException("JSONObject[" ... | 2 |
public synchronized boolean use(String openerSQL)
{
if((!inUse)&&(ready())&&(!isProbablyDead()))
{
lastError=null;
try
{
myPreparedStatement=null;
sqlserver=true;
myStatement=myConnection.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_READ_ONLY);
}
catch(final SQLExce... | 8 |
public void connect() {
try {
Connection c = DriverManager.getConnection(
"jdbc:hsqldb:file:C:\\Users\\school\\Ninak+katen\\repo\\sytossCinemaTraining\\cinemaBom\\cinema.db;ifexists=true",
"SA",
"");
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printS... | 1 |
public void debugOutput(String filePrefix) {
File topicFolder = new File(filePrefix + "topicAssignment");
if (!topicFolder.exists()) {
System.out.println("creating directory" + topicFolder);
topicFolder.mkdir();
}
File childTopKStnFolder = new File(filePrefix + "topKStn");
if (!childTopKStnFolder.exi... | 6 |
private static final InetAddress getLoopBackAddress() {
try {
return InetAddress.getByName(null);
} catch (UnknownHostException uhe) {
// This can't occur, as the loopback address is always valid.
Log.error(uhe);
return null;
}
} | 1 |
public static boolean isValidPresenceValue(int presence)
{
switch(presence) {
case AWAY:
case ONLINE:
case HIDEN:
case BUSY:
case ROBOT:
return true;
default:
return false;
}
} | 5 |
@Test
public void TestOptions() {
ArgSet a1 = new ArgSet("nooption -o --option -op -- - -");
assertTrue(a1.hasArg());
assertFalse(a1.hasAbbArg());
assertFalse(a1.hasOptionArg());
a1.pop();
assertFalse(a1.hasOptionArg());
assertTrue(a1.hasAbbArg());
assertTrue(a1.fetchAbbr().equals('o'));
assertTrue(a... | 0 |
private void initFrames(CtClass clazz, MethodInfo minfo) throws BadBytecode {
if (frames == null) {
frames = ((new Analyzer())).analyze(clazz, minfo);
offset = 0; // start tracking changes
}
} | 1 |
public ListIterator listIterator(final int startIndex) {
if (startIndex < 0 || startIndex > instructionCount)
throw new IllegalArgumentException();
return new ListIterator() {
Instruction instr = get0(startIndex);
Instruction toRemove = null;
int index = startIndex;
public boolean hasNext() {... | 8 |
@Override
protected void paintComponent(Graphics g) {
super.paintComponent(g);
Graphics2D g2 = (Graphics2D) g;
g2.setColor(Color.WHITE);
Rectangle2D.Double background = new Rectangle2D.Double(0, 0, Main.WINDOW_SIZE.width, Main.WINDOW_SIZE.height);
g2.fill(background);
g2.draw(background);
for (int ... | 4 |
private void nodeId(String s,int t) {
nextToken("error occurred in node_id");
if (m_st.ttype == '}') {
//creates a node if t is zero
if (t == 0) {
m_nodes.addElement(new InfoObject(s));
}
m_st.pushBack();
}
else if (m_st.ttype == '-') {
nextToken("error occurred chec... | 8 |
public PDALambdaTransitionChecker() {
super();
} | 0 |
protected static List<Block> mergeBlocks(final List<Block> blocks,
final List<PartitioningMath.Partition> partitions,
final Set<LinkDigest> survivors) {
final List<Block> merged = new ArrayList<Block>();
for (Parti... | 5 |
public void setCars(List<Car> cars) {
this.cars = cars;
} | 0 |
private static boolean processArgs(Option option) throws IOException, InterruptedException {
if (option.isDecodeurl() == false && option.getNbThreads() > 0 && option.isCheckOnly() == false
&& OptionFlags.getInstance().isMetadata() == false) {
return multithread(option);
}
for (String s : option.getResult()... | 9 |
public void close(boolean fuse) {
PluginVars.commu_mode.remove(this.editing);
this.editing.closeInventory();
if(fuse) {
if(!this.editing.isOnline()) {
this.returnCards();
return;
} else if(!this.receiver.isOnline()) {
this.editing.sendMessage("Player " + this.receiver.getDisplayName() + ChatColo... | 7 |
public int nombreKamonInitial(int nbjoueur){
int nbkamons = 0;
if(nbjoueur == 2){
nbkamons = 12;
}
if(nbjoueur == 3){
nbkamons = 10;
}
if(nbjoueur == 4){
nbkamons = 8;
}
return nbkamons;
} | 3 |
private ArrayList<String> getclashedModules(String name) {
// String part is module ID that it's clashed with, integer is how many
// students take that module.
try{
openDatabase();
}catch(Exception e){}
String query = "SELECT name FROM t8005t2 .modules WHERE ID IN (SELECT ForeignID FROM t8005t2 .cla... | 4 |
private static BitVector algoritam2(SATFormula formula) {
BitVector vector = new BitVector(formula.getNumberOfVariables());
for (int i = 0; i < NUMBER_OF_ITERATIONS; i++) {
SATFormulaStats vstat = new SATFormulaStats(formula);
vstat.setAssignment(vector, true);
if (vstat.isSatisfied()) {
System.out.pri... | 8 |
public void setBedCount(int bedCount) throws CarriageException {
if (bedCount < 0) {
throw new CarriageException("Beds count is under zero");
}
this.bedCount = bedCount;
} | 1 |
public static boolean isExist(int number, int counter){
int x = 0;
while(x < counter){
if(number == randlist[x]){
return false;
}
x++;
}
return true;
} | 2 |
public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args){
if (GuildUtils.czyGraczMaGildie(sender.getName()) == true) {
if (GuildUtils.czyGraczJestOwnerem(sender.getName(), GuildUtils.dajGildieGracza(sender.getName())) == false) {
if (args.length == 0) {
sender.sendMessage(C... | 7 |
public static int generateResult(Bean beanobj) throws NullPointerException, SQLException {
int total=0;
try {
con = DBConnection.getConnection();
//String query1 = "select question.answer,testresult.capturedanswer from question,testresult,test where test.testid='"+beanobj.getTestid()+"'and test.questionid=q... | 3 |
@Override
public void saveTroubleTicket(TroubleTicket troubleticket)
{
int ID = troubleticket.getID();
String userName = troubleticket.getUserName();
String callerName = troubleticket.getCallerName();
String description = troubleticket.getDescription();
String dateTime = troubleticket.getDateTime(... | 5 |
private void addVariable(String variable) {
myVariables.add(variable);
} | 0 |
public static void main(String[] args){ //the best input in the command line is : 1440 900 filename 6 3.75
Thread main = Thread.currentThread();
System.out.println(main);
if(args.length!=6&&args.length!=5&&args.length!=3&&args.length!=0&&args.length!=2){
System.err.println("i need either three or five or ... | 9 |
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.