rem stringlengths 0 477k | add stringlengths 0 313k | context stringlengths 6 599k |
|---|---|---|
mailData = new LimitingInputStream(mailData, MAX_MESSAGE_BYTES); | public boolean inject(String fromAddress, String toAddress, byte[] mailData) throws MessagingException { if (log.isDebugEnabled()) log.debug("Injecting message sent to " + toAddress); InternetAddress fromAddy = new InternetAddress(fromAddress); InternetAddress toAddy = new InternetAddress(toAddress); // Must... | |
System.out.println( Constants.APP_NAME + " " + res.getString("VERSION")+" " + PACKAGE.getImplementationVersion() ); | System.out.println( Constants.APP_NAME + " " + res.getString("VERSION")+" " + JavaImageAlbumFrame.class.getPackage().getImplementationVersion() ); | public static void main(String args[]) { // Read command line parameter try { if (args.length > 0) { for(int i = 0;i < args.length;i++) { if (args[i].equalsIgnoreCase("-v")) { System.out.println( Constants.APP_NAME + " " + res.getStri... |
if(loc.isContiguous()) { return false; } | public boolean equals(Object o) { if(!(o instanceof Location)) { return false; } Location loc = (Location) o; if(loc.isContiguous()) { return false; } if(loc.getMin() != getMin()) { return false; } if(loc.getMax() != getMax()) { return false; } Iterator thisI = blockIterator();... | |
public void setList(Long listId, String name, String description, boolean holdSubs) throws NotFoundException, PermissionException | public void setList(Long listId, String name, String description, String url, String email, boolean holdSubs) throws NotFoundException, PermissionException | public void setList(Long listId, String name, String description, boolean holdSubs) throws NotFoundException, PermissionException { MailingList list = this.getListFor(listId, Permission.EDIT_SETTINGS); list.setName(name); list.setDescription(description); boolean flushHolds = list.isSubscriptionHeld() && !hold... |
list.setUrl(url); list.setEmail(email); | public void setList(Long listId, String name, String description, boolean holdSubs) throws NotFoundException, PermissionException { MailingList list = this.getListFor(listId, Permission.EDIT_SETTINGS); list.setName(name); list.setDescription(description); boolean flushHolds = list.isSubscriptionHeld() && !hold... | |
public PairwiseDP(FlatModel mm) throws IllegalResidueException, | public PairwiseDP(MarkovModel mm) throws IllegalResidueException, | public PairwiseDP(FlatModel mm) throws IllegalResidueException, IllegalTransitionException { super(mm); magicalState = mm.magicalState(); magicalResidue = MagicalState.MAGICAL_RESIDUE; } |
seq[0].length(), | public double backward(ResidueList [] seq) throws IllegalResidueException, IllegalAlphabetException, IllegalResidueException { if(seq.length != 1) { throw new IllegalArgumentException("seq must be 1 long, not " + seq.length); } DPCursor dpCursor = new SmallCursor( getStates(), seq[0].length()... | |
seq[0].length(), | public double forward(ResidueList [] seq) throws IllegalResidueException, IllegalAlphabetException, IllegalResidueException { if(seq.length != 1) { throw new IllegalArgumentException("seq must be 1 long, not " + seq.length); } DPCursor dpCursor = new SmallCursor( getStates(), seq[0].length(),... | |
DPCursor dpCursor = new SmallCursor(getStates(), r.length(), r, r.iterator()); | DPCursor dpCursor = new SmallCursor(getStates(), r, r.iterator()); | public StatePath viterbi(ResidueList [] resList) throws IllegalResidueException { ResidueList r = resList[0]; DPCursor dpCursor = new SmallCursor(getStates(), r.length(), r, r.iterator()); return viterbi(dpCursor); } |
} else if (l.isContiguous()) { | } else if (l.isContiguous() && !CircularLocationTools.isCircular(l)) { | private static List getBlockList(Location l) { if (l == Location.empty) { return Collections.EMPTY_LIST; } else if (l instanceof CompoundLocation) { return ((CompoundLocation )l).getBlockList(); } else if (l.isContiguous()) { return Collections.nCopies(1, l); } else { List bl = new ArrayList(); ... |
WeightedHostSet ns = new WeightedHostSet(); | WeightedHostSet ns = new WeightedHostSet(scoreHighCap); | protected WeightedHostSet constrain(WeightedHostSet s, ResourceConstraintChecker rcc, TaskConstraints tc) { if (rcc == null) { return s; } else { WeightedHostSet ns = new WeightedHostSet(); Iterator i = s.iterator(); while (i.hasNext()) { WeightedHost wh = (WeightedHost) i.next(); if (rcc.checkConst... |
if (rcc.checkConstraints(wh.getHost(), tc)) { | if (rcc.checkConstraints(wh.getHost(), tc) && notOverloaded(wh)) { | protected WeightedHostSet constrain(WeightedHostSet s, ResourceConstraintChecker rcc, TaskConstraints tc) { if (rcc == null) { return s; } else { WeightedHostSet ns = new WeightedHostSet(); Iterator i = s.iterator(); while (i.hasNext()) { WeightedHost wh = (WeightedHost) i.next(); if (rcc.checkConst... |
logger.debug("Sorted: " + s); | protected synchronized BoundContact getNextContact(TaskConstraints t) throws NoFreeResourceException { checkGlobalLoadConditions(); BoundContact contact; WeightedHostSet s = sorted; s = constrain(s, getConstraintChecker(), t); double sum = s.getSum(); if (policy == POLICY_WEIGHTED_RANDOM) { double rand = Mat... | |
sum += wh.getScore(); | sum += wh.getTScore(); | protected synchronized BoundContact getNextContact(TaskConstraints t) throws NoFreeResourceException { checkGlobalLoadConditions(); BoundContact contact; WeightedHostSet s = sorted; s = constrain(s, getConstraintChecker(), t); double sum = s.getSum(); if (policy == POLICY_WEIGHTED_RANDOM) { double rand = Mat... |
return wh.getHost(); | selected = wh; break; | protected synchronized BoundContact getNextContact(TaskConstraints t) throws NoFreeResourceException { checkGlobalLoadConditions(); BoundContact contact; WeightedHostSet s = sorted; s = constrain(s, getConstraintChecker(), t); double sum = s.getSum(); if (policy == POLICY_WEIGHTED_RANDOM) { double rand = Mat... |
normalize(); contact = s.last().getHost(); | if (selected == null) { if (s.isEmpty()) { throw new NoFreeResourceException(); } else { selected = s.last(); } } | protected synchronized BoundContact getNextContact(TaskConstraints t) throws NoFreeResourceException { checkGlobalLoadConditions(); BoundContact contact; WeightedHostSet s = sorted; s = constrain(s, getConstraintChecker(), t); double sum = s.getSum(); if (policy == POLICY_WEIGHTED_RANDOM) { double rand = Mat... |
normalize(); contact = s.last().getHost(); | selected = s.last(); | protected synchronized BoundContact getNextContact(TaskConstraints t) throws NoFreeResourceException { checkGlobalLoadConditions(); BoundContact contact; WeightedHostSet s = sorted; s = constrain(s, getConstraintChecker(), t); double sum = s.getSum(); if (policy == POLICY_WEIGHTED_RANDOM) { double rand = Mat... |
logger.debug("Next contact: " + contact); | logger.debug("Next contact: " + selected.getHost()); | protected synchronized BoundContact getNextContact(TaskConstraints t) throws NoFreeResourceException { checkGlobalLoadConditions(); BoundContact contact; WeightedHostSet s = sorted; s = constrain(s, getConstraintChecker(), t); double sum = s.getSum(); if (policy == POLICY_WEIGHTED_RANDOM) { double rand = Mat... |
return contact; | selected.changeLoad(1); selected.setDelayedDelta(successFactor); return selected.getHost(); | protected synchronized BoundContact getNextContact(TaskConstraints t) throws NoFreeResourceException { checkGlobalLoadConditions(); BoundContact contact; WeightedHostSet s = sorted; s = constrain(s, getConstraintChecker(), t); double sum = s.getSum(); if (policy == POLICY_WEIGHTED_RANDOM) { double rand = Mat... |
double ns = checkCaps(score * factor); | double ns = factor(score, factor); | protected synchronized void multiplyScore(WeightedHost wh, double factor) { double score = wh.getScore(); if (logger.isDebugEnabled()) { logger.debug("multiplyScore(" + wh + ", " + factor + ")"); } double ns = checkCaps(score * factor); sorted.changeScore(wh, ns); if (logger.isDebugEnabled()) { logger.debug(... |
connectionRefusedFactor = 0.1; connectionTimeoutFactor = 0.05; jobSubmissionTaskLoadFactor = 0.9; transferTaskLoadFactor = 0.9; fileOperationTaskLoadFactor = 0.95; successFactor = 1.01; failureFactor = 0.9; | connectionRefusedFactor = -10; connectionTimeoutFactor = -20; jobSubmissionTaskLoadFactor = -0.2; transferTaskLoadFactor = -0.2; fileOperationTaskLoadFactor = -0.01; successFactor = 1; failureFactor = -0.1; | protected final void setDefaultFactors() { connectionRefusedFactor = 0.1; connectionTimeoutFactor = 0.05; jobSubmissionTaskLoadFactor = 0.9; transferTaskLoadFactor = 0.9; fileOperationTaskLoadFactor = 0.95; successFactor = 1.01; failureFactor = 0.9; scoreHighCap = 100; scoreLowCap = 0.01; normalizationDelay ... |
scoreLowCap = 0.01; normalizationDelay = 100; | jobThrottle = 2; | protected final void setDefaultFactors() { connectionRefusedFactor = 0.1; connectionTimeoutFactor = 0.05; jobSubmissionTaskLoadFactor = 0.9; transferTaskLoadFactor = 0.9; fileOperationTaskLoadFactor = 0.95; successFactor = 1.01; failureFactor = 0.9; scoreHighCap = 100; scoreLowCap = 0.01; normalizationDelay ... |
sorted = new WeightedHostSet(); | sorted = new WeightedHostSet(scoreHighCap); | public void setResources(ContactSet grid) { super.setResources(grid); sorted = new WeightedHostSet(); Iterator i = grid.getContacts().iterator(); while (i.hasNext()) { addToSorted(new WeightedHost((BoundContact) i.next())); } } |
return 1 / x; | return -x; | private double spow(double x, int exp) { if (exp == 1) { return x; } else if (exp == -1) { return 1 / x; } else { throw new IllegalArgumentException(); } } |
factorMultiple(contacts, successFactor); | factorMultipleLater(contacts, successFactor); | public void statusChanged(StatusEvent e) { try { Task t = (Task) e.getSource(); int code = e.getStatus().getStatusCode(); Contact[] contacts = getContacts(t); if (code == Status.SUBMITTED) { // this isn't reliable // factorSubmission(t, contacts, 1); } else if (code == Status.COMPLETED) { factorS... |
factorMultiple(contacts, failureFactor); | factorMultipleLater(contacts, failureFactor); | public void statusChanged(StatusEvent e) { try { Task t = (Task) e.getSource(); int code = e.getStatus().getStatusCode(); Contact[] contacts = getContacts(t); if (code == Status.SUBMITTED) { // this isn't reliable // factorSubmission(t, contacts, 1); } else if (code == Status.COMPLETED) { factorS... |
factorMultiple(contacts, connectionRefusedFactor); | factorMultipleLater(contacts, connectionRefusedFactor); | public void statusChanged(StatusEvent e) { try { Task t = (Task) e.getSource(); int code = e.getStatus().getStatusCode(); Contact[] contacts = getContacts(t); if (code == Status.SUBMITTED) { // this isn't reliable // factorSubmission(t, contacts, 1); } else if (code == Status.COMPLETED) { factorS... |
factorMultiple(contacts, connectionTimeoutFactor); | factorMultipleLater(contacts, connectionTimeoutFactor); | public void statusChanged(StatusEvent e) { try { Task t = (Task) e.getSource(); int code = e.getStatus().getStatusCode(); Contact[] contacts = getContacts(t); if (code == Status.SUBMITTED) { // this isn't reliable // factorSubmission(t, contacts, 1); } else if (code == Status.COMPLETED) { factorS... |
if (term instanceof ComparableTerm) return (ComparableTerm)term; | public ComparableTerm getOrImportTerm(Term term) { if (term instanceof ComparableTerm) return (ComparableTerm)term; try { if (!this.termsMap.containsKey(term.getName())) return (ComparableTerm)this.importTerm(term,term.getName()); else return (ComparableTerm)this.getTerm(name); ... | |
else return (ComparableTerm)this.getTerm(name); | else return (ComparableTerm)this.getTerm(term.getName()); | public ComparableTerm getOrImportTerm(Term term) { if (term instanceof ComparableTerm) return (ComparableTerm)term; try { if (!this.termsMap.containsKey(term.getName())) return (ComparableTerm)this.importTerm(term,term.getName()); else return (ComparableTerm)this.getTerm(name); ... |
public static void writeModel(FlatModel model, PrintStream out) throws Exception { | public static void writeModel(MarkovModel model, PrintStream out) throws Exception { model = DP.flatView(model); | public static void writeModel(FlatModel model, PrintStream out) throws Exception { FiniteAlphabet stateA = model.stateAlphabet(); FiniteAlphabet resA = (FiniteAlphabet) model.emissionAlphabet(); ResidueList stateR = stateA.residues(); List stateL = stateR.toList(); ResidueList resR = resA.residues(); ... |
Class.forName("org.postgresql.Driver"); String dbURL = "jdbc:postgresql: String dbUser = "keith"; | String dbURL = "jdbc:postgresql: String dbUser = "thomas"; | public static void main(String[] args) throws Exception {// String dbURL = "jdbc:mysql://fred.biohack.egenetics.com/test_biosql";// String dbUser = "";// String dbPass = "";// String bioName = "embl_rod"; Class.forName("org.postgresql.Driver"); String dbURL = "jdbc:postgresql://localhost:... |
String bioName = "n_meningitidis"; | String bioName = "embl"; | public static void main(String[] args) throws Exception {// String dbURL = "jdbc:mysql://fred.biohack.egenetics.com/test_biosql";// String dbUser = "";// String dbPass = "";// String bioName = "embl_rod"; Class.forName("org.postgresql.Driver"); String dbURL = "jdbc:postgresql://localhost:... |
SequenceFormat ff = new EmblLikeFormat(); | SequenceFormat ff = new EmblFormat(); | public static void main(String[] args) throws Exception {// String dbURL = "jdbc:mysql://fred.biohack.egenetics.com/test_biosql";// String dbUser = "";// String dbPass = "";// String bioName = "embl_rod"; Class.forName("org.postgresql.Driver"); String dbURL = "jdbc:postgresql://localhost:... |
localVariables[i].checkVariableScope(this.codeStart); | private LocalVariableInfo[] buildLocalVariableInfo(){ Vector tempLocalVars = new Vector(); for(int i = 0; localVariables != null && i < localVariables.length; i++){ // Only add informations for variables with valid start and end instructions. if(localVariables[i].getStart() != null && localVariables[i... | |
public synchronized SequenceDB getSequenceDB(String identifier) { Contract.pre(identifier != null, "identifier not null"); | public synchronized SequenceDB getSequenceDB(String identifier) { Contract.pre(identifier != null, "identifier was null"); | public synchronized SequenceDB getSequenceDB(String identifier) { Contract.pre(identifier != null, "identifier not null"); return (SequenceDB) this.sequenceDBByIdentifier.get(identifier); } |
public String toString() { return "StupidSequenceDBInstallation"; } | public String toString() { return "SimpleSequenceDBInstallation: " + this.sequenceDBByIdentifier.values(); } | public String toString() { return "StupidSequenceDBInstallation"; } |
fixy = battleField.getBoundingBox().getHeight() - getBoundingBox().height - getBoundingBox().y; | fixy = battleField.getBoundingBox().getHeight() - boundingBox.height - getBoundingBox().y; | public void checkWallCollision() { boolean hitWall = false; double fixx = 0, fixy = 0; double angle = 0; if (boundingBox.x + boundingBox.width > battleField.getBoundingBox().getWidth()) { hitWall = true; fixx = battleField.getBoundingBox().getWidth() - boundingBox.width - boundingBox.x; angle = normalRelativ... |
double velocity1 = fixx / sin(heading); double velocity2 = fixy / cos(heading); double fixv = (max(abs(velocity1), abs(velocity2)) == abs(velocity1)) ? velocity1 : velocity2; | double fixv = hypot(fixx, fixy); | public void checkWallCollision() { boolean hitWall = false; double fixx = 0, fixy = 0; double angle = 0; if (boundingBox.x + boundingBox.width > battleField.getBoundingBox().getWidth()) { hitWall = true; fixx = battleField.getBoundingBox().getWidth() - boundingBox.width - boundingBox.x; angle = normalRelativ... |
int start = Math.min(getMin(), l.getMin()); int end = Math.max(getMax(), l.getMax()); | List al = new ArrayList(2); al.add(this); al.add(l); | public Location union(Location l) { int start = Math.min(getMin(), l.getMin()); int end = Math.max(getMax(), l.getMax()); return new RangeLocation(start, end); } |
return new RangeLocation(start, end); | return new CompoundLocation(al); | public Location union(Location l) { int start = Math.min(getMin(), l.getMin()); int end = Math.max(getMax(), l.getMax()); return new RangeLocation(start, end); } |
return argb & 0xff000000 | HSLtoRGB(hsl[0], hsl[1], (HSL[2] + hsl[2]) / 2); | float L = Math.min(Math.max((0.15f + (hsl[2] + HSL[2] - 0.5f)), 0), 1); return argb & 0xff000000 | HSLtoRGB(hsl[0], hsl[1], L); | public int filterRGB(int x, int y, int argb) { int r = (argb >> 16) & 0xff; int g = (argb >> 8) & 0xff; int b = argb & 0xff; float[] HSL = RGBtoHSL(r, g, b); if (HSL[1] > 0) { return argb & 0xff000000 | HSLtoRGB(hsl[0], hsl[1], (HSL[2] + hsl[2]) / 2); } return argb; } |
private void checkExtraNodes(GroupNode n) throws Exception | private void checkExtraNodes(GroupNode n) | private void checkExtraNodes(GroupNode n) throws Exception { TreeGroupDAO tgm = DataAccessDriver.getInstance().newTreeGroupDAO(); List childGroups = tgm.selectGroups(n.getId()); for (Iterator iter = childGroups.iterator(); iter.hasNext();) { GroupNode f = (GroupNode)iter.next(); this.checkExtraNodes(f);... |
public List getNodes() throws Exception | public List getNodes() | public List getNodes() throws Exception { List nodes = new ArrayList(); TreeGroupDAO tgm = DataAccessDriver.getInstance().newTreeGroupDAO(); List rootGroups = tgm.selectGroups(0); for (Iterator iter = rootGroups.iterator(); iter.hasNext();) { GroupNode n = (GroupNode)iter.next(); this.checkExtraNo... |
int modifiers, String ident, CType returnType, CType[] paramTypes, CReferenceType[] exceptions, boolean deprecated, boolean synthetic, JBlock body) { super(owner, modifiers, ident, returnType, paramTypes, exceptions, deprecated, synthetic); this.body = body; } | int modifiers, String ident, CType returnType, JFormalParameter[] params, CType[] paramTypes, CReferenceType[] exceptions, boolean deprecated, boolean synthetic, JBlock body) { super(owner, modifiers, ident, returnType, paramTypes, exceptions, deprecated, synthetic); this.body = body; if(params != null){ this.fparamete... | public CSourceMethod(CClass owner, int modifiers, String ident, CType returnType, CType[] paramTypes, CReferenceType[] exceptions, boolean deprecated, boolean synthetic, JBlock body) { super(owner, modifiers, ident, returnType, paramTypes, exceptions... |
code.openNewScope(); | LocalVariableScope scope = new LocalVariableScope(); code.pushLocalVariableScope(scope); | private CodeInfo genByteCode(TypeFactory factory) { CodeSequence code = CodeSequence.getCodeSequence(); GenerationContext context = new GenerationContext(factory, code); code.openNewScope(); // TODO [mef] : add "this" and parameters to local variable info// if(this.getParameters().length > 0){... |
JFormalParameter[] params = this.getFormalParameters(); for(int i = 0; i < params.length; i++){ code.addLocalVarInfo(null, params[i]); } | private CodeInfo genByteCode(TypeFactory factory) { CodeSequence code = CodeSequence.getCodeSequence(); GenerationContext context = new GenerationContext(factory, code); code.openNewScope(); // TODO [mef] : add "this" and parameters to local variable info// if(this.getParameters().length > 0){... | |
code.closeScope(); | code.popLocalVariableScope(scope); | private CodeInfo genByteCode(TypeFactory factory) { CodeSequence code = CodeSequence.getCodeSequence(); GenerationContext context = new GenerationContext(factory, code); code.openNewScope(); // TODO [mef] : add "this" and parameters to local variable info// if(this.getParameters().length > 0){... |
/* Integer pos = new Integer(var.getLocalIndex()); | if(! CodeSequence.generateLocalVarInfo) return; if(var.isGenerated()){ return; } Integer pos = new Integer(var.getPosition()); | private final void addLocalVarInfo(LocalVarInstruction insn, JLocalVariable var) {/* // DISABLED, SLOW AND NOT USED AFTER Integer pos = new Integer(var.getLocalIndex()); Stack elemsAtPos; JLocalVariableEntry entry = new JLocalVariableEntry(insn, var); elemsAtPos = (Stack)locals.get(pos); if... |
JLocalVariableEntry entry = new JLocalVariableEntry(insn, var); elemsAtPos = (Stack)locals.get(pos); | JLocalVariableEntry entry = new JLocalVariableEntry(insn, var, (LocalVariableScope)scopes.peek()); elemsAtPos = (Stack)locals.get(pos); | private final void addLocalVarInfo(LocalVarInstruction insn, JLocalVariable var) {/* // DISABLED, SLOW AND NOT USED AFTER Integer pos = new Integer(var.getLocalIndex()); Stack elemsAtPos; JLocalVariableEntry entry = new JLocalVariableEntry(insn, var); elemsAtPos = (Stack)locals.get(pos); if... |
locals.put(pos, elemsAtPos = new Stack()); elemsAtPos.push(entry); } else if (!((JLocalVariableEntry)elemsAtPos.peek()).merge(entry)) { elemsAtPos.push(entry); | locals.put(pos, elemsAtPos = new Stack()); elemsAtPos.push(entry); } else if (! ((JLocalVariableEntry)elemsAtPos.peek()).getVar().getIdent().equals(var.getIdent())){ elemsAtPos.push(entry); | private final void addLocalVarInfo(LocalVarInstruction insn, JLocalVariable var) {/* // DISABLED, SLOW AND NOT USED AFTER Integer pos = new Integer(var.getLocalIndex()); Stack elemsAtPos; JLocalVariableEntry entry = new JLocalVariableEntry(insn, var); elemsAtPos = (Stack)locals.get(pos); if... |
*/ | private final void addLocalVarInfo(LocalVarInstruction insn, JLocalVariable var) {/* // DISABLED, SLOW AND NOT USED AFTER Integer pos = new Integer(var.getLocalIndex()); Stack elemsAtPos; JLocalVariableEntry entry = new JLocalVariableEntry(insn, var); elemsAtPos = (Stack)locals.get(pos); if... | |
results.addFeature(new SSRemoteFeature(SubSequence.this, this, rft, f)); | results.addFeature(new SSRemoteFeature(SubSequence.this, featureParent, rft, f)); | protected FeatureHolder createFeatureHolder() { ProjectionContext pc = new ProjectionContext() { public FeatureHolder getParent(Feature f) { return featureParent; } public Sequence getSequence(Feature f) { return SubSequence.this; } public Location getLocation(Feature f) { return f.getLocation(... |
Subscription sub = new Subscription(ea.getPerson(), list, ea, null); | Subscription sub = new Subscription(ea.getPerson(), list, ea, list.getOwnerRole()); | public Long createMailingList(InternetAddress address, URL url, String description, InternetAddress[] initialOwners) throws CreateMailingListException { // TODO: consider whether or not we should enforce any formatting of // the url here. Seems like that's a job for the web front end? // Make sure address and u... |
public static void checkUnreadPosts(Forum forum, Map tracking, long lastVisit) throws Exception | public static void checkUnreadPosts(Forum forum, Map tracking, long lastVisit) | public static void checkUnreadPosts(Forum forum, Map tracking, long lastVisit) throws Exception { LastPostInfo lpi = forum.getLastPostInfo(); if (lpi == null) { return; } Integer topicId = new Integer(lpi.getTopicId()); if (tracking != null && tracking.containsKey(topicId)) { long readTime = ((Long)tracki... |
Map tracking, boolean checkUnreadPosts) throws Exception | Map tracking, boolean checkUnreadPosts) | public static List getAllCategoriesAndForums(UserSession us, int anonymousUserId, Map tracking, boolean checkUnreadPosts) throws Exception { long lastVisit = 0; int userId = anonymousUserId; if (us != null) { lastVisit = us.getLastVisit().getTime(); userId = us.getUserId(); } // Do not check for unread... |
public static void notifyUsers(Forum f, Topic t, ForumDAO tm) throws Exception | public static void notifyUsers(Forum f, Topic t, ForumDAO tm) | public static void notifyUsers(Forum f, Topic t, ForumDAO tm) throws Exception { if (SystemGlobals.getBoolValue(ConfigKeys.MAIL_NOTIFY_ANSWERS)) { try { List usersToNotify = tm.notifyUsers(f); // we only have to send an email if there are users // subscribed to the topic if (usersToNotify != null && use... |
rlistener.setVersion(Integer.parseInt(m.group(2))); rlistener.setIdentifier(m.group(3)); | if (m.group(3)!=null) rlistener.setVersion(Integer.parseInt(m.group(3))); if (m.group(5)!=null) rlistener.setIdentifier(m.group(5)); | public boolean readRichSequence(BufferedReader reader, SymbolTokenization symParser, RichSeqIOListener rlistener, Namespace ns) throws IllegalSymbolException, IOException, ParseException { String line; boolean hasAnotherSequence = true; //bool... |
public void deleteAllRoles(int id) throws Exception | public void deleteAllRoles(int id) | public void deleteAllRoles(int id) throws Exception { PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement( SystemGlobals.getSql("PermissionControl.getRoleIdsByGroup")); p.setInt(1, id); String roleIds = this.getCsvIdList(p); p.close(); if (roleIds.length() == 0) { return; } ... |
PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement( SystemGlobals.getSql("PermissionControl.getRoleIdsByGroup")); p.setInt(1, id); String roleIds = this.getCsvIdList(p); p.close(); if (roleIds.length() == 0) { return; } p = this.getStatementForCsv( SystemGlobals.getSql("PermissionControl.... | PreparedStatement p=null; try { p = JForumExecutionContext.getConnection().prepareStatement( SystemGlobals.getSql("PermissionControl.getRoleIdsByGroup")); p.setInt(1, id); String roleIds = this.getCsvIdList(p); p.close(); p=null; if (roleIds.length() == 0) { return; } p = this.getStatementForCsv( SystemGlobals.getS... | public void deleteAllRoles(int id) throws Exception { PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement( SystemGlobals.getSql("PermissionControl.getRoleIdsByGroup")); p.setInt(1, id); String roleIds = this.getCsvIdList(p); p.close(); if (roleIds.length() == 0) { return; } ... |
protected String getCsvIdList(PreparedStatement p) throws Exception | protected String getCsvIdList(PreparedStatement p) throws SQLException | protected String getCsvIdList(PreparedStatement p) throws Exception { ResultSet rs = p.executeQuery(); StringBuffer sb = new StringBuffer(); while (rs.next()) { sb.append(rs.getInt(1)).append(","); } sb.append("-1"); rs.close(); return sb.toString(); } |
protected PreparedStatement getStatementForCsv(String sql, String csv) throws Exception | protected PreparedStatement getStatementForCsv(String sql, String csv) throws SQLException | protected PreparedStatement getStatementForCsv(String sql, String csv) throws Exception { int index = sql.indexOf('?'); sql = sql.substring(0, index) + csv + sql.substring(index + 1); return JForumExecutionContext.getConnection().prepareStatement(sql); } |
temp.strand = getStrand(); | public Feature.Template makeTemplate() { ComponentFeature.Template temp = new ComponentFeature.Template(); temp.type = getType(); temp.source = getSource(); temp.location = getLocation(); temp.annotation = getAnnotation(); temp.componentLocation = getComponentLocation(); temp.componentSequenceName = componentID; //... | |
if (browserCommand.indexOf(" ") != -1) { browserCommand = '"' + browserCommand + '"'; } | public BrowserManager(RobocodeManager manager) { this.manager = manager; if (File.separatorChar == '/') { browserCommand = Constants.cwd() + File.separator + "browser.sh"; } else { browserCommand = Constants.cwd() + File.separator + "browser.bat"; } } | |
private Object[] getWorkflowActions(int workflowId, int transitionId) | private List<String> getWorkflowActions(int workflowId, int transitionId) | private Object[] getWorkflowActions(int workflowId, int transitionId) throws PSExtensionProcessingException { String PROP_DELIMITER = ","; String VALUE_DELIMITER = "|"; ArrayList<String> actions = new ArrayList<String>(); Properties props = new Properties(); try {... |
ArrayList<String> actions = new ArrayList<String>(); | List<String> actions = new ArrayList<String>(); | private Object[] getWorkflowActions(int workflowId, int transitionId) throws PSExtensionProcessingException { String PROP_DELIMITER = ","; String VALUE_DELIMITER = "|"; ArrayList<String> actions = new ArrayList<String>(); Properties props = new Properties(); try {... |
return actions.toArray(); | return actions; | private Object[] getWorkflowActions(int workflowId, int transitionId) throws PSExtensionProcessingException { String PROP_DELIMITER = ","; String VALUE_DELIMITER = "|"; ArrayList<String> actions = new ArrayList<String>(); Properties props = new Properties(); try {... |
Object actions[] = getWorkflowActions(workflowId, transitionId); for(int i = 0; i < actions.length; i++) | List<String> actions = getWorkflowActions(workflowId, transitionId); log.debug("found " + actions.size() + " actions to execute."); for(String action : actions) | public void performAction(IPSWorkFlowContext wfContext, IPSRequestContext request) throws PSExtensionProcessingException { String sName = "performAction"; log.debug("WFActionDispatcher::performAction executing..."); boolean bOK = true; int contentId = 0; try { ... |
log.debug("Executing " + actions[i] + "... "); String className = getWorkflowActionClassName(actions[i].toString()); Class cl = Class.forName(className); Object action = cl.newInstance(); Method mt[] = cl.getMethods(); for(int j = 0; j < mt.length; j++) if(mt[j].getName().equals("init")) { Object initArgs[] = { null, n... | log.debug("Executing " + action + "... "); IPSWorkflowAction wfaction = (IPSWorkflowAction)this.getExtension(action); if(wfaction != null) { wfaction.performAction(wfContext, request); } | public void performAction(IPSWorkFlowContext wfContext, IPSRequestContext request) throws PSExtensionProcessingException { String sName = "performAction"; log.debug("WFActionDispatcher::performAction executing..."); boolean bOK = true; int contentId = 0; try { ... |
catch(ClassNotFoundException nfx) | catch(Exception nfx) | public void performAction(IPSWorkFlowContext wfContext, IPSRequestContext request) throws PSExtensionProcessingException { String sName = "performAction"; log.debug("WFActionDispatcher::performAction executing..."); boolean bOK = true; int contentId = 0; try { ... |
catch(InstantiationException inx) { log.error("WFActionDispatcher::performAction",inx); throw new PSExtensionProcessingException("WFActionDispatcher::performAction", inx); } catch(IllegalAccessException iax) { log.error("WFActionDispatcher::performAction",iax); throw new PSExtensionProcessingException("WFActionDispatch... | public void performAction(IPSWorkFlowContext wfContext, IPSRequestContext request) throws PSExtensionProcessingException { String sName = "performAction"; log.debug("WFActionDispatcher::performAction executing..."); boolean bOK = true; int contentId = 0; try { ... | |
if (LOG.isDebugEnabled()) { LOG.debug("Checking if " + name + " can be encoded using " + orderedCopiers[i]); | if (orderedCopiers[i].canBeEncoded(name, message)) { if (LOG.isDebugEnabled()) { LOG.debug(name + "can be encoded using " + orderedCopiers[i]); } return true; | public boolean canBeEncoded(String name, Message message) throws HJBException { EncodedValueCopier[] orderedCopiers = getOrderedValueCopiers(); for (int i = 0; i < orderedCopiers.length; i++) { if (LOG.isDebugEnabled()) { LOG.debug("Checking if " + name + " can be ... |
if (orderedCopiers[i].canBeEncoded(name, message)) return true; | public boolean canBeEncoded(String name, Message message) throws HJBException { EncodedValueCopier[] orderedCopiers = getOrderedValueCopiers(); for (int i = 0; i < orderedCopiers.length; i++) { if (LOG.isDebugEnabled()) { LOG.debug("Checking if " + name + " can be ... | |
if (LOG.isDebugEnabled()) { LOG.debug("Checking to get value for " + name + " using " + orderedCopiers[i]); } | public String getAsEncodedValue(String name, Message message) throws HJBException { EncodedValueCopier[] orderedCopiers = getOrderedValueCopiers(); for (int i = 0; i < orderedCopiers.length; i++) { if (LOG.isDebugEnabled()) { LOG.debug("Checking to get value for " ... | |
if (LOG.isDebugEnabled()) { LOG.debug(name + " is encoded using " + orderedCopiers[i]); } | public String getAsEncodedValue(String name, Message message) throws HJBException { EncodedValueCopier[] orderedCopiers = getOrderedValueCopiers(); for (int i = 0; i < orderedCopiers.length; i++) { if (LOG.isDebugEnabled()) { LOG.debug("Checking to get value for " ... | |
public void addNew(Ranking ranking) throws Exception | public void addNew(Ranking ranking) | public void addNew(Ranking ranking) throws Exception { PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("RankingModel.addNew")); p.setString(1, ranking.getTitle()); p.setInt(2, ranking.getMin()); p.executeUpdate(); p.close(); } |
PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("RankingModel.addNew")); p.setString(1, ranking.getTitle()); p.setInt(2, ranking.getMin()); p.executeUpdate(); p.close(); | PreparedStatement p=null; try { p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("RankingModel.addNew")); p.setString(1, ranking.getTitle()); p.setInt(2, ranking.getMin()); p.executeUpdate(); } catch (SQLException e) { String es = "Erorr selectActiveBannerByPlacement()"; log.error(es, ... | public void addNew(Ranking ranking) throws Exception { PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("RankingModel.addNew")); p.setString(1, ranking.getTitle()); p.setInt(2, ranking.getMin()); p.executeUpdate(); p.close(); } |
public void delete(int rankingId) throws Exception | public void delete(int rankingId) | public void delete(int rankingId) throws Exception { PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("RankingModel.delete")); p.setInt(1, rankingId); p.executeUpdate(); p.close(); } |
PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("RankingModel.delete")); p.setInt(1, rankingId); p.executeUpdate(); p.close(); | PreparedStatement p=null; try { p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("RankingModel.delete")); p.setInt(1, rankingId); p.executeUpdate(); } catch (SQLException e) { String es = "Erorr selectActiveBannerByPlacement()"; log.error(es, e); throw new RuntimeException(es, e); } fin... | public void delete(int rankingId) throws Exception { PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("RankingModel.delete")); p.setInt(1, rankingId); p.executeUpdate(); p.close(); } |
public List selectAll() throws Exception | public List selectAll() | public List selectAll() throws Exception { List l = new ArrayList(); PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("RankingModel.selectAll")); ResultSet rs = p.executeQuery(); while (rs.next()) { Ranking ranking = new Ranking(); ranking.setId(rs.getInt... |
PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("RankingModel.selectAll")); ResultSet rs = p.executeQuery(); while (rs.next()) { Ranking ranking = new Ranking(); ranking.setId(rs.getInt("rank_id")); ranking.setTitle(rs.getString("rank_title")); ranking.setImage(rs.ge... | PreparedStatement p=null; ResultSet rs=null; try { p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("RankingModel.selectAll")); rs = p.executeQuery(); while (rs.next()) { Ranking ranking = new Ranking(); ranking.setId(rs.getInt("rank_id")); ranking.setTitle(rs.getString("rank_title"));... | public List selectAll() throws Exception { List l = new ArrayList(); PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("RankingModel.selectAll")); ResultSet rs = p.executeQuery(); while (rs.next()) { Ranking ranking = new Ranking(); ranking.setId(rs.getInt... |
public Ranking selectById(int rankingId) throws Exception | public Ranking selectById(int rankingId) | public Ranking selectById(int rankingId) throws Exception { Ranking ranking = new Ranking(); PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("RankingModel.selectById")); p.setInt(1, rankingId); ResultSet rs = p.executeQuery(); if (rs.next()) { ranking.s... |
PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("RankingModel.selectById")); p.setInt(1, rankingId); ResultSet rs = p.executeQuery(); if (rs.next()) { ranking.setId(rankingId); ranking.setTitle(rs.getString("rank_title")); ranking.setImage(rs.getString("rank_image"));... | PreparedStatement p=null; ResultSet rs=null; try { p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("RankingModel.selectById")); p.setInt(1, rankingId); rs = p.executeQuery(); if (rs.next()) { ranking.setId(rankingId); ranking.setTitle(rs.getString("rank_title")); ranking.setImage(rs.ge... | public Ranking selectById(int rankingId) throws Exception { Ranking ranking = new Ranking(); PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("RankingModel.selectById")); p.setInt(1, rankingId); ResultSet rs = p.executeQuery(); if (rs.next()) { ranking.s... |
public void update(Ranking ranking) throws Exception | public void update(Ranking ranking) | public void update(Ranking ranking) throws Exception { PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("RankingModel.update")); p.setString(1, ranking.getTitle()); p.setString(2, ranking.getImage()); p.setInt(3, ranking.getSpecial()); p.setInt(4, ranking.getMi... |
PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("RankingModel.update")); p.setString(1, ranking.getTitle()); p.setString(2, ranking.getImage()); p.setInt(3, ranking.getSpecial()); p.setInt(4, ranking.getMin()); p.setInt(5, ranking.getId()); p.executeUpdate(); p.close... | PreparedStatement p=null; try { p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("RankingModel.update")); p.setString(1, ranking.getTitle()); p.setString(2, ranking.getImage()); p.setInt(3, ranking.getSpecial()); p.setInt(4, ranking.getMin()); p.setInt(5, ranking.getId()); p.executeUpd... | public void update(Ranking ranking) throws Exception { PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("RankingModel.update")); p.setString(1, ranking.getTitle()); p.setString(2, ranking.getImage()); p.setInt(3, ranking.getSpecial()); p.setInt(4, ranking.getMi... |
Mail oldParent = descendant.getParent(); oldParent.getReplies().remove(descendant); | if (descendant.getParent() != null) { Mail oldParent = descendant.getParent(); oldParent.getReplies().remove(descendant); } | void threadMail(Mail mail, SubEthaMessage msg) throws MessagingException { if (log.isDebugEnabled()) log.debug("Threading mail " + mail); // // STEP ONE: Figure who we want to be our parent. // List<String> wantedReference = new ArrayList<String>(); // If there is an InReplyTo, that tops the list String ... |
buttonMechanismus.setSelected(true); | private void initComponents() { java.awt.GridBagConstraints gridBagConstraints; WerkzeugPanel = new javax.swing.JPanel(); knopfBerechnen = new javax.swing.JButton(); knopfZurücksetzen = new javax.swing.JButton(); knopfKnoten = new javax.swing.JToggleButton(); knopfStab = ne... | |
reconciler.setDocumentPartitioning(SchemeDocumentSetupParticipant.SCHEME_PARTITIONING); | public IPresentationReconciler getPresentationReconciler() { PresentationReconciler reconciler = new PresentationReconciler(); DefaultDamagerRepairer dr = new DefaultDamagerRepairer(getSchemeColoringScanner()); reconciler.setDamager(dr, IDocument.DEFAULT_CONTENT_TYPE); reconciler.setRepa... | |
throw e.addPosition(fields[i].getTokenReference()); | throw e.addPosition(methods[i].getTokenReference()); | public void checkDependentTypes(CContext ctx) throws PositionedError { // check fields for (int i = 0; i < fields.length; i++) { CType t = fields[i].getType(ctx.getTypeFactory()); try { if(t instanceof CClassNameType) { CClassNameType nt ... |
battleProperties.load(in); | getBattleProperties().load(in); | public void loadBattleProperties() { try { FileInputStream in = new FileInputStream(battleFilename); battleProperties.load(in); } catch (FileNotFoundException e) { Utils.log("No file " + battleFilename + " found, using defaults."); } catch (IOException e) { Utils.log("IO Exception reading " + battleFilename... |
final ProxyInfo proxyInfo = this.proxyInfo; | public void openConnection() throws ConnectionException, AuthenticationException { previousProxyHost = System.getProperty( "http.proxyHost" ); previousProxyPort = System.getProperty( "http.proxyPort" ); previousProxyExclusions = System.getProperty( "http.nonProxyHosts" ); if ( ... | |
RangeLocation locB = new RangeLocation(rmin, seqLength); RangeLocation locA = new RangeLocation(1,rmax - seqLength); Location compound = LocationTools.union(locA,locB); | Location locA; Location locB; Location compound; if(rmin == seqLength){ locB = new PointLocation(rmin); }else{ locB = new RangeLocation(rmin, seqLength); } if(rmax - seqLength == 1){ locA = new PointLocation(1); }else{ locA = new RangeLocation(1,rmax - seqLength); } compound = LocationTools.union(locA,locB); | protected static CircularLocation makeCircLoc(int min, int max, int seqLength){ if(min == 0|| max == 0 || seqLength == 0){ throw new IllegalArgumentException( "Must use a non zero integer a a parameter" ); } boolean overlap = false; int rmin = realValue(min, seqLength); ... |
if(val == 0) val = 1; | private static int realValue(int val, int length){ val = ((val-1)%length)+1; if(val<0)val = length+1 + val; return val; } | |
scmFile.getParentFile().mkdirs(); | File basedir = scmFile.getParentFile(); | public void get( String resourceName, File destination ) throws TransferFailedException, ResourceDoesNotExistException, AuthorizationException { Resource resource = new Resource( resourceName ); fireGetInitiated( resource, destination ); String url = getRepository().getUrl() + "/" + r... |
if ( scmFile.exists() ) | if ( new File( basedir, ".svn" ).exists() || new File( basedir, "CVS" ).exists() ) | public void get( String resourceName, File destination ) throws TransferFailedException, ResourceDoesNotExistException, AuthorizationException { Resource resource = new Resource( resourceName ); fireGetInitiated( resource, destination ); String url = getRepository().getUrl() + "/" + r... |
scmManager.update( scmRepository, new ScmFileSet( checkoutDirectory, resourceName, null ), null ); | scmManager.update( scmRepository, new ScmFileSet( basedir ), null ); | public void get( String resourceName, File destination ) throws TransferFailedException, ResourceDoesNotExistException, AuthorizationException { Resource resource = new Resource( resourceName ); fireGetInitiated( resource, destination ); String url = getRepository().getUrl() + "/" + r... |
scmManager.checkOut( scmRepository, new ScmFileSet( scmFile.getParentFile() ), null ); | basedir.mkdirs(); scmManager.checkOut( scmRepository, new ScmFileSet( basedir ), null ); } if ( !scmFile.exists() ) { throw new ResourceDoesNotExistException( "Unable to find resource " + destination + " after checkout" ); | public void get( String resourceName, File destination ) throws TransferFailedException, ResourceDoesNotExistException, AuthorizationException { Resource resource = new Resource( resourceName ); fireGetInitiated( resource, destination ); String url = getRepository().getUrl() + "/" + r... |
scmFile.getParentFile().mkdirs(); boolean alreadyExists = scmFile.exists(); | File basedir = scmFile.getParentFile(); | public void put( File source, String resourceName ) throws TransferFailedException, ResourceDoesNotExistException, AuthorizationException { Resource resource = new Resource( resourceName ); firePutInitiated( resource, source ); String url = getRepository().getUrl() + "/" + resourceNam... |
if ( alreadyExists ) | String msg = "Adding " + resourceName + " to repository"; if ( new File( basedir, ".svn" ).exists() || new File( basedir, "CVS" ).exists() ) | public void put( File source, String resourceName ) throws TransferFailedException, ResourceDoesNotExistException, AuthorizationException { Resource resource = new Resource( resourceName ); firePutInitiated( resource, source ); String url = getRepository().getUrl() + "/" + resourceNam... |
scmManager.update( scmRepository, new ScmFileSet( checkoutDirectory, resourceName, null ), null ); | scmManager.update( scmRepository, new ScmFileSet( basedir ), null ); | public void put( File source, String resourceName ) throws TransferFailedException, ResourceDoesNotExistException, AuthorizationException { Resource resource = new Resource( resourceName ); firePutInitiated( resource, source ); String url = getRepository().getUrl() + "/" + resourceNam... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.