text stringlengths 14 410k | label int32 0 9 |
|---|---|
private void afficherMatchs() throws IOException, SQLException {
lbNumJour.setText(Integer.toString(jour)+"/01");
if (jour == 22) btPrec.setEnabled(false);
else if (jour == 30) btSuiv.setEnabled(false);
else {
btPrec.setEnabled(true);
btSuiv.setEnabled(true);
... | 4 |
public void newArray(final Type type) {
int typ;
switch (type.getSort()) {
case Type.BOOLEAN:
typ = Opcodes.T_BOOLEAN;
break;
case Type.CHAR:
typ = Opcodes.T_CHAR;
break;
case Type.BYTE:
typ = Opcodes.T_BYTE;
break;
case Type.SHORT:
typ = Opcodes.T_SHORT;
break;
case Type.INT:
t... | 8 |
public ComparativeTableControl.DataSource getComparativeDataSource()
{
return new ComparativeTableControl.DataSource()
{
public int getRowCount()
{
int rowCount = 0;
for (int dsftBinIndex = 0; dsftBinIndex < dsftBinSpriteSetLis... | 8 |
public void mouseDragged(MouseEvent e) {
if (buttonSelected == null || buttonSelected == ButtonSelected.DRAW_TRIANGLE)
return;
if (buttonSelected == ButtonSelected.SELECT) {
if (handlesSelected) { // resizing shape
createOrUpdateShape(e, Action.UPDATE_SELECTED, anchor);
handleManager.createOutline(sha... | 6 |
public static boolean fixedTimeEqual(String lhs, String rhs) {
boolean equal = (lhs.length() == rhs.length() ? true : false);
// If not equal, work on a single operand to have same length.
if(!equal) {
rhs = lhs;
}
int len = lhs.length();
for(int i=0;i<len;i++) {
if(lhs.charAt(i) == rhs.charAt(i... | 6 |
public int canCompleteCircuit(int[] gas, int[] cost) {
int[] r = new int[gas.length];
int idx = 0, s = 0, b = -1, ts = 0;
for(int i = 0; i<gas.length; i++)
r[i] = gas[i] - cost[i];
for(idx = 0; idx < r.length; idx++){
ts += r[idx];
s += r[idx];
if(s<0){
b = -1;
... | 5 |
@Override
public void keyPressed(KeyEvent e)
{
int delta_x = 0;
int delta_y = 0;
switch (e.getKeyCode())
{
case KeyEvent.VK_LEFT:
delta_x = -OFFSET;
break;
case KeyEvent.VK_RIGHT:
delta_x = OFFSET;
break;
case KeyEvent.VK_UP:
delta_y = -OFFSET;
break;
case KeyEvent.VK_DOWN:
delta... | 6 |
@Override
public Converter put(String key, Converter value) {
Converter v = super.put(key, value);
if (v != null) {
throw new IllegalArgumentException("Duplicate Converter for "
+ key);
}
return v;
} | 1 |
final public boolean handshakeResponse(ByteBuffer downloadBuffer) throws WebSocketException {
ByteBuffer buffer = null;
try{
if (state == State.INIT || state == State.DONE) {
transitionTo(State.METHOD);
responseStatus = -1;
httpResponseHeaderParser = new HttpResponseHeaderParser();
bufferManager.... | 9 |
public void removeProfessor(String matricula)
throws ProfessorInexistenteException {
boolean teste = false;
for (Professor e : professores) {
if (e.getMatricula().equals(matricula)) {
professores.remove(e);
teste = true;
break;
}
}
if (teste == false) {
throw new ProfessorInexistenteExce... | 3 |
public Object get(String key) throws JSONException {
if (key == null) {
throw new JSONException("Null key.");
}
Object object = this.opt(key);
if (object == null) {
throw new JSONException("JSONObject[" + quote(key) +
"] not found.");
}... | 2 |
public static void main(String[] args){
//int[] arr = {4, 3, 5, 1, 2, 6, 9, 2, 10, 11};
int[] arr = {4, 33, 5, 33, 2, 6, 9, 2, 10, 11,45};
int min;
int max;
int i = 0;
int totalElements = arr.length;
//no items in array, show a message
if(totalElements ==... | 9 |
public ImageCreatorDialog(final Panel panel) {
setTitle("Create square image");
setBounds(1, 1, 250, 130);
Toolkit toolkit = getToolkit();
Dimension size = toolkit.getScreenSize();
setLocation(size.width / 3 - getWidth() / 3, size.height / 3
- getHeight() / 3);
this.setResizable(false);
setLayout(null... | 3 |
@Override
public void deserialize(Buffer buf) {
super.deserialize(buf);
id = buf.readInt();
if (id < 0)
throw new RuntimeException("Forbidden value on id = " + id + ", it doesn't respect the following condition : id < 0");
lifePoints = buf.readInt();
if (lifePoint... | 6 |
@Override
public String toString() {
String rtn = "size = " + size + "\nUndealt cards: \n";
for (int k = size - 1; k >= 0; k--) {
rtn = rtn + cards.get(k);
if (k != 0) {
rtn = rtn + ", ";
}
if ((size - k) % 2 == 0) {
// Insert carriage returns so entire deck is visible on console.
rtn = rt... | 6 |
private void openConnection() {
if (this.dbConnParamUrl == null)
return;
try {
if (this.dbconn != null && !this.dbconn.isClosed())
this.dbconn.close();
this.dbconn = DriverManager.getConnection( dbConnParamUrl,
... | 4 |
static final void method3260(int i) {
for (Class348_Sub15 class348_sub15
= (Class348_Sub15) Class27.aClass356_389.method3484(0);
class348_sub15 != null;
class348_sub15
= (Class348_Sub15) Class27.aClass356_389.method3482(0)) {
if (((Class348_Sub15) class348_sub15).aClass55_Sub1_6768
.method... | 7 |
public static void main(String[] args) throws InstantiationException, IllegalAccessException {
int boardSize = 10;
int timeout = 20000;
for (String arg : args) {
System.err.println(arg);
}
PrintStream origOut = System.out;
System.setOut(System.err);
Sy... | 8 |
protected void switchChannel(String toReplace, String replacing) {
if (toReplace.equals(replacing.toLowerCase())) { //Nothing to edit, reload the initial picture
this.changePicture(this.getRelURL());
this.revalidateContainer();
reloadChanges();
return;
}
// BufferedImage toEdit = getBufferedImag... | 9 |
public void testWithFieldAdded8() {
Partial test = createHourMinPartial(0, 0, ISO_UTC);
try {
test.withFieldAdded(DurationFieldType.minutes(), -1);
fail();
} catch (IllegalArgumentException ex) {
// expected
}
check(test, 0, 0);
... | 2 |
public InternalRewrite(Map<String, String> headers, String uri) {
super(null);
this.headers = headers;
this.uri = uri;
} | 0 |
public static CircleEquation newInstance(float a, float b, float r) {
return new CircleEquation(a, b, r);
} | 0 |
public int insertObject(Object obj) {
String table = this.getTableName(this.getObjectClass(obj).toString());
String fieldName[] = this.getField(obj);
String sql = "INSERT INTO "+PREFIX+table+"(";
for (int i = 0; i < fieldName.length; i++) {
sql += fieldName[i];
if(i != fieldName.length -1)
sql += ",... | 8 |
public static void main(String[] args) throws Exception {
if (args.length < 2) {
System.out.println("Usage: java JGrep file regex");
System.exit(0);
}
Pattern p = Pattern.compile(args[1]);
// Iterate through the lines of the input file:
int index = 0;
Matcher m = p.matcher("");
for (String line : ne... | 3 |
private static String getExpressionWithToken(ParsedExpression parsedExpression, String token) {
String originalExpression = parsedExpression.getOriginalExpression();
StringBuilder actualExpression = new StringBuilder();
List<String> paramNames = parsedExpression.getParameterNames();
int lastIndex = 0;
for (in... | 1 |
public TrialGroup(List<Trial> trials, boolean lowLoad) throws IncorrectNumberOfTrialsException {
super(trials);
if (trials.size() != Options.TRIALS_PER_GROUP) {
//should not occur
throw new IncorrectNumberOfTrialsException("Trying to create a group of " + Options.TRIALS_PER_GROUP + " trials, but only "
... | 3 |
public static final List<String> getItemUrls(
ResponseWrapper responseWrapper, Logger logger) {
List<String> urlStrings = new ArrayList<String>();
Element doc = responseWrapper.getDoc();
Elements itemElements = doc.select("dl.item");
for (Element itemElement : itemElements) {
Element aElement = itemElemen... | 1 |
public static void globalBypass(String arg){
arg = arg.toLowerCase();
if(TOGGLES.containsKey(arg)){
if(!checkPermission("eCore.invBypass.global.toggle", true))
return;
switch(TOGGLES.get(arg)){
case 0:
GlobalDataManager.invBypass = !GlobalDataManager.invBypass;
break;
case 1:
Glo... | 8 |
final public void Print_statement() throws ParseException {
/*@bgen(jjtree) Print_statement */
SimpleNode jjtn000 = new SimpleNode(JJTPRINT_STATEMENT);
boolean jjtc000 = true;
jjtree.openNodeScope(jjtn000);
jjtn000.jjtSetFirstToken(getToken(1));
try {
jj_consume_token(PRINT);
... | 8 |
public boolean parsePatch(File f, String patch) {
String s = null;
boolean result = false;
if(patch.equalsIgnoreCase(CARRIER_PATCH)) {
s = findReturn(f, "this.carrierText = \"");
if(s!=null) {
carrierString = s.substring(s.indexOf("\"")+1, s.lastIndexOf("\... | 6 |
public String getStatus() {
if (active) {
return "Active";
} else {
return "Paused";
}
} | 1 |
@Override
public List<Gruppi> getGruppiByUtente(Utente utente) {
List<Gruppi> result = new ArrayList();
ResultSet rs = null;
ResultSet rs1 = null;
try {
gIdGruppi_Utente.setInt(1, utente.getKey());
rs = gIdGruppi_Utente.executeQuery();
while (rs... | 8 |
@Override
public String handle(String cmd) {
if (cmd.equals("clear")) {
setText("");
} else {
return "unknown command '" + cmd + "'\n";
}
return null;
} | 1 |
String paramList(String title, CSProperties p) {
if (p.size() == 0) {
return "";
}
List<String> keys = new ArrayList<String>(p.keySet());
Collections.sort(keys);
StringBuffer db = new StringBuffer();
db.append("<variablelist>");
... | 2 |
public boolean method537() {
if (anIntArray658 == null) {
return true;
}
boolean flag = true;
for (int j = 0; j < anIntArray658.length; j++) {
if (!Model.isCached(anIntArray658[j])) {
flag = false;
}
}
return flag;
} | 3 |
public void updateUi(String yourPlayerId) {
updateUiPlayerId = yourPlayerId;
game.sendUpdateUI(new UpdateUI(yourPlayerId, playersInfo,
gameState.getStateForPlayerId(yourPlayerId),
lastGameState == null ? null : lastGameState.getStateForPlayerId(yourPlayerId),
lastMove, lastMove... | 1 |
public DummySSLSocketFactory()
{
try
{
SSLContext sslcontent = SSLContext.getInstance("TLS");
sslcontent.init(null, new TrustManager[]{new DummyTrustManager()}, new java.security.SecureRandom());
factory = sslcontent.getSocketFactory();
}
catch (No... | 2 |
protected void append(LoggingEvent event) {
if (!performChecks()) {
return;
}
String logOutput = this.layout.format(event);
appenderUI.doLog(logOutput);
if (layout.ignoresThrowable()) {
String[] lines = event.getThrowableStrRep();
if (lines != null) {
in... | 4 |
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
ClientMessage other = (ClientMessage) obj;
if (_name == null) {
if (other._name != null)
return false;
} else if (!_name.equals(other._n... | 6 |
public int winner() {
// A player captured enought seeds
if (position[12] > 24)
return SOUTH;
if (position[13] > 24)
return NORTH;
if (position[12] == 24 && position[13] == 24)
return DRAW;
// The game hasn't ended yet
... | 9 |
private boolean go(Direction dirToGo)
{
try
{
StringBuffer output = new StringBuffer();
boolean hasMoved = CommandController.getPlayer().move(dirToGo, output);
printMessage(output.toString());
return hasMoved;
}
catch(Exception e)
{
if(e in... | 2 |
public FileView(Composite parent) {
this.canvas = new Canvas(parent, SWT.H_SCROLL | SWT.V_SCROLL | SWT.NO_BACKGROUND);
canvas.addMouseWheelListener(new MouseWheelListener() {
public void mouseScrolled(MouseEvent event) {
ScrollBar bar = canvas.getVerticalBar();
bar.setSelection(bar.getSelection() - ev... | 9 |
@Override
public boolean equals(Object obj) {
if(!(obj instanceof Result)) {
return false;
}
Result that = (Result) obj;
if(
this.coeff1==that.coeff1 &&
this.coeff2==that.coeff2 &&
this.gcd==that.gcd &&
this.errorFlag==that.errorFlag &&
this.err==that.err
) {return true;}
return false;
... | 6 |
private void runGA() {
int generation = 1;
while (generation<=this.generations) {
System.out.println("Generation "+generation);
population.evaluate(fitnessFunction);
T populationFittest = population.getFittestIndividual();
if (generation == 1)
... | 3 |
public String[] getAllPlayersName() {
ArrayList<String> names = new ArrayList<String>();
for (Player player : players) {
names.add(player.getName());
}
return names.toArray(new String[names.size()]);
} | 1 |
@Override
public int hashCode( )
{
final int prime = 31;
int result = 1;
result = prime * result + ( ativo ? 1231 : 1237 );
result = prime * result + ( ( codigo == null ) ? 0 : codigo.hashCode( ) );
result = prime * result + ( ( email == null ) ? 0 : email.hashCode( ) );
result... | 9 |
@Override
public boolean equals(Object obj)
{
if (this == obj)
return true;
if (obj == null)
return false;
if (!(obj instanceof GeoPosition))
return false;
GeoPosition other = (GeoPosition) obj;
if (Double.doubleToLongBits(latitude) != Double.doubleToLongBits(other.latitude))
return false;
if ... | 5 |
private boolean sort()
{
// Obter pontuações
String contents = toString();
if(contents == null)
return false;
String[] scoresArr = contents.split( Util.EOL ); // Array de pontuações
int[] scoresVals = new int[ scoresArr.length ]; // Array com valores
String[][] scoresNomes = new String[ scoresArr.leng... | 9 |
public void connect(boolean useXMPPConnection){
if (useXMPPConnection) {
Utils.printWithDate("XMPP Connection to: " + hostXMPP + " (Port " + portXMPP + ") ... ", Utils.DEBUGLEVEL.GENERAL);
ConnectionConfiguration xmppConfig = new ConnectionConfiguration(hostXMPP, portXMPP);
xmppConfig.setReconnectionAllowe... | 5 |
private FullHttpResponse performStatus() {
StatDAO stat = new StatDAO();
ResultSet resultSetTableIP = null;
ResultSet resultSetTableRedirect = null;
ResultSet resultSetTableRecentConnections = null;
// HTML head
StringBuilder message = new StringBuilder();
... | 7 |
public boolean validaEmail(String Email) {
boolean Validacao = true;
if ((Email.contains("@")) && (Email.contains(".")) && (!Email.contains(" "))) {
String usuario = new String(Email.substring(0, Email.lastIndexOf('@')));
String dominio = new String(Email.substring(Email.lastIn... | 9 |
public int compareTo(Endpoint other) {
double length = Math.abs(value);
double otherLength = Math.abs(other.value);
double distance = length - otherLength;
if (distance == 0.0d)
{
if (type.ordinal() < other.type.ordinal())
{
return -1;
}
else if (type.ordinal() == other.type.ordinal()... | 4 |
private boolean jj_2_23(int xla) {
jj_la = xla; jj_lastpos = jj_scanpos = token;
try { return !jj_3_23(); }
catch(LookaheadSuccess ls) { return true; }
finally { jj_save(22, xla); }
} | 1 |
public void WGResetWord(String sender, Command command) {
if(command.arguments.length == 4) {
Game game = getGame(command.arguments[1]);
if(game != null) {
User user = getUserByNick(game, command.arguments[2]);
if(user != null) {
for(... | 5 |
@Override
public ValueType returnedType(ValueType... types) throws EvalException
{
// Check the number of argument
if (types.length == 1)
{
// If numerical
if (types[0].isNumeric() || types[0] == ValueType.NONE)
return types[0];
// if ... | 4 |
private static void setValue(CuratorFramework client, String command, String[] args) throws Exception {
if (args.length != 2) {
System.err.println("syntax error (expected set <path> <value>): " + command);
return;
}
String name = args[0];
if (name.contains("/")) ... | 3 |
public void run(){
//TODO gossip runs and interface events need to be synchronised
// Create demo interface
D = new DemoInterface();
D.showGui("PA300m1.svg");
// minimise side panel
D.gui.toggleSidePanelSize();
// add node click listener
... | 7 |
public void collideCheck()
{
if (dead) return;
float xMarioD = world.mario.x - x;
float yMarioD = world.mario.y - y;
float w = 16;
if (xMarioD > -16 && xMarioD < 16)
{
if (yMarioD > -height && yMarioD < world.mario.height)
{
if... | 9 |
public Twitter() {
} | 0 |
@EventHandler(priority = EventPriority.LOWEST)
public void onLogin(PostLoginEvent e) {
ProxiedPlayer p = e.getPlayer();
if (!this.knownClientIPS.containsKey(p.getName())) {
this.knownClientIPS.put(plugin.clearifyIP(p.getAddress().toString()), p.getName());
}
if (plugin.ma... | 3 |
public Descriptor compile(SymbolTable table){
Descriptor d = null;
if(type instanceof IdentNode){
String s = ((IdentNode) type).getIdentName();
if(s.equals("integer")){
d = new SimpleTypeDescriptor(Type.INTEGER);
}
else if(s.equals("boolean")){
d = new SimpleTypeDescriptor(Type.BOOLEAN);
}
... | 4 |
public CompRegPumpingLemmaInputPane(RegularPumpingLemma l)
{
super(l, "<i>L</i> = {" + l.getHTMLTitle() + "} Regular Pumping Lemma");
} | 0 |
@Override
public boolean equals(Object obj) {
boolean result= false;
Personajes myObj = (Personajes) obj;
if(this == obj) result= true;
if(obj == null || (this.getClass() != obj.getClass()))
result = false;
if((this.nombre == myObj.nombre) && (this.alias == my... | 9 |
public void setWindowInnerAnimation(Animation animation) {
if (animation == null) {
this.window_InnerAnimation = UIAnimationInits.INNERWINDOW.getAnimation();
} else {
this.window_InnerAnimation = animation;
}
somethingChanged();
} | 1 |
public static void main(String[] args) {
Map<String, Integer> grades = new ArrayMap<>();
// Add a few entries into our grade map
grades.put("Andy", 76);
grades.put("John Doe", 95);
grades.put("Jane Doe", 98);
// Get the value of a few entries
System.out.println(grades.get("Andy"));
System.out.println(... | 3 |
private StartRouter() {
// JFormDesigner - Action initialization - DO NOT MODIFY //GEN-BEGIN:initComponents
putValue(NAME, "Iniciar Router");
putValue(SHORT_DESCRIPTION, "Iniciar Router");
putValue(LONG_DESCRIPTION, "Iniciar Router");
putValue(SMALL_ICON, new... | 0 |
public static int randomSelect(int[] array, int start, int end, int index){
if(start == end)
return array[start];
else{
int q = randomized_partiton(array,start,end);
int k = q - start +1;
if(k ==index)
return array[q];
else if(index < k)
return randomSelect(array,start,q-1,index);
el... | 3 |
public Term setPerference(Term term)
throws TermException
{
if (term.var == null) {
Operation op = term.operation;
Operation res = null;
if (!op.modName.equals(this.modName)) {
Operation[] ops = this.getOperationsWithName(op.getName());
for (int i=0; i<ops.length; i++) {
if (... | 8 |
public Deserializer getDeserializer(Class cl)
throws HessianProtocolException
{
if (ObjectName.class.equals(cl)) {
return new StringValueDeserializer(cl);
}
else if (ObjectInstance.class.equals(cl)) {
return new ObjectInstanceDeserializer();
}
else if (MBeanAttributeInfo.class.isAs... | 7 |
public static void main(String[] args) throws IOException {
// wget
// http://dumps.wikimedia.org/jawiki/20140503/jawiki-20140503-pages-meta-current.xml.bz2
// bunzip2 jawiki-20140503-pages-meta-current.xml.bz2
String wikiPagesMetaXmlFilePath = args[0];
String outPutDirPath = args[1];
File outPutDir = new... | 8 |
public static Genre getByName(String s) {
switch( s ) {
case "Drama": return DRAMA;
case "Kinderbuch": return KIDS_BOOK;
case "Lyrik": return LYRICS;
case "Roman": return NOVEL;
case "Sachbuch": return NONFICTION;
default:
throw new InvalidParameterException("There is no genre which has the specif... | 5 |
public ConnectEvent(Object client) {
super(client);
} | 0 |
@EventHandler
public void BlazeMiningFatigue(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.Mini... | 6 |
@Override
public String getTooltip()
{
String tooltip = name;
for (GroupOfUnits u: garisson.getUnits()) {
tooltip += "\n"+ u.type.name +" ("+u.getNumberDesc()+")";
}
return tooltip;
} | 1 |
public void renderItem(Graphics g, Entity entity, Item item)
{
if(item instanceof ItemSword || item instanceof ItemBow && entity != null)
{
float r = entity.getBB(entity.getCoords()).getBoundingCircleRadius();
Vector2f looking = entity.getLooking().copy().normalise().scale(r);
int n = ((int)((item.getText... | 7 |
private void calcGenomehs() {
genomenr = new int[popdata.chromCount()][][];
genomehs = new ArrayList<ArrayList<ArrayList<ArrayList<Integer>>>>(); //for each genome nr:
//which haplostructs in initorder have this genome nr (for both sides)
possiblePairCount = new int[popdata.chromCou... | 6 |
private JMenu getUsersMenu() {
final JMenu usersMenu = new JMenu("Users");
//List of Users
try {
for (String user: client.getUsers()) {
JLabel label = new JLabel(user);
label.setBorder(BorderFactory.createEmptyBorder(2, 5, 3, 5));
users... | 4 |
public static int getInverseTransfType(int type){
int inverse = 0;
switch (type){
case 0: inverse = 0;
break;
case 1: inverse = 3;
break;
case 2: inverse = 2;
break;
case 3: inverse = 1;
break... | 8 |
private Tile[] rotate(int dgr) {
Tile[] newTiles = new Tile[ROW * ROW];
int offsetX = 3, offsetY = 3;
if (dgr == 90) {
offsetY = 0;
} else if (dgr == 180) {
} else if (dgr == 270) {
offsetX = 0;
} else {
throw new IllegalArgumentExcepti... | 5 |
public static void main(String[] args) throws IOException {
StringBuilder sb = new StringBuilder();
BufferedReader buf = new BufferedReader(
new InputStreamReader(System.in));
String line = "";
d: do {
line = buf.readLine();
if (line == null || line.length() == 0)
break d;
sb.append(convery(lin... | 4 |
private static void findAllC2(int n){
for(int i=0;i<n;i++){
for(int j=i+1;j<n;j++){
allSwaps.add(new Point(i, j));
}
}
} | 2 |
public static String fetchURLGet(final String u, String parameters) {
String returnedString = "";
try {
final URL url = new URL(u + "?" + parameters);
final BufferedReader reader = new BufferedReader(
new InputStreamReader(url.openStream()));
String line;
while ((line = reader.readLine()) != null) ... | 3 |
public static void main(String[] args) {
System.loadLibrary(Core.NATIVE_LIBRARY_NAME);
String path = "resources/lena.png";
Mat image = Highgui.imread(path);
Mat out = new Mat();
if(image.empty()) {
System.out.println("Image not found !!");
return;
}
ImageUtils.displayImage(ImageUtils.... | 1 |
public static void setFoxCreationProbability(double FOX_CREATION_PROBABILITY)
{
if (FOX_CREATION_PROBABILITY >= 0)
Simulator.FOX_CREATION_PROBABILITY = FOX_CREATION_PROBABILITY;
} | 1 |
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Genero other = (Genero) obj;
if (id == null) {
if (other.id != null)
return false;
} else if (!id.equals(other.id))
return false;
r... | 6 |
@Override
public void addRecordToDB() {
// add to database
try {
String statement = new String("INSERT INTO " + DBTable
+ " (qid, userid)"
+ " VALUES (?, ?)");
PreparedStatement stmt = DBConnection.con.prepareStatement(statement, new String[] {"id"});
stmt.setInt(1, quiz.quizID);
stmt.setIn... | 1 |
public void setComfortType(ComfortType comfortType)
throws CarriageException {
if (comfortType == null) {
throw new CarriageException("Comfort type is null");
}
this.comfortType = comfortType;
} | 1 |
private int whitePosition(int i) {
int whitePos;
switch (i) {
case 1:
whitePos = 1;
break;
case 3:
whitePos = 2;
break;
case 5:
whitePos = 3;
break;
case 7:
whitePos = 4;
break;
case 8:
whitePos = 5;
break;
case 10:
whitePos = 6;
break;
case 0:
whitePos = 7;
... | 7 |
public GroupJoinIterator(Iterable<T> outer, Iterable<TInner> inner, Selector<T, TKey> outerKeySelector, Selector<TInner, TKey> innerKeySelector, Joint<T, TInner, TResult> joint, Comparator<TKey> comparator)
{
this._outer = outer;
this._inner = inner;
this._innerKeySelector = innerKeySelector;
this._outerK... | 0 |
public Neg(byte[] buf) {
int off;
cc = cdec(buf, 0);
bc = cdec(buf, 4);
bs = cdec(buf, 8);
sz = cdec(buf, 12);
bc = MapView.s2m(bc);
bs = MapView.s2m(bs).add(bc.inv());
ep = new Coord[8][0];
int en = buf[16];
off = 17;
for (int i = 0; i < en; i++) {
int epid = buf[off];
int cn ... | 2 |
@Override
public Attribute getBestAttribute(Attribute target,
ArrayList<Attribute> attributes) {
double entropyTarget = computeEntropy(target);
// System.out.println("Entropy Target -> " + entropyTarget);
// System.out.println();
Attribute bestAttribute = null;
Double bestValue = Double.NEGATIVE_INFINI... | 7 |
public String getAlgorithm() {
return algorithm;
} | 0 |
public boolean connect() throws Exception
{
port = getPropPort();
portRate = 9600;
//Service.WriteLog("Find port: "+port);
parity = 0;
rts = true;
if (this.port.length()<1)
{
return false;
}
if (status == Device.DEVICE_READY || status =... | 6 |
private static boolean insertPatient(Patient bean, PreparedStatement stmt) throws SQLException{
stmt.setString(1, bean.getFirstName());
stmt.setString(2, bean.getLastName());
stmt.setDate(3, bean.getDob());
stmt.setString(4, bean.getPrimaryDoc());
stmt.setString(5, bean.getPhone());
stmt.setString(6, bean.... | 1 |
public Object get(int i){
return vector.get(i);
} | 0 |
public void resizeColumns()
{
if (_vertical)
{
TableColumn column = _table.getColumnModel().getColumn(1);
int origWidth = column.getWidth();
int width = origWidth;
Font font = _table.getFont();
FontMetrics fontMetrics = _table.getFontMetric... | 7 |
protected void switchToBars() {
if (m_plotSurround.getComponentCount() > 1 &&
m_plotSurround.getComponent(1) == m_legendPanel) {
m_plotSurround.remove(m_legendPanel);
}
if (m_plotSurround.getComponentCount() > 1 &&
m_plotSurround.getComponent(1) == m_attrib) {
... | 7 |
private Object handlePrim(Object tos) {
if ((tos instanceof Media && ((Media)tos).getPrimary() == null) ||
(tos instanceof ParentFamilyRef && ((ParentFamilyRef)tos).getPrimary() == null)) {
return new FieldRef(tos, "Primary");
}
return null;
} | 4 |
public boolean allVisitedMore(int comp)
{
for (Action a : actions)
if (a.getVisits() < comp)
return false;
return true;
} | 2 |
private void drawVoltageGrid(Graphics g) {
ArrayList<Double> list = makeList(voltageValue);
Collections.sort(list);
double belowZero = getNegativeAmount(list);
double exactlyZero = getZeroAmount(list);
double aboveZero = getPositiveAmount(list);
for(int x = width/6 +5; x < width*5/6 -10; x+=pixel){
f... | 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.