text stringlengths 14 410k | label int32 0 9 |
|---|---|
@Override
public void onServerStatusChanged() {
ServerStatusController.ServerStatus serverStatus = ServerStatusController.getServerStatus();
switch (serverStatus) {
case AVAILABLE:
TestInfo testInfo = BmTestManager.getInstance().getTestInfo();
TestInfoCon... | 3 |
public BodyPart(int upgradeCount, UpgradeType type, String name){
this.upgrades = new Upgrade[upgradeCount];
this.type = type;
this.name = name;
} | 0 |
public void testSetWeekOfWeekyear_int2() {
MutableDateTime test = new MutableDateTime(2002, 6, 9, 5, 6, 7, 8);
try {
test.setWeekOfWeekyear(53);
fail();
} catch (IllegalArgumentException ex) {}
assertEquals("2002-06-09T05:06:07.008+01:00", test.toString());
} | 1 |
@Override
public void onEnable(){
plugin=this;
pointsplugin = new BAPointsPluginManager(this);
string = new StringManager();
if(user==null){
user = new BAUserManager(this);
}
new BukkitRunnable() {
@Override
public void run() {
user.load();
}
}.runTaskLater(plugin, 5);
... | 2 |
private boolean isClassBox(String owner) {
if (!owner.startsWith("java/lang/")) {
return false;
}
String className = owner.substring("java/lang/".length());
return (className.equals("Integer") ||
className.equals("Double") ||
className.equals("Long"... | 7 |
public static void main(String[] args) {
new ConcurrentNAV().timeAndComputeValue();
} | 0 |
private int findChromosomeID( BPTreeNode thisNode, String chromKey){
int chromID = -1; // until found
// search down the tree recursively starting with the root node
if(thisNode.isLeaf())
{
int nLeaves = thisNode.getItemCount();
for(int index = 0; index < nLeave... | 8 |
public Trail(Thing body, int length, int freq) {
// Initialize a path
this.path = new Vector3D[length];
this.body = body;
this.freq = freq;
for (int i = 0; i < path.length; i++) {
path[i] = body.position.clone();
if (body.parent != null) {
path[i].subtract(body.parent.position);
}
}
} | 2 |
private boolean HLIDGenerationTest(Object obj, CycAccess cyc) {
try {
String cmd = "(compact-hl-external-id-string "
+ DefaultCycObject.stringApiValue(obj) + ")";
String cycId = cyc.converseString(cmd);
String apiId = null;
if (obj instanceof String) {
apiId = CompactHL... | 3 |
public static int getIdByIndex(int index) {
int id = -1;
if (index >= 0 && index < ChartData.getSize()) {
for (Integer itemId : data.keySet()) {
if (index == 0) {
id = itemId;
break;
}
index--;
}
}
return id;
} | 4 |
public void add(Component e) {
if (selectedOC != null)
selectedOC.setSelected(false);
selectedOC = null;
if (enteredIC != null)
enteredIC.setSelected(false);
enteredIC = null;
if (e instanceof Stub) {
if (stubs.size() < 4)
stubs.add((Stub) e);
else {
JOptionPane.showMessageDialog(null,
... | 4 |
public void SetPriority(int priority)
{
//set the priority of the person for the stop
this.priority = priority;
} | 0 |
protected Element createTransitionElement(Document document,
Transition transition) {
Element te = super.createTransitionElement(document, transition);
FSATransition t = (FSATransition) transition;
// Add what the label is.
te.appendChild(createElement(document, TRANSITION_READ_NAME, null, t
.getLabel())... | 0 |
@Override
public String toString() {
String func = retType + " " + name + "(";
int i;
if (parameters.size() > 0) {
for (i = 0; i < parameters.size() - 1; i++) {
func = func + parameters.get(i) + ", ";
}
func = func + parameters.get(i) + ");";
} else {
func = func + ");";
}
return func;
} | 2 |
public void validate(Evento evento){
if(evento == null || evento.equals("")){
throw new SaveException("Evento não pode ser vazio.");
} else if (evento.getNome() == null || evento.getNome().equals("")){
throw new SaveException("Nome do evento não pode ser vazio.");
} else ... | 6 |
public int posMax()
{
int MaxValue; //trakcs the maximum value
int MaxValPos = -1; //tracks the position of the maximum value
if(IntValues.length > 0) //if the sequence is nonempty
{
MaxValue = IntValues[0]; //initialize the max value as first value
MaxValPos = 0; //initialize the positi... | 3 |
@Override
public final void run() { //Run to clean up any memory leaks we may cause by holding dead tasks
if (tasks.isEmpty()) {
return; // skip cleaning if there are no tasks
}
Iterator<Task> taskItr = tasks.keySet().iterator();
while (taskItr.has... | 6 |
public String getAltsStr() {
if (alts == null) return "";
String altsStr = "";
for (String alt : alts)
altsStr += alt + " ";
return altsStr.trim().replace(' ', ',');
} | 2 |
@Override
public boolean equals(Object obj) {
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final AbstractEntity other = (AbstractEntity) obj;
if (!Objects.equals(this.getUuid(), other.getUuid())) {
... | 3 |
public String getToDate() {
return toDate;
} | 0 |
@SuppressWarnings("unchecked")
private T back()
{
boolean back_left = true, back_right = true;
Comparable<T> lprev = null, rprev = null;
while (true)
{
if (back_left)
if (!left.hasPrev())
return null;
else
lprev = (Comparable<T>)left.prev();
if (back_right)
if (!right.hasPrev()... | 7 |
public void setSearch(ArrayList<Product> p) {
reset();
if (p.size() > 0) {
panel.setVisible(true);
btnSil.setVisible(true);
btnGuncelle.setVisible(true);
Product p2 = p.get(0);
textField_1.setText(p2.getpId() + "");
textField_2.setText(p2.getpName());
textField_3.setText(p2.getAmount() + "")... | 1 |
public static TobiiEventMap loadTobiiEvent3(File file) throws IOException {
CSVReader reader = new CSVReader(new FileReader(file), '\t');
String[] line;
// Get header data for this file
TobiiHeader header = readHeader(reader);
TobiiEventMap eventMap = new TobiiEventMap(header);
// Work our way dow... | 7 |
@Override
public Response handle(JsonElement data) {
Response res;
Fingerprint fprint = GsonFactory.getGsonInstance().fromJson(data, Fingerprint.class);
if (fprint.getLocation() != null && ((Location)fprint.getLocation()).getId() != null && ((Location)fprint.getLocation()).getId().intValue() != -1) {
Locat... | 5 |
public void suivant(){
if (indiceRapportVisiteCourant == lesRapportsVisites.size()-1) {
indiceRapportVisiteCourant = 0;
} else {
indiceRapportVisiteCourant = indiceRapportVisiteCourant + 1;
}
DefaultTableModel model = (DefaultTableModel) this.vue.getjTableOffre().... | 2 |
public Nodo predecessor(Nodo nodo){
if(nodo.getLeft() == null){
return maximo(nodo.getLeft());
}
else{
Nodo nodoAux = pai(root, nodo.getKey());
while(nodoAux != null && nodoAux.getLeft() == nodo){
nodo = nodoAux;
nodoAux = pai(r... | 3 |
private static int charAt(String s, int d) {
if (d < s.length()) return s.charAt(d);
else return -1;
} | 1 |
private final Class348_Sub19_Sub1 method310(int i, int i_5_, byte i_6_,
int[] is) {
anInt375++;
int i_7_ = i ^ (0xfff0 & i_5_ << -2102985404 | i_5_ >>> -313218292);
i_7_ |= i_5_ << 1075063824;
int i_8_ = -113 / ((i_6_ - 16) / 34);
long l = (long) i_7_ ^ 0x100000000L;
Class348_Sub19_Sub1 class348_sub19_sub1
... | 6 |
private void rotate()
{
//orient++;
if (orient%4==0)
{
litPositions=new int[][]
{{0,1,0},
{1,1,1},
{0,0,0}};
}
if (orient%4==1)
{
litPositions=new int[][]
{{0,1,0},
{0,1,1},
{0,1,0}};
}
if (orient%4==2)
{
litPositions=new int[][]
... | 4 |
private BackupPeriod getBackupPeriod() {
BackupPeriod backupPeriod = BackupPeriod.DISABLED; // Set backupPeriod to default: DISABLED.
String backupPeriodString = Controller.getProperty(ApplicationProperties.BACKUP_PERIOD);
boolean backupPeriodNull = false;
if (backupPeriodString != null && !"".equals(backupP... | 4 |
public String toString() {
String retStr = "\n-----------------------------------------\n";
retStr += " ";
for (int i = 1; i < 10; i ++) {
retStr += i + " ";
if (i % 3 == 0) {
retStr += " ";
}
}
for (int i = 0; i < 9; i++) {
if ( i % 3 == 0) {
retStr += "\n --------------------------... | 7 |
@Override
public boolean okMessage(final Environmental myHost, final CMMsg msg)
{
if(!super.okMessage(myHost,msg))
return false;
if((msg.targetMinor()==CMMsg.TYP_ENTER)
&&(msg.target()==this))
{
final MOB mob=msg.source();
if((mob.location()!=null)&&(mob.location().roomID().length()>0))
{
int... | 8 |
public static Pair<String> splitFirst(String str, String out)
{
if (str == null || "".equals(str))
{
return null;
}
if (str.length() < out.length())
{
return null;
}
if (str.equalsIgnoreCase(out))
{
return new Pair<String>("", "");
}
int ind = str.indexOf(out);
if (ind == -1)... | 5 |
public double matchAtFrom(int i, int j) {
while(j < children.length) {
double cur;
if (children[j].optional) {
PartMatcher incl, excl;
Regex.GroupMap inclGroups,... | 6 |
public void resolveConflict(Transaction me, Transaction other) {
long transferred = 0;
ContentionManager otherManager = other.getContentionManager();
for (int attempts = 0; ; attempts++) {
long otherPriority = otherManager.getPriority();
long delta = otherPriority - priority;
if (delta < 0... | 5 |
@Override
public int attack(double agility, double luck) {
if(random.nextInt(100) < luck)
{
System.out.println("I just intimidated the enemy!");
return random.nextInt((int) agility) * 4;
}
return 0;
} | 1 |
@Override
public String getCalle() {
return super.getCalle();
} | 0 |
public BufferedImage HistogramSpecification(ImageClass im2){ // Especificacion del histograma con otra imagen de muestra
int[] imhisto = this.getAcumulativeValues();
int[] imhisto2 = im2.getAcumulativeValues();
double []imh1 = new double[256];
double []imh2 = new double[256];
... | 9 |
@Override
public void run() {
try {
// Opening the socket
socket = new DatagramSocket(serverUDPPort);
/* Registering to the Registry Server */
registerRegistryServer();
getOtherServers();
// Listen to articles and pings
byte buffer[] = new byte[1024];
DatagramPacket pkg = new Datagr... | 8 |
public void paint(Graphics g)
{
if (fm == null) {
this.font = mcd.getFont();
this.fm = mcd.getFontMetrics(font);
}
updateSize();
Graphics2D g2d = (Graphics2D) g;
g2d.setFont(font);
RoundRectangle2D r = new RoundRectangle2D.Double(getX(), getY... | 3 |
@Override
public Object getValueAt(int row, int col) {
if (col == 0) {
if (panel.isCellEditable(row)) {
return TEXT_DELETE;
} else {
return "";
}
} else if (col == 1) {
boolean isReadOnly = ((Boolean) readOnly.get(row)).booleanValue();
if (isReadOnly) {
return OutlineEditableIndicator.IC... | 5 |
public FieldVisitor visitField(
final int access,
final String name,
final String desc,
final String signature,
final Object value)
{
StringBuffer sb = new StringBuffer();
appendAccess(access | ACCESS_FIELD, sb);
AttributesImpl att = new AttributesImp... | 2 |
public static boolean registerObject(ChunkyObject object) {
HashMap<String, ChunkyObject> ids = OBJECTS.get(object.getType());
if (ids == null) {
ids = new HashMap<String, ChunkyObject>();
OBJECTS.put(object.getType(), ids);
}
if (ids.containsKey(object.getId())) ... | 2 |
public void reduce(Text key, Iterable<Text> values, Context context)
throws IOException, InterruptedException {
edits.clear();
langCounts.clear();
for (Text str : values) {
try {
edits.add(new JSONObject(str.toString()));
} catch (JSONException e) {
logger.error("Error parsing JSON from mapper... | 8 |
public static Keyword uSignumSpecialist(ControlFrame frame, Keyword lastmove) {
{ Proposition proposition = frame.proposition;
Stella_Object mainarg = (proposition.arguments.theArray)[0];
Stella_Object mainargvalue = Logic.argumentBoundTo(mainarg);
DimNumberLogicWrapper mainargdim = ((mainargvalue... | 7 |
public void backToMenu() {
int reply = JOptionPane.showConfirmDialog(null, "Would you like to return to the Main Menu?");
if(reply == JOptionPane.YES_OPTION) {
timer.stop();
reply = JOptionPane.showConfirmDialog(null, "Would you like to save your progress before quiting?");
if(reply == JOptionPane.YES_OPTI... | 6 |
@Override
public void endElement(String uri, String localName, String qName) throws SAXException {
System.out.println("==end Element");
} | 0 |
@Override
public String toString() {
final StringBuilder sb = new StringBuilder();
sb.append("Car");
sb.append("{carPhysics=").append(carPhysics);
sb.append('}');
return sb.toString();
} | 0 |
private void doUpdate() {
//check so everything is ok
if (!Validate.tfEmpty(tfBenamning)) {
if (Validate.notOverSize(taBeskrivning) && Validate.notOverSize(tfBenamning)) {
updateKompetens();
PanelHelper.cleanPanel(PanelHelper.getMainFrame().getMfRight());
... | 3 |
@Override
public void cook() {
Iterator<IFoodMaterial> iFoodMaterialIterator = foodMaterials.iterator();
while (iFoodMaterialIterator.hasNext()) {
IFoodMaterial foodMaterial = iFoodMaterialIterator.next();
if ("牛肉".equals(foodMaterial.getName())) {
foodMateria... | 4 |
private int pickFruit(int [] platter)
{
// generate a prefix sum
int[] prefixsum = new int[NUM_FRUITS];
prefixsum[0] = platter[0];
for (int i = 1; i != NUM_FRUITS; ++i)
prefixsum[i] = prefixsum[i-1] + platter[i];
int currentFruitCount = prefixsum[NUM_FRUITS-1];
... | 3 |
private boolean addImportFormat(String formatName, OpenFileFormat format) {
if (isNameUnique(formatName, importerNames)) {
format.setName(formatName);
importerNames.add(formatName);
importers.add(format);
// Also add it to the list of formats stored in the preferences
Preferences.FILE_FORMATS_IMPOR... | 1 |
public Cell selectCellCoord(int x, int y) {
for (Cell tempCell : cells) {
if (tempCell.x == x && tempCell.y == y) return tempCell;
}
return null;
} | 3 |
private boolean jj_3_2()
{
if (jj_scan_token(LEFTB)) return true;
if (jj_3R_9()) return true;
if (jj_scan_token(RIGHTB)) return true;
return false;
} | 3 |
private List<Cluster> getResultingClusters(Map<Node, Color> nodeClusterMapping)
{
Map<Color,List<Node>> clusters = new HashMap<Color, List<Node>>();
for(Map.Entry<Node, Color> nodesCluster : nodeClusterMapping.entrySet()) {
List<Node> clusterNodes = new ArrayList<Node>();
Col... | 3 |
public static void finish(String message) {
try {
after = System.currentTimeMillis();
String output = "Completed " + message + NEWLINE;
console.append(output);
console.append("Operation took: " + (after - before)/1000.0 + " seconds." +... | 1 |
protected DirectoryFileFilter(String baseDir, String excludeDirs)
{
exclusionList = new ArrayList();
StringTokenizer st = new StringTokenizer(excludeDirs, ",");
while (st.hasMoreTokens())
{
String token = st.nextToken().trim();
if (token.equals("."))
{
exclusionList.add(baseDir);
}... | 2 |
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((browser == null) ? 0 : browser.hashCode());
result = prime * result + id;
result = prime * result
+ ((operatingSystem == null) ? 0 : operatingSystem.hashCode());
return result;
} | 2 |
public Matrix4f mul(Matrix4f r) {
Matrix4f res = new Matrix4f();
for (int i = 0; i < 4; i++) {
for (int j = 0; j < 4; j++) {
// @formatter:off
res.set(i, j, m[i][0] * r.get(0, j) +
m[i][1] * r.get(1, j) +
m[i][2] * r.get(2, j) +
m[i][3] * r.get(3, j));
// @formatter:on
}
... | 2 |
@Override
public boolean equals(final Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final Piece other = (Piece) obj;
if (color == null) {
if (other.color != null) {
return false;
}
}
else if ... | 7 |
public java.security.cert.X509Certificate[] getAcceptedIssuers() {
java.security.cert.X509Certificate[] chain = null;
try {
TrustManagerFactory tmf = TrustManagerFactory.getInstance("SunX509");
KeyStore tks = KeyStore.getInstance("JKS");
tks.load(this.getClas... | 1 |
final void method645(Component component) {
javax.sound.sampled.Mixer.Info ainfo[] = AudioSystem.getMixerInfo();
if (ainfo != null) {
javax.sound.sampled.Mixer.Info ainfo1[] = ainfo;
for (int i = 0; ainfo1.length > i; i++) {
javax.sound.sampled.Mixer.Info info = a... | 7 |
public AbstractAction getKeyListener(final String move) {
return new AbstractAction() {
private static final long serialVersionUID = 1L;
public void actionPerformed(ActionEvent evt) {
Coordinate newLocation = null;
if (move.toUpperCase().equals("UP")){
newLocation = game.getPlayerLocation().getNort... | 5 |
public void update(){
checkKeys();
if(score >= highScore){
highScore = score;
}
for(int row = 0; row < ROWS; row++){
for(int col = 0; col < COLS; col++){
Tile current = board[row][col];
if(current == null) continue;
current.update();
resetPosition(current, row, col);
if(current.g... | 5 |
static final void method3324(AbstractToolkit var_ha, byte i, long l) {
do {
try {
Class122.anInt1803 = 0;
FileIndexTracker.anInt4797 = Class313.totalParticals;
Class318_Sub1_Sub5.currentParticles = 0;
anInt7120++;
Class313.totalParticals = 0;
long l_1_ = Class62.getCurrentTimeMillis();
Class318_Sub1... | 8 |
@Override
public ArrayList<Secteur> getAll() throws DaoException {
ArrayList<Secteur> result = new ArrayList<Secteur>();
ResultSet rs;
// préparer la requête
String requete = "SELECT * FROM SECTEUR";
try {
PreparedStatement ps = Jdbc.getInstance().getConnexion().p... | 2 |
public EditItemInventory(String prodName, String code, double price, int stock, final int id) {
setTitle("Edit Item");
setBounds(500, 500, 400, 150);
GridBagLayout gridBagLayout = new GridBagLayout();
gridBagLayout.columnWidths = new int[]{0, 0, 0, 0, 0};
gridBagLayout.rowHeights = new int[]{0, 0, 0, 0, 0, 0,... | 2 |
public void setHealth(int healt) {
if(health <= 0){
this.die();
}
this.health = healt;
} | 1 |
public HashMap<String, Epoque> getAllEpoques() {
List listeEpoquesXML = racine.getChildren("epoque");
HashMap<String, Epoque> listeEpoques = new HashMap();
Iterator i = listeEpoquesXML.iterator();
while (i.hasNext()) {
Epoque ep = new Epoque();
... | 3 |
public void enumerate() {
effectiveCounter = 0;
feasibleCounter = 0;
int j = -1;
do {
if (j >= 0) {
cuts[j]--;
}
long unused = stockLength;
int k = -1;
for (int i = 0; i < cuts.length; i++) {
if... | 7 |
static ContentType interleave(ContentType t1, ContentType t2) {
if (t1.isA(ZERO_OR_MORE_ELEMENT_CLASS) && t2.isA(ZERO_OR_MORE_ELEMENT_CLASS))
return INTERLEAVE_ZERO_OR_MORE_ELEMENT_CLASS;
if (((t1.isA(MIXED_MODEL) || t1 == TEXT) && t2.isA(ZERO_OR_MORE_ELEMENT_CLASS))
|| t1.isA(ZERO_OR_MORE_ELEMENT... | 8 |
public void moveTo(Vector2 toTile) {
IPathFinder pathFinder = new AStarPathFinder(World.getWorld().getLayerMap());
Path path = pathFinder.getShortestPath(getGridPosition(), toTile);
this.considered = ((AStarPathFinder)pathFinder).considered;
this.usedPath = ((AStarPathFinder)pathFinder).thePath;
if(path != nu... | 1 |
private static boolean handlePossibleMove(Board b, ArrayList<Move> moves, Move m, int opponentColor) {
try {
if (b.spaceHasOpponent(m.end, opponentColor)) {
moves.add(m);
return false;
} else if (b.spaceIsEmpty(m.end)) {
moves.add(m);
return true;
}
return false;
} catch (IndexOutOfBound... | 3 |
private int getParamNumberInCommand(String command) {
int result = 0;
if (command == null) return result;
for (int i = 0; i < command.length(); i++) {
if (command.substring(i,i+1).equalsIgnoreCase("?")) result++;
}
return result;
} | 3 |
private void setFitness() {
for(int i = 0; i < numberOfParticles; i++){
double currentfitness = objectiveFunction.CalculateFitness(position[i]);
fitness.put(i, currentfitness);
}
} | 1 |
public boolean end() {
return this.eof && !this.usePrevious;
} | 1 |
public /*@pure@*/ boolean checkInstance(Instance instance) {
if (instance.numAttributes() != numAttributes()) {
return false;
}
for (int i = 0; i < numAttributes(); i++) {
if (instance.isMissing(i)) {
continue;
} else if (attribute(i).isNominal() ||
attribute(i).isString()) {
if (!(U... | 8 |
public static String applyRelativePath(String path, String relativePath) {
int separatorIndex = path.lastIndexOf(FOLDER_SEPARATOR);
if (separatorIndex != -1) {
String newPath = path.substring(0, separatorIndex);
if (!relativePath.startsWith(FOLDER_SEPARATOR)) {
newPath += FOLDER_SEPARATOR;
}
return ... | 2 |
public void paintComponent(Graphics g) {
switch(status) {
case 1:
paintBackgroundAndStuff(g);
break;
case 2:
paintBackgroundAndStuff(g);
drawContinueArrow(g, image.getWidth() - 200, image.getHeight() - 110);
break;
case 3:
paintBackgroundAndStuff(g);
drawOldTutorial(g, this.getSi... | 4 |
public void render(Graphics g){
g.setColor(Color.BLACK);
g.setFont(JudokaComponent.bigFont);
JudokaComponent.drawTextBox(170, 160, 350, 35, g);
g.drawImage(JudokaComponent.judokaMatte, 640, 120, 160, 240, null);
g.setColor(Color.BLACK);
g.drawString(name, 175, 187);
if(timer % 60 < 30 && selectedIt... | 8 |
public Element appendAt(String parentPath, String prefix, String name, Map<String, String> namespaces) throws Exception {
Element output = null;
Node parent = Utilities.selectSingleNode(this.doc, parentPath, this.namespaces);
String uri = null;
if(!Utilities.isNullOrWhitespace(prefix) && namespaces != nul... | 4 |
public void setUserRoleField(String nodeName,String content) {
if (nodeName.equals("roleid")) setRoleId(Long.parseLong(content));
if (nodeName.equals("name")) setName(content);
if (nodeName.equals("shortname")) setShortName(content);
if (nodeName.equals("sortorder")) setSortOrder(Integer.parseInt(conten... | 4 |
public Class<?> getColumnClass(int n) {
if (columnClasses == null)
throw new IllegalStateException("columnClasses not set");
int max = columnClasses.length;
if (n>=max)
throw new ArrayIndexOutOfBoundsException(
"columnClasses has " + max + " elements; you asked for " + max);
return columnClasses[n];
} | 3 |
public int getGeometryIndex(int stake) {
RoadGeometry toFind = geometry.get(0);
for (RoadGeometry section : stakes.keySet()) {
if (stakes.get(section).contains(stake)) {
toFind = section;
break;
}
}
return geometry.indexOf(toFind);
} | 2 |
@Override
public boolean isDead()
{
// The handler is dead if it was killed
if (this.killed)
return true;
// or if autodeath is on and it's empty (but has had an object in it previously)
if (this.autodeath)
{
// Removes dead handleds to be sure
removeDeadHandleds();
if (this.started && th... | 4 |
@Test
public void testSave1() {
Session session=null;
Transaction tx = null;
User user=null;
try{
session=sessionFactory.openSession();
tx= session.beginTransaction();
user=new User();
user.setAge(26);
user.setName("刘江龙");
user.setCreateTime(new Date());
user.setExpireTime(new Date());
... | 4 |
private void setUpGUI() {
// add split pane to application frame
this.add(share);
southPanel.setPreferredSize(new Dimension(500,500));
southPanel.setLayout(new BorderLayout());
southPanel.add(textScroll, BorderLayout.CENTER);
if (controllsOption != null)
southPanel.add(controllsOption, BorderLayout.PAGE_... | 1 |
public static void main(String[] args) {
ProxyFactory factory = new ProxyFactory();
factory.setInterfaces(new Class[] { TestInterface.class });
factory.setFilter(new MethodFilter() {
@Override
public boolean isHandled(Method m) {
if (m.getName().equals("doTest")) {
return true;
}
return fa... | 4 |
public List<PosSolicitud> getSolicitudesNuevasFromPos(int idPos){
try {
return getHibernateTemplate().find(
"from PosSolicitud where solEstado = 'X' and solPosId = ? ", idPos);
} catch (DataAccessException e) {
e.printStackTrace();
return new Array... | 1 |
public void mousePressed(MouseEvent e)
{
java.awt.Point point = e.getPoint();
if (table.getSelectedRowCount() == 0
|| !table.isRowSelected(table.rowAtPoint(point)))
table.changeSelection(table.rowAtPoint(point), 0, false, false);
} | 2 |
public void refreshList () {
if ((rosterTableModel == null) || (MainWindow.rosterDB == null))
return;
rosterTable.removeAll();
for (Roster r: MainWindow.rosterDB.getRosters()) {
rosterTable.add( r);
}
rosterTable.changeSelection(0, 0, false, false);
rosterTableModel.fireTableDataChanged();
} | 3 |
private void doViewAllCYs(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
String pageNum = StringUtil.toString(request.getParameter("pageNum"));
if("".equals(pageNum)) {
pageNum = "1";
}
try {
Pager<ChengYuan> page... | 2 |
protected void loadSamples(String samples) {
if (verbose) Timer.showStdErr("Loaded GTEx experiments from file " + samples);
if (!Gpr.canRead(samples)) throw new RuntimeException("Cannot find samples file '" + samples + "'");
experiments = new HashMap<String, GtexExperiment>();
LineFileIterator lfi = new LineF... | 5 |
public static void minimizeInsertions(List<Insertion> insertions, List<Deletion> deletions, Map<String, String> relabelings) {
List<Insertion> insertionsToRemove = new ArrayList<Insertion>();
List<Deletion> deletionsToRemove = new ArrayList<Deletion>();
Map<String, String> parentToInserted = new HashMap<String... | 9 |
public void deleteSubscribedCategories(int studentid){
ResultSet rs=null;
Connection con=null;
PreparedStatement ps=null;
try{
String sql="DELETE FROM student_category_mapping WHERE s_id=(?)";
con=ConnectionPool.getConnectionFromPool();
ps=con.prepareStatement(sql);
ps.setInt(1, studentid);
ps.ex... | 7 |
private PolizaElectronica actualizarConBase(PolizaElectronica pol) {
for (int i = 1; i < base.length; i++) {
String poliza = base[i][colNumPolBase - 1];
// Si coinciden las polizas
if (poliza.equals(pol.getNumPol())) {
String rutaDoc = base[i][colRutaDoc - 1];
System.out.println("POliza = "+pol.get... | 8 |
public Object getValueAt(int row, int col) {
if (col==bytesPerRow) {
// Get ascii dump of entire row
int pos = editor.cellToOffset(row, 0);
if (pos==-1) { // A cleared row (from deletions)
return "";
}
int count = doc.read(pos, bitBuf);
for (int i=0; i<count; i++) {
char ch = (char)bitBuf[i... | 6 |
public void validate() throws XPathException {
name = typeCheck("name", name);
select = typeCheck("select", select);
int countChildren = 0;
NodeInfo firstChild = null;
AxisIterator kids = iterateAxis(Axis.CHILD);
while (true) {
NodeInfo child = (NodeInfo)kids.... | 9 |
public Location getAdjacentLocation(int direction)
{
// reduce mod 360 and round to closest multiple of 45
int adjustedDirection = (direction + HALF_RIGHT / 2) % FULL_CIRCLE;
if (adjustedDirection < 0)
adjustedDirection += FULL_CIRCLE;
adjustedDirection = (adjustedDirect... | 9 |
public void drawChar(char ch)
{
Font font = new Font("monospaced", 0, 16);
GlyphVector gv = font.createGlyphVector(new FontRenderContext(null, false, true), ""+ch);
Shape shape = gv.getOutline();
PathIterator pi = shape.getPathIterator(null, 0.1D);
double[] coords = new double[6];
GLUtessella... | 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.