rem stringlengths 0 477k | add stringlengths 0 313k | context stringlengths 6 599k |
|---|---|---|
return s.substring(0, i); | if (i < 0) return s; else return s.substring(0, i); | public Object change(Object value) { String s = (String) value; int i = s.indexOf(" "); return s.substring(0, i); } |
private static void indexFasta(BioStoreFactory bsf, File location, File [] seqFiles) throws FileNotFoundException, IOException, BioException | public static void indexFasta(File location, File [] seqFiles, int alphabetIdentifier) throws FileNotFoundException, IOException, ParserException, BioException | private static void indexFasta(BioStoreFactory bsf, File location, File [] seqFiles) throws FileNotFoundException, IOException, BioException { bsf.setPrimaryKey("ID"); bsf.setStoreLocation(location); bsf.addKey("ID", 10); BioStore store = bsf.cr... |
bsf.setPrimaryKey("ID"); bsf.setStoreLocation(location); bsf.addKey("ID", 10); | BioStoreFactory bsf = new BioStoreFactory(); | private static void indexFasta(BioStoreFactory bsf, File location, File [] seqFiles) throws FileNotFoundException, IOException, BioException { bsf.setPrimaryKey("ID"); bsf.setStoreLocation(location); bsf.addKey("ID", 10); BioStore store = bsf.cr... |
BioStore store = bsf.createBioStore(); | switch (alphabetIdentifier) { case (SeqIOConstants.DNA): bsf.setSequenceFormat(LifeScienceIdentifier.valueOf("open-bio.org", "fasta", "dna" )); break; case (SeqIOConstants.RNA): bsf.setSequenceFormat(LifeScienceIdentifier.valueOf("open-bio.org", "fasta", "rna" )); break; case (SeqIOConstants.AA): bsf.setSequenceFormat(... | private static void indexFasta(BioStoreFactory bsf, File location, File [] seqFiles) throws FileNotFoundException, IOException, BioException { bsf.setPrimaryKey("ID"); bsf.setStoreLocation(location); bsf.addKey("ID", 10); BioStore store = bsf.cr... |
for (int i = 0; i < seqFiles.length; i++) { long newOffset = 0L; long oldOffset = 0L; RAF raf = new RAF(seqFiles[i], "r"); Map map = new HashMap(); CountedBufferedReader reader = new CountedBufferedReader(new FileReader(raf.getFile())); String id = ""; String line = null; while ((line = reader.readLine()) != null)... | default: throw new IllegalArgumentException("Unknown alphabet identifier '" + alphabetIdentifier + "'"); | private static void indexFasta(BioStoreFactory bsf, File location, File [] seqFiles) throws FileNotFoundException, IOException, BioException { bsf.setPrimaryKey("ID"); bsf.setStoreLocation(location); bsf.addKey("ID", 10); BioStore store = bsf.cr... |
try { store.commit(); } catch (NestedException ne) { throw new BioException(ne, "Failed to commit new index to file"); } | _indexFasta(bsf, location, seqFiles); | private static void indexFasta(BioStoreFactory bsf, File location, File [] seqFiles) throws FileNotFoundException, IOException, BioException { bsf.setPrimaryKey("ID"); bsf.setStoreLocation(location); bsf.addKey("ID", 10); BioStore store = bsf.cr... |
private static void indexGenbank(BioStoreFactory bsf, File location, File [] seqFiles) | public static void indexGenbank(File location, File [] seqFiles, int alphabetIdentifier) | private static void indexGenbank(BioStoreFactory bsf, File location, File [] seqFiles) throws FileNotFoundException, IOException, ParserException, BioException { bsf.setPrimaryKey("LOCUS"); bsf.setStoreLocation(location); bsf.addKey("L... |
bsf.setPrimaryKey("LOCUS"); bsf.setStoreLocation(location); bsf.addKey("LOCUS", 10); bsf.addKey("ACCESSION", 10); | BioStoreFactory bsf = new BioStoreFactory(); | private static void indexGenbank(BioStoreFactory bsf, File location, File [] seqFiles) throws FileNotFoundException, IOException, ParserException, BioException { bsf.setPrimaryKey("LOCUS"); bsf.setStoreLocation(location); bsf.addKey("L... |
BioStore store = bsf.createBioStore(); | switch (alphabetIdentifier) { case (SeqIOConstants.DNA): bsf.setSequenceFormat(LifeScienceIdentifier.valueOf("open-bio.org", "genbank", "dna" )); break; case (SeqIOConstants.RNA): bsf.setSequenceFormat(LifeScienceIdentifier.valueOf("open-bio.org", "genbank", "rna" )); break; case (SeqIOConstants.AA): bsf.setSequenceFor... | private static void indexGenbank(BioStoreFactory bsf, File location, File [] seqFiles) throws FileNotFoundException, IOException, ParserException, BioException { bsf.setPrimaryKey("LOCUS"); bsf.setStoreLocation(location); bsf.addKey("L... |
for (int i = 0; i < seqFiles.length; i++) { Indexer indexer = new Indexer(seqFiles[i], store); indexer.setPrimaryKeyName("LOCUS"); indexer.addSecondaryKey("ACCESSION"); ChangeTable changeTable = new ChangeTable(); changeTable.setChanger("LOCUS", new ChangeTable.Changer() { public Object change(Object value) { String ... | default: throw new IllegalArgumentException("Unknown alphabet identifier '" + alphabetIdentifier + "'"); | private static void indexGenbank(BioStoreFactory bsf, File location, File [] seqFiles) throws FileNotFoundException, IOException, ParserException, BioException { bsf.setPrimaryKey("LOCUS"); bsf.setStoreLocation(location); bsf.addKey("L... |
try { store.commit(); } catch (NestedException ne) { throw new BioException(ne, "Failed to commit new index to file"); } | _indexGenbank(bsf, location, seqFiles); | private static void indexGenbank(BioStoreFactory bsf, File location, File [] seqFiles) throws FileNotFoundException, IOException, ParserException, BioException { bsf.setPrimaryKey("LOCUS"); bsf.setStoreLocation(location); bsf.addKey("L... |
indexEmblLike(bsf, location, seqFiles); | _indexEmblLike(bsf, location, seqFiles); | public static void indexSwissprot(File location, File [] seqFiles) throws FileNotFoundException, IOException, ParserException, BioException { BioStoreFactory bsf = new BioStoreFactory(); bsf.setSequenceFormat(LifeScienceIdentifier.valueOf("open-bio.org", ... |
cu.setInners(new JTypeDeclaration[0]); | cu.fireInnersCopied(); | protected void moveInners(JCompilationUnit cu, CjVirtualClassDeclaration collabDecl) { JTypeDeclaration inners[] = cu.getInners(); for (int i1 = 0; i1 < inners.length; i1++) { if (inners[i1] instanceof CjVirtualClassDeclaration) { CjVirtualClassDeclaration nestedDecl = (CjVirtu... |
this.annotation = annotation; | this.annotation = new SimpleAnnotation(annotation); | public SimpleAtomicSymbol(char token, String name, Annotation annotation) { if(annotation == null) { throw new IllegalArgumentException("Can't use null Annotation"); } this.token = token; this.name = name; this.annotation = annotation; this.alphabet = new SingletonAlphabet(this); } |
cache = new HashMap(); | public CachingKernel() { cache = new HashMap(); } | |
if ( annotations.containsKey( SCP_EXECUTABLE_KEY ) ); | if ( annotations.containsKey( SCP_EXECUTABLE_KEY ) ) | private String getScpExecutable( Map annotations ) { String retValue = scpExecutable; if ( annotations.containsKey( SCP_EXECUTABLE_KEY ) ); { retValue = ( String ) annotations.get( SCP_EXECUTABLE_KEY ) ; } return retValue; } |
if ( annotations.containsKey( SCP_EXECUTABLE_KEY ) ); | if ( annotations.containsKey( SSH_EXECUTABLE_KEY ) ) | private String getSshExecutable( Map annotations ) { String retValue = sshExecutable; if ( annotations.containsKey( SCP_EXECUTABLE_KEY ) ); { retValue = ( String ) annotations.get( SCP_EXECUTABLE_KEY ) ; } return retValue; } |
retValue = ( String ) annotations.get( SCP_EXECUTABLE_KEY ) ; | retValue = (String) annotations.get( SSH_EXECUTABLE_KEY ); | private String getSshExecutable( Map annotations ) { String retValue = sshExecutable; if ( annotations.containsKey( SCP_EXECUTABLE_KEY ) ); { retValue = ( String ) annotations.get( SCP_EXECUTABLE_KEY ) ; } return retValue; } |
this.lnReader = new LineNumberReader(reader); this.handler = handler; this.parser = parser; | this.reader = reader; this.handler = handler; this.parser = parser; | public SearchReader(BufferedReader reader, SearchBuilder handler, SearchParser parser) { this.lnReader = new LineNumberReader(reader); this.handler = handler; this.parser = parser; } |
moreSearchesAvailable = parser.parseSearch(lnReader, handler); | moreSearchesAvailable = parser.parseSearch(reader, handler); | public Object next() throws NoSuchElementException { if (! moreSearchesAvailable) throw new NoSuchElementException("Attempt to read search result from empty stream"); try { moreSearchesAvailable = parser.parseSearch(lnReader, handler); return handler.makeSearchResult(); } catch (ParserException pex) ... |
if(returnType.isClassType()) { | if(!returnType.isArrayType() && returnType.isClassType()) { | public JExpression analyse(CExpressionContext context) throws PositionedError { TypeFactory factory = context.getTypeFactory(); // analyse expression expr = (JMethodCallExpression)expr.analyse(context); // cast the return type CType returnType... |
public void list() throws Exception | public void list() | public void list() throws Exception { this.setTemplateName(TemplateKeys.MODERATION_ADMIN_LIST); this.context.put("infoList", DataAccessDriver.getInstance().newModerationDAO().categoryPendingModeration()); } |
public void save() throws Exception | public void save() | public void save() throws Exception { this.doSave(); this.view(); } |
public void view() throws Exception | public void view() | public void view() throws Exception { int forumId = this.request.getIntParameter("forum_id"); this.setTemplateName(TemplateKeys.MODERATION_ADMIN_VIEW); this.context.put("forum", ForumRepository.getForum(forumId)); this.context.put("topics", DataAccessDriver.getInstance().newModerationDAO().topicsByForum( foru... |
if(thisAsFamily == null) throw new PositionedError(getTokenReference(), CaesarMessages.PREFIX_FAMILY_PATH_NOT_AVAILABLE, ident); | if(thisAsFamily == null) { thisAsFamily = new InfiniteContextExpression(); } | protected void calcExpressionFamily() throws PositionedError { try { // CTODO: ugly these constants if(method.isCaesarFactoryMethod()) { // factory method... make special treatement // CTODO: this is ugly, why not having own data type for factory methods family = pr... |
URL url = SchemeScriptPlugin.getDefault().find(new Path("conf/forms.scm")); | URL url = SchemeScriptPlugin.findFile(new Path("conf/forms.scm")); | public static ISymbolDictionary getSchemeSymbolDictionary() { if (mDictionary == null) { URL url = SchemeScriptPlugin.getDefault().find(new Path("conf/forms.scm")); mDictionary = UserDictionary.createInstance(KawaDictionary.getInstance(), "scm,ss,sch,brl,krl", url); } retu... |
setKeyBindingScopes(new String[] { "Scheme Editing", "Edit" }); | setKeyBindingScopes(new String[] {"Scheme Editing"}); | protected void initializeKeyBindingScopes() { setKeyBindingScopes(new String[] { "Scheme Editing", "Edit" }); } |
try { | if (conn==null) { return; } try { | public void releaseConnection(Connection conn) { try { conn.close(); } catch (Exception e) { e.printStackTrace(); } } |
mappings[i] = value; | mappings[i+1] = value; | private void _setProperty(Object key, Object value) { if (mappings == null) { mappings = new Object[4]; } else { int keyHash = key.hashCode(); for (int i = 0; i < numMappings * 2; i += 2) { if (keyHash == mappings[i].hashCode() && key.equals(mappings[i])) { mappings[i] = value; return; } ... |
if (prefix.length() < 3) return; | protected void completeSymbols(String prefix, List entries) { if (prefix.length() < 3) return; Enumeration enumeration = mEntries.keys(); while (enumeration.hasMoreElements()) { String symbolName = (String) enumeration.nextElement(); if (symbolName.st... | |
return (SequenceDB) this.sequenceDBByIdentifier.get(identifier); | return (SequenceDBLite) this.sequenceDBByIdentifier.get(identifier); | public synchronized SequenceDBLite getSequenceDB(String identifier) { if (identifier == null) { throw new IllegalArgumentException("identifier was null"); } return (SequenceDB) this.sequenceDBByIdentifier.get(identifier); } |
result = getProviderContext().lookup(name); if (null != result) { return result; } | protected Object locate(String name) { try { Object result = getProviderContext().lookup(name); if (null != result) { return result; } else { return handleResourceNotFound(name, null); } } catch (NamingException e) { ... | |
if (cd.getId().equals(Config.ConfigKey.ID_SITE_URL.getKey())) | if (cd.getId().equals("siteUrl")) | public void execute() throws Exception { Model model = (Model)this.getCtx().getModel(); model.configData = Backend.instance().getAdmin().getSiteConfig(); for (ConfigData cd : model.configData) { if (cd.getId().equals(Config.ConfigKey.ID_SITE_URL.getKey())) { model.siteUrl = cd.getValue().toString(); ... |
public List selectAll(int startFrom, int count) throws Exception | public List selectAll(int startFrom, int count) | public List selectAll(int startFrom, int count) throws Exception { if (count > 0) { return super.selectAll(count, startFrom); } return super.selectAll(0, 0); } |
public List selectAllByGroup(int groupId, int start, int count) throws Exception | public List selectAllByGroup(int groupId, int start, int count) | public List selectAllByGroup(int groupId, int start, int count) throws Exception { return super.selectAllByGroup(groupId, count, start); } |
*/ | public boolean addSourceClass(CSourceClass cl) { CClass last = (CClass)allLoadedClasses.put(cl.getQualifiedName(), cl); allLoadedPackages.add(cl.getPackage()); return (last == null) || (cl.getOwner() != null) || !(last instanceof CSourceClass) || last.getSourceFile() == cl.getSourceFile();... | |
protected void configureUserSession(UserSession userSession, User user) throws Exception | protected void configureUserSession(UserSession userSession, User user) | protected void configureUserSession(UserSession userSession, User user) throws Exception { userSession.dataToUser(user); // As an user may come back to the forum before its // last visit's session expires, we should check for // existent user information and then, if found, store // it to the database before gett... |
UserSession tmpUs = new UserSession(); | UserSession tmpUs; | protected void configureUserSession(UserSession userSession, User user) throws Exception { userSession.dataToUser(user); // As an user may come back to the forum before its // last visit's session expires, we should check for // existent user information and then, if found, store // it to the database before gett... |
public void refreshSession() throws Exception | public void refreshSession() | public void refreshSession() throws Exception { UserSession userSession = SessionFacade.getUserSession(); ActionServletRequest request = JForumExecutionContext.getRequest(); if (userSession == null) { userSession = new UserSession(); userSession.registerBasicInfo(); userSession.setSessionId(request.getSession... |
SSO sso = (SSO) Class.forName(SystemGlobals.getValue(ConfigKeys.SSO_IMPLEMENTATION)).newInstance(); | SSO sso; try { sso = (SSO) Class.forName(SystemGlobals.getValue(ConfigKeys.SSO_IMPLEMENTATION)).newInstance(); } catch (Exception e) { String es = "Erorr add()"; log.error(es, e); throw new RuntimeException(es, e); } | public void refreshSession() throws Exception { UserSession userSession = SessionFacade.getUserSession(); ActionServletRequest request = JForumExecutionContext.getRequest(); if (userSession == null) { userSession = new UserSession(); userSession.registerBasicInfo(); userSession.setSessionId(request.getSession... |
System.out.println("add Extension "+s); | public void addExtension(String s){ System.out.println("add Extension "+s); extensions.add(s); } | |
System.out.println("checking file"); | private FileInputStream getInputStream() throws IOException { System.out.println("checking file"); // compression formats supported String[] str = {".gz",".zip",".Z"}; ArrayList compressions = new ArrayList( Arrays.asList( str ) ); FileInputStream inputStream =null; String pdbFile = null ; File f = null ; S... | |
System.out.println("testing: "+fpath+ex); | private FileInputStream getInputStream() throws IOException { System.out.println("checking file"); // compression formats supported String[] str = {".gz",".zip",".Z"}; ArrayList compressions = new ArrayList( Arrays.asList( str ) ); FileInputStream inputStream =null; String pdbFile = null ; File f = null ; S... | |
System.out.println("found!"); | private FileInputStream getInputStream() throws IOException { System.out.println("checking file"); // compression formats supported String[] str = {".gz",".zip",".Z"}; ArrayList compressions = new ArrayList( Arrays.asList( str ) ); FileInputStream inputStream =null; String pdbFile = null ; File f = null ; S... | |
System.out.println("Starting to parse PDB file " + getTimeStamp()); | public Structure getStructure() throws IOException { FileInputStream inStream = getInputStream(); try{ System.out.println("Starting to parse PDB file " + getTimeStamp()); parsePDBFile(inStream) ; System.out.println("Done parsing PDB file " + getTimeStamp()); } catch(Exception ex){ ex.printStack... | |
System.out.println("Done parsing PDB file " + getTimeStamp()); | public Structure getStructure() throws IOException { FileInputStream inStream = getInputStream(); try{ System.out.println("Starting to parse PDB file " + getTimeStamp()); parsePDBFile(inStream) ; System.out.println("Done parsing PDB file " + getTimeStamp()); } catch(Exception ex){ ex.printStack... | |
System.out.println("preparing buffer"); | public Structure parsePDBFile(InputStream inStream) throws IOException, PDBParseException { System.out.println("preparing buffer"); BufferedReader buf ; try { buf = getBufferedReader(inStream); } catch (IOException e) { e.printStackTrace(); throw new IOException ("error initializing BufferedRea... | |
System.out.println("done"); | public Structure parsePDBFile(InputStream inStream) throws IOException, PDBParseException { System.out.println("preparing buffer"); BufferedReader buf ; try { buf = getBufferedReader(inStream); } catch (IOException e) { e.printStackTrace(); throw new IOException ("error initializing BufferedRea... | |
channel.cd( repository.getBasedir() ); channel.cd( dir ); | try { channel.cd( repository.getBasedir() ); } catch ( SftpException e ) { if ( "No such file".equals( e.toString() ) ) { throw new ResourceDoesNotExistException( "Repository base directory is missing for: " + repository.getId(), e ); } else { throw e; } } | public boolean getIfNewer( String resourceName, File destination, long timestamp ) throws TransferFailedException, ResourceDoesNotExistException, AuthorizationException { boolean bDownloaded = true; createParentDirectories( destination ); ChannelSftp channel; resourceName = Str... |
String basedir = repository.getBasedir(); channel.cd( repository.getBasedir() ); channel.cd( dir ); | public boolean getIfNewer( String resourceName, File destination, long timestamp ) throws TransferFailedException, ResourceDoesNotExistException, AuthorizationException { boolean bDownloaded = true; createParentDirectories( destination ); ChannelSftp channel; resourceName = Str... | |
mkdir( channel, basedir, directoryMode ); | mkdirs( channel, basedir, directoryMode ); | public void put( File source, String resourceName ) throws TransferFailedException, ResourceDoesNotExistException, AuthorizationException { String basedir = getRepository().getBasedir(); resourceName = StringUtils.replace( resourceName, "\\", "/" ); String dir = PathUtils.dirname( res... |
} } else if (value instanceof Taxon) { if (key.equals(EmblLikeFormat.ORGANISM_TAG)) { line = EbiFormat.getInstance().serialize((Taxon) value); } else if (key.equals(EmblLikeFormat.SOURCE_TAG)) { line = EbiFormat.getInstance().serializeSource((Taxon) value); } else if (key.equals(EmblLikeFormat.ORGANISM_XREF_TAG)) { lin... | public void addSequenceProperty(Object key, Object value) throws ParseException { StringBuffer sb = new StringBuffer(); // Ignore separators if they are sent to us. The parser should // be ignoring these really if (key.equals(EmblLikeFormat.SEPARATOR_TAG)) return; ... | |
raw.getPerson().getEmailArray(), | raw.getPerson().getEmailList(), | public static SubscriberData heldSubscription(SubscriptionHold raw) { if (log.isDebugEnabled()) log.debug(raw.toString()); return new SubscriberData( raw.getPerson().getId(), raw.getPerson().getName(), raw.getPerson().getEmailArray(), null, (raw.getDeliverTo() != null) ? raw.getDeliverTo().getId() ... |
raw.getPerson().getEmailArray(), | raw.getPerson().getEmailList(), | public static SubscriberData subscriber(Subscription raw) { if (log.isDebugEnabled()) log.debug(raw.toString()); return new SubscriberData( raw.getPerson().getId(), raw.getPerson().getName(), raw.getPerson().getEmailArray(), raw.getRole().getName(), (raw.getDeliverTo() != null) ? raw.getDeliverTo().... |
if (!m.containsKey(params)) { m.put(params,builder.buildObject(clazz, params)); | if (!m.containsKey(paramsList)) { m.put(paramsList,builder.buildObject(clazz, paramsList)); | public static synchronized Object getObject(Class clazz, Object[] params) { if (!cache.containsKey(clazz)) { cache.put(clazz, new LinkedHashMap(LRUcacheSize, 0.75f, true) { protected boolean removeEldestEntry(Map.Entry eldest) { return this.size() > LRUcacheSize; ... |
return m.get(params); | return m.get(paramsList); | public static synchronized Object getObject(Class clazz, Object[] params) { if (!cache.containsKey(clazz)) { cache.put(clazz, new LinkedHashMap(LRUcacheSize, 0.75f, true) { protected boolean removeEldestEntry(Map.Entry eldest) { return this.size() > LRUcacheSize; ... |
Log.verbose("prepare dynamic deployment"); GenerateDeploymentSupport genDeplSupport = new GenerateDeploymentSupport(this, environment); genDeplSupport.generateSupportClasses(); Log.verbose("join deployment support classes"); for (int i = 0; i < tree.length; i++) { JCompilationUnit cu = tree[i]; JoinDeploymentSupport... | try { Log.verbose("prepare dynamic deployment"); GenerateDeploymentSupport genDeplSupport = new GenerateDeploymentSupport(this, environment); genDeplSupport.generateSupportClasses(); Log.verbose("join deployment support classes"); for (int i = 0; i < tree.length; i++) { JCompilationUnit cu = tree[i]; JoinDeploymentS... | protected void prepareAspectDeployment( KjcEnvironment environment, JCompilationUnit[] tree) { Log.verbose("prepare dynamic deployment"); // Modify and generate support classes for dynamic deployment. GenerateDeploymentSupport genDeplSupport = new GenerateDeploymentSupport(th... |
weaveGeneratedCode(environment); CodeSequence.endSession(); | weaveGeneratedCode(environment); if(errorFound) return false; | public boolean run(String[] args) { errorFound = false; if (!parseArguments(args)) { return false; } Log.setVerbose(options.verbose); KjcEnvironment environment = createEnvironment(options); setSourceVersion(environment.getSourceVersion()); ... |
CaesarBcelWorld.deleteInstance(); | protected void weaveClasses(KjcEnvironment env) { /* Reset the world for the weaver, so that it does not see source files */ CaesarBcelWorld bcelWorld = CaesarBcelWorld.createInstance(); bcelWorld.setClassReader(env.getClassReader()); // Make sure the weaver is using a model if (asmMana... | |
public boolean dispatchMessages() throws Exception | public boolean dispatchMessages() | public boolean dispatchMessages() throws Exception { if (SystemGlobals.getBoolValue(ConfigKeys.MAIL_SMTP_AUTH)) { if (username != null && !username.equals("") && password != null && !password.equals("")) { Transport transport = Spammer.getSession().getTransport("smtp"); try { String host = SystemGlobals.g... |
if (SystemGlobals.getBoolValue(ConfigKeys.MAIL_SMTP_AUTH)) { if (username != null && !username.equals("") && password != null && !password.equals("")) { Transport transport = Spammer.getSession().getTransport("smtp"); | try { if (SystemGlobals.getBoolValue(ConfigKeys.MAIL_SMTP_AUTH)) { if (username != null && !username.equals("") && password != null && !password.equals("")) { Transport transport = Spammer.getSession().getTransport("smtp"); | public boolean dispatchMessages() throws Exception { if (SystemGlobals.getBoolValue(ConfigKeys.MAIL_SMTP_AUTH)) { if (username != null && !username.equals("") && password != null && !password.equals("")) { Transport transport = Spammer.getSession().getTransport("smtp"); try { String host = SystemGlobals.g... |
try { String host = SystemGlobals.getValue(ConfigKeys.MAIL_SMTP_HOST); if (host != null) { int colon = host.indexOf(':'); if (colon > 0) { transport.connect(host.substring(0, colon), Integer.parseInt(host.substring(colon + 1)), username, password); } else { transport.connect(host, username, password); } } } catch (Mess... | String host = SystemGlobals.getValue(ConfigKeys.MAIL_SMTP_HOST); if (host != null) { int colon = host.indexOf(':'); if (colon > 0) { transport.connect(host.substring(0, colon), Integer.parseInt(host.substring(colon + 1)), username, password); } else { transport.connect(host, username, password); } } | public boolean dispatchMessages() throws Exception { if (SystemGlobals.getBoolValue(ConfigKeys.MAIL_SMTP_AUTH)) { if (username != null && !username.equals("") && password != null && !password.equals("")) { Transport transport = Spammer.getSession().getTransport("smtp"); try { String host = SystemGlobals.g... |
if (transport.isConnected()) { Address[] addresses = message.getAllRecipients(); for (int i = 0; i < addresses.length; i++) { message.setRecipient(Message.RecipientType.TO, addresses[i]); transport.sendMessage(message, new Address[] { addresses[i] }); } } transport.close(); } } else { Address[] addresses = message.ge... | if (transport.isConnected()) { Address[] addresses = message.getAllRecipients(); for (int i = 0; i < addresses.length; i++) { message.setRecipient(Message.RecipientType.TO, addresses[i]); transport.sendMessage(message, new Address[] { addresses[i] }); } } | public boolean dispatchMessages() throws Exception { if (SystemGlobals.getBoolValue(ConfigKeys.MAIL_SMTP_AUTH)) { if (username != null && !username.equals("") && password != null && !password.equals("")) { Transport transport = Spammer.getSession().getTransport("smtp"); try { String host = SystemGlobals.g... |
return true; | transport.close(); } } else { Address[] addresses = message.getAllRecipients(); for (int i = 0; i < addresses.length; i++) { message.setRecipient(Message.RecipientType.TO, addresses[i]); Transport.send(message, new Address[] { addresses[i] }); } } } catch (MessagingException e) { throw new EmailException("Error dispatc... | public boolean dispatchMessages() throws Exception { if (SystemGlobals.getBoolValue(ConfigKeys.MAIL_SMTP_AUTH)) { if (username != null && !username.equals("") && password != null && !password.equals("")) { Transport transport = Spammer.getSession().getTransport("smtp"); try { String host = SystemGlobals.g... |
Template template = null; | Template template; | protected String getMessageText(SimpleHash params, String messageFile) throws Exception { String templateEncoding = SystemGlobals.getValue(ConfigKeys.MAIL_TEMPLATE_ENCODING); StringWriter sWriter = new StringWriter(); Template template = null; if (templateEncoding == null || "".equals(templateEncoding.trim()... |
return "Annotation Type: " + type; | return "ByAnnotationType {" + type + "}"; | public String toString() { return "Annotation Type: " + type; } |
EnabledFilter filt = list.getEnabledFilters().remove(className); | EnabledFilter filt = list.getEnabledFilters().get(className); | public void disableFilter(Long listId, String className) throws NotFoundException, PermissionException { MailingList list = this.getListFor(listId, Permission.EDIT_FILTERS); EnabledFilter filt = list.getEnabledFilters().remove(className); if (filt == null) { if (log.isWarnEnabled()) log.warn("Attempt to rem... |
list.getEnabledFilters().remove(className); | public void disableFilter(Long listId, String className) throws NotFoundException, PermissionException { MailingList list = this.getListFor(listId, Permission.EDIT_FILTERS); EnabledFilter filt = list.getEnabledFilters().remove(className); if (filt == null) { if (log.isWarnEnabled()) log.warn("Attempt to rem... | |
name = cclass.getImplQualifiedName(); | public TypeX lookupType(String typeName, IHasPosition location) { // Primitive types are resolved directly if (context.getTypeFactory().isPrimitive(typeName)) return TypeX.forName(typeName); // Resolve the type CClass cclass = lookupClass(typeName); // Just process if it is not a regular Java class or it w... | |
IndexTools.indexEmblDNA(new File(location), files); | IndexTools.indexEmbl(new File(location), files, SeqIOConstants.DNA); | public void testIndexEmblDNA() throws Exception { File [] files = getDBFiles(new String [] { "part1.embl", "part2.embl" }); IndexTools.indexEmblDNA(new File(location), files); SequenceDBLite db = new FlatSequenceDB(location, "embl"); S... |
SequenceDBLite db = createFastaDB(SeqIOConstants.DNA, "dna", new String [] { "dna1.fasta", "dna2.fasta" }); | File [] files = getDBFiles(new String [] { "dna1.fasta", "dna2.fasta" }); IndexTools.indexFasta(new File(location), files, SeqIOConstants.DNA); SequenceDBLite db = new FlatSequenceDB(location, "dna"); | public void testIndexFastaDNA() throws Exception { SequenceDBLite db = createFastaDB(SeqIOConstants.DNA, "dna", new String [] { "dna1.fasta", "dna2.fasta" }); Sequence seq1 = db.getSequence("id1"); ... |
SequenceDBLite db = createFastaDB(SeqIOConstants.AA, "protein", new String [] { "protein1.fasta", "protein2.fasta" }); | File [] files = getDBFiles(new String [] { "protein1.fasta", "protein2.fasta" }); IndexTools.indexFasta(new File(location), files, SeqIOConstants.AA); SequenceDBLite db = new FlatSequenceDB(location, "protein"); | public void testIndexFastaProtein() throws Exception { SequenceDBLite db = createFastaDB(SeqIOConstants.AA, "protein", new String [] { "protein1.fasta", "protein2.fasta" }); Sequence seq1 = db.getSeque... |
SequenceDBLite db = createFastaDB(SeqIOConstants.RNA, "rna", new String [] { "rna1.fasta", "rna2.fasta" }); | File [] files = getDBFiles(new String [] { "rna1.fasta", "rna2.fasta" }); IndexTools.indexFasta(new File(location), files, SeqIOConstants.RNA); SequenceDBLite db = new FlatSequenceDB(location, "rna"); | public void testIndexFastaRNA() throws Exception { SequenceDBLite db = createFastaDB(SeqIOConstants.RNA, "rna", new String [] { "rna1.fasta", "rna2.fasta" }); Sequence seq1 = db.getSequence("id1"); ... |
int value = 31; | int value = 17; | public int hashCode() { int value = 31; if(getName() != null) value = 31 * (getName().hashCode() +5); if(getDescription() != null) value = 31 * (getDescription().hashCode() + 7); if(getAnnotation() != null) value = 31 * (getAnnotation().hashCode() + 11); ... |
value = 31 * (getName().hashCode() +5); if(getDescription() != null) value = 31 * (getDescription().hashCode() + 7); if(getAnnotation() != null) value = 31 * (getAnnotation().hashCode() + 11); return -91 * value; | value *= 31 * getName().hashCode(); return 17 * value; | public int hashCode() { int value = 31; if(getName() != null) value = 31 * (getName().hashCode() +5); if(getDescription() != null) value = 31 * (getDescription().hashCode() + 7); if(getAnnotation() != null) value = 31 * (getAnnotation().hashCode() + 11); ... |
parameters, | public CSourceMethod checkInterface(CClassContext context) throws PositionedError { try { CType[] parameterTypes = new CType[parameters.length]; CBinaryTypeContext typeContext = new CBinaryTypeContext( context.getClassReader(), context.getTypeFactory(), context, (modifiers & ACC_STATIC) == 0... | |
params, | public CCjProceed( CClass owner, String ident, CType returnType, CType[] parameterTypes, String adviceName) { super( owner, ACC_STATIC, ident, returnType, parameterTypes, new CReferenceType[0], false, true, null); this.adviceName = adviceName; } | |
public boolean canBannerDisplay(int bannerId) throws Exception | public boolean canBannerDisplay(int bannerId) | public boolean canBannerDisplay(int bannerId) throws Exception { boolean result = true; // todo return result; } |
public Banner getBanner() throws Exception | public Banner getBanner() | public Banner getBanner() throws Exception { Banner result = null; if (banners == null || banners.isEmpty()) { return null; } // get correct banner based on weight int r = (new Random().nextInt(99)); int weightFrom = 0; int weightTo = 0; for(int i = 0; i < banners.size(); i++) { result = (Banner)banners.... |
public boolean isActiveBannerExist(int placement) throws Exception | public boolean isActiveBannerExist(int placement) | public boolean isActiveBannerExist(int placement) throws Exception { banners = dao.selectActiveBannerByPlacement(placement); if (banners == null || banners.isEmpty()) { return false; } return true; } |
Clip c = sounds.getSound(key); | Clip c = getSounds().getSound(key); | private void playSound(Object key, float pan, float volume) { Clip c = sounds.getSound(key); if (c == null) { return; } if (isPanEnabled()) { FloatControl panCtrl = (FloatControl) c.getControl(FloatControl.Type.PAN); panCtrl.setValue(pan); } if (isVolumeEnabled()) { FloatControl volCtrl = (FloatControl) ... |
String homePage = JForum.getRequest().getContextPath() + "/forums/list" + SystemGlobals.getValue(ConfigKeys.SERVLET_EXTENSION); | public void registrationComplete() throws Exception { int userId = SessionFacade.getUserSession().getUserId(); String profilePage = JForum.getRequest().getContextPath() + "/user/edit/" + userId + SystemGlobals.getValue(ConfigKeys.SERVLET_EXTENSION); String homePage = JForum.getRequest().getContextPath() + "/f... | |
String message = I18n.getMessage("User.RegistrationCompleteMessage", | String homePage = JForum.getRequest().getContextPath() + "/forums/list" + SystemGlobals.getValue(ConfigKeys.SERVLET_EXTENSION); String message = I18n.getMessage("User.RegistrationCompleteMessage", | public void registrationComplete() throws Exception { int userId = SessionFacade.getUserSession().getUserId(); String profilePage = JForum.getRequest().getContextPath() + "/user/edit/" + userId + SystemGlobals.getValue(ConfigKeys.SERVLET_EXTENSION); String homePage = JForum.getRequest().getContextPath() + "/f... |
SAXParser parser = new SAXParser(); | XMLReader parser; try { SAXParserFactory spf = SAXParserFactory.newInstance(); spf.setValidating(false); spf.setNamespaceAware(true); parser = spf.newSAXParser().getXMLReader(); } catch (Exception ex) { throw new BioException(ex, "Error creating SAX parser"); } | public static void annotateXFF(File xffFile, final Sequence sequence) throws IOException, SAXException, BioException { SequenceBuilder sb = new SequenceBuilderBase() { { seq = sequence; } public void addSymbols(Alphabet alpha, Symbol[] syms, int start, int length) {} }... |
SystemGlobals.loadQueries(SystemGlobals.getApplicationResourceDir() +"/config/"+ SystemGlobals.getValue(ConfigKeys.GENERIC_SQL_QUERIES)); SystemGlobals.loadQueries(SystemGlobals.getApplicationResourceDir() +"/config/"+ SystemGlobals.getValue(ConfigKeys.SQL_FILE)); | SystemGlobals.loadQueries(SystemGlobals.getValue(ConfigKeys.SQL_QUERIES_GENERIC)); SystemGlobals.loadQueries(SystemGlobals.getValue(ConfigKeys.SQL_QUERIES_DRIVER)); | private void loadConfigStuff() throws Exception { SystemGlobals.loadQueries(SystemGlobals.getApplicationResourceDir() +"/config/"+ SystemGlobals.getValue(ConfigKeys.GENERIC_SQL_QUERIES)); SystemGlobals.loadQueries(SystemGlobals.getApplicationResourceDir() +"/config/"+ SystemGlobals.getValue(ConfigKeys.SQL_FILE)); ... |
ConnectionPool.init(SystemGlobals.getApplicationResourceDir() +"/config/database.properties"); | ConnectionPool.init(); | private void startDatabase() throws Exception { ConnectionPool.init(SystemGlobals.getApplicationResourceDir() +"/config/database.properties"); } |
public StructureModelDump(PrintStream outArg) { | public StructureModelDump(PrintStream outArg, CaesarJAsmManager asmManager) { | public StructureModelDump(PrintStream outArg) { this.out = outArg; } |
this.asmManager = asmManager; this.depth = 0; | public StructureModelDump(PrintStream outArg) { this.out = outArg; } | |
public void print(CaesarJAsmManager asmManager) { print("", asmManager.getHierarchy().getRoot()); | public void print() { this.process(asmManager.hierarchy.getRoot()); | public void print(CaesarJAsmManager asmManager) { print("", asmManager.getHierarchy().getRoot()); printRelationshipMap(asmManager); } |
outArg.print("[" + node.getKind() + "] " + node.getName() + " package ='" + node.getPackageName() + "' "); | outArg.print("[" + node.getKind() + "] " + node.getName()); | protected void printNodeHeader(PrintStream outArg, IProgramElement node) { //out.print(node.getClass().getName()); outArg.print("[" + node.getKind() + "] " + node.getName() + " package ='" + node.getPackageName() + "' "); ISourceLocation srcLoc = node.getSourceLocation(); if (srcLoc != null) { outArg.print("(L "... |
*overlapping patterns, unfortunately it means the behaivour of a pattern | *overlapping patterns, unfortunately it means the behaviour of a pattern | public KnuthMorrisPrattSearch(SymbolList pattern) { Alphabet alpha = pattern.getAlphabet(); ArrayList rList = new ArrayList(pattern.toList()); /* *need to perform this hack to make the kmpNext capable of dealing with *overlapping patterns, unfortunately it means the behaivour of a pattern *contai... |
fixx = battleField.getBoundingBox().getWidth() - boundingBox.width - boundingBox.x - .001; | fixx = battleField.getBoundingBox().getWidth() - boundingBox.width - boundingBox.x; | 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 - .001; angle = normal... |
fixx = -boundingBox.x + .001; | fixx = -boundingBox.x; | 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 - .001; angle = normal... |
fixy = battleField.getBoundingBox().getHeight() - getBoundingBox().height - getBoundingBox().y - .001; | fixy = battleField.getBoundingBox().getHeight() - getBoundingBox().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 - .001; angle = normal... |
fixy = -boundingBox.y + .001; | fixy = -boundingBox.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 - .001; angle = normal... |
double velocity1 = 0, velocity2 = 0; | double velocity1 = fixx / sin(heading); double velocity2 = fixy / cos(heading); | 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 - .001; angle = normal... |
if (abs(sin(heading)) > .00001) { velocity1 = fixx / sin(heading); } else { velocity1 = 0; } if (abs(cos(heading)) > .00001) { velocity2 = fixy / cos(heading); } else { velocity2 = 0; } double fixv = 0; if (max(abs(velocity1), abs(velocity2)) == abs(velocity1)) { fixv = velocity1; } else { fixv = velocity2; } | double fixv = (max(abs(velocity1), abs(velocity2)) == abs(velocity1)) ? velocity1 : velocity2; | 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 - .001; angle = normal... |
parameters, | public JAccessorMethod(TypeFactory factory, CSourceClass target, CMember member, boolean leftSide, boolean isSuper, int oper) { super(TokenReference.NO_REF, null, new JavaStyleComment[0]); this.target = target; this.member = member; JBlock body; JFormalParameter[] parameters; Strin... | |
if (!TestProperties.instance().ignoreUndefMessages()) { failure("failed : undefined message: " + getId() + " : "+getDescription()); } | if(found.length == 0) failure("No errors found: "+getId()+" : "+getDescription()); | private void checkErrors(MessageDescription[] expected){ List errors = new LinkedList(); for (Iterator iter = positionedErrorList.iterator(); iter.hasNext();) { Object o = iter.next(); // ignore warnings which are a subtype of PositionedError if (!(o instanceof CWarnin... |
new EhloCommand(commandDispatcher); | private void initializeCommandDispatcher() { commandDispatcher = new CommandDispatcher(this); new HelloCommand(commandDispatcher); // new EhloCommand(commandDispatcher); new MailCommand(commandDispatcher); new ReceiptCommand(commandDispatcher); new DataCommand(commandDispatcher); new ResetCommand(commandDispatc... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.