rem
stringlengths
0
477k
add
stringlengths
0
313k
context
stringlengths
6
599k
int b = (int) (255 * HUEtoRGB(m1, m2, h - (1f / 3f)));
int b = (int) (255 * HUEtoRGB(m1, m2, h - (1f / 3)));
private static final int HSLtoRGB(float h, float s, float l) { float m2 = (l <= 0.5) ? (l * (s + 1f)) : (l + s - l * s); float m1 = 2f * l - m2; int r = (int) (255 * HUEtoRGB(m1, m2, h + (1f / 3f))); int g = (int) (255 * HUEtoRGB(m1, m2, h)); int b = (int) (255 * HUEtoRGB(m1, m2, h - (1f / 3f))); return (((r << ...
if (h < 0f) { h += 1f;
if (h < 0) { h++;
private static float HUEtoRGB(float m1, float m2, float h) { if (h < 0f) { h += 1f; } if (h > 1f) { h -= 1f; } if ((h * 6f) < 1f) { return m1 + (m2 - m1) * h * 6f; } if ((h * 2f) < 1f) { return m2; } if ((h * 3f) < 2f) { return m1 + (m2 - m1) * ((2f / 3f) - h) * 6f; } return m1; }
if (h > 1f) { h -= 1f;
if (h > 1) { h--;
private static float HUEtoRGB(float m1, float m2, float h) { if (h < 0f) { h += 1f; } if (h > 1f) { h -= 1f; } if ((h * 6f) < 1f) { return m1 + (m2 - m1) * h * 6f; } if ((h * 2f) < 1f) { return m2; } if ((h * 3f) < 2f) { return m1 + (m2 - m1) * ((2f / 3f) - h) * 6f; } return m1; }
if ((h * 6f) < 1f) { return m1 + (m2 - m1) * h * 6f;
if ((h * 6) < 1) { return m1 + (m2 - m1) * h * 6;
private static float HUEtoRGB(float m1, float m2, float h) { if (h < 0f) { h += 1f; } if (h > 1f) { h -= 1f; } if ((h * 6f) < 1f) { return m1 + (m2 - m1) * h * 6f; } if ((h * 2f) < 1f) { return m2; } if ((h * 3f) < 2f) { return m1 + (m2 - m1) * ((2f / 3f) - h) * 6f; } return m1; }
if ((h * 2f) < 1f) {
if ((h * 2) < 1) {
private static float HUEtoRGB(float m1, float m2, float h) { if (h < 0f) { h += 1f; } if (h > 1f) { h -= 1f; } if ((h * 6f) < 1f) { return m1 + (m2 - m1) * h * 6f; } if ((h * 2f) < 1f) { return m2; } if ((h * 3f) < 2f) { return m1 + (m2 - m1) * ((2f / 3f) - h) * 6f; } return m1; }
if ((h * 3f) < 2f) { return m1 + (m2 - m1) * ((2f / 3f) - h) * 6f;
if ((h * 3) < 2) { return m1 + (m2 - m1) * ((2f / 3) - h) * 6;
private static float HUEtoRGB(float m1, float m2, float h) { if (h < 0f) { h += 1f; } if (h > 1f) { h -= 1f; } if ((h * 6f) < 1f) { return m1 + (m2 - m1) * h * 6f; } if ((h * 2f) < 1f) { return m2; } if ((h * 3f) < 2f) { return m1 + (m2 - m1) * ((2f / 3f) - h) * 6f; } return m1; }
this.componentSequenceName = temp.componentSequenceName;
public DistComponentFeature(DistributedSequence parent, ComponentFeature.Template temp) throws BioException { if (locationContent(temp.location) != locationContent(temp.componentLocation)) { throw new BioException("Component and container locations must contain an equal number of symbols."); }...
if (FilterUtils.areDisjoint(ff, new FeatureFilter.ByParent(new FeatureFilter.ByClass(ComponentFeature.class)))) { return FeatureHolder.EMPTY_FEATURE_HOLDER; } Location loc = FilterUtils.extractOverlappingLocation(ff); if (loc != null && !LocationTools.overlaps(loc, getLocation())) { return FeatureHolder.EMPTY_FEATURE...
public FeatureHolder filter(FeatureFilter ff, boolean recurse) { return getProjectedFeatures().filter(ff, recurse); }
this(fh, null, parent, translation, oppositeStrand);
this.wrapped = fh; this.parent = parent; this.translate = translation; this.oppositeStrand = oppositeStrand; this.filter = filter; this.projectionContext = new PFHContext(); underlyingFeaturesChange = new ChangeListener() { public void preChange(ChangeEvent e) throws ChangeVetoException { if (changeSupport != null) {...
public ProjectedFeatureHolder(FeatureHolder fh, FeatureHolder parent, int translation, boolean oppositeStrand) { this(fh, null, parent, translation, oppositeStrand); }
Role myRole = role.getList().getRoleFor(this.getMe());
protected Role getRoleForEdit(Long roleId) throws NotFoundException, PermissionException { Role role = this.dao.findRole(roleId); Role myRole = role.getList().getRoleFor(this.getMe()); if (! myRole.getPermissions().contains(Permission.EDIT_ROLES)) throw new PermissionException(Permission.EDIT_ROLES); return ...
if (! myRole.getPermissions().contains(Permission.EDIT_ROLES))
if (! role.getList().getPermissionsFor(this.getMe()).contains(Permission.EDIT_ROLES))
protected Role getRoleForEdit(Long roleId) throws NotFoundException, PermissionException { Role role = this.dao.findRole(roleId); Role myRole = role.getList().getRoleFor(this.getMe()); if (! myRole.getPermissions().contains(Permission.EDIT_ROLES)) throw new PermissionException(Permission.EDIT_ROLES); return ...
public EnabledFilter(MailingList list, String className) { if (log.isDebugEnabled()) log.debug("Creating new EnabledFilter"); this.list = list; this.className = className; this.arguments = new HashMap<String, FilterArgument>(); }
public EnabledFilter() {}
public EnabledFilter(MailingList list, String className) { if (log.isDebugEnabled()) log.debug("Creating new EnabledFilter"); this.list = list; this.className = className; this.arguments = new HashMap<String, FilterArgument>(); }
public FilterArgument(EnabledFilter filter, String name, Object value) { if (log.isDebugEnabled()) log.debug("Creating new FilterArgument"); this.filter = filter; this.name = name; }
public FilterArgument() {}
public FilterArgument(EnabledFilter filter, String name, Object value) { if (log.isDebugEnabled()) log.debug("Creating new FilterArgument"); this.filter = filter; this.name = name; }
alignment.addObject(current_object);
alignment.addObject(AnnotationFactory.makeAnnotation(current_object));
public void endElement (String uri, String name, String qName){ //System.out.println("endElement >" + qName + "< >" + name + "<") ; if (qName.equals("OBJECT")) { try { alignment.addObject(current_object); } catch ( DASException e) { e.printStackTrace() ; } current_object = new HashMap() ; } if (...
try { alignment.addBlock(current_block); } catch ( DASException e) { e.printStackTrace() ; }
public void endElement (String uri, String name, String qName){ //System.out.println("endElement >" + qName + "< >" + name + "<") ; if (qName.equals("OBJECT")) { try { alignment.addObject(current_object); } catch ( DASException e) { e.printStackTrace() ; } current_object = new HashMap() ; } if (...
this.response.setHeader("Content-Disposition", "attachment; filename=\"" + a.getInfo().getRealFilename() + "\";");
this.response.setHeader("Content-Disposition", "attachment; filename=\"" + toUtf8String(a.getInfo().getRealFilename()) + "\";");
public void downloadAttach() throws Exception { if (!SecurityRepository.canAccess(SecurityConstants.PERM_ATTACHMENTS_DOWNLOAD)) { this.setTemplateName(TemplateKeys.POSTS_CANNOT_DOWNLOAD); this.context.put("message", I18n.getMessage("Attachments.featureDisabled")); return; } int id = this.request.getIntParam...
public Attachment(Mail mail, Blob content, String contentType) { if (log.isDebugEnabled()) log.debug("Creating new attachment"); this.mail = mail; this.content = content; this.contentType = contentType; }
public Attachment() {}
public Attachment(Mail mail, Blob content, String contentType) { if (log.isDebugEnabled()) log.debug("Creating new attachment"); this.mail = mail; this.content = content; this.contentType = contentType; }
protected CBodyContext(CBodyContext parent, KjcEnvironment environment, CBodyContext source) {
protected CBodyContext(CBodyContext parent, KjcEnvironment environment) {
protected CBodyContext(CBodyContext parent, KjcEnvironment environment, CBodyContext source) { super(parent, environment); flowState = source.flowState; variableInfo = new CVariableInfo(source.getVariableInfo()); variableInfo.createInfo(); fieldInfo = new CVariableInfo(source.getFieldInfo()); field...
flowState = source.flowState; variableInfo = new CVariableInfo(source.getVariableInfo()); variableInfo.createInfo(); fieldInfo = new CVariableInfo(source.getFieldInfo()); fieldInfo.createInfo();
flowState = parent.flowState; variableInfo = new CVariableInfo(parent.getVariableInfo()); fieldInfo = new CVariableInfo(parent.getFieldInfo());
protected CBodyContext(CBodyContext parent, KjcEnvironment environment, CBodyContext source) { super(parent, environment); flowState = source.flowState; variableInfo = new CVariableInfo(source.getVariableInfo()); variableInfo.createInfo(); fieldInfo = new CVariableInfo(source.getFieldInfo()); field...
if (commonArguments.contains(name)) { continue; }
protected void checkArguments() { Map args = (Map) ArgumentsMap.getMap().getValidArgs().get(getCanonicalType()); for (Iterator i = getStaticArguments().keySet().iterator(); i.hasNext();) { String name = (String) i.next(); if (args == null || !args.containsKey(name)) { if (commonArguments.contains(name)) { ...
} else { seq = this.crr.getRemoteSymbolList(this.getCrossRef(), seq.getAlphabet());
public SymbolList symbols(SymbolList seq) { if (seq==null) throw new IllegalArgumentException("Sequence cannot be null"); if (seq instanceof RichSequence) { RichSequence rs = (RichSequence)seq; if (this.getCircularLength()>0) { if (!rs.getCircular()) throw ...
SymbolList seq2 = seq.subList(this.getMin(),this.getMax());
seq = seq.subList(this.getMin(),this.getMax());
public SymbolList symbols(SymbolList seq) { if (seq==null) throw new IllegalArgumentException("Sequence cannot be null"); if (seq instanceof RichSequence) { RichSequence rs = (RichSequence)seq; if (this.getCircularLength()>0) { if (!rs.getCircular()) throw ...
seq2 = DNATools.reverseComplement(seq);
seq = DNATools.reverseComplement(seq);
public SymbolList symbols(SymbolList seq) { if (seq==null) throw new IllegalArgumentException("Sequence cannot be null"); if (seq instanceof RichSequence) { RichSequence rs = (RichSequence)seq; if (this.getCircularLength()>0) { if (!rs.getCircular()) throw ...
seq2 = RNATools.reverseComplement(seq);
seq = RNATools.reverseComplement(seq);
public SymbolList symbols(SymbolList seq) { if (seq==null) throw new IllegalArgumentException("Sequence cannot be null"); if (seq instanceof RichSequence) { RichSequence rs = (RichSequence)seq; if (this.getCircularLength()>0) { if (!rs.getCircular()) throw ...
seq2 = SymbolListViews.reverse(seq2);
seq = SymbolListViews.reverse(seq);
public SymbolList symbols(SymbolList seq) { if (seq==null) throw new IllegalArgumentException("Sequence cannot be null"); if (seq instanceof RichSequence) { RichSequence rs = (RichSequence)seq; if (this.getCircularLength()>0) { if (!rs.getCircular()) throw ...
return seq2;
return seq;
public SymbolList symbols(SymbolList seq) { if (seq==null) throw new IllegalArgumentException("Sequence cannot be null"); if (seq instanceof RichSequence) { RichSequence rs = (RichSequence)seq; if (this.getCircularLength()>0) { if (!rs.getCircular()) throw ...
public static Properties loadModulesMapping(String baseConfigDir) throws IOException
public static Properties loadModulesMapping(String baseConfigDir)
public static Properties loadModulesMapping(String baseConfigDir) throws IOException { Properties modulesMapping = new Properties(); modulesMapping.load(new FileInputStream(baseConfigDir + "/modulesMapping.properties")); return modulesMapping; }
Properties modulesMapping = new Properties(); modulesMapping.load(new FileInputStream(baseConfigDir + "/modulesMapping.properties")); return modulesMapping; }
try { Properties modulesMapping = new Properties(); modulesMapping.load(new FileInputStream(baseConfigDir + "/modulesMapping.properties")); return modulesMapping; } catch (IOException e) { String es = "Erorr loadModulesMapping()"; logger.error(es, e); throw new RuntimeException(es, e); } }
public static Properties loadModulesMapping(String baseConfigDir) throws IOException { Properties modulesMapping = new Properties(); modulesMapping.load(new FileInputStream(baseConfigDir + "/modulesMapping.properties")); return modulesMapping; }
public static void loadUrlPatterns() throws IOException { Properties p = new Properties(); p.load(new FileInputStream(SystemGlobals.getValue(ConfigKeys.CONFIG_DIR) + "/urlPattern.properties"));
public static void loadUrlPatterns() { try { Properties p = new Properties(); p.load(new FileInputStream(SystemGlobals.getValue(ConfigKeys.CONFIG_DIR) + "/urlPattern.properties"));
public static void loadUrlPatterns() throws IOException { Properties p = new Properties(); p.load(new FileInputStream(SystemGlobals.getValue(ConfigKeys.CONFIG_DIR) + "/urlPattern.properties")); Iterator iter = p.entrySet().iterator(); while (iter.hasNext()) { Map.Entry entry = (Map.Entry) iter.next(); Action...
ActionServletRequest.addUrlPattern((String)entry.getKey(), (String)entry.getValue());
ActionServletRequest.addUrlPattern((String)entry.getKey(), (String)entry.getValue()); } } catch (IOException e) { String es = "Erorr add()"; logger.error(es, e); throw new RuntimeException(es, e);
public static void loadUrlPatterns() throws IOException { Properties p = new Properties(); p.load(new FileInputStream(SystemGlobals.getValue(ConfigKeys.CONFIG_DIR) + "/urlPattern.properties")); Iterator iter = p.entrySet().iterator(); while (iter.hasNext()) { Map.Entry entry = (Map.Entry) iter.next(); Action...
public static void startSystemglobals(String appPath) throws Exception
public static void startSystemglobals(String appPath)
public static void startSystemglobals(String appPath) throws Exception { SystemGlobals.initGlobals(appPath, appPath + "/WEB-INF/config/SystemGlobals.properties"); SystemGlobals.loadAdditionalDefaults(SystemGlobals.getValue(ConfigKeys.DATABASE_DRIVER_CONFIG)); if (new File(SystemGlobals.getValue(ConfigKeys.INSTALL...
partition = document.getPartition(startOffset);
partition = SchemeTextUtilities.getPartition(document, startOffset);
public static boolean checkCompleteSExpressions(IDocument document, int offset, int length) { try { int startOffset = offset; int endOffset = offset + length; ITypedRegion partition; // if the start of the region is inside a comment, go to the start // o...
partition = document.getPartition(endOffset);
partition = SchemeTextUtilities.getPartition(document, endOffset);
public static boolean checkCompleteSExpressions(IDocument document, int offset, int length) { try { int startOffset = offset; int endOffset = offset + length; ITypedRegion partition; // if the start of the region is inside a comment, go to the start // o...
try { SexpNavigator navigator = new SexpNavigator(document);
SexpNavigator navigator = new SexpNavigator(document);
public static IRegion findEnclosingSexpressions(IDocument document, int start, int end) { try { SexpNavigator navigator = new SexpNavigator(document); ITypedRegion partition = document.getPartition(start); while (partition.getType() == SchemePartitionScanner.SCHEME_COMMENT) {...
ITypedRegion partition = document.getPartition(start); while (partition.getType() == SchemePartitionScanner.SCHEME_COMMENT) { start = partition.getOffset() + partition.getLength(); partition = document.getPartition(start); }
ITypedRegion partition = SchemeTextUtilities.getPartition(document, start); while (partition.getType() == SchemePartitionScanner.SCHEME_COMMENT) { start = partition.getOffset() + partition.getLength(); partition = SchemeTextUtilities.getPartition(document, start); }
public static IRegion findEnclosingSexpressions(IDocument document, int start, int end) { try { SexpNavigator navigator = new SexpNavigator(document); ITypedRegion partition = document.getPartition(start); while (partition.getType() == SchemePartitionScanner.SCHEME_COMMENT) {...
partition = document.getPartition(end); while (partition.getType() == SchemePartitionScanner.SCHEME_COMMENT) { end = partition.getOffset() - 1; partition = document.getPartition(end); } if (start >= end) return null;
partition = SchemeTextUtilities.getPartition(document, end); while (partition.getType() == SchemePartitionScanner.SCHEME_COMMENT) { end = partition.getOffset() - 1; partition = SchemeTextUtilities.getPartition(document, end); } if (start >= end) return null;
public static IRegion findEnclosingSexpressions(IDocument document, int start, int end) { try { SexpNavigator navigator = new SexpNavigator(document); ITypedRegion partition = document.getPartition(start); while (partition.getType() == SchemePartitionScanner.SCHEME_COMMENT) {...
return new Region(start, end - start); } catch (BadLocationException e) { return null; }
return new Region(start, end - start);
public static IRegion findEnclosingSexpressions(IDocument document, int start, int end) { try { SexpNavigator navigator = new SexpNavigator(document); ITypedRegion partition = document.getPartition(start); while (partition.getType() == SchemePartitionScanner.SCHEME_COMMENT) {...
writeAnnotations(Feature f) throws IOException
protected void writeAnnotations(FeatureHolder f) throws IOException
writeAnnotations(Feature f) throws IOException { //write annotation // <!ELEMENT annotations (seq_feature | gene | comp_result )+ > mIndent.indent(); mOut.print(mIndent); mOut.println("<annotations>"); /* for (Iterator i = f.features(); i.hasNext(); ) { ...
else writeCompResult( feature);
else { writeSeqFeature(feature); }
writeAnnotations(Feature f) throws IOException { //write annotation // <!ELEMENT annotations (seq_feature | gene | comp_result )+ > mIndent.indent(); mOut.print(mIndent); mOut.println("<annotations>"); /* for (Iterator i = f.features(); i.hasNext(); ) { ...
writeSequenceMap(seq);
writeSequenceMap2(seq);
writeBioSequence(Annotatable seq ) throws IOException { String s; mIndent.indent(); mOut.print(mIndent); mOut.print("<bio_sequence"); // write attributes // if( seq instanceof Sequence) { mOut.print(" seq_length=\""); mOut.print( ((Seq...
if (s == null) { s = ((Feature) f).getType(); }
writeSeqFeature( Annotatable f) throws IOException {/*<!ELEMENT seq_feature (classification* , note? , seq_location , xrefs? , evidence? , qualifier* , seq_feature* , related_annot*)><!ATTLIST seq_feature element_id ID #IMPLIED feature_type CDATA #REQUIRED ...
writeAnnotations((Feature)f);
writeAnnotations((FeatureHolder) f);
writeSequenceMap2(Annotatable f) throws IOException {/*<!ELEMENT sequence_map (note? , computation? , annotations? )><!ATTLIST sequence_map label CDATA #IMPLIED >*/ mIndent.indent(); mOut.print(mIndent); mOut.print("<sequence_map"); // write attributes // String ...
if( property_class.equals(QUALIFIER))
if( property_class.equals(QUALIFIER)) {
public String toString(String indent, String indent_unit) { StringBuffer sb = new StringBuffer() ; sb.append(indent + "<" + property_class ) ; if( property_class.equals(QUALIFIER)) sb.append( " qualifier_type=\"" ) ; else sb.append( " data_type=\"" ) ; sb.ap...
else sb.append( " data_type=\"" ) ;
} else { sb.append( " prop_type=\"" ) ; } sb.append(prop);
public String toString(String indent, String indent_unit) { StringBuffer sb = new StringBuffer() ; sb.append(indent + "<" + property_class ) ; if( property_class.equals(QUALIFIER)) sb.append( " qualifier_type=\"" ) ; else sb.append( " data_type=\"" ) ; sb.ap...
return LayeredRenderer.INSTANCE.processMouseEvent(
SequenceViewerEvent sve = LayeredRenderer.INSTANCE.processMouseEvent(
public SequenceViewerEvent processMouseEvent( SequenceRenderContext src, MouseEvent me, List path, int min, int max ) { path.add(this); List layers = layer(src); return LayeredRenderer.INSTANCE.processMouseEvent( layers, me, path, min, max, Collections.nCopies(layers.siz...
if(sve == null) { sve = new SequenceViewerEvent( this, null, src.graphicsToSequence(me.getPoint()), me, path ); } return sve;
public SequenceViewerEvent processMouseEvent( SequenceRenderContext src, MouseEvent me, List path, int min, int max ) { path.add(this); List layers = layer(src); return LayeredRenderer.INSTANCE.processMouseEvent( layers, me, path, min, max, Collections.nCopies(layers.siz...
SequenceRenderer sRend = (SequenceRenderer) i.next(); depth += sRend.getDepth(src);
SequenceRenderer sRend = (SequenceRenderer) i.next(); if(sRend instanceof OverlayMarker){ depth += 0.0; }else { depth += sRend.getDepth(src); }
public double getDepth(List srcL, List renderers) { if (srcL.size() != renderers.size()) { throw new IllegalArgumentException("srcL and renderers must be the same size: " + srcL.size() + ":" + renderers.size()); } double depth = 0.0; ...
public static final boolean createInstance()
public static boolean createInstance()
public static final boolean createInstance() { try { instance = (DBConnection)Class.forName(SystemGlobals.getValue( ConfigKeys.DATABASE_CONNECTION_IMPLEMENTATION)).newInstance(); } catch (Exception e) { logger.warn("Error creating the database connection implementation instance. " + e); e.printStackTrac...
static double distance(double d, double loc) { double dist = Math.abs(d-loc); double min = Math.min(d, loc); double max = Math.max(d, loc); double altdist = Math.abs(1.0+min-max); return Math.min(dist, altdist);
static double distance(PeerNode p, double loc) { double d = distance(p.getLocation().getValue(), loc); return d;
static double distance(double d, double loc) { // Circular keyspace double dist = Math.abs(d-loc); double min = Math.min(d, loc); double max = Math.max(d, loc); double altdist = Math.abs(1.0+min-max); return Math.min(dist, altdist); }
String q1 = SystemGlobals.getSql("GenericModel.selectByLimit"); String q2 = SystemGlobals.getSql("TopicModel.selectAllByForumByLimit"); PreparedStatement p = JForum.getConnection().prepareStatement(q1 + " " + count + " " + q2);
String top = SystemGlobals.getSql("GenericModel.selectByLimit"); PreparedStatement p = JForum.getConnection().prepareStatement((top + " " + count + " " + SystemGlobals.getSql("TopicModel.selectAllByForumByLimit1") + " " + top + " " + startFrom + " " + SystemGlobals.getSql("TopicModel.selectAllByForumByLimit2"))); Sys...
public List selectAllByForumByLimit(int forumId, int startFrom, int count) throws Exception { List l = new ArrayList(); String q1 = SystemGlobals.getSql("GenericModel.selectByLimit"); String q2 = SystemGlobals.getSql("TopicModel.selectAllByForumByLimit"); PreparedStatement p = JForum.getConnection().prepareStateme...
p.setInt(2, forumId);
public List selectAllByForumByLimit(int forumId, int startFrom, int count) throws Exception { List l = new ArrayList(); String q1 = SystemGlobals.getSql("GenericModel.selectByLimit"); String q2 = SystemGlobals.getSql("TopicModel.selectAllByForumByLimit"); PreparedStatement p = JForum.getConnection().prepareStateme...
Label label = new Label(composite, SWT.SHADOW_OUT); label.setText("Symbols");
Label label = new Label(composite, SWT.BORDER | SWT.SHADOW_IN); label.setText(" Symbols");
protected Control createContents(Composite parent) { Composite composite = new Composite(parent, SWT.NULL); GridLayout layout = new GridLayout(1, true); layout.verticalSpacing = 0; layout.marginHeight = 0; layout.marginWidth = 0; composite.setLayout(layout); ...
else if (event.character == 27) { cancel(); }
protected Control createContents(Composite parent) { Composite composite = new Composite(parent, SWT.NULL); GridLayout layout = new GridLayout(1, true); layout.verticalSpacing = 0; layout.marginHeight = 0; layout.marginWidth = 0; composite.setLayout(layout); ...
else if (event.character == 27) { cancel(); }
public void keyPressed(KeyEvent event) { if (event.character == '\r') { ok(); } else if (event.character == 27) { cancel(); } }
setReturnCode(OK);
protected void ok() { close(); }
String expectedOutput = testDescription.toString() + CR
String expectedOutput = testDescription.toString() + CR + '\t'
public void testLongDescriptionOutputsAllValues() { Mock mockSubscriber = mock(TopicSubscriber.class); Mock mockTopic = mock(Topic.class); mockTopic.stubs().method("getTopicName").will(returnValue("testTopic")); mockSubscriber.stubs() .method("getTopic") .will(retur...
+ defaultClockTimeAsHJBEncodedLong() + CR + "message-selector=testSelector" + CR + "no-local=(boolean false)" + CR + "subscriber-name=testTopic";
+ defaultClockTimeAsHJBEncodedLong() + ", message-selector=testSelector" + ", no-local=(boolean false), subscriber-name=testTopic";
public void testLongDescriptionOutputsAllValues() { Mock mockSubscriber = mock(TopicSubscriber.class); Mock mockTopic = mock(Topic.class); mockTopic.stubs().method("getTopicName").will(returnValue("testTopic")); mockSubscriber.stubs() .method("getTopic") .will(retur...
public StaticAceSet(AceSet parent, AceURL url) {
public StaticAceSet(AceSet parent, AceURL url, String name) {
public StaticAceSet(AceSet parent, AceURL url) { this.parent = parent; this.url = url; }
this.name = name;
public StaticAceSet(AceSet parent, AceURL url) { this.parent = parent; this.url = url; }
ContentHandler listener = getListener();
public HitHandler(StAXFeatureHandler staxenv) { super(staxenv);// // acquire value of <Hit_num> with inner class.// super.addHandler(new ElementRecognizer.ByLocalName("Hit_num"),// HitPropertyHandler.HIT_PROPERTY_HANDLER_FACTORY); // acquire value of <Hit_id> with inner cla...
ContentHandler listener = getListener();
public StAXContentHandler getHandler(StAXFeatureHandler staxenv) { return new StringElementHandlerBase() { public void startElement( String nsURI, String localName, String qName, ...
ContentHandler listener = getListener();
public void endElement( String nsURI, String localName, String qName, StAXContentHandler handler) throws SAXException { ...
listener.endElement(biojavaUri, "Hit", biojavaUri + ":Hit");
staxenv.listener.endElement(biojavaUri, "Hit", biojavaUri + ":Hit");
public void endElementHandler( String nsURI, String localName, String qName, StAXContentHandler handler) throws SAXException { listener.endElement(biojavaUri, "Hit", biojavaUri + ":Hit"); }
listener.startElement(biojavaUri, "HSPCollection", biojavaUri + ":HSPCollection", new AttributesImpl());
staxenv.listener.startElement(biojavaUri, "HSPCollection", biojavaUri + ":HSPCollection", new AttributesImpl());
public void startElementHandler( String nsURI, String localName, String qName, Attributes attrs) throws SAXException { // generate start of <biojava:HSPCollection> listener.startElement(biojavaUri, "HSPCollection", biojavaUri + ":HSPCollection...
out.print( " <tr><td>Log info</td>\n" ); out.print( " <td>"+outPhoto.getAllExif()+"</td></tr>\n" );
private void printExifInformation ( OutputPhoto outPhoto, PrintWriter out ) { out.println( "<hr/>\n" ); if ( outPhoto.isExif() ) { out.print( "<table cellpadding=\"2\" cellspacing=\"0\" " + "border=\"0\" width=\"60%\" align=\"Left\">\n" ); ...
raw.getDeliverTo().getId());
(raw.getDeliverTo() != null) ? raw.getDeliverTo().getId() : null);
public static SubscriberData subscriber(Subscription raw) { if (log.isDebugEnabled()) log.debug(raw.toString()); return new SubscriberData( raw.getPerson().getId(), raw.getPerson().getName(), raw.getEmailAddresses(), raw.getRole().getName(), raw.getDeliverTo().getId()); }
String newSignature = "(L"+newClassName+";)V";
String newSignature = "(L"+newOuterClassName+";)V";
public void visitMethod(Method obj) { // we search for outer-class-access functions, which // are static, have exactly one argument of this class' type and // return an instance of the outer class' type if (obj.getName().startsWith("access$")){ if (!obj.isStatic() ) return; String returnType = Type.getRetur...
for (int j = 0; localVariables != null && j < localVariables.length; j++){ ((InstructionHandle)localVariables[j].getEnd()).addAccessor(localVariables[j]); ((InstructionHandle)localVariables[j].getStart()).addAccessor(localVariables[j]); }
private void buildBasicBlocks(InstructionHandle start) { for (InstructionHandle handle = this.codeStart; handle != null; handle = handle.getNext()) { handle.reset(); } for (int i = 0; i < handlers.length; i++) { // !!! if (start.isReachable()) ((InstructionHandle)handlers[i].getHandler()).addA...
localVariables);
buildLocalVariableInfo());
public CodeInfo getCodeInfo() { CodeInfo codeInfo; codeInfo = new CodeInfo(buildInstructionArray(), handlers, buildLineNumberInfo(), localVariables); // replace instruction handles by actual instructions try { AccessorTransformer transformer = new AccessorTransformer() { public In...
while ( codeChanged) {
while (level-- > 0 && codeChanged) {
public static CodeInfo optimize(CodeInfo code, int level) { Optimizer opt = new Optimizer(code); // do work at specified level boolean codeChanged = true; while (/*level-- > 0 &&*/ codeChanged) { codeChanged = opt.optimizeCodeSequence(); } code = opt.getCodeInfo(); return code; }
new HJBMessageWriter().writeAsText(attributesAsAMap(), pw);
pw.print('\t'); new HJBMessageWriter().writeAsTextOnALine(attributesAsAMap(), pw);
public void writeLongDescription(Writer aWriter) { PrintWriter pw = new PrintWriter(aWriter); pw.print(this); pw.println(); new HJBMessageWriter().writeAsText(attributesAsAMap(), pw); }
if (lineTokens.hasMoreTokens()) { String nextToken = lineTokens.nextToken(); if(nextToken.startsWith(GenbankFormat.GI_TAG)) { this.saveSeqAnno(); headerTag = GenbankFormat.GI_TAG; headerTagText = new StringBuffer(nextToken.substring(3)); } } } else if (hasHeaderTag(line)) { this.saveSeqAnno(); headerTag = line.substrin...
if (lineTokens.hasMoreTokens()) { String nextToken = lineTokens.nextToken(); if(nextToken.startsWith(GenbankFormat.GI_TAG)) { this.saveSeqAnno(); headerTag = GenbankFormat.GI_TAG; headerTagText = new StringBuffer(nextToken.substring(3)); } } } else if (hasHeaderTag(line)) { this.saveSeqAnno(); headerTag = line.substrin...
private void processHeaderLine(String line) throws ParseException { if(line.startsWith(GenbankFormat.LOCUS_TAG)) { // the LOCUS line is a special case because it contains the // locus, size, molecule type, GenBank division, and the date // of last modification. this.saveSeqAnno(); StringToken...
new LocalVariableInfo[0]);
this.info.getLocalVariables());
public CodeInfo generateCode() { Instruction[] instructions = cfg.getInstructions(); HandlerInfo[] handlers = cfg.getHandlerInfos(instructions); CodeInfo info = new CodeInfo(instructions, handlers, new LineNumberInfo[0], new LocalVariableInfo[0]); //this.info.getLocalVariables()...
public Integer findTimeout(Map decodedParameters) { return findInteger(decodedParameters, HJBServletConstants.TIMEOUT, "timeout", null);
public Long findTimeout(Map decodedParameters) { return findLong(decodedParameters, HJBServletConstants.TIMEOUT, "timeout", null);
public Integer findTimeout(Map decodedParameters) { return findInteger(decodedParameters, HJBServletConstants.TIMEOUT, "timeout", null); }
System.out.println("Warnung: kein Pivot gefunden in Zeile " + z);
if (debug ) System.out.println("Warnung: kein Pivot gefunden in Zeile " + z);
public final double[][] solve() throws ArithmeticException { // -------------------------------------------------------------------------- // EIGENTLICHER SOLVER für bestimmte Lösungsvariablen in unbestimmen Systemen // -------------------------------------------------------------------...
System.out.println("Entwarnung: Zeile " + z + " besteht aus lauter Nullen (ok)");
if (debug) System.out.println("Entwarnung: Zeile " + z + " besteht aus lauter Nullen (ok)");
public final double[][] solve() throws ArithmeticException { // -------------------------------------------------------------------------- // EIGENTLICHER SOLVER für bestimmte Lösungsvariablen in unbestimmen Systemen // -------------------------------------------------------------------...
if (x[i][0] == 0 && Math.abs(R.viewRow(z).get(i)) > 0) {
if (x[i][0] == 0 && Math.abs(R.viewRow(z).get(i)) > TOL) {
public final double[][] solve() throws ArithmeticException { // -------------------------------------------------------------------------- // EIGENTLICHER SOLVER für bestimmte Lösungsvariablen in unbestimmen Systemen // -------------------------------------------------------------------...
double obnull = Math.abs(kontrolle[0] - c.get(z,0)); if (obnull > TOL) { System.out.println("Widerspruch im Gleichungssystem! (Zeile "+z+") " + obnull +" ungleich 0"); throw new ArithmeticException("Widerspruch im Gleichungssystem!"); } for (int j = 1; j < kontrolle.length; j++) {
boolean alleParamNull = true; int bekParam = -1; for (int j = kontrolle.length - 1; j > 0; j--) {
public final double[][] solve() throws ArithmeticException { // -------------------------------------------------------------------------- // EIGENTLICHER SOLVER für bestimmte Lösungsvariablen in unbestimmen Systemen // -------------------------------------------------------------------...
System.out.println("Widerspruch im Gleichungssystem! (Zeile "+z+") Parameter "+j+" ungleich 0: " + kontrolle[j]);
alleParamNull = false; if (bekParam < 0) bekParam = j; } } if (alleParamNull) { double obnull = Math.abs(kontrolle[0] - c.get(z,0)); if (obnull > TOL) { System.out.println("Widerspruch im Gleichungssystem! (Zeile "+z+") " + obnull +" ungleich 0");
public final double[][] solve() throws ArithmeticException { // -------------------------------------------------------------------------- // EIGENTLICHER SOLVER für bestimmte Lösungsvariablen in unbestimmen Systemen // -------------------------------------------------------------------...
} }
else continue; } assert bekParam > 0; for (int xi = 0; xi < x.length; xi++) { double faktor = x[xi][1+bekParam]; if (Math.abs(faktor) < TOL) continue; assert x[xi][0] > 0; for (int j = 0; j < kontrolle.length; j++) { if (j != bekParam) { x[xi][j+1] += -kontrolle[j] * faktor / kontrolle[bekParam]; } } if (bekParam...
public final double[][] solve() throws ArithmeticException { // -------------------------------------------------------------------------- // EIGENTLICHER SOLVER für bestimmte Lösungsvariablen in unbestimmen Systemen // -------------------------------------------------------------------...
double rms1 = a.getRms(); double rms2 = a.getRms();
double rms1 = a.getRmsd(); double rms2 = b.getRmsd();
public int compare(Object arg0, Object arg1) { AlternativeAlignment a = (AlternativeAlignment) arg0; AlternativeAlignment b = (AlternativeAlignment) arg1; int s1 = a.getIdx1().length; int s2 = b.getIdx1().length; if ( s1 > s2) return 1; if ( s1 < ...
rtype == CodeUtils.TYPE_BYTE) {
rtype == CodeUtils.TYPE_BYTE || rtype == CodeUtils.TYPE_BOOLEAN) {
private Class getProjectionClass(Class face) { Class projection = (Class) _projectionClasses.get(face); if (projection == null) { try { Class baseClass = ProjectedFeature.class; if (StrandedFeature.class.isAssignableFrom(face)) baseClass = ProjectedStrandedFeature.class; StringTokenizer st = new Strin...
new StreamMessageByteArrayValueCopier(valuesRead),
public EncodedValueCopier[] getOrderedValueCopiers() { return new EncodedValueCopier[] { new StreamMessageByteValueCopier(valuesRead), new StreamMessageShortValueCopier(valuesRead), new StreamMessageCharValueCopier(valuesRead), new StreamMessageIntV...
SubscriptionHold hold = pers.getHeldSubscriptions().remove(listId);
SubscriptionHold hold = pers.getHeldSubscriptions().get(listId);
protected SubscriptionHold discardHeldSubcriptionInternal(Long listId, Long personId) throws NotFoundException, PermissionException { this.getListFor(listId, Permission.APPROVE_SUBSCRIPTIONS); Person pers = this.em.get(Person.class, personId); SubscriptionHold hold = pers.getHeldSubscriptions().remove(listId); ...
}
protected SubscriptionHold discardHeldSubcriptionInternal(Long listId, Long personId) throws NotFoundException, PermissionException { this.getListFor(listId, Permission.APPROVE_SUBSCRIPTIONS); Person pers = this.em.get(Person.class, personId); SubscriptionHold hold = pers.getHeldSubscriptions().remove(listId); ...
if (soundInitialized) { soundManager.dispose(); }
public void run() { running = true; if (unsafeLoadRobotsThread != null && Thread.currentThread() == unsafeLoadRobotsThread) { unsafeLoadRobots(); return; } // Load robots try { initialize(); } catch (NullPointerException e) { if (!abortBattles) { Utils.log("Null pointer exception in battle.initialize"...
boolean soundInitialized = false; if (manager.isSoundEnabled()) { soundManager.init(); soundInitialized = true; }
public void runRound() { Utils.log("Let the games begin!"); boolean battleOver = false; endTimer = 0; stopTime = 0; currentTime = 0; inactiveTurnCount = 0; int turnsThisSec = 0; int framesThisSec = 0; long frameStartTime; int currentFrameMillis = 0; int totalRobotMillisThisSec = 0; int totalFrameMillisThis...
if (soundInitialized) { soundManager.dispose(); }
public void runRound() { Utils.log("Let the games begin!"); boolean battleOver = false; endTimer = 0; stopTime = 0; currentTime = 0; inactiveTurnCount = 0; int turnsThisSec = 0; int framesThisSec = 0; long frameStartTime; int currentFrameMillis = 0; int totalRobotMillisThisSec = 0; int totalFrameMillisThis...
bufferStrategy.show();
if (getGraphics() != null) { bufferStrategy.show(); }
public void update() { try { if (robocodeFrame.isIconified() || (getWidth() <= 0) || (getHeight() <= 0)) { return; } if (!initialized) { initialize(); } if (offscreenImage != null) { offscreenGfx = (Graphics2D) offscreenImage.getGraphics(); offscreenGfx.setRenderingHints(renderingHints); ...
public void update() { if (active) {
public synchronized void update() { if (isActive) {
public void update() { if (active) { updateMovement(); checkBulletCollision(); if (active) { checkRobotCollision(); } if (active) { checkWallCollision(); } } else if (hitVictim) { setX(victim.getX() + deltaX); setY(victim.getY() + deltaY); synchronized (this) { hitVictimTime++; frame = ...
if (active) {
if (isActive) {
public void update() { if (active) { updateMovement(); checkBulletCollision(); if (active) { checkRobotCollision(); } if (active) { checkWallCollision(); } } else if (hitVictim) { setX(victim.getX() + deltaX); setY(victim.getY() + deltaY); synchronized (this) { hitVictimTime++; frame = ...
} else if (hitVictim) {
} else if (hasHitVictim) {
public void update() { if (active) { updateMovement(); checkBulletCollision(); if (active) { checkRobotCollision(); } if (active) { checkWallCollision(); } } else if (hitVictim) { setX(victim.getX() + deltaX); setY(victim.getY() + deltaY); synchronized (this) { hitVictimTime++; frame = ...
synchronized (this) { hitVictimTime++; frame = hitVictimTime; if (hitVictimTime >= battle.getManager().getImageManager().getExplosionFrames(WHICH_EXPLOSION)) { hitVictim = false; }
hitVictimTime++; frame = hitVictimTime; if (hitVictimTime >= battle.getManager().getImageManager().getExplosionFrames(WHICH_EXPLOSION)) { hasHitVictim = false;
public void update() { if (active) { updateMovement(); checkBulletCollision(); if (active) { checkRobotCollision(); } if (active) { checkWallCollision(); } } else if (hitVictim) { setX(victim.getX() + deltaX); setY(victim.getY() + deltaY); synchronized (this) { hitVictimTime++; frame = ...
} else if (hitBullet) { synchronized (this) { hitBulletTime++; frame = hitBulletTime; if (hitBulletTime >= battle.getManager().getImageManager().getExplosionFrames(WHICH_EXPLOSION)) { hitBullet = false; }
} else if (hasHitBullet) { hitBulletTime++; frame = hitBulletTime; if (hitBulletTime >= battle.getManager().getImageManager().getExplosionFrames(WHICH_EXPLOSION)) { hasHitBullet = false;
public void update() { if (active) { updateMovement(); checkBulletCollision(); if (active) { checkRobotCollision(); } if (active) { checkWallCollision(); } } else if (hitVictim) { setX(victim.getX() + deltaX); setY(victim.getY() + deltaY); synchronized (this) { hitVictimTime++; frame = ...
startAngle = Utils.normalAbsoluteAngle(startAngle);
startAngle = normalAbsoluteAngle(startAngle);
public void scan() { if (isDroid) { return; } double startAngle = lastRadarHeading; double scanRadians = radarHeading - lastRadarHeading; // Check if we passed through 360 if (scanRadians < -PI) { scanRadians = 2 * PI + scanRadians; } else if (scanRadians > PI) { scanRadians = scanRadians - 2 * PI; } ...
new ScannedRobotEvent(r.getName(), r.energy, Utils.normalRelativeAngle(angle - heading), dist, r.heading, r.velocity));
new ScannedRobotEvent(r.getName(), r.energy, normalRelativeAngle(angle - heading), dist, r.heading, r.velocity));
public void scan() { if (isDroid) { return; } double startAngle = lastRadarHeading; double scanRadians = radarHeading - lastRadarHeading; // Check if we passed through 360 if (scanRadians < -PI) { scanRadians = 2 * PI + scanRadians; } else if (scanRadians > PI) { scanRadians = scanRadians - 2 * PI; } ...
sounds = new SoundCache(theMixer); sounds.addSound("death", "/resources/sounds/explode.wav", 3); sounds.addSound("gun", "/resources/sounds/zap.wav", 5); sounds.addSound("hit", "/resources/sounds/shellhit.wav", 3); sounds.addSound("collision", "/resources/sounds/13831_adcbicycle_22.wav", 2);
public void init() { theMixer = findMixer(properties.getOptionsSoundMixer()); sounds = new SoundCache(theMixer); sounds.addSound("death", "/resources/sounds/explode.wav", 3); sounds.addSound("gun", "/resources/sounds/zap.wav", 5); sounds.addSound("hit", "/resources/sounds/shellhit.wav", 3); sounds.addSound("coll...
sounds.clear();
getSounds().clear();
public void dispose() { sounds.clear(); }
Template.readingFrame = FramedFeature.FRAME_0;
framed.readingFrame = FramedFeature.FRAME_0;
public Sequence annotate(Sequence seq) throws BioException, ChangeVetoException { Feature.Template plain = new Feature.Template(); StrandedFeature.Template stranded = new StrandedFeature.Template(); FramedFeature.Template framed = new FramedFeature.Template(); plain.annotation = Annota...
Template.readingFrame = FramedFeature.FRAME_1;
framed.readingFrame = FramedFeature.FRAME_1;
public Sequence annotate(Sequence seq) throws BioException, ChangeVetoException { Feature.Template plain = new Feature.Template(); StrandedFeature.Template stranded = new StrandedFeature.Template(); FramedFeature.Template framed = new FramedFeature.Template(); plain.annotation = Annota...