text stringlengths 14 410k | label int32 0 9 |
|---|---|
public synchronized int addWalkBatch(int vertex, int numWalks) {
if (sourceSeqIdx >= sources.length)
throw new IllegalStateException("You can have a maximum of " + sources.length + " random walk sources");
if (sourceSeqIdx > 0) {
if (sources[sourceSeqIdx - 1] > vertex) {
... | 3 |
public static void main(String[] args) throws Exception {
new HelloWorldAWTGL().loop();
} | 0 |
public List<Class<? super T>> inheritance() {
return unfold(
(java.lang.Class<? super T> c2) -> {
if (c == null)
return none();
else {
final P2<java.lang.Class<? super T>, java.lang.Class<? super T>> p =
new P2<java.lang.Cla... | 9 |
public static void main(String[] args) {
//获取枚举类型中的全部枚举值
Week[] days = Week.values();
for(Week day : days) {
//返回枚举常量的名称
String name = day.name();
//返回枚举常量的序数(常量在枚举声明中的位置,从0开始)
int ordinal = day.ordinal();
String toString = day.toString();
Class declaringClass = day.getDe... | 1 |
public static String fetchLink(String lineText)
{
if(linkExists(lineText)) return link.get(lineText);
return null;
} | 1 |
public String getPiece() {
boolean readString = true;
String piece = getString("What type of piece would you like to be? Enter x or o.");
while (readString) {
if (!(piece.equals("x") || piece.equals("X") || piece.equals("o") || piece.equals("O"))) {
System.out.println( "Oops, you must enter x or o, try again... | 5 |
public static void addMethods( Class<?> c, MethodDepth depth )
{
switch (depth)
{
case DEFINED:
for (Method m : c.getDeclaredMethods())
{
addMethod( m );
}
break;
case PUBLIC_INHERITED:
for (Method m : c.getM... | 8 |
public static boolean warpNextMap(final MapleCharacter c, final boolean fromResting) {
final int currentmap = c.getMapId();
final ChannelServer ch = c.getClient().getChannelServer();
if (!fromResting) {
clearMap(ch.getMapFactory().getMap(currentmap), true);
c.gainItem(Items.currencyType.Sight, 1);
... | 5 |
private static Collection liveMethods(final Collection classes,
final BloatContext context) {
// Determine the roots of the call graph
final Set roots = new HashSet();
Iterator iter = classes.iterator();
while (iter.hasNext()) {
final String className = (String) iter.next();
try {
final ClassEdito... | 7 |
public static boolean isEmptyString(String str, boolean showError)
{
boolean bool = false;
if (Utils.isNull(str, true))
{
}
if (str.replaceAll(" ", "").isEmpty())
{
bool = true;
if (showError)
{
final IllegalArgumentException as = new IllegalArgumentException("The Parameter Cannot Be Empty... | 3 |
private void idCmbxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_idCmbxActionPerformed
String id = "";
if (idCmbx.getSelectedItem() != null && idCmbx.getSelectedIndex() != 0) {
id = idCmbx.getSelectedItem().toString();
try {
Student student = ... | 5 |
public void start() throws InstantiationException, IllegalAccessException{
//new intance
for(Class<? extends IModule> clazz:classSet){
IModule module=(IModule)clazz.newInstance();
this.moduleSet.add(module);
}
//init context
for(IModule module:moduleSet){
moduleContext.addMod... | 7 |
public void overwriteTRNS(byte r, byte g, byte b) {
if(hasAlphaChannel()) {
throw new UnsupportedOperationException("image has an alpha channel");
}
byte[] pal = this.palette;
if(pal == null) {
transPixel = new byte[] { 0, r, 0, g, 0, b };
} else {
... | 6 |
@Override
public BodyElement process(BodyElement source) {
JsArray<Node> toProcess = (JsArray<Node>) JsArray.createArray();
extractChild(source, toProcess);
Node node;
while ((node = toProcess.shift()) != null) {
int type;
try {
type = node.getNodeType();
if (type == Node.T... | 7 |
private void sendSuccessfulResponse(SipRequest sipRequest, Dialog dialog) {
SipHeaders reqHeaders = sipRequest.getSipHeaders();
SipHeaderFieldValue contentType =
reqHeaders.get(new SipHeaderFieldName(RFC3261.HDR_CONTENT_TYPE));
if (RFC3261.CONTENT_TYPE_SDP.equals(co... | 9 |
@Override
public void windowClosed(WindowEvent e)
{
} | 0 |
public int computeAreaPart(int top, int bottom, Box topBox, Box bottomBox, Box current) {
int area = 0;
if (top < MAX_VALUE && bottom < MAX_VALUE) {
if (current.in(topBox) && current.in(bottomBox)) {
area = -current.area();
} else {
int topLength =... | 8 |
public void drawAsLine(Graphics graphics, double xmin, double xmax, double ymin, double ymax, Dimension componentSize) {
Graphics2D g = (Graphics2D) graphics;
double b1 = a*xmin + b;
double b2 = a*xmax + b;
double y1 = VisualPoint.bToY(b1, ymin, ymax, componentSize);
double y2 = VisualPoint.bToY(b2, ymi... | 9 |
public int temaLookback( int optInTimePeriod )
{
int retValue;
if( (int)optInTimePeriod == ( Integer.MIN_VALUE ) )
optInTimePeriod = 30;
else if( ((int)optInTimePeriod < 2) || ((int)optInTimePeriod > 100000) )
return -1;
retValue = emaLookback ( optInTimePeriod );
retu... | 3 |
public void stop() {
System.out.println("Stopping attack. . .");
for (Flooder flooder : flooders) {
flooder.stop();
}
running = false;
} | 1 |
public String genJSONRequest(String method, String field, String id) {
try {
JsonObject req = new JsonObject();
req.addProperty("method", method);
JsonObject arguments = new JsonObject();
//FIELDS
Scanner sc = new Scanner(field).useDelimit... | 4 |
@Override
public boolean equals(Object other) {
if (this == other)
return true;
if (!(other instanceof Position))
return false;
Position pos = (Position)other;
return ((this.row == pos.row) && (this.col == pos.col));
} | 3 |
private static int[] getFirstK(double[] sum, int k) {
Map<Integer, Double> m = new TreeMap<Integer, Double>();
for (int i = 0; i < sum.length; i++) {
m.put(i, sum[i]);
}
List<Map.Entry<Integer, Double>> mappingList = null;
mappingList = new ArrayList<Map.Entry<Integer... | 5 |
public Object open() {
createContents();
UI.centerShell(getParent(), shell);
shell.open();
shell.layout();
Display display = getParent().getDisplay();
while (!shell.isDisposed()) {
if (!display.readAndDispatch()) {
display.sleep();
}
}
return result;
} | 2 |
static private void parseDataVariables(DodsV parent, Enumeration children) throws NoSuchVariableException {
while (children.hasMoreElements()) {
opendap.dap.BaseType bt = (opendap.dap.BaseType) children.nextElement();
DodsV dodsV = new DodsV(parent, bt);
parent.children.add(dodsV);
if (bt i... | 8 |
@Override
public boolean importData(TransferSupport support) {
if(!canImport(support))
return false;
Transferable transferable = support.getTransferable();
try {
ArrayList<Object> data = (ArrayList<Object>) transferable.getTransferData(
... | 9 |
public void handlePlayerInfo(Packet201PlayerInfo par1Packet201PlayerInfo)
{
GuiPlayerInfo var2 = (GuiPlayerInfo)this.playerInfoMap.get(par1Packet201PlayerInfo.playerName);
if (var2 == null && par1Packet201PlayerInfo.isConnected)
{
var2 = new GuiPlayerInfo(par1Packet201PlayerInfo... | 6 |
public static void testValidity(Object o) throws JSONException {
if (o != null) {
if (o instanceof Double) {
if (((Double) o).isInfinite() || ((Double) o).isNaN()) {
throw new JSONException(
"JSON does not allow non-finite numbers.");
... | 7 |
public List<Position> getPath2(int x, int y){
try{
Pattern pattern= Pattern.compile("(\\d+)");
List<Position> posList= new ArrayList<>();
int X,Y = 0;
if(posicao(pacmanX(),pacmanY())){
String str=intelFant(x, y, pacmanX(), pacmanY(),"solve2");
... | 4 |
protected T fetchOverlappingInterval(T queryInterval) {
Node<U, T> node = (Node<U, T>) binarySearchTree.getRoot();
while (node != null) {
if (node.getValue().overlaps(queryInterval)) {
return node.getValue();
}
Node<U, T> leftChild = node.getLeft();
node = node.getRight();
... | 7 |
public void setAvalie(PExpLogica node)
{
if(this._avalie_ != null)
{
this._avalie_.parent(null);
}
if(node != null)
{
if(node.parent() != null)
{
node.parent().removeChild(node);
}
node.parent(this)... | 3 |
public static TreeNode initNormalTree(int id){
TreeNode root = new TreeNode(1);
if(id==1) {
/**
* 1
* 2 3
* 4 5 6 7
*/
TreeNode l = new TreeNode(2);
TreeNode r = new TreeNode(3);
root.left = l;
root.right = r;
TreeNode ll = new TreeNode(4);
TreeNode lr = new TreeNode(5);
... | 4 |
public Set<Map.Entry<K,Integer>> entrySet() {
return new AbstractSet<Map.Entry<K,Integer>>() {
public int size() {
return _map.size();
}
public boolean isEmpty() {
return TObjectIntMapDecorator.this.isEmpty();
}
public... | 6 |
public void testDES() {
String source = "abcdefghijklmnopqrstuvwxyz";
try {
String key = DESCoder.initKey(source);
byte[] data = DESCoder
.encrypt(source.getBytes(), key, DESCoder.DES);
byte[] result = DESCoder.decrypt(data, key, DESCoder.DES);
assertEquals(source, new String(result));
} catch (E... | 1 |
public boolean isDelete() {
return !(myAdd || myChange);
} | 1 |
public static void main(String[] args) throws Exception {
ServerSocket sersock = new ServerSocket(3000);
System.out.println("Server ready for chatting");
Socket sock = sersock.accept( );
// reading from keyboard (keyRead object)
BufferedReader keyRead = new BufferedReader(new InputStreamReader(S... | 2 |
public String getDefaultName() {
switch (typecode) {
case TC_LONG:
return "l";
case TC_FLOAT:
return "f";
case TC_DOUBLE:
return "d";
default:
return "local";
}
} | 3 |
@Override
public GameState doAction(GameState state, Card card, int time) {
if(time == Time.DAY)
{
//Do nothing
}
else if(time == Time.DUSK)
{
PickTreasure temp = new PickTreasure();
state = temp.doAction(state, card, time);
}
else if(time == Time.NIGHT)
{
state = waitressNightAction(state,... | 3 |
public boolean isPressed() {
if (KeyMapping.xboxController.isAttached()) {
if (button != null && button.isPressed()) {
return true;
}
}
if (Keyboard.isKeyDown(keyboardValue)) {
if (!keyHeld) {
keyHeld = true;
re... | 5 |
private void travelTree(TreeNode node, List<Integer> result) {
//record
result.add(node.val);
TreeNode left = node.left;
TreeNode right = node.right;
//travel left
if(null != left) travelTree(left, result);
//travel right
if(null != right) travelTree(righ... | 2 |
private boolean VerifySelectedObject() {
if(world.getSelectObject() == null)
return selectObjectName.equals("null");
else
return selectObjectName.equals(world.getSelectObject().getName());
} | 1 |
public void frame254(int i1, int i2, int i3, int i4, int i5)
{
outStream.createFrame(254);
outStream.writeByte(i1);
if(i1 == 1)
{
outStream.writeWord(i2);
}
if(i1 >= 2 && i1 <= 6)
{
outStream.writeWord(i3);
outStream.writeWord(i4);
outStream.writeByte(i5);
}
if(i1 == 10)
{
outStream.writeWord(i2);
}
sendMessage("F... | 4 |
@Override
public void keyPressed(KeyEvent e) {
int key = e.getKeyCode();
if(e.isControlDown() && uManager.canUndo()) {
// C-z でUndo実行
if(key == KeyEvent.VK_Z && uManager.canUndo()) {
uManager.undo();
e.consume();
}
// C-y でRedo実行
if(key == KeyEvent.VK_Y && uManager.canRedo()) {
uMana... | 6 |
public static void main(String[] args) throws Exception {
if (args.length != 9) {
System.err.print("Syntax error. Correct syntax:\n"
+ " <trainfile_supervised>" + " <trainfile_semisupervised>"
+ " <supervised_weight>" + " <observation_feature>"
+ " <state_feature>" + " <modelfile>" + " <numiteratio... | 8 |
private void jjCheckNAddStates(int start, int end)
{
do {
jjCheckNAdd(jjnextStates[start]);
} while (start++ != end);
} | 1 |
@Override
protected int getCountInternal(Query query) throws IOException {
// TODO: support query filter
Filter filter = query.getFilter();
if (filter != null) {
//LOGGER.severe("Unhandled filter in getCountInternal" + query.getFilter());
LOGGER.warning("Unable handle... | 4 |
public String getName() {
return name;
} | 0 |
public synchronized boolean removalStep()
{
long l1 = this.TopMessageFinishedAt + 6000L;
long l2 = System.currentTimeMillis();
if (l1 > l2)
{
startRemovalDelay((int)(l1 - l2));
}
else if (this.CurrentMessages.size() > 0)
{
remove((Component)this.CurrentMessages.elementAt(0));
... | 3 |
public void connect() throws ErrorException {
try {
Class.forName( this.DRIVER );
} catch( ClassNotFoundException e ) {
throw new ErrorException( "Brak sterownika JDBC" );
}
try {
polaczenie = DriverManager.getConnection( DB_URL, username, password )... | 2 |
public String getDescription(Hand other) {
if (isRoyalFlush()) return "Royal Flush";
if (isStraightFlush()) return "Straight Flush";
if (hasFourOfAKind()) return "Four of a Kind";
if (isFullHouse()) return "Full House";
if (isFlush()) return "Flush";
if (isStraight()) ret... | 9 |
private Task updateTask(Task currentTask, Task taskToUpdated) {
if (currentTask.getDescription() != null) {
taskToUpdated.setDescription(currentTask.getDescription());
}
if (currentTask.getFromDateTime() != null
&& currentTask.getToDateTime() != null) {
taskToUpdated.setFromDateTime(currentTask.getFromD... | 7 |
public static ArrayList<Excel> rotateZ(int angle, ArrayList<Excel> toScale)
{
return Rotate.rotateZ(angle, toScale);
} | 0 |
public static byte[] decode(InputStream in) throws IOException {
byte first = (byte) in.read();
if (first == -1) {
throw new IOException("End of stream");
}
int length;
if (first >= 0) {
length = first + 1;
} else {
length = (first & 0x1F) + 1;
int count = (first & 0x60) >>> 5;
for (int i... | 3 |
protected void cellsResized(Object[] cells)
{
if (cells != null)
{
mxIGraphModel model = getGraph().getModel();
model.beginUpdate();
try
{
for (int i = 0; i < cells.length; i++)
{
if (!isCellIgnored(cells[i]))
{
cellResized(cells[i]);
break;
}
}
}
finally
... | 3 |
public static double processFancyHouse(FancyHouse fancyHouse) {
long timeStart = System.currentTimeMillis();
while (!fancyHouse.canBeLifted()) {
//Random balloon with diameter 20..30 cm and fullness 80..100%
Balloon b = Balloon.getRandomBalloon(0.10, 0.15, 0.8, 1.0);
... | 1 |
@Override
public boolean getDados() {
preenchido = true;
String msg =bundle.getString("Os Campos: ");
nome = txtNome.getText();
localizacao = txtLocalizacao.getText();
desc = txtaDesc.getText();
descIng = txtaDescIng.getText();
qtQuartos = (int) spNQuartos.g... | 9 |
@Override
public boolean invoke(MOB mob, List<String> commands, Physical givenTarget, boolean auto, int asLevel)
{
final MOB target=this.getTarget(mob,commands,givenTarget);
if(target==null)
return false;
if(!super.invoke(mob,commands,givenTarget,auto,asLevel))
return false;
final boolean success=prof... | 8 |
public Set<Map.Entry<Long,Byte>> entrySet() {
return new AbstractSet<Map.Entry<Long,Byte>>() {
public int size() {
return _map.size();
}
public boolean isEmpty() {
return TLongByteMapDecorator.this.isEmpty();
}
public ... | 8 |
@XmlElementDecl(namespace = "http://www.w3.org/2000/09/xmldsig#", name = "CanonicalizationMethod")
public JAXBElement<CanonicalizationMethodType> createCanonicalizationMethod(CanonicalizationMethodType value) {
return new JAXBElement<CanonicalizationMethodType>(_CanonicalizationMethod_QNAME, Canonicalizatio... | 0 |
public final TLParser.equExpr_return equExpr() throws RecognitionException {
TLParser.equExpr_return retval = new TLParser.equExpr_return();
retval.start = input.LT(1);
Object root_0 = null;
Token set115=null;
TLParser.relExpr_return relExpr114 = null;
TLParser.relExpr... | 7 |
public void gererTour()
{
// Temps max pour test
this.J1.setTempsEcoule(10);
this.J2.setTempsEcoule(10);
boolean fini = false;
while(!fini)
{
if(this.getTour()%2 == 1 && this.J2.getTempsEcoule() != 0)
{
while(!defilerTemps(this.J1))
{
defilerTemps(this.J1);
}
}
if(this.g... | 9 |
public static boolean isPalindrome(String str) {
for (int i = 0, j = str.length() - 1; i < j; i++, j--) {
char a = str.charAt(i);
char b = str.charAt(j);
if (!(Character.isLowerCase(a) || Character.isUpperCase(a))) {
j++;
continue;
}
if (!(Character.isLowerCase(b) || Character.isUpperCase(b))) ... | 6 |
@Override
public void documentAdded(DocumentRepositoryEvent e) {} | 0 |
private int updateCellCount(int cellValue, int count) {
if (count == 0) {
if (cellValue == 1) {
return -1;
}
if (cellValue == 2) {
return 1;
}
} else {
if (count < 0) {
if (cellValue == 1) {
return count - 1;
}
if (cellValue == 2) {
return 1;
}
}
if (count > 0)... | 9 |
@Override
public void valueChanged(ListSelectionEvent selEvt) {
// TODO Auto-generated method stub
if (selEvt.getValueIsAdjusting())
return;
if (selEvt.getSource().equals(riverList))
refreshEditData ();
} | 2 |
private static double getJaccardBtw2User(User u1, User u2){
double same = 0.0;
for (Business business1 : u1.businesses){
for (Business business2 : u2.businesses){
if(business1.id.equals(business2.id)){
double star1 = ubStar.get(u1.u_id + ";" + business1.id);
double star2 = ubStar.get(u2.u_id + ";" ... | 4 |
private Node sumExpression() {
// term ((PLUS^|MINUS^) term)*
Node termExpression = term();
while (lookAhead(1) == TokenType.PLUS ||
lookAhead(1) == TokenType.MINUS) {
if (lookAhead(1) == TokenType.PLUS) {
termExpression = new AddOpNode(match(TokenType.PLUS).getPosition(),
termExpression, term())... | 4 |
@Override
protected void onJoin(final String channel, final String sender,
final String login, final String hostname) {
if (sender.equals(getNick())) {
if (trustNickServ && (nickPass != null) && !loggedIn) {
attemptIdentify();
}
sendMessage(getIntendedChannel(), "Initialized - " + getVersion());
i... | 8 |
protected void fitLogistic(Instances insts, int cl1, int cl2,
int numFolds, Random random)
throws Exception {
// Create header of instances object
FastVector atts = new FastVector(2);
atts.addElement(new Attribute("pred"));
FastVector attVals = new FastVector(2);
attVals.ad... | 7 |
public int removeDuplicates(int[] A) {
// Start typing your Java solution below
// DO NOT write main() function
if (A == null)
return 0;
if (A.length < 3)
return A.length;
int i = -1, tag = 0, count = 1, cur = 1;
while (cur < A.length) {
if (A[cur] == A[tag])
count++;
else {
A[++i] = A... | 9 |
public void mDisplayLCS()
{
System.out.println("Length of Longest Common Sequence is "+
length[seq1.length-1][seq2.length-1]);
LinkedList<Integer> list = new LinkedList<Integer>();
int row = seq1.length-1, col = seq2.length - 1, temp = -1, index = -1;
whi... | 6 |
private void renderStats(GUIContext container, Graphics g) {
g.setColor(new Color(0, 0, 0, 0.4f));
g.fillRoundRect(430, 20, 280, 160, 15);
g.setColor(Color.black);
g.drawRoundRect(430, 20, 280, 160, 15);
g.setColor(Color.white);
g.setFont(bigFont);
if (wavesHaveBegun) {
g.drawString("Wave " + (waveIn... | 6 |
private boolean jj_2_43(int xla) {
jj_la = xla; jj_lastpos = jj_scanpos = token;
try { return !jj_3_43(); }
catch(LookaheadSuccess ls) { return true; }
finally { jj_save(42, xla); }
} | 1 |
public static Client getClientById(long id) {
Client ClientHolder = null;
Session session = null;
try {
session = HibernateUtil.getSessionFactory().openSession();
ClientHolder = (Client) session.get(Client.class, id);
} catch (Exception e) {
e.printSta... | 3 |
public void menuItemUpdate() {
save_to_file.setSelected(theApp.getLogging());
CROWD36_item.setSelected(theApp.isCROWD36());
XPA_10_item.setSelected(theApp.isXPA_10());
XPA_20_item.setSelected(theApp.isXPA_20());
XPA2_item.setSelected(theApp.isXPA2());
CIS3650_item.setSelected(theApp.isCIS3650());
CCIR493_... | 4 |
public static List<String> compareAll(Object o1, Object o2) throws Exception {
final List<String> diffs = new ArrayList<String>();
if (o1.getClass() != o2.getClass()) {
fail("Can't compare different classes");
}
final Field[] fields = o1.getClass().getDeclaredFields();
for (Field f : fields) {
f.setAcc... | 5 |
private Value getValueForType(Body body, LocalGenerator gen,
Type tp, Set<SootClass> constructionStack, Set<SootClass> parentClasses) {
// Depending on the parameter type, we try to find a suitable
// concrete substitution
if (isSimpleType(tp.toString()))
return getSimpleDefaultValue(tp.toString());
else ... | 9 |
public String eval(final String messageTemplate, final Object problem)
{
try
{
final StringBuilder results = new StringBuilder(
messageTemplate.length());
int state = STATE_OUT_OF_EXPRESSION;
int expStartIndex = 0;
/*
* So you may have guessed that writing compilers is not my strong
* su... | 8 |
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://download.oracle.com/j... | 6 |
private boolean isInBounds(int cy, int cx) {
return cx >= 0 && cy >= 0 && cx < BOARD_SIZE && cy < BOARD_SIZE;
} | 3 |
public boolean containsBadStates() {
for (Entry<Integer, HashSet<HashSet<Integer>>> entryOfTable : FiniteTreesTable.entrySet()) {
for (HashSet<Integer> tree : entryOfTable.getValue()) {
if (!FiniteTreesTable.keySet().containsAll(tree))
return true;
}
}
return false;
} | 3 |
private void addToList(List<Ball>[] array, int i, Ball b) {
if (array[i] == null) {
LinkedList<Ball> t = new LinkedList<Ball>();
t.add(b);
array[i] = t;
} else {
array[i].add(b);
}
} | 1 |
private void btonrepoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btonrepoActionPerformed
switch (tabla.getSelectedRow()) {
case 0:
setClientView(false);
jDialog1.setSize(220, 184);
jDialog1.setLocationRelativeTo(this);
... | 7 |
public Deck() {
// generate the 52 cards and shuffle them
for (int i = 0; i < Card.SUITS.length; i++) {
for (int j = 0; j < Card.CARD_TYPES.length; j++) {
Card card = new Card(Card.CARD_TYPES[j], Card.SUITS[i]);
cardDeck.add(card);
}
}
shuffleDeck();
} | 2 |
void replaceChild (Node oldChild, Node newChild)
{
if (_occurs_ == oldChild)
{
setOccurs ((TOccurs) newChild);
return;
}
if (_occursTo_ == oldChild)
{
setOccursTo ((POccursTo) newChild);
return;
}
if (_number... | 7 |
@Override
public double cumulativeProbability(double x) {
if (x >= this.point) return 1.0;
else return 0.0;
} | 1 |
private String fixBadChars(String s) {
if (s == null || s.length() == 0) return s;
Pattern p = Pattern.compile("[<>\"&]");
Matcher m = p.matcher(s);
StringBuffer b = null;
while (m.find()) {
if (b == null) b = new StringBuffer();
switch (s.charAt(m.start(... | 9 |
public ChangesStatus withdrawMoney(int account_id, int customer_id_by,
int amount, int pin) throws BelowMinimumBalanceException {
Connection connection = DBConnectionHelper.getConnection();
AccountDAO accountDAO = DAOFactory.getAccountDAO();
try {
Account account = accountDAO.getObject(connection, account... | 7 |
public Agent(InfluenceMatrix inf,
ArrayList<HashSet<Integer>> iterationPlan, int processingPower,
String type, int totalNum, double constraint, boolean isAveraging,
boolean isExhaustive
/*
* , boolean isRefactoringAll
*/) {
// check for valid iteration plan
boolean flagArray[] = new boolean[inf.getN()... | 9 |
public void setFlowBlock(FlowBlock flowBlock) {
if (this.flowBlock != flowBlock) {
this.flowBlock = flowBlock;
StructuredBlock[] subs = getSubBlocks();
for (int i = 0; i < subs.length; i++) {
if (subs[i] != null)
subs[i].setFlowBlock(flowBlock);
}
}
} | 3 |
public static double logNormalThreeParPDF(double alpha, double beta, double gamma, double x) {
if (beta < 0) throw new IllegalArgumentException("The parameter beta, " + beta + ", must be greater than or equal to zero");
if (x <= alpha) {
return 0.0D;
} else {
return Math.exp(-0.5D * Fmath.square(Math.log((x... | 2 |
private Map<String, String> parseVariablesForUri(final URI uri, final String[] routePaths) {
Map<String, String> routeParams = null;
Map<String, String> variables = new HashMap<String, String>();
String[] inputPaths = URIUtils.getPathSegments(uri);
boolean isComponentCountEqual = routeP... | 5 |
@Override
public boolean equals(Object object) {
// TODO: Warning - this method won't work in the case the id fields are not set
if (!(object instanceof HabitatCategory)) {
return false;
}
HabitatCategory other = (HabitatCategory) object;
if ((this.id == null && o... | 5 |
public static void save() throws IOException {
// Scanner scan = new Scanner(System.in);
File input = new File("src/" + ACC + ".txt");
try {
Scanner scan = new Scanner(input);
String table = "";
while (scan.hasNextLine()) {
String temp = scan.nextLine();
String[] t = temp.split(",");
if (t[0... | 6 |
@EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = true)
public void onEntityTarget(EntityTargetEvent event) {
Entity target = event.getTarget();
if (target instanceof Player) {
xAuthPlayer xp = plyrMngr.getPlayer(((Player) target).getName());
if (plyrMngr.isRestricted(xp, event))
event.set... | 2 |
public void setHeight(Double height) {
this.height = height;
} | 0 |
@Override
public void updateUser(User user) throws SQLException {
Session session=null;
try{
session=HibernateUtil.getSessionFactory().openSession();
session.beginTransaction();
session.update(user);
session.getTransaction().commit();
}catch(Exception e){
e.printStackTrace();
}finally{
if(ses... | 3 |
public void desplazar(Vector3f distancia) {
Transform3D nueva = MiLibreria3D.trasladarDinamico(distancia);
Transform3D actual = new Transform3D();
tgPersonaje.getTransform(actual);
actual.mul(nueva);
tgPersonaje.setTransform(actual);
float diagonal = distancia.getY() * ES... | 8 |
private void checkFromNode()
{
Edge edgeFrom = addressFinder.searchForEdge(from.getText());
if (edgeFrom != null)
{
fromNode = edgeFrom.getFromNode();
from.setText(edgeFrom.getRoadName());
mapComponent.setFrom(true);
mapComponent.setFromNode(fromNode);
mapComponent.repaint();
reset.setEnabled(t... | 1 |
final int method1607(int i, int i_0_, byte i_1_) {
anInt2882++;
int i_2_ = ((i ^ 0xffffffff) > (Class321.windowWidth ^ 0xffffffff)
? Class321.windowWidth : i);
if (Class5_Sub1.aClass221_8344 == this)
return 0;
if (i_1_ >= -103)
aBoolean2881 = true;
if (this == Class223.aClass221_2893)
return i... | 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.