rem stringlengths 0 477k | add stringlengths 0 313k | context stringlengths 6 599k |
|---|---|---|
this.context.put("pageTitle", I18n.getMessage("PostForm.title")); | public void insert() throws Exception { int forumId = this.request.getIntParameter("forum_id"); if (!TopicsCommon.isTopicAccessible(forumId)) { return; } if (!this.anonymousPost(forumId) || this.isForumReadonly(forumId, this.request.getParameter("topic_id") != null)) { return; } if (this.request.getPar... | |
this.context.put("pageTitle", I18n.getMessage("PostForm.reply")+" "+p.getSubject()); | public void quote() throws Exception { PostDAO pm = DataAccessDriver.getInstance().newPostDAO(); Post p = pm.selectById(this.request.getIntParameter("post_id")); if (!this.anonymousPost(p.getForumId())) { return; } Topic t = TopicRepository.getTopic(new Topic(p.getTopicId())); if (t == null) { t = DataAcce... | |
public static void storeSessionData(String sessionId) throws Exception | public static void storeSessionData(String sessionId) | public static void storeSessionData(String sessionId) throws Exception { Connection conn = null; try { conn = DBConnection.getImplementation().getConnection(); SessionFacade.storeSessionData(sessionId, conn); } finally { if (conn != null) { try { DBConnection.getImplementation().releaseConnection(conn... |
public void update(UserSession us, Connection conn) throws Exception; | public void update(UserSession us, Connection conn) ; | public void update(UserSession us, Connection conn) throws Exception; |
log.debug("Subject Filter: onInject()"); | if (log.isDebugEnabled()) log.debug("Subject Filter: onInject()"); | public void onInject(SubEthaMessage msg, FilterContext ctx) throws IgnoreException, HoldException, MessagingException { log.debug("Subject Filter: onInject()"); // get the parameter arguments String subjectArg = (String) ctx.getArgument(ARG_SUBJECTPREFIX); // get the subject for the message String subjectMsg ... |
try { if (mPosition < mDocument.getLength()) { mCurrentPartition = mDocument.getPartition(mPosition); while (mCurrentPartition.getType() == SchemePartitionScanner.SCHEME_COMMENT) { mPosition = mCurrentPartition.getOffset() + mCurrentPartition.getLength(); mCurrentPartition = mDocument.getPartition(mPosition); } mPosit... | if (mPosition < mDocument.getLength()) { mCurrentPartition = getCurrentPartition(); if (mCurrentPartition == null) return; while (mCurrentPartition.getType() == SchemePartitionScanner.SCHEME_COMMENT) { mPosition = mCurrentPartition.getOffset() + mCurrentPartition.getLength(); ITypedRegion partition = getCurrentPartiti... | private void fetchNextPartition() { try { // skip over comment partitions... if (mPosition < mDocument.getLength()) { mCurrentPartition = mDocument.getPartition(mPosition); while (mCurrentPartition.getType() == SchemePartitionScanner.SCHEME_COMMENT) { ... |
try { if (position < mDocument.getLength()) { mCurrentPartition = mDocument.getPartition(position); if (SchemePartitionScanner.isStringPartition(mCurrentPartition.getType())) { mPosition = mCurrentPartition.getOffset(); mEnd = mPosition + mCurrentPartition.getLength(); } else if (mCurrentPartition.getType() == SchemePa... | if (position < mDocument.getLength()) { mCurrentPartition = SchemeTextUtilities.getPartition(mDocument, position); if (SchemePartitionScanner.isStringPartition(mCurrentPartition.getType())) { mPosition = mCurrentPartition.getOffset(); mEnd = mPosition + mCurrentPartition.getLength(); } else if (mCurrentPartition.getTyp... | public void setPosition(int position) { try { if (position < mDocument.getLength()) { mCurrentPartition = mDocument.getPartition(position); if (SchemePartitionScanner.isStringPartition(mCurrentPartition.getType())) { mPosition = mCurrentPartition.ge... |
builder.setFrom(postmaster.toString()); | builder.setFrom(postmaster); | public void sendAddEmailToken(Person me, String email, String token) { if (log.isDebugEnabled()) log.debug("Sending add email token to " + email); VelocityContext vctx = new VelocityContext(); vctx.put("token", this.token(token)); vctx.put("email", email); vctx.put("person", me); if (me.getSubscriptions().... |
String url = (String)this.em.findConfigValue(Config.ID_SITE_URL); vctx.put("url", url); | URL url = (URL)this.em.findConfigValue(Config.ID_SITE_URL); vctx.put("url", url.toString()); | public void sendPassword(EmailAddress addy) { if (log.isDebugEnabled()) log.debug("Sending password for " + addy.getId()); VelocityContext vctx = new VelocityContext(); vctx.put("addy", addy); if (addy.getPerson().getSubscriptions().size() == 1) { // If only one list, make it appear that mail comes from the... |
String postmaster = (String)this.em.findConfigValue(Config.ID_SITE_POSTMASTER); | InternetAddress postmaster = (InternetAddress)this.em.findConfigValue(Config.ID_SITE_POSTMASTER); | public void sendPassword(EmailAddress addy) { if (log.isDebugEnabled()) log.debug("Sending password for " + addy.getId()); VelocityContext vctx = new VelocityContext(); vctx.put("addy", addy); if (addy.getPerson().getSubscriptions().size() == 1) { // If only one list, make it appear that mail comes from the... |
public void list() throws Exception | public void list() | public void list() throws Exception { int postsPerPage = SystemGlobals.getIntValue(ConfigKeys.POST_PER_PAGE); this.setTemplateName(TemplateKeys.RECENT_LIST); this.context.put("postsPerPage", new Integer(postsPerPage)); this.context.put("topics", this.topics()); this.context.put("forums", this.forums); this.con... |
public void showTopicsByUser() throws Exception | public void showTopicsByUser() | public void showTopicsByUser() throws Exception { DataAccessDriver da = DataAccessDriver.getInstance(); UserDAO udao = da.newUserDAO(); User u = udao.selectById(this.request.getIntParameter("user_id")); if (u.getId() == 0) { this.context.put("message", I18n.getMessage("User.notFound")); this.setTemplateNam... |
List topics() throws Exception | List topics() | List topics() throws Exception { int postsPerPage = SystemGlobals.getIntValue(ConfigKeys.POST_PER_PAGE); List tmpTopics = TopicRepository.getRecentTopics(); this.forums = new ArrayList(postsPerPage); for (Iterator iter = tmpTopics.iterator(); iter.hasNext(); ) { Topic t = (Topic)iter.next(); if (TopicsCom... |
SMTPServerContext.deliver(sender, recipient, getMessage().getBytes()); | try { SMTPServerContext.deliver(sender, recipient, new ByteArrayInputStream(getMessage().getBytes())); } catch (Exception ex) { } | public void flush(SMTPServerContext SMTPServerContext) { for (String recipient : recipients) { SMTPServerContext.deliver(sender, recipient, getMessage().getBytes()); } reset(); } |
public PermissionProcessHelper(PermissionControl pc, int id) throws Exception | public PermissionProcessHelper(PermissionControl pc, int id, boolean isGroup) throws Exception | public PermissionProcessHelper(PermissionControl pc, int id) throws Exception { this(pc, id, false); } |
this(pc, id, false); | this.id = id; this.pc = pc; this.isGroup = isGroup; if (this.isGroup) { umodel = DataAccessDriver.getInstance().newUserSecurityModel(); } this.init(); | public PermissionProcessHelper(PermissionControl pc, int id) throws Exception { this(pc, id, false); } |
FeatureFilter filt = new FeatureFilter.OverlapsLocation(src.getRange()); | FeatureFilter filt = FilterUtils.overlapsLocation(src.getRange()); | protected List layer(SequenceRenderContext src) { FeatureFilter filt = new FeatureFilter.OverlapsLocation(src.getRange()); CtxtFilt gopher = new CtxtFilt(src, filt, false); List layers = (List) contextCache.get(gopher); if(layers == null) { layers = doLayer(src, filt); contextCache.put(gopher, l... |
throw (new SAXException( "Failed to parse what the framework supposes " + " to be a consensus line in an alignment due to " + "the source program not outputing expected white space." + " Tried to access character " + iEnd + " in a String " + "of length " + poLine.length() + ". The String is show " + "below. If it is no... | int iLen = iEnd - poLine.length(); char[] oPadding = new char[ iLen ]; Arrays.fill( oPadding, 0, iLen, ' ' ); oParsedSeq = poLine.substring( iOffset).concat ( new String( oPadding ) ); } | private void parseLine(String poLine) throws SAXException{ poLine = poLine.toUpperCase(); if ( (poLine.startsWith("QUERY:")) || (poLine.startsWith("SBJCT:")) ) { oSt = new StringTokenizer(poLine,":"); //there should be two tokens at this point if (oSt.countTokens() != 2) { ... |
char[] oPadding = new char[ iEnd-iOffset ]; Arrays.fill( oPadding, 0, iEnd-iOffset, ' ' ); oMatchConsensus.append( new String( oPadding) ); } | private void parseLine(String poLine) throws SAXException{ poLine = poLine.toUpperCase(); if ( (poLine.startsWith("QUERY:")) || (poLine.startsWith("SBJCT:")) ) { oSt = new StringTokenizer(poLine,":"); //there should be two tokens at this point if (oSt.countTokens() != 2) { ... | |
throw (new SAXException( "Failed parsing the consensus line of an alignment." + " Cannot currently deal with consensus lines that" + " are blank.")); | tJustDoneQuery = false; tJustDoneConsensus = false; tJustDoneHit = true; | private void parseLine(String poLine) throws SAXException{ poLine = poLine.toUpperCase(); if ( (poLine.startsWith("QUERY:")) || (poLine.startsWith("SBJCT:")) ) { oSt = new StringTokenizer(poLine,":"); //there should be two tokens at this point if (oSt.countTokens() != 2) { ... |
} tJustDoneQuery = false; tJustDoneConsensus = false; tJustDoneHit = true; this.changeState(DONE_FIRST_SEGMENT); return; | this.changeState(DONE_FIRST_SEGMENT); return; | private void parseLine(String poLine) throws SAXException{ poLine = poLine.toUpperCase(); if ( (poLine.startsWith("QUERY:")) || (poLine.startsWith("SBJCT:")) ) { oSt = new StringTokenizer(poLine,":"); //there should be two tokens at this point if (oSt.countTokens() != 2) { ... |
oQueryStopId.setLength(0); oQueryStopId.append(oStopId); oQuery.append(oParsedSeq); return; | oQueryStopId.setLength(0); oQueryStopId.append(oStopId); oQuery.append(oParsedSeq); tJustDoneQuery = true; tJustDoneConsensus = false; return; | private void parseLine(String poLine) throws SAXException{ poLine = poLine.toUpperCase(); if ( (poLine.startsWith("QUERY:")) || (poLine.startsWith("SBJCT:")) ) { oSt = new StringTokenizer(poLine,":"); //there should be two tokens at this point if (oSt.countTokens() != 2) { ... |
oHitStopId.setLength(0); oHitStopId.append(oStopId); oHit.append(oParsedSeq); return; | oHitStopId.setLength(0); oHitStopId.append(oStopId); oHit.append(oParsedSeq); if (!tJustDoneConsensus) { char[] oPadding = new char[ iEnd-iOffset ]; Arrays.fill( oPadding, 0, iEnd-iOffset, ' ' ); oMatchConsensus.append( new String( oPadding) ); } tJustDoneQuery = false; tJustDoneConsensus = false; return; | private void parseLine(String poLine) throws SAXException{ poLine = poLine.toUpperCase(); if ( (poLine.startsWith("QUERY:")) || (poLine.startsWith("SBJCT:")) ) { oSt = new StringTokenizer(poLine,":"); //there should be two tokens at this point if (oSt.countTokens() != 2) { ... |
tJustDoneQuery = false; tJustDoneConsensus = true; | private void parseLine(String poLine) throws SAXException{ poLine = poLine.toUpperCase(); if ( (poLine.startsWith("QUERY:")) || (poLine.startsWith("SBJCT:")) ) { oSt = new StringTokenizer(poLine,":"); //there should be two tokens at this point if (oSt.countTokens() != 2) { ... | |
generateChangeSupport(null); | public void addChangeListener(ChangeListener cl) { changeSupport.addChangeListener(cl); } | |
synchronized(changeSupport) { changeSupport.firePreChangeEvent(ce); | if(changeSupport == null) { | public void destroyTransition(State from, State to) throws IllegalSymbolException, ChangeVetoException { stateAlphabet().validate(from); stateAlphabet().validate(to); FiniteAlphabet f = transitionsFrom(from); FiniteAlphabet t = transitionsTo(to); ChangeEvent ce = new ChangeEvent( this, MarkovMode... |
changeSupport.firePostChangeEvent(ce); } | changeSupport.firePostChangeEvent(ce); } } | public void destroyTransition(State from, State to) throws IllegalSymbolException, ChangeVetoException { stateAlphabet().validate(from); stateAlphabet().validate(to); FiniteAlphabet f = transitionsFrom(from); FiniteAlphabet t = transitionsTo(to); ChangeEvent ce = new ChangeEvent( this, MarkovMode... |
dist.addChangeListener(distForwarder, Distribution.WEIGHTS); dist.addChangeListener(distForwarder, Distribution.NULL_MODEL); | if(distForwarder != null) { dist.addChangeListener(distForwarder, Distribution.WEIGHTS); dist.addChangeListener(distForwarder, Distribution.NULL_MODEL); } | private void doAddState(State toAdd) throws IllegalSymbolException { ((SimpleAlphabet) stateAlphabet()).addSymbol(toAdd); FiniteAlphabet fa = new SimpleAlphabet("Transitions from " + toAdd.getName()); transFrom.put(toAdd, fa); transTo.put(toAdd, new SimpleAlphabet("Transitions to " + toAdd.getName())); ... |
toGo.removeChangeListener(distForwarder, Distribution.NULL_MODEL); toGo.removeChangeListener(distForwarder, Distribution.WEIGHTS); | if(distForwarder != null) { toGo.removeChangeListener(distForwarder, Distribution.NULL_MODEL); toGo.removeChangeListener(distForwarder, Distribution.WEIGHTS); } | private void doRemoveState(State toGo) throws IllegalSymbolException { ((SimpleAlphabet) stateAlphabet()).removeSymbol(toGo); transFrom.remove(toGo); transTo.remove(toGo); if(toGo instanceof EmissionState) { Distribution dist = ((EmissionState) toGo).getDistribution(); toGo.removeChangeListener(... |
private static void handleAvatar(User u) throws Exception | private static void handleAvatar(User u) | private static void handleAvatar(User u) throws Exception { String fileName = MD5.crypt(Integer.toString(u.getId())); FileItem item = (FileItem)JForumExecutionContext.getRequest().getObjectParameter("avatar"); UploadUtils uploadUtils = new UploadUtils(item); // Gets file extension String extension = uploadUtil... |
public static BufferedImage resizeImage(String imgName, int type, int maxWidth, int maxHeight) throws IOException | public static BufferedImage resizeImage(String imgName, int type, int maxWidth, int maxHeight) | public static BufferedImage resizeImage(String imgName, int type, int maxWidth, int maxHeight) throws IOException { return resizeImage(ImageIO.read(new File(imgName)), type, maxWidth, maxHeight); } |
return resizeImage(ImageIO.read(new File(imgName)), type, maxWidth, maxHeight); } | try { return resizeImage(ImageIO.read(new File(imgName)), type, maxWidth, maxHeight); } catch (IOException e) { String es = "Erorr resizeImage()"; log.error(es, e); throw new RuntimeException(es, e); } } | public static BufferedImage resizeImage(String imgName, int type, int maxWidth, int maxHeight) throws IOException { return resizeImage(ImageIO.read(new File(imgName)), type, maxWidth, maxHeight); } |
public static boolean saveImage(BufferedImage image, String toFileName, int type) throws IOException | public static boolean saveImage(BufferedImage image, String toFileName, int type) | public static boolean saveImage(BufferedImage image, String toFileName, int type) throws IOException { return ImageIO.write(image, type == IMAGE_JPEG ? "jpg" : "png", new File(toFileName)); } |
return ImageIO.write(image, type == IMAGE_JPEG ? "jpg" : "png", new File(toFileName)); } | try { return ImageIO.write(image, type == IMAGE_JPEG ? "jpg" : "png", new File(toFileName)); } catch (IOException e) { String es = "Erorr saveImage()"; log.error(es, e); throw new RuntimeException(es, e); } } | public static boolean saveImage(BufferedImage image, String toFileName, int type) throws IOException { return ImageIO.write(image, type == IMAGE_JPEG ? "jpg" : "png", new File(toFileName)); } |
setText("Send text to interpreter"); | if (topExpression) setText("Eval top expression"); else setText("Eval previous expression"); | public EvalExpressionAction(SchemeEditor editor, boolean topExpression) { Assert.isNotNull(editor); setText("Send text to interpreter"); setToolTipText("Send text to interpreter"); mEditor = editor; mMoveToTop = topExpression; } |
CClass implClass = context.getClassReader().loadClass( factory, type.getCClass().convertToImplQn() ); CReferenceType newType = implClass.getAbstractType(); if(implClass.getOwner() != null) { expr = new JMethodCallExpression( | if( type.getCClass().isNested() ) { expr = new CjMethodCallExpression( | public JExpression analyse(CExpressionContext context) throws PositionedError { JExpression expr; TypeFactory factory = context.getTypeFactory(); try { type = (CReferenceType)type.checkType(context); } catch (UnpositionedError e) { ... |
new JThisExpression(getTokenReference()), | null, | public JExpression analyse(CExpressionContext context) throws PositionedError { JExpression expr; TypeFactory factory = context.getTypeFactory(); try { type = (CReferenceType)type.checkType(context); } catch (UnpositionedError e) { ... |
else { | else { CClass implClass = context.getClassReader().loadClass( factory, type.getCClass().convertToImplQn() ); CReferenceType newType = implClass.getAbstractType(); | public JExpression analyse(CExpressionContext context) throws PositionedError { JExpression expr; TypeFactory factory = context.getTypeFactory(); try { type = (CReferenceType)type.checkType(context); } catch (UnpositionedError e) { ... |
System.exit(0); | System.exit(runerror ? 2 : 0); | public static void main(String[] argv) { ArgumentParser ap = buildArgumentParser(); boolean debug = false, cache = false; long start = System.currentTimeMillis(); String project = null, source = null; try { ap.parse(argv); Map arguments = new Hashtable(); if (ap.isPresent(ARG_HELP)) { ap.usage(); Syst... |
"Over ran buffer with primary ID: " + str + " : " + buffer.length | "Over ran buffer with primary ID: " + new String(str) + " "+ str.length + " : " + buffer.length +" index: "+i | protected void generateRecord(byte[] buffer, Object item) { KeyPair kp = (KeyPair) item; int i = 0; byte[] str = null; try { str = kp.getPrimary().getBytes(); for(int j = 0; j < str.length; j++) { buffer[i++] = str[j]; } } catch (ArrayIndexOutOfBoundsException e) { th... |
buffer[i++] = str[j]; | if(i < buffer.length) buffer[i++] = str[j]; else break; | protected void generateRecord(byte[] buffer, Object item) { KeyPair kp = (KeyPair) item; int i = 0; byte[] str = null; try { str = kp.getPrimary().getBytes(); for(int j = 0; j < str.length; j++) { buffer[i++] = str[j]; } } catch (ArrayIndexOutOfBoundsException e) { th... |
"Over ran buffer with secondary ID: " + str + " : " + buffer.length | "Over ran buffer with secondary ID: " + new String(str) + " "+ str.length + " : " + buffer.length + " index: "+i | protected void generateRecord(byte[] buffer, Object item) { KeyPair kp = (KeyPair) item; int i = 0; byte[] str = null; try { str = kp.getPrimary().getBytes(); for(int j = 0; j < str.length; j++) { buffer[i++] = str[j]; } } catch (ArrayIndexOutOfBoundsException e) { th... |
offscreenGfx.scale(scale, scale); | private void initialize() { if (offscreenImage != null) { offscreenImage.flush(); offscreenImage = null; } offscreenImage = getGraphicsConfiguration().createCompatibleImage(getWidth(), getHeight()); offscreenGfx = (Graphics2D) offscreenImage.getGraphics(); if (bufferStrategy == null) { createBufferStrategy(... | |
Graphics2D g = (Graphics2D) bufferStrategy.getDrawGraphics(); | if (offscreenImage != null) { offscreenGfx = (Graphics2D) offscreenImage.getGraphics(); | public void update() { try { if (robocodeFrame.isIconified() || (getWidth() <= 0) || (getHeight() <= 0)) { return; } if (!initialized) { initialize(); } Graphics2D g = (Graphics2D) bufferStrategy.getDrawGraphics(); offscreenGfx.setRenderingHints(manager.getProperties().getRenderingHints()); paintB... |
g.drawImage(offscreenImage, 0, 0, null); | Graphics2D g = (Graphics2D) bufferStrategy.getDrawGraphics(); g.drawImage(offscreenImage, 0, 0, null); g.dispose(); | public void update() { try { if (robocodeFrame.isIconified() || (getWidth() <= 0) || (getHeight() <= 0)) { return; } if (!initialized) { initialize(); } Graphics2D g = (Graphics2D) bufferStrategy.getDrawGraphics(); offscreenGfx.setRenderingHints(manager.getProperties().getRenderingHints()); paintB... |
g.dispose(); if (getGraphics() != null) { bufferStrategy.show(); | if (getGraphics() != null) { bufferStrategy.show(); } | public void update() { try { if (robocodeFrame.isIconified() || (getWidth() <= 0) || (getHeight() <= 0)) { return; } if (!initialized) { initialize(); } Graphics2D g = (Graphics2D) bufferStrategy.getDrawGraphics(); offscreenGfx.setRenderingHints(manager.getProperties().getRenderingHints()); paintB... |
public String[] getEmailAddresses() | public List<String> getEmailAddresses() | public String[] getEmailAddresses() { return this.emailAddresses; } |
new JFormalParameter[0], | public CCjPrivilegedField( CField baseField, CCjSourceClass aspect) { super( baseField.getOwner(), baseField.getModifiers(), baseField.getIdent(), baseField.getType(), baseField.isDeprecated(), baseField.isSynthetic()); this.baseField = baseField; this.declaringSig = CaesarBcelWorld.getInstance().reso... | |
public Object compare(Object o1, Object o2) throws IllegalTransitionException, IllegalResidueException { if (o1 == o2) return EQUAL; | public Object compare(Object o1, Object o2) throws IllegalTransitionException, IllegalResidueException { if (o1 == o2) { return EQUAL; } | public Object compare(Object o1, Object o2) throws IllegalTransitionException, IllegalResidueException { if (o1 == o2) return EQUAL; State s1 = (State) o1; State s2 = (State) o2; if (transitionsTo(s1, s2)) return LESS_THAN; if (transitionsTo(s2, s1)) return GREATER_THAN; return DISJ... |
if (transitionsTo(s1, s2)) return LESS_THAN; if (transitionsTo(s2, s1)) return GREATER_THAN; | if (transitionsTo(s1, s2)) { return LESS_THAN; } if (transitionsTo(s2, s1)) { return GREATER_THAN; } | public Object compare(Object o1, Object o2) throws IllegalTransitionException, IllegalResidueException { if (o1 == o2) return EQUAL; State s1 = (State) o1; State s2 = (State) o2; if (transitionsTo(s1, s2)) return LESS_THAN; if (transitionsTo(s2, s1)) return GREATER_THAN; return DISJ... |
Set newWorkingSet = new HashSet(); for (Iterator i = workingSet.iterator(); i.hasNext(); ) { State s = (State) i.next(); if (s instanceof EmissionState) continue; if (s == from) throw new IllegalTransitionException(from, from, "Loop in dot states."); if (s == to) return true; for (Iterator j = mm.transitionsFrom(s).ite... | Set newWorkingSet = new HashSet(); for (Iterator i = workingSet.iterator(); i.hasNext(); ) { State s = (State) i.next(); if (s instanceof EmissionState) { continue; } if (s == from) { throw new IllegalTransitionException( from, from, "Loop in dot states." ); } if (s == to) { return true; } for (Iterator j = mm.transiti... | private boolean transitionsTo(State from, State to) throws IllegalTransitionException, IllegalResidueException { Set checkedSet = new HashSet(); Set workingSet = mm.transitionsFrom(from); while (workingSet.size() > 0) { Set newWorkingSet = new HashSet(); for (Iterator i = workingSet.iterator(); i... |
public DP(FlatModel model) throws IllegalResidueException, | public DP(MarkovModel model) throws IllegalResidueException, | public DP(FlatModel model) throws IllegalResidueException, IllegalTransitionException { this.model = model; this.states = stateList(model); this.forwardTransitions = forwardTransitions(model, states); this.forwardTransitionScores = forwardTransitionScores(model, states,... |
public FlatModel getModel() { | public MarkovModel getModel() { | public FlatModel getModel() { return model; } |
FlatModel flatM = new FlatModel(mis.getModel()); | MarkovModel flatM = DP.flatView(mis.getModel()); | public FlatModel(MarkovModel model) throws IllegalResidueException, IllegalAlphabetException { this.source = model; this.stateAlpha = new SimpleAlphabet(); stateAlpha.setName("flat " + model.stateAlphabet().getName()); addAState(model.magicalState()); // add all the states //System.out.... |
EmailAddress ea = sub.getDeliverTo(); | public void deliver(Long mailId, Long personId) throws NotFoundException { Mail mail = this.em.get(Mail.class, mailId); Person person = this.em.get(Person.class, personId); Subscription sub = person.getSubscription(mail.getList().getId()); EmailAddress ea = sub.getDeliverTo(); if (sub == null || sub.getDeliverT... | |
EmailAddress ea = sub.getDeliverTo(); | public void deliver(Long mailId, Long personId) throws NotFoundException { Mail mail = this.em.get(Mail.class, mailId); Person person = this.em.get(Person.class, personId); Subscription sub = person.getSubscription(mail.getList().getId()); EmailAddress ea = sub.getDeliverTo(); if (sub == null || sub.getDeliverT... | |
Collection<MailHold> msgs = this.admin.getListMgr().getHeldMessages(this.ml.getId()); | Collection<MailHold> msgs = this.admin.getListMgr().getHeldMessages(this.ml.getId(), -1, -1); | public void testDiscard() throws Exception { this.injector.inject(this.pers2.getAddress().getAddress(), this.ml.getEmail(), rawMsg); Thread.sleep(1000); assertEquals(1, this.smtp.count(MailType.MAIL_HELD)); Collection<MailHold> msgs = this.admin.getListMgr().getHeldMessages(this.ml.getId()); assertEquals(1, msg... |
Collection<MailHold> msgs = this.admin.getListMgr().getHeldMessages(this.ml.getId()); | Collection<MailHold> msgs = this.admin.getListMgr().getHeldMessages(this.ml.getId(), -1, -1); | public void testManualApproval() throws Exception { this.injector.inject(this.pers2.getAddress().getAddress(), this.ml.getEmail(), rawMsg); Collection<MailHold> msgs = this.admin.getListMgr().getHeldMessages(this.ml.getId()); MailHold msg = msgs.iterator().next(); this.admin.getListMgr().approveHeldMessage(msg... |
String [] types = {"gene", "tRNA", "snRNA", "pseudogene", "transposon", "snoRNA", "misc. non-coding RNA"}; | String [] types = {"gene", "tRNA", "snRNA", "pseudogene", "transposon", "snoRNA", "misc. non-coding RNA", "transposable_element", "miscellaneous curator's observation"}; | private void knownTypesInitialiser() { // initialise a String array String [] types = {"gene", "tRNA", "snRNA", "pseudogene", "transposon", "snoRNA", "misc. non-coding RNA"}; // now initialise the knownTypes Set knownTypes = new HashSet(); for (int i=0; i < types.length; i++) {... |
public void insertSearchWords(List posts) throws Exception | public void insertSearchWords(List posts) | public void insertSearchWords(List posts) throws Exception { int minWordSize = SystemGlobals.getIntValue(ConfigKeys.SEARCH_MIN_WORD_SIZE); int maxWordSize = SystemGlobals.getIntValue(ConfigKeys.SEARCH_MAX_WORD_SIZE); int searchMaxWordsMessage = SystemGlobals.getIntValue(ConfigKeys.SEARCH_MAX_WORDS_MESSAGE); String... |
String matchSql = SystemGlobals.getSql("SearchModel.associateWordToPost"); PreparedStatement words = this.conn.prepareStatement(SystemGlobals.getSql("SearchModel.insertWords")); for (Iterator iter = posts.iterator(); iter.hasNext(); ) { Post p = (Post)iter.next(); | PreparedStatement words=null; try { String matchSql = SystemGlobals.getSql("SearchModel.associateWordToPost"); words = this.conn.prepareStatement(SystemGlobals.getSql("SearchModel.insertWords")); | public void insertSearchWords(List posts) throws Exception { int minWordSize = SystemGlobals.getIntValue(ConfigKeys.SEARCH_MIN_WORD_SIZE); int maxWordSize = SystemGlobals.getIntValue(ConfigKeys.SEARCH_MAX_WORD_SIZE); int searchMaxWordsMessage = SystemGlobals.getIntValue(ConfigKeys.SEARCH_MAX_WORDS_MESSAGE); String... |
String text = new StringBuffer(p.getText()).append(" ") .append(p.getSubject()).toString(); text = text.toLowerCase().replaceAll("[\\.\\\\\\/~\\^\\&\\(\\)\\-_+=!@;#\\$%\"\'\\[\\]\\{\\}\\?<\\:>,\\*\n\r\t]", " "); | for (Iterator iter = posts.iterator(); iter.hasNext(); ) { Post p = (Post)iter.next(); | public void insertSearchWords(List posts) throws Exception { int minWordSize = SystemGlobals.getIntValue(ConfigKeys.SEARCH_MIN_WORD_SIZE); int maxWordSize = SystemGlobals.getIntValue(ConfigKeys.SEARCH_MAX_WORD_SIZE); int searchMaxWordsMessage = SystemGlobals.getIntValue(ConfigKeys.SEARCH_MAX_WORDS_MESSAGE); String... |
Set allWords = new HashSet(); | String text = new StringBuffer(p.getText()).append(" ") .append(p.getSubject()).toString(); | public void insertSearchWords(List posts) throws Exception { int minWordSize = SystemGlobals.getIntValue(ConfigKeys.SEARCH_MIN_WORD_SIZE); int maxWordSize = SystemGlobals.getIntValue(ConfigKeys.SEARCH_MAX_WORD_SIZE); int searchMaxWordsMessage = SystemGlobals.getIntValue(ConfigKeys.SEARCH_MAX_WORDS_MESSAGE); String... |
sb.delete(0, sb.length()); StringTokenizer st = new StringTokenizer(text, " "); while (st.hasMoreTokens() && (searchMaxWordsMessage < 1 || allWords.size() < searchMaxWordsMessage)) { String w = st.nextToken().trim(); if (w.length() < minWordSize) { continue; } else if (w.length() > maxWordSize) { w = w.substring(0,... | text = text.toLowerCase().replaceAll("[\\.\\\\\\/~\\^\\&\\(\\)\\-_+=!@;#\\$%\"\'\\[\\]\\{\\}\\?<\\:>,\\*\n\r\t]", " "); | public void insertSearchWords(List posts) throws Exception { int minWordSize = SystemGlobals.getIntValue(ConfigKeys.SEARCH_MIN_WORD_SIZE); int maxWordSize = SystemGlobals.getIntValue(ConfigKeys.SEARCH_MAX_WORD_SIZE); int searchMaxWordsMessage = SystemGlobals.getIntValue(ConfigKeys.SEARCH_MAX_WORDS_MESSAGE); String... |
String in = sb.substring(0, sb.length() - 1); String sql = SystemGlobals.getSql("SearchModel.selectExistingWords"); sql = sql.replaceAll("#IN#", in); Statement s = this.conn.createStatement(); ResultSet rs = s.executeQuery(sql); List newWords = new ArrayList(); while (rs.next()) { newWords.add(rs.getString("word"))... | Set allWords = new HashSet(); sb.delete(0, sb.length()); StringTokenizer st = new StringTokenizer(text, " "); while (st.hasMoreTokens() && (searchMaxWordsMessage < 1 || allWords.size() < searchMaxWordsMessage)) { String w = st.nextToken().trim(); if (w.length() < minWordSize) { continue; } else if (w.length() > ma... | public void insertSearchWords(List posts) throws Exception { int minWordSize = SystemGlobals.getIntValue(ConfigKeys.SEARCH_MIN_WORD_SIZE); int maxWordSize = SystemGlobals.getIntValue(ConfigKeys.SEARCH_MAX_WORD_SIZE); int searchMaxWordsMessage = SystemGlobals.getIntValue(ConfigKeys.SEARCH_MAX_WORDS_MESSAGE); String... |
return new SymbolListCharSequence(syms.subList(start, end), | return new SymbolListCharSequence(syms.subList(start + 1, end + 1), | public CharSequence subSequence(int start, int end) { return new SymbolListCharSequence(syms.subList(start, end), alphaTokens); } |
unsafeLoaderMonitor.wait(180000); | unsafeLoaderMonitor.wait(); | public void unsafeLoadRobots() { while (true) { // Loader waiting synchronized (unsafeLoaderMonitor) { try { setUnsafeLoaderThreadRunning(true); unsafeLoaderMonitor.wait(180000); } catch (InterruptedException e) {} } // Loader awake if (getRoundNum() >= getNumRounds() || abortBattles == true) ... |
connectionString = connectionString.replace(hostKey, hostKey + portKey); | connectionString = StringUtils.replace(connectionString, hostKey, hostKey + portKey); | private void handleDatabasePort(Properties p, String port) { String portKey = ":${database.connection.port}"; String connectionString = p.getProperty(ConfigKeys.DATABASE_CONNECTION_STRING); if (port == null || port.trim().length() == 0) { int index = connectionString.indexOf(portKey); if (index > -1) { ... |
String[] parts = line.split("="); currentTag = parts[0].trim(); | private List readSection(BufferedReader br) throws ParseException { List section = new ArrayList(); String line; String currKey = null; StringBuffer currVal = new StringBuffer(); boolean done = false; int linecount = 0; // while not done try { ... | |
currentVal.append(parts[1]); | int equalIndex = line.indexOf('='); if (equalIndex>=0) { currentTag = line.substring(0, equalIndex); currentVal.append(line.substring(equalIndex+1)); } else { currentTag = line; } | private List readSection(BufferedReader br) throws ParseException { List section = new ArrayList(); String line; String currKey = null; StringBuffer currVal = new StringBuffer(); boolean done = false; int linecount = 0; // while not done try { ... |
if (currentTag!=null) section.add(new String[]{currentTag,currentVal.toString()}); | private List readSection(BufferedReader br) throws ParseException { List section = new ArrayList(); String line; String currKey = null; StringBuffer currVal = new StringBuffer(); boolean done = false; int linecount = 0; // while not done try { ... | |
"org/biojava/bio/symbol/TranslationTables.xml" | "org/biojava/bio/seq/TranslationTables.xml" | private static void loadGeneticCodes() { try { InputStream tablesStream = RNATools.class.getClassLoader().getResourceAsStream( "org/biojava/bio/symbol/TranslationTables.xml" ); if(tablesStream == null ) { throw new BioError("Couldn't locate TranslationTables.xml."); } I... |
AtomicSymbol fromS = (AtomicSymbol) sourceP.parseToken(from); | SymbolList fromSymbols = RNATools.createRNA(from); if (fromSymbols.length() != 3) { throw new BioError("`" + from + "' is not a valid codon"); } AtomicSymbol fromS = (AtomicSymbol) sourceA.getSymbol(fromSymbols.toList()); | private static void loadGeneticCodes() { try { InputStream tablesStream = RNATools.class.getClassLoader().getResourceAsStream( "org/biojava/bio/symbol/TranslationTables.xml" ); if(tablesStream == null ) { throw new BioError("Couldn't locate TranslationTables.xml."); } I... |
public void setLoadingRobot(RobotPeer newLoadingRobot) { | public synchronized void setLoadingRobot(RobotPeer newLoadingRobot) { | public void setLoadingRobot(RobotPeer newLoadingRobot) { if (robotLoaderThread != null && robotLoaderThread.equals(Thread.currentThread())) { synchronized (loadingRobot) { loadingRobot = newLoadingRobot; } } } |
synchronized (loadingRobot) { loadingRobot = newLoadingRobot; } | loadingRobot = newLoadingRobot; | public void setLoadingRobot(RobotPeer newLoadingRobot) { if (robotLoaderThread != null && robotLoaderThread.equals(Thread.currentThread())) { synchronized (loadingRobot) { loadingRobot = newLoadingRobot; } } } |
code.closeScope(); | public void genCode(GenerationContext context) { CodeSequence code = context.getCodeSequence(); setLineNumber(code); if (cond.isConstant()) { if (cond.booleanValue()) { thenClause.genCode(context); } else if (elseClause != null) { elseClause.genCode(context); } } else { CodeLabel else... | |
SequenceDBLite db = registry.getDatabase("embl"); | public void testInstance() throws Exception { Registry registry = SystemRegistry.instance(); assertNotNull(registry); SequenceDBLite db = registry.getDatabase("embl"); } | |
ProxyInfo proxyInfo = getRepository().getProxyInfo(); | public void openConnection() throws AuthenticationException { try { final AuthenticationInfo authInfo = getRepository().getAuthenticationInfo(); if ( authInfo == null ) { throw new IllegalArgumentException( "Authentication Credentials canno... | |
protected void shutdownStream( OutputStream outputStream ) | protected void shutdownStream( InputStream inputStream ) | protected void shutdownStream( OutputStream outputStream ) { if ( outputStream != null ) { try { outputStream.close(); } catch ( Exception e ) { } } } |
if ( outputStream != null ) | if ( inputStream != null ) | protected void shutdownStream( OutputStream outputStream ) { if ( outputStream != null ) { try { outputStream.close(); } catch ( Exception e ) { } } } |
outputStream.close(); | inputStream.close(); | protected void shutdownStream( OutputStream outputStream ) { if ( outputStream != null ) { try { outputStream.close(); } catch ( Exception e ) { } } } |
get( resourceName, destination, 0, false ); | get( resourceName, destination, 0 ); | public void get( String resourceName, File destination ) throws TransferFailedException, ResourceDoesNotExistException, AuthorizationException { get( resourceName, destination, 0, false ); } |
return get( resourceName, destination, timestamp, true ); | return get( resourceName, destination, timestamp ); | public boolean getIfNewer( String resourceName, File destination, long timestamp ) throws TransferFailedException, ResourceDoesNotExistException, AuthorizationException { return get( resourceName, destination, timestamp, true ); } |
if ( StringUtils.isNotEmpty( proxyUsername ) && StringUtils.isNotEmpty( proxyPassword ) && StringUtils.isNotEmpty( proxyHost ) ) | int proxyPort = proxyInfo.getPort(); String proxyNtlmHost = proxyInfo.getNtlmHost(); String proxyNtlmDomain = proxyInfo.getNtlmDomain(); if ( proxyHost != null ) | public void openConnection() { client = new HttpClient( new MultiThreadedHttpConnectionManager() ); final AuthenticationInfo authInfo = getRepository().getAuthenticationInfo(); String username = null; String password = null; if ( authInfo != null ) { username ... |
Credentials creds = new UsernamePasswordCredentials( username, password ); | hc.setProxy( proxyHost, proxyPort ); | public void openConnection() { client = new HttpClient( new MultiThreadedHttpConnectionManager() ); final AuthenticationInfo authInfo = getRepository().getAuthenticationInfo(); String username = null; String password = null; if ( authInfo != null ) { username ... |
client.getState().setProxyCredentials( null, proxyHost, creds ); | if ( proxyUsername != null && proxyPassword != null ) { Credentials creds; if ( proxyNtlmHost != null || proxyNtlmDomain != null ) { creds = new NTCredentials( proxyUsername, proxyPassword, proxyNtlmHost, proxyNtlmDomain ); } else { creds = new UsernamePasswordCredentials( proxyUsername, proxyPassword ); } client.getS... | public void openConnection() { client = new HttpClient( new MultiThreadedHttpConnectionManager() ); final AuthenticationInfo authInfo = getRepository().getAuthenticationInfo(); String username = null; String password = null; if ( authInfo != null ) { username ... |
throw new ResourceDoesNotExistException( "File: " + url + " does not extist" ); | throw new TransferFailedException( "Failed to transfer file: " + url + " after " + attempt + " attempts" ); | public void put( File source, String resourceName ) throws TransferFailedException, ResourceDoesNotExistException, AuthorizationException { String url = getRepository().getUrl() + "/" + resourceName; PutMethod putMethod = new PutMethod( url ); Resource resource = new Resource( resourc... |
throw new TransferFailedException( "Failed to trasfer file: " + url + ". Return code is: " + statusCode ); | throw new TransferFailedException( "Failed to transfer file: " + url + ". Return code is: " + statusCode ); | public void put( File source, String resourceName ) throws TransferFailedException, ResourceDoesNotExistException, AuthorizationException { String url = getRepository().getUrl() + "/" + resourceName; PutMethod putMethod = new PutMethod( url ); Resource resource = new Resource( resourc... |
public synchronized void addImage( String key, BufferedImage image ) { | public synchronized void addImage( final String key, final BufferedImage image ) { | public synchronized void addImage( String key, BufferedImage image ) { if( images.containsKey( key ) ) { images.put( key, image ); } else { // Destroy old image: if( mruList.size() == size ) { String oldKey = (Strin... |
String oldKey = (String)mruList.elementAt( 0 ); Image img = (Image)images.get( oldKey ); | final String oldKey = (String)mruList.elementAt( 0 ); final Image img = (Image)images.get( oldKey ); | public synchronized void addImage( String key, BufferedImage image ) { if( images.containsKey( key ) ) { images.put( key, image ); } else { // Destroy old image: if( mruList.size() == size ) { String oldKey = (Strin... |
public synchronized BufferedImage getImage( String key ) { | public synchronized BufferedImage getImage( final String key ) { | public synchronized BufferedImage getImage( String key ) { BufferedImage result = null; if( images.containsKey( key ) ) { result = (BufferedImage)images.get( key ); // Move this image to the front of the MRU list: int index = mru... |
int index = mruList.indexOf( key ); | final int index = mruList.indexOf( key ); | public synchronized BufferedImage getImage( String key ) { BufferedImage result = null; if( images.containsKey( key ) ) { result = (BufferedImage)images.get( key ); // Move this image to the front of the MRU list: int index = mru... |
String key = (String)mruList.elementAt( i ); BufferedImage image = (BufferedImage)images.get( key ); | final String key = (String)mruList.elementAt( i ); final BufferedImage image = (BufferedImage)images.get( key ); | public synchronized void invalidate() { for( int i = 0; i < mruList.size(); i++ ) { String key = (String)mruList.elementAt( i ); BufferedImage image = (BufferedImage)images.get( key ); image.flush(); } mruList.clear(); imag... |
super(); | public ImagePreviewPanel() { initComponents (); startPreviewThread(); } | |
private void drawText( Graphics g, String text ) { | private void drawText( final Graphics g, final String text ) { | private void drawText( Graphics g, String text ) { g.setColor( Color.black ); Dimension size = getSize(); int textWidth = g.getFontMetrics().stringWidth( text ); int textHeight = g.getFontMetrics().getHeight(); g.drawString( text, (size.width - textW... |
Dimension size = getSize(); int textWidth = g.getFontMetrics().stringWidth( text ); int textHeight = g.getFontMetrics().getHeight(); | final Dimension size = getSize(); final int textWidth = g.getFontMetrics().stringWidth( text ); final int textHeight = g.getFontMetrics().getHeight(); | private void drawText( Graphics g, String text ) { g.setColor( Color.black ); Dimension size = getSize(); int textWidth = g.getFontMetrics().stringWidth( text ); int textHeight = g.getFontMetrics().getHeight(); g.drawString( text, (size.width - textW... |
private synchronized void loadAndCache( File imageFile ) | private synchronized void loadAndCache( final File imageFile ) | private synchronized void loadAndCache( File imageFile ) throws IOException { // Even if caller does this, it's important that we check again, // because this method is synchronized and called from numerous // Threads. String key = imageFile.getAbsolutePath(); BufferedI... |
String key = imageFile.getAbsolutePath(); | final String key = imageFile.getAbsolutePath(); | private synchronized void loadAndCache( File imageFile ) throws IOException { // Even if caller does this, it's important that we check again, // because this method is synchronized and called from numerous // Threads. String key = imageFile.getAbsolutePath(); BufferedI... |
Dimension panelSize = getSize(); BufferedImage outImage = | final Dimension panelSize = getSize(); final BufferedImage outImage = | private synchronized void loadAndCache( File imageFile ) throws IOException { // Even if caller does this, it's important that we check again, // because this method is synchronized and called from numerous // Threads. String key = imageFile.getAbsolutePath(); BufferedI... |
public void paint( Graphics g ) { | public void paint( final Graphics g ) { | public void paint( Graphics g ) { wasPainted = true; Dimension size = getSize(); g.setColor( getBackground() ); g.fillRect( 0, 0, size.width, size.height ); if( isEnabled() ) { switch( state ) { case STATE_BLANK: paintBlank( g )... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.