text stringlengths 14 410k | label int32 0 9 |
|---|---|
public void setjCheckBoxQuit(JCheckBox jCheckBoxQuit) {
this.jCheckBoxQuit = jCheckBoxQuit;
} | 0 |
@Override
public byte[] getPayload() throws IOException {
byte[] payload=null;
try {
payload = reload();
} catch (FileNotFoundException ex) {
this.log(Level.WARNING,"file not found retrieving payload "+ex.toString());
}
return payload;
} | 1 |
public void setFullScreen(DisplayMode dm, JFrame window){ //Display mode: 4 param 2 resolution (X Y), bit depth, refresh rate
window.setUndecorated(true); //titlebars scrollbars
window.setResizable(false);
vc.setFullScreenWindow(window);
//check
if(dm != null && vc.isDisplayChan... | 3 |
@Override
public int filterRGB(int x, int y, int rgb) {
return (rgb & 0xff000000) | amount;
} | 0 |
private void decodeHeader(BufferedReader in, Properties pre, Properties parms, Properties header)
throws InterruptedException
{
try {
// Read the request line
String inLine = in.readLine();
if (inLine == null) return;
StringTokenizer st = new StringTokenizer( inLine );
if ( !st.hasMoreToken... | 9 |
public static void SQLencrypted (String host, String port, String db, String user, char [] pw) {
try {
String newPW = String.valueOf(pw);
// See also Encrypting with DES Using a Pass Phrase.
SecretKeyFactory keyFactory = SecretKeyFactor... | 1 |
private int handleCC(String value,
DoubleMetaphoneResult result,
int index) {
if (contains(value, index + 2, 1, "I", "E", "H") &&
!contains(value, index + 2, 2, "HU")) {
//-- "bellocchio" but not "bacchus" --//
if ((index =... | 5 |
public Neuron getOutputNeuron() {
return outputNeuron;
} | 0 |
public void mouseClicked(MouseEvent me) {
Point cell = me.getPoint();
if (me.getClickCount() == 1) {
int col = tabel.columnAtPoint(cell);
int row = tabel.rowAtPoint(cell);
if (col == 4) {
CounterParty counterParty = (CounterParty) tabel.getValueAt(row, col);
if (counterParty == null) {
... | 7 |
@Override
public Object invoke(Context context,List<Object> arguments) {
context = context.subContext();
int nArgs = Math.min(arguments.size(), variables.size());
for (int i=0;i<nArgs;i++){
context.setVariable(variables.get(i), arguments.get(i));
}
for (Statement statement: statements){
sta... | 2 |
@Override
protected void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
HttpSession session = request.getSession();
PrintWriter out = response.getWriter();
String destino = null;
ArrayList order = new ArrayList();
... | 9 |
public void testNodeRemoval2b() {
setTree(new TreeNode("dummy"));
TreeNode root = new TreeNode("root", 1);
TreeNode leaf = new TreeNode("leaf");
root.setBranch(new TreeNode[]{ leaf });
Map tree = Collections.synchronizedMap(new HashMap());
tree.put(root, new TreeNode[]{ l... | 7 |
private void appendSource(int position) {
final int limit = 4;
int start;
final int skip = position - limit + 1;
if (skip <= 0) {
start = 0;
} else {
if (skip == 1) {
htmlStrings.add("... (skipping 1 line) ...");
plainStrings.add("... (skipping 1 line) ...");
} else {
htmlStrings.add("...... | 8 |
public void updateLoggers() {
log.trace("Syncing up JDK logger levels from Log4j");
final Map<Logger, java.util.logging.Logger> loggerMap = this.loggerMap;
final LevelMapper levelMapper = this.levelMapper;
loggerMap.clear();
final Logger rootLogger = Logger.getRootLogger();
... | 7 |
@SuppressWarnings("static-access")
public static CommandLine createOptions(String[] args)
{
CommandLine cmd=null;
//create the options
Options options = new Options();
options.addOption("h", "help", false, "prints the help content");
options.addOption(OptionBuilder.withArgName("json-file").hasArg().withDesc... | 4 |
public static void mult( RowD1Matrix64F a, D1Matrix64F b, D1Matrix64F c)
{
if( c.numCols != 1 ) {
throw new MatrixDimensionException("C is not a column vector");
} else if( c.numRows != a.numRows ) {
throw new MatrixDimensionException("C is not the expected length");
... | 8 |
public static boolean isDinheiro(String valor) {
final String NUMEROS = "0123456789.";
for (int i = 0; i < valor.length(); i++) {
char caracter = valor.charAt(i);
if (NUMEROS.indexOf(caracter) == -1) {
return false;
}
}
return true;
... | 2 |
@Override
public boolean execute() {
Boolean val = true;
try {
this.document.loadFromFile(filePath);
} catch (Exception ex) {
ex.printStackTrace();
val = false;
}
return val;
} | 1 |
public final void setDefaultAction(Action a) {
if(a == null)
defaultAction = unknownCommandAction;
else
defaultAction = a;
} | 1 |
public void run(Graphics g){
if(!closed){
g.drawImage(img, x,y,x+(3*8), y+(3*8), 0, 0, 3, 3, null);
g.drawImage(img, x,y+(3*8), x+(3*8), y+h-(3*8), 0, 3, 3, 6, null);
g.drawImage(img, x,y+h-(3*8), x+(3*8), y+h, 0, 6, 3, 9, null);
g.drawImage(img, x+3*8,y,x+w-(3*8), y+(3*8), 3, 0, 6, 3, null);
g.drawIma... | 5 |
private JSONArray readArray(boolean stringy) throws JSONException {
JSONArray jsonarray = new JSONArray();
jsonarray.put(stringy ? readString() : readValue());
while (true) {
if (probe) {
log("\n");
}
if (!bit()) {
if (!bit()) {... | 7 |
synchronized public void start(int number_of_threads){
// start the number of threads concurrently that have been given to the initial start
if(_recordings.size() > 0){
// check that the recordings to download is larger than the number of threads to initial start with
// if it is smaller then there is n... | 6 |
public long read2bytes() throws IOException {
long b0 = read();
long b1 = read();
if (le)
return b0 | (b1 << 8);
else
return b1 | (b0 << 8);
} | 1 |
public ScoreBoardCon() {
scores = new ArrayList<Score>();
// Sets the path to the users current working directory/save/highscores.save
fs = System.getProperty("file.separator");
path = Paths.get(System.getProperty("user.dir") + fs + "save" + fs + "highscores.save");
File file = new File(path.toString());
... | 4 |
@Override
public Exam create(Exam toCreate) {
try (Connection con = getConnection();
PreparedStatement insertExam = con.prepareStatement(queryInsertExam, new String[]{columnExamId});
PreparedStatement insertQuestion = con.prepareStatement(queryInsertQuestion, new String[]{columnQu... | 5 |
public BodyPart getBodypart(){
return bodypart;
} | 0 |
public static Field parseField(String raw) {
if (Strings.isEmpty(raw) || !raw.contains(": ")) {
return null;
}
Builder fieldBuilder = new Builder();
String[] partArray = raw.split(":");
// I originally used a For Each, but that requires hacky access to the internal ... | 5 |
public void intersection(SFormsFastMapDirect map) {
for (int i = 2; i >= 0; i--) {
FastSparseSet<Integer>[] lstOwn = elements[i];
if (lstOwn.length == 0) {
continue;
}
FastSparseSet<Integer>[] lstExtern = map.elements[i];
int[] arrnext = next[i];
int pointer = 0;
... | 8 |
private void preciomedicamentosFieldKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_preciomedicamentosFieldKeyTyped
// TODO add your handling code here:
if (!Character.isDigit(evt.getKeyChar()) && evt.getKeyChar() !='.' && !Character.isISOControl(evt.getKeyChar()))
{
... | 4 |
public InfoNode Add(int key, String value, Node node){
if(node instanceof LeafNode){
if(((LeafNode) node).size < BPlusTreeIntToString60.maxDegree + 1){
node.add(key, value);
return null;
}
else{
return SplitLeaf(key,value,node);
}
}
if(node instanceof InternalNode){
for(int i = 1; i <= ... | 7 |
private String DELETE_Request(String url, String url_params) {
StringBuffer response;
String json_data = "";
HttpsURLConnection con = null;
try {
// url = "https://selfsolve.apple.com/wcResults.do";
// url_params = "sn=C02G8416DRJM&cn=&locale=&caller=&num=12345";
// URL obj = new URL(url);
// con =... | 6 |
public void keyReleased(KeyEvent e)
{
int code = e.getKeyCode();
if(code == P)
{
keyP = false;
}
if(code == R1 || code == R2)
{
rightKey = false;
}
if (code == L1 || code == L2)
{
leftKey = false;
... | 7 |
public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
Player player = null;
if (sender instanceof Player) {
player = (Player) sender;
}
String PlayerName;
if(args.length != 2){
sender.sendMessage("/addowner <ChannelName> <PlayerName>");
return... | 9 |
public static Pair<String> minmax(String[] a)
{
if (a == null || a.length == 0) return null;
String min = a[0];
String max = a[0];
for (int i = 1; i < a.length; i++)
{
if (min.compareTo(a[i]) > 0) min = a[i];
if (max.compareTo(a[i]) < 0) max = a[i];
}
retur... | 5 |
public String getChargeTermid() {
return ChargeTermid;
} | 0 |
protected boolean renewPoints() {
int points = ctx.summoning.points();
for (GameObject obelisk : ctx.objects.select().id(OBELISK).within(20).first()) {
if (ctx.camera.prepare(obelisk) && obelisk.interact("Renew")) {
Timer t = new Timer(10000);
while (t.running()) {
if (ctx.players.local().inMotion(... | 7 |
public void setEmailType(String emailType) {
this.emailType = emailType;
} | 0 |
@Override
public boolean tick(Tickable ticking, int tickID)
{
if(!super.tick(ticking, tickID))
return false;
if(ticking instanceof MOB)
{
final MOB mob=(MOB)ticking;
if((mob.amFollowing()==null)||(mob.amFollowing().isMonster())||(!CMLib.flags().isInTheGame(mob.amFollowing(), true)))
{
if(mob.ge... | 7 |
public static Hashtable<Integer, Double> GrowthContains(int start, int range, int averageCount)
{
Random rnd = new Random();
Hashtable<Integer, Double> NTable = new Hashtable<Integer, Double>();
//Go through the range
for (int n = start; n < range+1; n+=500)
{
int warm = 0;
while (warm < 1... | 4 |
public boolean moveActorIfPossible(Actor actor, GridPoint destination) {
int x = destination.getColumn();
int y = destination.getRow();
if (y < 0 || y >= this.height || x < 0 || x >= this.width) {
return false;
}
Tile currentTile = this.tiles[y][x];
if (currentTile.isImpassable()) {
return false;
}
... | 6 |
public Component getTableCellRendererComponent
(JTable table, Object value, boolean selected, boolean focused, int row, int column)
{
setEnabled(table == null || table.isEnabled());
if(column==0) {
setHorizontalAlignment(SwingConstants.CENTER);
... | 5 |
public Map<String,String> parseArguments(String[] argv) {
Map<String, String> optionsValueMap = new HashMap<String, String>();
fileNameArguments = new ArrayList<String>();
for (int i = 0; i < argv.length; i++) { // Cannot use foreach, need i
Debug.println("getopt", "parseArg: i=" + i + ": arg " + argv[i]);
... | 3 |
@Override
public void KeybindTouched(KeybindEvent e) {
if(e.getKeybind().equals(Keybind.CONFIRM) && e.getKeybind().clicked()) {
if(textFill < getLength()) {
textFill = getLength();
setSize(getWidth((int) textFill + 1), getHeight((int) textFill + 1));
removeTimeListener(timeListener);
}... | 3 |
public int[] oneTrainIn(){
/*if(eventIndex>numF1){
//System.out.println("!!!Error @ an unexperienced event RECORDED BY SEQUENCE LEARNER!!!");
return null;
}
curSeqWeight.add(new Double(tho));
curSeq.add(new Integer(eventIndex));
tho-=v;*/
... | 9 |
public String getTargetTypeName(int targetType)
{
Integer targetTypeKey = getTargetTypeKey(targetType);
if (null == targetTypeKey)
{
return "UNKNOWN TYPE 0x" + Integer.toHexString(targetType);
}
switch(targetTypeKey.intValue())
{
case TARGET_T... | 7 |
public AnimationData(int frameCount, long frameDelay, float initialX, float initialY, float frameW, float frameH) {
this.frames = new ArrayList<FrameData>();
for(int i = 0; i < frameCount; i++) {
frames.add(new FrameData(initialX+i*frameW, initialY, frameW, frameH));
}
... | 1 |
private void setModDownloads() {
String downloadModList = util.getModDownloads();
dlModList = downloadModList.split(";");
con.log("Log","Downloadable mods found... " + dlModList.length);
lblModDlCounter.setText("Downloadable mod Count: " + dlModList.length);
if(tglbtnNewModsFirst.isSelected()){
for(int ... | 3 |
@Id
@GenericGenerator(name = "generator", strategy = "increment")
@GeneratedValue(generator = "generator")
@Column(name = "person_id")
public int getPersonId() {
return personId;
} | 0 |
public int turn(Turn.direction dir) {
switch (dir) {
case LEFT:
return (this.direction + 5) % 6;
case RIGHT:
return (this.direction + 1) % 6;
default:
return -1;
}
} | 2 |
public void setPoints() {
if (x2 - x > sizeX * cspc2 && this == sim.getDragElm()) {
setSize(2);
}
int hs = cspc;
int x0 = x + cspc2;
int y0 = y;
int xr = x0 - cspc;
int yr = y0 - cspc;
int xs = sizeX * cspc2;
int ys = sizeY * cspc2;
... | 7 |
public void generatePif(List<pif> p, String filename) {
FileWriter outputStream = null;
try {
outputStream = new FileWriter(filename);
for (pif f : p) {
outputStream.write(f.code + " " + f.positionST + " ("
+ f.token + ")\n");
}
} catch (IOException e) {
e.printStackTrace();
}
tr... | 3 |
boolean isSystemObjectTypeObjectSetUsesDifferent(SystemObjectTypeProperties property, SystemObjectType systemObjectType) {
final NonMutableSet nonMutableSet = systemObjectType.getNonMutableSet("Mengen");
final List<SystemObject> directObjectSetUses = nonMutableSet.getElementsInVersion(systemObjectType.getConfigurat... | 7 |
public static List<Integer> maxProfitPoint(int[] prices, int a, int b) {
List<Integer> res = new ArrayList<Integer>();
if (a == b) {res.add(a); res.add(a); res.add(0);return res;}
int profit = 0;
int min = a;
int minp = a, maxp = a;
for(int i = a; i < b; i++) {
if (pro... | 4 |
private void addListeners()
{
newItem.setMnemonic(KeyEvent.VK_N);
newItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_N, ActionEvent.CTRL_MASK));
newItem.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
{
createFrame();
}
});
closeItem.setMnemonic... | 3 |
private void doExecuteScript(final Resource scriptResource) {
if (scriptResource == null || !scriptResource.exists())
return;
TransactionTemplate transactionTemplate = new TransactionTemplate(new DataSourceTransactionManager(dataSource));
transactionTemplate.execute(new TransactionCallback() {
@SuppressWar... | 8 |
private void processDeleteMaster(Sim_event ev)
{
if (ev == null) {
return;
}
Object[] obj = (Object[]) ev.get_data();
if (obj == null)
{
System.out.println(super.get_name() +
".processDeleteMaster(): master file name is null");
... | 5 |
@Override
public void execute(CommandSender sender, String[] args) {
if (!sender.hasPermission("bungeeutils.admin")) {
sender.sendMessage(new ComponentBuilder("").append(plugin.prefix + plugin.messages.get(EnumMessage.NOPERM)).create());
return;
}
if (args.length == ... | 5 |
public String[] getArgs(String[] args)
{
String[] a = new String[args.length - 1];
System.arraycopy(args, 1, a, 0, a.length);
return a;
} | 0 |
public UInt64 readUInt64() {
byte[] bytes = new byte[8];
for(int i = 0; i < 8; i++) {
try {
bytes[i] = this.readByte();
} catch (IOException e) {
Client.logger.Log(e);
}
}
UInt64 value = new UInt64((byte)0);
try {
value = new UInt64(bytes);
} catch (InvalidUIntException e) {
Client... | 3 |
public void testWithFieldAdded2() {
Partial test = createHourMinPartial();
try {
test.withFieldAdded(null, 0);
fail();
} catch (IllegalArgumentException ex) {}
check(test, 10, 20);
} | 1 |
private boolean isNotReady()
{
return closed || !initialized || listener == null;
} | 2 |
public ArrayList<Rod> getMaximumRevenueRods(int totalLength, ArrayList<Rod> rodList) {
rods = new ArrayList<Rod>(rodList);
// sort rods by price length ratio
rods = RodCuttingCommon.getInstance().sortByPriceLengthRatio(rods);
// greedy add rods until sum of selected rods length not > total length
int curren... | 2 |
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
if(this.jTextField1.getText().isEmpty()){
Error np = new Error(this,true);
np.ready("Debe ingresar su nombre de usuario");
np.setVisible(true);
}
else{
... | 2 |
public static void handleEpgQueryReply(HTSMsg msg, HTSPClient client) {
Collection<String> requiredFields = Arrays.asList(new String[]{"query"});
if (msg.keySet().containsAll(requiredFields)){
//TODO
} else if (msg.get("error") != null){
//TODO
} else{
System.out.println("Faulty reply");
}
} | 2 |
public static String secondsToMinutes(int time) {
if (time < 0)
return null;
int minutes = (time / 60) % 60;
String minutesStr = (minutes < 10 ? "0" : "") + minutes;
return new String(minutesStr);
} | 2 |
@EventHandler
public void WitherJump(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.getZombieConfig().getDouble("Wither.Jump.Dodge... | 7 |
public static MyUnits unmarshal(String filepath)
{
MyUnits lengthUnits = null;
try
{
SchemaFactory sf = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
Schema schema = sf.newSchema(new File(Launcher.SCHEMA_LOC+Launcher.SCHEMA1_NAME));
lengthUnits = (MyUnits)Factory.loadInstance(new File... | 3 |
@SuppressWarnings("incomplete-switch")
@Override
public void fkActionEvent(FkActionEvent event) {
//System.out.println( "Event data:"+ event.data );
MessageBox dialog;
Boolean closeSelf=false;
switch(event.type)
{
case ACTION_ABORTED:
txtBUSYMSG.setText(Messages.NewAccountDialog_55);
dialog = new... | 8 |
@Override
protected void toXMLImpl(XMLStreamWriter out, Player player,
boolean showAll, boolean toSavedGame)
throws XMLStreamException {
// Start element:
out.writeStartElement(getXMLElementTagName());
// Add attributes:
out.writeAttribute(ID_ATT... | 6 |
protected EToolsSearchResponse handleResponse(HttpResponse response, EToolsSearchResponse value, Context context) throws IOException {
if (response.getStatusLine().getStatusCode() != 200)
throw new IOException("status is not OK");
Document doc;
{
InputStream in = response.getEntity().getContent();
doc = ... | 8 |
public String listarSeriales() {
String Recorrer_seriales = "";
try {
ResultSet list_SER = ele.consultarSeriales(datos_elemento);
String colorEstado = "";
String iconoEstado = "";
String nomFuncion = "";
while (list_SER.next()) {
... | 5 |
public static Document getDocumentByQuery(String query){
String youdao = "fanyi.youdao.com";
HttpClient httpclient = new DefaultHttpClient();
httpclient.getParams().setParameter(ClientPNames.ALLOW_CIRCULAR_REDIRECTS, false);
HttpHost targetHost = new HttpHost(youdao);
query = query.replace(" ", "%20");
Http... | 4 |
public boolean getBoolean(int index) throws JSONException {
Object object = this.get(index);
if (object.equals(Boolean.FALSE)
|| (object instanceof String && ((String) object)
.equalsIgnoreCase("false"))) {
return false;
} else if (object.equal... | 6 |
public ResultSet validate(String email, String password) {
ResultSet res = null;
try {
// hash password with SHA1 algorithm
String hashPass = makeSHA1Hash(password);
String query = "SELECT * FROM customer where email=? and password=?";
stmnt = CONN.prepareStatement(query);
// Bind Parameters
... | 2 |
public synchronized int baseNumberPreMRna(int pos) {
int count = 0;
for (Exon eint : sortedStrand()) {
if (eint.intersects(pos)) {
// Intersect this exon? Calculate the number of bases from the beginning
int dist = 0;
if (isStrandPlus()) dist = pos - eint.getStart();
else dist = eint.getEnd() - p... | 4 |
public void test_getValue_long() {
assertEquals(0, iField.getValue(0L));
assertEquals(12345678 / 90, iField.getValue(12345678L));
assertEquals(-1234 / 90, iField.getValue(-1234L));
assertEquals(INTEGER_MAX / 90, iField.getValue(LONG_INTEGER_MAX));
try {
iField.getValu... | 1 |
public static String replace(String in, String match, String replacement) {
// check for null refs
if (in == null || match == null || replacement == null) {
return in;
}
StringBuffer out = new StringBuffer();
int matchLength = match.length();
int inLength = in.length();
for (int i = 0; i < inL... | 6 |
private void updateHC() {
if (this.hoveredClassroom != null) {
this.name.setText(this.hoveredClassroom.getName());
this.type.setText(this.hoveredClassroom.getType().getShortName() + " (" + this.hoveredClassroom.getType().getName() + ")");
this.eff.setText(((Integer)(this.hoveredClassroom.getEffectif())).toSt... | 1 |
public TLValue resolve(String var) {
TLValue value = variables.get(var);
if(value != null) {
// The variable resides in this scope
return value;
}
else if(!isGlobalScope()) {
// Let the parent scope look for the variable
return parent.resolve(var);
}
else {
// Unkno... | 2 |
public void doit( String finp, String sheetnm )
{
WorkBookHandle book = new WorkBookHandle( finp );
WorkSheetHandle sheet = null;
try
{
sheet = book.getWorkSheet( sheetnm );
WorkSheetHandle[] handles = book.getWorkSheets();
ChartHandle[] charts = book.getCharts();
for( int i = 0; i < charts.length;... | 8 |
public static void main(String[] args) throws IOException, ClassNotFoundException {
NativeLibrary.addSearchPath(RuntimeUtil.getLibVlcLibraryName(),vlcLibraryPath);
Native.loadLibrary(RuntimeUtil.getLibVlcLibraryName(), LibVlc.class);
player = new EmbeddedAudioPlayer(vlcLibraryPath);
... | 2 |
@RequestMapping("queryDeptById")
@ResponseBody
public SystemResponse<Department> queryDeptById(HttpServletRequest request, HttpServletResponse response)
{
SystemResponse<Department> result = new SystemResponse<Department>();
String deptId = request.getParameter("deptId");
String isCacheString = request.g... | 4 |
public void reload() {
if (this.maxAmmo > 0) {
if (this.currentAmmo < this.maxCurrentAmmo) {
if (this.maxCurrentAmmo - this.currentAmmo > this.maxAmmo) {
this.currentAmmo += this.maxAmmo;
this.decreaseAmmo(this.maxAmmo);
SoundEffect.GUNRELOAD.play();
if (this.currentAmmo > 0) this.canShot ... | 6 |
public void store() {
// needed to create a store() method different from the one in
// Properties class to store configurations, in order to not lose
// commented out lines from config file
BufferedReader br = null;
StringBuilder confString = new StringBuilder();
try {
br = new BufferedReader(new FileR... | 9 |
protected void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException
{
PrintWriter out = response.getWriter();
response.setContentType("text/plain");
String date = request.getParameter("date"); // format must be yyyy-mm-dd
String state = reques... | 2 |
private void initialize() {
this.setBounds(100, 100, 800, 600);
sourceImagePanel = new JPanel();
sourceImagePanel.setBounds(10, 30, 293, 447);
getContentPane().add(sourceImagePanel);
imageSourceLabel = new JLabel("");
sourceImagePanel.add(imageSourceLabel);
imageSourceLabel.setIcon(new ImageIcon(imageRe... | 1 |
public static boolean comienza(String baseDeDatos, String entrada) {
/* ENTRADA DE DATOS */
String[] cadena;
StringTokenizer tokenizerBD = new StringTokenizer(baseDeDatos, " ");
int cantTokensBD = tokenizerBD.countTokens();
StringTokenizer tokenizerEntrada = new StringTokenizer(entrada, " ");
int cantTokens... | 9 |
public void initialise(World world) throws PatternFormatException
{
String[] cellParts = cells.split(" ");
for (int i=0;i<cellParts.length;i++)
{
char[] currCells = cellParts[i].toCharArray();
for (int j=0;j<currCells.length;j++)
{
if (currCells[j] != '1' && currCells[j] != '0') ... | 5 |
public static byte[] TripleDES_Decrypt(byte[] data,byte[][] keys)
{
int i;
byte[] tmp = new byte[data.length];
byte[] bloc = new byte[8];
K = generateSubKeys(keys[0]);
K1 = generateSubKeys(keys[1]);
K2 = generateSubKeys(keys[2]);
for (i = 0; i < data.length; i++) {
if (i > 0 && i % 8 == 0) {
blo... | 4 |
@Override
public void deserialize(Buffer buf) {
memberId = buf.readInt();
if (memberId < 0)
throw new RuntimeException("Forbidden value on memberId = " + memberId + ", it doesn't respect the following condition : memberId < 0");
rank = buf.readShort();
if (rank < 0)
... | 6 |
public void visitClassType(final String name) {
if (type != TYPE_SIGNATURE || state != EMPTY) {
throw new IllegalStateException();
}
CheckMethodAdapter.checkInternalName(name, "class name");
state = CLASS_TYPE;
if (sv != null) {
sv.visitClassType(name);
}
} | 3 |
public static IBomber buildBomber(int number, int bombs, Match match, String projectFolder) throws IOException {
ProcessBuilder pb = new ProcessBuilder(projectFolder + "/run.sh", Integer.toString(number), Integer.toString(Game.PORT_NO));
Map<String, String> env = pb.environment();
env.put("PATH... | 0 |
public void runJob() {
try {
JobOperator jo = BatchRuntime.getJobOperator();
long jobId = jo.start("eod-sales", new Properties());
System.out.println("Started job: with id: " + jobId);
} catch (JobStartException ex) {
ex.printStackTrace();
}
} | 1 |
public String getDescription() {
return description;
} | 0 |
public usb.core.Device getDevice (String portId)
throws IOException
{
// hack to work with hotplugging and $DEVICE
// /proc/bus/usb/BBB/DDD names are unstable, evil !!
if (portId.startsWith("usb-@0x")) {
String wanted_busnumstr = portId.substring(7);
... | 5 |
static double dijsktra(int d,int h,double[][] mAdy){
int n=mAdy.length;double[] sol=new double[n];
boolean[] visitados=new boolean[n];
PriorityQueue<double[]> cola=new PriorityQueue<double[]>(n,new Comparator<double[]>(){
public int compare(double[] o1,double[] o2){
if(o1[0]<o2[0])return -1;
if(o1[0]>o... | 8 |
public void do_interrupt(int ID) {
System.out.println("Interrupt");
if (is_bit_set(7, 0xb)) {
switch (ID) {
// RB0 Interrupt
case 1:
if (is_bit_set(4, 0xb)) {
STACK.add(getProgrammCounter());
setProgramCounter(4);
set_Bit(1, 0xb);
}
System.out.println("RB0 Interrupt");
break;... | 9 |
@Test
public void testBadRange() throws Exception {
final Properties config = new Properties();
final String min_uptime = "2000";
final String max_uptime = "200";
config.setProperty("min_uptime", min_uptime);
config.setProperty("max_uptime", max_uptime);
final Conn... | 1 |
@Override
public boolean acceptsDraggableObject(DraggableObject object)
{
if(object instanceof DraggableObjectEntity)
{
DraggableObjectEntity fileobj = ((DraggableObjectEntity)object);
if(fileobj.uuid != null)
{
if(!fileobj.uuid.trim().equals(""))
return true;
}
}
return false;
} | 3 |
public void setSubtotalRow(String countType, int rid, double[] subtotal, HSSFWorkbook workbook, HSSFSheet sheet) {
HSSFRow row = sheet.createRow(rid);
for (int k = 0; k < 10; k++) {
try {
switch (k) {
case 3:
excelUtils.setCellValue(subtotal[0], workbook, k, row, cellStyle.cellFontBoldBorderStyle);/... | 5 |
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.