text stringlengths 14 410k | label int32 0 9 |
|---|---|
public int run(PrintWriter out, String[] args)
{
long maxNumber = Long.parseLong(args[1]);
if (maxNumber<1) return(ILLEGAL_PARAMETER);
out.println(args[0]+ ": Sequence up to " + maxNumber + " numbers");
if (maxNumber>=1) out.println(1);
if (maxNumber>=2) out.println(1);
long first = 1, secon... | 4 |
private void getHorizontalAxis() {
int y = 0, y2 = 0;
try {
y = Integer.parseInt(listVarString.get("depart1").split(":")[1]);
} catch (NumberFormatException e) {
System.err.println(" depart 1 incorrect");
}
try {
y2 = Integer.parseInt(listVarSt... | 6 |
private int calcCompability(String name1, String name2,
String surname1, String surname2){
char[] name1charArr = name1.toCharArray();
char[] name2charArr = name2.toCharArray();
char[] surname1charArr = surname1.toCharArray();
char[] surname2charArr = surname2.toCharArray();
int result = 100;... | 5 |
public boolean equals(Quaternion r) {
return x == r.getX() && y == r.getY() && z == r.getZ() && w == r.getW();
} | 3 |
static int getOffsetOfChunk(int []vsize, int[] csize, int []start)
{
int [] volume = new int [vsize.length];
int []dsize = new int [vsize.length +1];
dsize[vsize.length]=1;
volume[0]=1;
for(int i = 1; i < volume.length; i++)
{
volume[i] = volume[i-1]*vsize[i-1];
}
for(int i = vsize.length -1 ; i... | 4 |
public String toStringVisible(){
StringBuilder sb = new StringBuilder("[");
for (int i=0; i<cards.length; i++){
sb.append(exposed[i] ? cards[i] : "?");
if (i+1 != cards.length)
sb.append(", ");
}
sb.append("]");
return sb.toString();
} | 3 |
private void updateStateEntry(List<Keyword> keywords, List<String> terms, List<String> approval) {
if (keywords == null || keywords.isEmpty()) {
DialogManager.giveDialogManager().setInErrorState(true);
}
//If User has History
if (!this.getCurrentSession().getCurrentUser().getUserData().getAcceptedSuggestions... | 3 |
public void ignoreFile(final LessFileStatus lfs) {
synchronized (WATCH_LOCK) {
filesWatcher.removeFile(lfs.getFrom());
filesWatcher.removeFile(lfs.getTo());
try {
if (!fIgnore.exists())
fIgnore.createNewFile();
BufferedWriter bw = new BufferedWriter(new FileWriter(fIgnore, true));
bw.append(... | 2 |
public boolean partialMatch(String search) {
int idx = 0;
if (search.length() == 0)
return true;
while(true) {
if ((idx = name.toLowerCase().indexOf(search.toLowerCase(), idx)) != -1) {
if (idx == 0 || name.charAt(idx - 1) == ' ') {
return true;
}
else {
idx++;
continue;
... | 5 |
@EventHandler
public void BlazeStrength(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.getBlazeConfig().getDouble("Blaze.Strength.... | 6 |
protected void updateMenu(String[] comboboxEntries, final RightMenu menu) {
for (String s : comboboxEntries) {
this.rightPanelComboBox.addItem(s);
}
if ((this.rightPanelComboBox.getActionListeners() != null) && (this.rightPanelComboBox.getActionListeners().length > 0)) {
... | 3 |
@Override
public void render(int glMode) {
List<Morph> morphsToDraw = new ArrayList<>();
for (MorphType morphType : MorphType.values()) {
List<Morph> morphsByType = ship.getMorphsByType(morphType);
if (morphsByType != null) {
morphsToDraw.addAll(morphsByType);
}
}
int layer = 0;
Iterator<Morph>... | 8 |
public void getSoakingBonus() {
for (int i = 0; i < c.playerEquipment.length; i++) {
if (c.playerEquipment[i] > -1) {
for (int j = 0; j < Config.ITEM_LIMIT; j++) {
if (Server.itemHandler.ItemList[j] != null) {
if (Server.itemHandler.ItemList[j].itemId == c.playerEquipment[i]) {
for (int k = 0... | 6 |
private Message normalMessage(Stat stat) {
Message msg = new Message();
String subject = stat.getName() + ": now is in normal state";
if (stat.getStateDescription() != null) subject += " (" + stat.getStateDescription() + ")";
msg.subject(subject);
addNameValue(stat, msg);
... | 1 |
private void handleString(String x){
//tests to see if the code matches some predefined server commands
if (x.substring (0, 5).equals ("serv."))
{
if (x.equalsIgnoreCase ("serv.dc")) ... | 6 |
public void setPage(String page) {
this.page = page;
} | 0 |
public int fromDegree(Object from, boolean excludeSameVertexEdges) {
if (!excludeSameVertexEdges)
return degree(from);
int count = 0;
Object[] vertices = verticesToNeighbors.keySet().toArray();
for (int i=0; i<vertices.length; i++)
if (hasEdge(from, vertices[i]) && !vertices[i].equals(from))
coun... | 4 |
public static long determineGbPalette(long[] colors) {
long minCosts = Long.MAX_VALUE;
long minCostPalette = 0;
int minCostMethod = -1;
// Median Cut
{
long mcPalette = MedianCut.calculateGbPalette(colors);
long mcPaletteCost = ColorUtil.getCosts(colors, mcPalette);
long mcKmPalet... | 7 |
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... | 3 |
public List<Class<?>> getClassesFromJar(File file, ClassLoader classLoader)
{
final List<Class<?>> classes = new ArrayList<Class<?>>();
try
{
final JarFile jarFile = new JarFile(file);
Enumeration<JarEntry> enumeration = jarFile.entries();
while (enumerati... | 8 |
@Override
public void actionPerformed(ActionEvent e) {
// TODO Auto-generated method stub
if (e.getSource() == vp_ui.btn_entity)
{
EntityUi entity_ui = new EntityUi();
entity_ui.setVisible(true);
String prev_code = vp_ui.ta_code.getText();
if(entity_ui.entity.name!=null)prev_code += entity_ui.entity.... | 4 |
@Override
public boolean equals(Object o) {
if (this == o)
return true;
if (o == null || getClass() != o.getClass())
return false;
Position position = (Position) o;
return Objects.equal(position.getX(), this.getX()) && Objects.equal(position.getY(), this.getY... | 5 |
public InputStream downloadStream(FTPFile fromFile) throws IOException, FtpWorkflowException, FtpIOException {
PipedInputStream pis = new PipedInputStream();
class DownStreamingThread extends Thread {
FTPConnection connection;
FTPFile fromFile;
Piped... | 7 |
public void SoloLetras(JTextField a) {
a.addKeyListener(new KeyAdapter() {
public void keyTyped(KeyEvent e) {
char c = e.getKeyChar();
if (!Character.isAlphabetic(c) && !Character.isLetter(c)) {
getToolkit().beep();
e.consume();... | 2 |
public static String encode(String s, int n) {
String converted = "";
n = n%26;
int index = 0;
while(index < s.length()) {
char curChar = s.charAt(index);
if ('a' <= curChar && curChar <= '... | 9 |
public static OrderStatusType valOf(Character val) throws Exception {
if (val.equals(Process.getVal())) {
return Process;
} else if (val.equals(Finish.getVal())) {
return Finish;
} else if (val.equals(Void.getVal())) {
return Void;
}
throw new Exception("Kode tidak terdaftar");
} | 3 |
public static String getFormattedNumber(String telephoneNumber, String email) {
PhoneNumberUtil phoneUtil = PhoneNumberUtil.getInstance();
String defaultRegion = "ZZ";
if (email != null) {
defaultRegion = CountryUtil.getCountryCode(email);
}
try {
PhoneNumber numberObj = phoneUtil.parse(telephoneNumber,... | 9 |
private DataMessage searchMessage(ArrayList<DataMessage> stored,
Address source, int seqNbr) {
Iterator<DataMessage> iter = stored.iterator();
while (iter.hasNext()) {
DataMessage dataMessage = iter.next();
if (dataMessage.getSequenceNumber() == seqNbr
... | 3 |
public boolean skipPast(String to) throws JSONException {
boolean b;
char c;
int i;
int j;
int offset = 0;
int length = to.length();
char[] circle = new char[length];
/*
* First fill the circle buffer with as many characters as are in the
... | 9 |
public void windowIconified(WindowEvent e) {
System.out.println("Die Anwendung wurde maximiert...");
} | 0 |
private int updateNamn() {
int res = 0;
lblError.setVisible(false);
if (Validate.notOverSize(tfNyttNamn) && !Validate.tfEmpty(tfNyttNamn)) {
try {
DB.update("update anstalld set namn = '" + tfNyttNamn.getText() + "' where aid =" + selectedAnstalld);
re... | 3 |
public static int[][] transpose(int[][] matrix){
//preconditions
if(matrix == null)throw new IllegalArgumentException("matrix must not be null");
for(int i = 0; i < matrix.length; i++){
if(matrix.length != matrix[i].length)throw new IllegalArgumentException("matrix must be square!");
}
int[][] newMatrix... | 5 |
public boolean collide(Ball b) {
if (this == b) return false;
boolean closeEnougth = Math.abs(getPosition()-b.getPosition()) < (getRadius()+b.getRadius());
boolean approaching = getSpeed() > b.getSpeed();
if (b.getPosition() < getPosition())
approaching = getSpeed() < b.getSpeed();
retu... | 3 |
public void compExecTime() {
double newExeTime;
double newCost;
dEval = 0;
dTime = 0;
dCost = 0;
for (int i = 0; i < iClass; i++) {
newExeTime = 0;
// System.out.print("Cost[" + i + "]");
for (int j = 0; j < iSite; j++) {
if (dmAlloc[i][j] != -1) {
if (dmAlloc[i][j] < 1) {
newExeTime... | 8 |
public Fraction absolute(){
int num = getNumerator();
int denom = getDenominator();
if(num < 0) {num = getNumerator()*-1;}
if(denom < 0){denom = getDenominator()*-1;}
return new Fraction(num, denom);
} | 2 |
@SuppressWarnings("fallthrough")
public BytesRef getMax() throws IOException {
long size = size();
if (size == 0) {
// empty: only possible from a FilteredTermsEnum...
return null;
} else if (size >= 0) {
// try to seek-by-ord
try {
TermsEnum iterator = iterator();
... | 9 |
@Override
public void draw(Graphics g, int offsetX, int offsetY){
int x = tileX - offsetX;
int y = tileY - offsetY;
if (x < -2 || x > 40 || y < -2 || y > 40){
onScreen = false;
return;
}
onScreen = true;
float tX = x * 16 + Settings.CAM_X + movingValueX;
float tY = y * 16 + Settings.CAM_Y + movingV... | 5 |
public LoginAdmin validateAndConvert() throws ValidointiPoikkeus {
Validator validator = new Validator();
if(username == null || username.isEmpty()) {
System.out.println("virhe: tyhjä käyttäjätunnus");
validator.addError("username", "Käyttäjätunnus ei saa olla tyhjä");
}
if(password == null || passw... | 5 |
public static void main(String[] args) {
Integer n1 = new Integer(47);
Integer n2 = new Integer(47);
System.out.println(n1 == n2);
System.out.println(n1 != n2);
} | 0 |
@Override
protected void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
String action = request.getParameter("action");
//由context parameter取得JDBC需要的資訊
ServletContext sc = this.getServletConfig().getServletContext()... | 9 |
public ValueType getValue(int place) throws NotExistException {
Iterator<ValueType> step = new ListIterator();
if (place <= count) {
for (int i = 1; i < place; i++) {
step.remove();
}
return step.next();
} else {
throw new NotExistE... | 2 |
public void setCountry(String country) {
addressCompany.setCountry(country);
} | 0 |
public List<DoneQuestDTO> getSetDoneQuestDTO() {
return setDoneQuestDTO;
} | 0 |
@Override
public boolean equals(Object obj)
{
if(obj == null) return false;
if(obj == this) return true;
if(obj instanceof CommunicationTypeProperty) {
return type == ((CommunicationTypeProperty) obj).type;
} else {
return false;
}
} | 3 |
public void activateOptions() {
if (debug) {
System.out.println("Activate options");
}
if (buffertype.equalsIgnoreCase("autopop")) {
eventQueue = new Fifo(buffersize, Fifo.AUTOPOP);
} else if (buffertype.equalsIgnoreCase("refuse")) {
eventQueue = new Fifo(buffersize, Fifo.REFUSE);
} else {
event... | 5 |
@Override
public void handleEvent(Event event) {
switch (event.getType()) {
case "PlayerTurn":
// System.out.println("logic: player turn");
this.handlePlayerTurnEvent((PlayerTurnEvent) event);
break;
case "GameStatusUpdate":
this.handleGameStatusUpdate((GameStatusUpdateEvent) event);
break;
... | 3 |
public static void main(String... args)
{
File file = new File("./data/average.txt");
try
{
FileReader stream = new FileReader(file);
BufferedReader reader = new BufferedReader(stream);
String line;
double total = 0;
double count = 0;
int last = 0;
while ((line = reader.readLine()) != null)
... | 4 |
public int getState(Configuration configuration) {
return ((ConfigurationButton) configurationToButtonMap
.get(configuration)).state;
} | 0 |
@SuppressWarnings("unchecked")
@Override
public void actionPerformed(ActionEvent e) {
if (Toolbar.CMD_PLAY.equals(e.getActionCommand())) {
if (simState == seqFinished) {
// clear map and replay simulation
mapEntries = (Vector<MapEntry>) mapEntriesReplay.clone();
mapEntriesReplay.clear();
try {
... | 6 |
public List<Integer> largestDivisibleSubset(int[] nums) {
LinkedList<Integer> res = new LinkedList<>();
if (nums == null || nums.length == 0)
return res;
Arrays.sort(nums);
int index[] = new int[nums.length];
int len[] = new int[nums.length];
Arrays.fill(len, 1);
Arrays.fill(index, -1);
for (int i = ... | 9 |
static Method[] getDeclaredMethods(final Class clazz) {
if (System.getSecurityManager() == null)
return clazz.getDeclaredMethods();
else {
return (Method[]) AccessController
.doPrivileged(new PrivilegedAction() {
public Object run() {
... | 1 |
public void fromXML(String xml,XMLNoteImageIcon.Provider prov) throws BadDocumentException {
//System.out.println(xml);
InputSource source=new InputSource(new StringReader(xml));
if (prov!=null) { _doc.setXMLNoteImageIconProvider(prov); }
boolean ignore=_doc.getUndoManager().setIgnore(true);
try {
SAXParse... | 9 |
@Override
public void run() {
String serverAddress = SERVER_IP;
try {
Socket socket = new Socket(serverAddress, SERVER_PORT);
InputStream input = socket.getInputStream();
OutputStream output = socket.getOutputStream();
long startDate = System.current... | 3 |
public static int[] permutationByNumber(int n, long number) {
long[] fact = new long[n];
fact[0] = 1;
for (int i = 1; i < n; i++) {
fact[i] = i * fact[i - 1];
}
int[] p = new int[n];
int[] free = new int[n];
for (int i = 0; i < n; i++) {
fr... | 3 |
final private int[] getFlags( Function f ) {
int[] rtn = new int[ 0 ];
if ( f instanceof Sine || f instanceof Cosine || f instanceof Tangent ||
f instanceof Cosecant || f instanceof Secant || f instanceof Cotangent ||
f instanceof Arcsine || f instanceof Arccosine || f instanceof Arctangent ) {
rtn = n... | 9 |
private void poll() {
KeyState state=null;
do {
state=keyMapper.poll();
if (state!=KeyState.NONE) {
keyAffected(state);
}
} while (state!=KeyState.NONE);
} | 2 |
public void run()
{
boolean incr = true;
while(true)
{
if(incr)
{
if(a.nFontSize < 30)
a.nFontSize++;
else
incr = false;
}
else
{
if(a.nFontSize > 12)
a.nFontSize--;
else
incr = true;
}
a.repaint();
try
... | 2 |
private boolean checkDomination(Label l1) {
// Can't be dominated if the label is the only one
if(labels.get(l1.getNode())==null) return true;
for(Label l2 : labels.get(l1.getNode())) {
if(l1.getDistance()>=l2.getDistance() && l1.getDanger()>=l2.getDanger() && (l1.getDistance()>l2.getDistance() || l1.getDan... | 6 |
public static void main(String args[]) {
/* Set the Nimbus look and feel */
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
/* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
* For details see http://down... | 6 |
private void empty() {
for (Widget wdg = lchild; wdg != null; wdg = wdg.prev) {
if (wdg.visible && wdg instanceof Item) {
wdg.wdgmsg("drop", Coord.z);
}
}
} | 3 |
public void display(){
int tempIndex = reDrawIndex, count = 0;
do{
//Setting index to 0 when list goes out of bounds
if(tempIndex == listImages.size()){
tempIndex = 0;
}
// Setting position of next image
// Drawing next image
listImages.get(tempIndex).setPosition( (count*(s_W/5))+(... | 2 |
public static void main(String[] args){
DummyPOJO dm = new DummyPOJO();
ArrayList<Method> setters=null;
ArrayList<Method> getters=null;
try {
setters = Introspect.getSetters(Introspect.getClass(dm));
getters = Introspect.getGetters(Introspect.getClass(dm));
} catch (NoClassFoundException e1) {
... | 8 |
public String getTrainNumber() {
return this._trainNumber;
} | 0 |
@EventHandler
public void SlimeFastDigging(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.getSlimeConfig().getDouble("Slime.FastDi... | 6 |
@Override
public void mergeAuctioneerPolicy(Auctioneer A)
{
if (A == null)
return;
final DefaultAuctionPolicy base = new DefaultAuctionPolicy();
liveListPrice = base.liveListPrice;
timeListPrice = A.timedListingPrice() < 0.0 ? base.timeListPrice : A.timedListingPrice();
timeListPct = A.timedListingPct() ... | 7 |
public static ArrayList<String> convertir(String a){
ArrayList<String> expresion = new ArrayList<>();
char[] xpres= a.toCharArray();
String numero="";
for (int i = 0; i < xpres.length; i++) {
if(Character.isDigit(xpres[i])||xpres[i]=='.'){
numero=numero+xpres[i]... | 4 |
@EventHandler
public void onCommandPreEnter(PlayerCommandPreprocessEvent event) {
if(plugin.getConfig().getBoolean("EnableFakePluginList") == false) {
return;
} else {
if(event.getMessage().equalsIgnoreCase("/plugins") || event.getMessage().equalsIgnoreCase("/pl")) {
if(!event.getPlayer().hasPermission("... | 6 |
private void normalizePoint(int x, int y)
{
double normalizedCharge=0;
if (_field[x][y].getVal()>0)
{
normalizedCharge=_field[x][y].getVal()/_maxPotential;
}
else
{
normalizedCharge=_field[x][y].getVal()/Math.abs(_minPotential);
}
double magnitude=_field[x][y].getVector().getAbs();
if (magnitud... | 5 |
private static void startServer() {
logger.info("Starting stand-alone server.");
try {
final FreeColServer freeColServer;
if (FreeColDirectories.getSavegameFile() != null) {
XMLStream xs = null;
try {
// Get suggestions for "sin... | 8 |
private List<File> listFilesForFolder(final File folder) {
List<File> ret = new ArrayList<File>();
if (folder.listFiles() == null) {
if (processTrayIcon != null){
processTrayIcon.displayMessage("Connection Error Message", "Could not find folder " + folder,
TrayIcon.MessageType.ERROR);
return null;
... | 4 |
public void reduceAP(MapleClient c, byte stat, short amount) {
MapleCharacter player = c.getPlayer();
switch (stat) {
case 1: // STR
player.getStat().setStr(player.getStat().getStr() - amount);
player.updateSingleStat(MapleStat.STR, player.getStat().getStr());... | 5 |
public void addStuff()
{
this.removeAll();
this.add(name);
this.add(keywords);
this.add(attackTypeParameter1);
this.add(attackTypeParameter2);
this.add(typeLevel);
this.add(flavor);
this.add(newParam);
this.add(delParam);
for(int i = 0; i < body.toArray().length; i++)
{
BodyParam ... | 1 |
@Override
public void publish(LogRecord record)
{
if( getFormatter() == null )
setFormatter(new SimpleFormatter());
try
{
String message = getFormatter().format(record);
if( record.getLevel().intValue() >= Level.WARNING.intValue() )
{
... | 3 |
public static void cutText(OutlinerCellRendererImpl textArea, JoeTree tree, OutlineLayoutManager layout) {
Node currentNode = textArea.node;
// Abort if node is not editable
if (!currentNode.isEditable()) {
return;
}
// Copy Text
String text = textArea.getSelectedText();
if (text != null) {
j... | 4 |
private void addDb(Attributes attr) {
try {
this.bd.add(new BancoDados(attr));
/*
BancoDados tmp[] = this.bd;
bd = new BancoDados[tmp.length + 1];
System.arraycopy(tmp, 0, bd, 0, tmp.length);
bd[tmp.length] = new BancoDados(attr);
... | 1 |
public static int Ingresar() {
do {
tc = 0;
salp = 0;
System.out.println("Codigo: ");
String Cod = LeerT.Leer();
if (Cod.equals("0"))
return 0;
System.out.println("Nombre: ");
String Nombre = LeerT.Leer();
System.out.println("Fecha: ");
String Fecha = LeerT.Leer();
System.out.print... | 5 |
private void clickHexagon( int i, int j )
{
if ( PresentacioCtrl.getInstancia().consultaEstatPartida() == EstatPartida.NO_FINALITZADA &&
( PresentacioCtrl.getInstancia().esTornHuma() || !partida_en_curs ) )
{
try
{
//No ens cal comprovar si el moviment es fa o no (si retorna true o false).
Pre... | 8 |
public void setUserEnrolledCourseField(String field, String value) {
if (field.equals("id")) setId(Long.parseLong(value));
if (field.equals("fullname") && !value.equals("")) setFullName(value);
if (field.equals("shortname") && !value.equals("")) setShortName(value);
} | 5 |
public static AbstractTile getTile(int uniqueID){
if (uniqueID <= tiles.size() && tiles.get(uniqueID) != null){
return tiles.get(uniqueID);
} else {
System.out.println("Tried to access an ID not bound to a tile");
System.out.println(String.valueOf(uniqueID));
return tiles.get(0);
}
//return null;... | 2 |
public synchronized void actionPerformed(ActionEvent e) {
Object target = e.getSource();
// /#endif
if (target == startButton) {
// /#ifdef AWT10
// / startButton.disable();
// /#else
startButton.setEnabled(false);
// /#endif
decompileThread = new Thread(this);
sourcecodeArea.setText("Please... | 6 |
private void showSelectedOrder(SessionRequestContent request) {
String selected = request.getParameter(JSP_SELECT_ID);
Order currOrder = null;
if (selected != null) {
Integer idOrder = Integer.decode(selected);
if (idOrder != null) {
List<Order> list = (L... | 5 |
private final boolean cons(int i)
{ switch (b[i])
{ case 'a': case 'e': case 'i': case 'o': case 'u': return false;
case 'y': return (i==0) ? true : !cons(i-1);
default: return true;
}
} | 7 |
private void btnBuscarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnBuscarActionPerformed
if (cmbBuscaFuncionario.getSelectedItem().equals("Selecione")) {
JOptionPane.showMessageDialog(null, "Erro selecione o departamento",
"Departamento", JOptionPane.ERRO... | 2 |
public void run() {
while(true)
evenIncrement();
} | 1 |
public List<Expression> combine(Expression expression) {
List<Expression> allCombinations = new LinkedList<Expression>();
List<Expression> leftCombinations = left.combine(expression);
for ( Expression leftExpression:leftCombinations ) {
if ( operator == Operator.DIVIDE && right.eval().equals(0) )
continue... | 6 |
public void visitFieldInsn(
final int opcode,
final String owner,
final String name,
final String desc)
{
mv.visitFieldInsn(opcode, owner, name, desc);
if (constructor) {
char c = desc.charAt(0);
boolean longOrDouble = c == 'J' || c == 'D';
... | 9 |
public void addAuthHeader(int cust_id,String token)
{
Connection con = null;
PreparedStatement pstmt = null;
try {
DBconnection dbCon = new DBconnection();
Class.forName(dbCon.getJDBC_DRIVER());
con = DriverManager.getConnection(dbCon.getDATABASE_URL(),
... | 6 |
private void laboratorioperteneceFieldKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_laboratorioperteneceFieldKeyTyped
// TODO add your handling code here:
if (!Character.isLetterOrDigit(evt.getKeyChar()) && !Character.isISOControl(evt.getKeyChar()) && !Character.isWhitespace(evt.getKeyChar())... | 5 |
protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException
{
if (ServletFileUpload.isMultipartContent(req)) {
Deck deck = new Deck();
// Create a factory for disk-based file items
DiskFileItemFactory factory = new DiskFileItemFactory();
// Set factor... | 9 |
@Override
public int hashCode() {
final int prime = 31;
int result = super.hashCode();
result = prime * result + ((answere == null) ? 0 : answere.hashCode());
result = prime * result
+ ((answereInfo == null) ? 0 : answereInfo.hashCode());
result = prime * result
+ ((catagory == null) ? 0 : catagory.h... | 9 |
public synchronized int getFramePosition(int x, int y) {
if (getCorner(TOP | LEFT | CORNER).contains(x,y)) {
JShot.debug("TOP | LEFT | CORNER");
return TOP | LEFT | CORNER;
} else if (getCorner(TOP | RIGHT | CORNER).contains(x, y)) {
JShot.debug("TOP | RIGHT | CORNER");
return TOP | RIGHT | CORNER;
} ... | 8 |
private boolean syncSequenceHunt(CircularDataBuffer circBuf,WaveData waveData) {
int pos=0,b0,b1;
int f0=getSymbolFreq(circBuf,waveData,pos);
b0=getFreqBin();
// Check this first tone isn't just noise the highest bin must make up 10% of the total
if (getPercentageOfTotal()<10.0) return false;
pos=(int)sampl... | 7 |
private void addBranchElement(Document doc, Element linesElement, FileData fileData, int i, Element lineElement) {
if (fileData.getBranchData().keySet().contains(i)) {
List<BranchData> branchDatas = fileData.getBranchData().get(i);
if (lineElement == null) {
lineElement =... | 3 |
private void setHeaders(String url, PostParameter[] params, HttpURLConnection connection, boolean authenticated, String httpMethod) {
log("Request: ");
log(httpMethod + " ", url);
if (authenticated) {
if ( oauth == null) {
}
String authorization = null;
... | 4 |
@Override
public String introduceYourself() {
return "MultipleChoiceQuest";
} | 0 |
public String connect_url(String uri) {
String result = "";
try {
URL url = new URL(uri);
//File f = new File("Kana_Hanazawa");
URLConnection urlc = url.openConnection();
BufferedReader buffer = new BufferedReader(new InputStreamReader(urlc.getInputStream(... | 2 |
public static Object[] reprodukcja(ParamSpec ps, Unit[] oldpop) {
Unit[] newpop = new Unit[oldpop.length];
int mate1 = 0, mate2 = 0, popsize = oldpop.length;
String s1 = null,s2 = null;
Object[] obj = statystyki(oldpop);
oldpop = (Unit[])obj[0];
double[] stat... | 5 |
private File createNewSettings(String in)
{
File def = new File(plugin.getServer().getPluginManager().getPlugin(in.substring(0, in.length() - 4)).getDataFolder(), "settings");
if(!def.exists())
def.mkdir();
String settingsName = in.substring(0, in.length() - 4).toLowerCase() + "-... | 1 |
private ArrayList<Solution> dispatchAlgorithms(Solution solution, Set<Algebra> states){
ArrayList<Solution> solutions = new ArrayList<Solution>();
//iterate over algorithms
//keep a list of all smarts, along with the respective algorithm and tree
ArrayList<AbstractMap.SimpleEntry<Integer, AbstractMap.SimpleEntr... | 5 |
private void mode(String mode) {
if((mode == "") || (last != mode))
save();
last = mode;
} | 2 |
Subsets and Splits
SQL Console for giganticode/java-cmpx-v1
The query retrieves a limited number of text entries within a specific length range, providing basic filtering but minimal analytical insight.