rem
stringlengths
0
477k
add
stringlengths
0
313k
context
stringlengths
6
599k
if(result!=null) {
if(!isBuilding()) {
public String getIconColor() { if(result!=null) { // already built if(result==Result.SUCCESS) return "blue"; if(result== Result.UNSTABLE) return "yellow"; else return "red"; } // a new build is in progress ...
if(useUpdate && isUpdatable(workspace.getLocal(),listener)) {
if(useUpdate && isUpdatable(workspace,listener)) {
public boolean checkout(Build build, Launcher launcher, FilePath workspace, BuildListener listener, File changelogFile) throws IOException { boolean result; if(useUpdate && isUpdatable(workspace.getLocal(),listener)) { result = update(launcher,workspace,listener); if(!result) ...
private boolean isUpdatable(File dir,BuildListener listener) {
private boolean isUpdatable(FilePath workspace,BuildListener listener) {
private boolean isUpdatable(File dir,BuildListener listener) { StringTokenizer tokens = new StringTokenizer(modules); while(tokens.hasMoreTokens()) { String url = tokens.nextToken(); File module = new File(dir,getLastPathComponent(url)); File svn = new File(module,".sv...
File module = new File(dir,getLastPathComponent(url)); File svn = new File(module,".svn/entries"); if(!svn.exists()) { listener.getLogger().println("Checking out a fresh workspace because "+svn+" doesn't exist."); return false; }
String moduleName = getLastPathComponent(url); File module = workspace.child(url).getLocal();
private boolean isUpdatable(File dir,BuildListener listener) { StringTokenizer tokens = new StringTokenizer(modules); while(tokens.hasMoreTokens()) { String url = tokens.nextToken(); File module = new File(dir,getLastPathComponent(url)); File svn = new File(module,".sv...
synchronized(spf) { try { SAXParser parser = spf.newSAXParser(); Checker checker = new Checker(url); parser.parse(svn,checker); if(!checker.found()) { listener.getLogger().println("Checking out a fresh workspace because the workspace is not "+url); return false; } } catch (ParserConfigurationException e) { throw new E...
try { SvnInfo svnInfo = SvnInfo.parse(moduleName, createEnvVarMap(false), workspace, listener); if(!svnInfo.url.equals(url)) { listener.getLogger().println("Checking out a fresh workspace because the workspace is not "+url);
private boolean isUpdatable(File dir,BuildListener listener) { StringTokenizer tokens = new StringTokenizer(modules); while(tokens.hasMoreTokens()) { String url = tokens.nextToken(); File module = new File(dir,getLastPathComponent(url)); File svn = new File(module,".sv...
} catch (IOException e) { listener.getLogger().println("Checking out a fresh workspace because Hudson failed to detect the current workspace "+module); e.printStackTrace(listener.error(e.getMessage()));
private boolean isUpdatable(File dir,BuildListener listener) { StringTokenizer tokens = new StringTokenizer(modules); while(tokens.hasMoreTokens()) { String url = tokens.nextToken(); File module = new File(dir,getLastPathComponent(url)); File svn = new File(module,".sv...
className = cn; testName = testCase.attributeValue("name");
className = cn.replace('/','_'); testName = testCase.attributeValue("name").replace('/','_');
CaseResult(SuiteResult parent, Element testCase) { String cn = testCase.attributeValue("classname"); if(cn==null) // Maven seems to skip classname, and that shows up in testSuite/@name cn = parent.getName(); className = cn; testName = testCase.attributeValue("name")...
myOpenFileDialog.open(); return myOpenFileDialog.getFilterPath().concat("/").concat( myOpenFileDialog.getFileName());
return myOpenFileDialog.open();
public String getOpenFilename() { myOpenFileDialog.open(); return myOpenFileDialog.getFilterPath().concat("/").concat( myOpenFileDialog.getFileName()); }
else if(num != num) return new Double(Double.NaN);
public Object log(Object param) throws ParseException { if (param instanceof Complex) { return ((Complex)param).log().div(CLOG10); } else if (param instanceof Number) { double num = ((Number) param).doubleValue(); if( num > 0) return new Double(Math.log(num)/LOG10); else { Complex temp = new C...
if(req.getQueryString()!=null) { String path = req.getParameter("path"); if(path!=null) { rsp.sendRedirect(path); return; } }
public synchronized void doWs( StaplerRequest req, StaplerResponse rsp ) throws IOException, ServletException { serveFile(req, rsp, getWorkspace(), true); }
File[] files = f.listFiles(); Arrays.sort(files,FILE_SORTER); req.setAttribute("files",files);
req.setAttribute("parentPath",buildParentPath(path)); req.setAttribute("files",buildChildPathList(f));
private void serveFile(StaplerRequest req, StaplerResponse rsp, File root, boolean serveDirIndex) throws IOException, ServletException { String path = req.getRestOfPath(); if(path.length()==0) path = "/"; if(path.indexOf("..")!=-1 || path.length()<1) { // don't serve anyth...
public void persistPersonalData(PersonalData personalData);
public void persistPersonalData(SecureUserDetails secureUserDetails);
public void persistPersonalData(PersonalData personalData);
plottableDisplay.setSelectedRectangle(prevx, prevy, me.getX(), me.getY());
public void mouseReleased(MouseEvent me) { plottableDisplay.setSelectedRectangle(prevx, prevy, me.getX(), me.getY()); }
setName( job.getJobName() );
setName( job.getJobName() + "-W" + Integer.toHexString( hashCode() ) );
public void run() { Job job = null; activeThreads ++; while(true) { synchronized( ThreadPool.this ) { long startedWaiting = System.currentTimeMillis(); // As long as no jobs ar...
public short getHasUploadedFlag()
public short getHasUploadedFlag() throws InvalidMessageException
public short getHasUploadedFlag() { parseBody(); return hasUploadedFlag; }
public short getPushNeededFlag()
public short getPushNeededFlag() throws InvalidMessageException
public short getPushNeededFlag() { parseBody(); return pushNeededFlag; }
public DestAddress[] getPushProxyAddresses()
public DestAddress[] getPushProxyAddresses() throws InvalidMessageException
public DestAddress[] getPushProxyAddresses() { parseBody(); return pushProxyAddresses; }
public long getRemoteHostSpeed()
public long getRemoteHostSpeed() throws InvalidMessageException
public long getRemoteHostSpeed() { parseBody(); return remoteHostSpeed; }
public short getServerBusyFlag()
public short getServerBusyFlag() throws InvalidMessageException
public short getServerBusyFlag() { parseBody(); return serverBusyFlag; }
public short getUniqueResultCount()
public short getUniqueResultCount() throws InvalidMessageException
public short getUniqueResultCount() { parseBody(); return uniqueResultCount; }
public short getUploadSpeedFlag()
public short getUploadSpeedFlag() throws InvalidMessageException
public short getUploadSpeedFlag() { parseBody(); return uploadSpeedFlag; }
public String getVendorCode()
public String getVendorCode() throws InvalidMessageException
public String getVendorCode() { parseBody(); return vendorCode; }
public boolean isBrowseHostSupported()
public boolean isBrowseHostSupported() throws InvalidMessageException
public boolean isBrowseHostSupported() { parseBody(); return isBrowseHostSupported; }
public boolean isChatSupported()
public boolean isChatSupported() throws InvalidMessageException
public boolean isChatSupported() { parseBody(); return isChatSupported; }
private boolean isVendorCodeValid( String vendorCode )
private static boolean isVendorCodeValid( String vendorCode )
private boolean isVendorCodeValid( String vendorCode ) { // verify length if ( vendorCode.length() != 4 ) { return false; } // verify characters for ( int i = 0; i < 4; i++ ) { if ( !XMLUtils.isXmlChar( vendorCode.charAt( i ) ) ) {...
try
long speed = IOUtil.unsignedInt2Long( IOUtil.deserializeIntLE(body, offset) ); remoteHostSpeed = speed; offset += 4; uniqueResultCount = 0; Set<URN> uniqueURNs = new HashSet<URN>(); records = new QueryResponseRecord[ recordCount ]; int highestAltLocCount = 0; for (int i = 0; i < recordCount; i++)
private void parseBody() { if ( isParsed ) { return; } // Already read the header. int offset = 0; byte n = body[offset++]; short recordCount = (short)(n < 0 ? 256 + n : n); // parsing of port and ip is done on demand in getHostAddress() and ...
long speed = IOUtil.unsignedInt2Long( IOUtil.deserializeIntLE(body, offset) ); remoteHostSpeed = speed;
QueryResponseRecord rec = new QueryResponseRecord(); offset = rec.deserialize(body, offset); if ( rec.getAlternateLocations() != null ) { highestAltLocCount = Math.max(highestAltLocCount, rec.getAlternateLocations().length); if ( NLogger.isWarnEnabled( QueryResponseMsg.class ) && rec.getAlternateLocations().length > 1...
private void parseBody() { if ( isParsed ) { return; } // Already read the header. int offset = 0; byte n = body[offset++]; short recordCount = (short)(n < 0 ? 256 + n : n); // parsing of port and ip is done on demand in getHostAddress() and ...
uniqueResultCount = 0; Set<URN> uniqueURNs = new HashSet<URN>(); records = new QueryResponseRecord[ recordCount ]; for (int i = 0; i < recordCount; i++) { QueryResponseRecord rec = new QueryResponseRecord(); offset = rec.deserialize(body, offset); if ( NLogger.isWarnEnabled( QueryResponseMsg.class ) && rec.getAlternat...
int openDataLength = IOUtil.unsignedByte2int( body[ offset ] ); offset += 1; if ( openDataLength > 1) { byte flag1 = body[ offset ]; byte flag2 = body[ offset + 1]; if ( ( flag2 & PUSH_NEEDED_MASK ) != 0 ) { if ( ( flag1 & PUSH_NEEDED_MASK ) != 0 ) { pushNeededFlag = QHD_TRUE_FLAG; } else { pushNeededFlag = QHD_FAL...
private void parseBody() { if ( isParsed ) { return; } // Already read the header. int offset = 0; byte n = body[offset++]; short recordCount = (short)(n < 0 ? 256 + n : n); // parsing of port and ip is done on demand in getHostAddress() and ...
pushNeededFlag = QHD_TRUE_FLAG;
break;
private void parseBody() { if ( isParsed ) { return; } // Already read the header. int offset = 0; byte n = body[offset++]; short recordCount = (short)(n < 0 ? 256 + n : n); // parsing of port and ip is done on demand in getHostAddress() and ...
else { pushNeededFlag = QHD_FALSE_FLAG; } } if ((flag1 & SERVER_BUSY_MASK) != 0) { if ( (flag2 & SERVER_BUSY_MASK) != 0 ) { serverBusyFlag = QHD_TRUE_FLAG; } else { serverBusyFlag = QHD_FALSE_FLAG; } } if ((flag1 & HAS_UPLOADED_MASK) != 0) { if ( (flag2 & HAS_UPLOADED_MASK) != 0 ) { hasUploadedFlag = QHD_TRUE_FLAG;...
ggepMagicIndex ++; } GGEPBlock[] ggepBlocks = null; try { ggepBlocks = GGEPBlock.parseGGEPBlocks( body, ggepMagicIndex ); isBrowseHostSupported = GGEPBlock.isExtensionHeaderInBlocks( ggepBlocks, GGEPBlock.BROWSE_HOST_HEADER_ID ); pushProxyAddresses = GGEPExtension.parsePushProxyExtensionData( ggepBlocks ); } catch ( I...
private void parseBody() { if ( isParsed ) { return; } // Already read the header. int offset = 0; byte n = body[offset++]; short recordCount = (short)(n < 0 ? 256 + n : n); // parsing of port and ip is done on demand in getHostAddress() and ...
catch ( java.io.UnsupportedEncodingException exp ) { return; }
parseRemoteClientID(); isParsed = true;
private void parseBody() { if ( isParsed ) { return; } // Already read the header. int offset = 0; byte n = body[offset++]; short recordCount = (short)(n < 0 ? 256 + n : n); // parsing of port and ip is done on demand in getHostAddress() and ...
else return null;
return null;
public Dimensions calcDim(Dimensions l,Dimensions r) { if(l.equals(r) && l.is1D()) return Dimensions.ONE; else return null; }
else return super.mul(param1,param2);
return super.mul(param1,param2);
public Object dot(Object param1, Object param2) throws ParseException { if(param1 instanceof MVector && param2 instanceof MVector) return dot((MVector) param1,(MVector) param2); else return super.mul(param1,param2); }
System.out.println("currRow xShift min max ampScale ampScale*min ampScale*max plotofset plot_y"); System.out.println(" plot_x");
void drawPlottableNew(Graphics g, Plottable[] plot) { int xShift = plot_x/plotrows; mean = getMean(); for (int currRow = 0; currRow < plotrows; currRow++) { System.out.println(currRow+" "+xShift+" "+min+" "+max+" "+ampScale+" "+(ampScale*min)+" "+(ampScale*max)+" "+plotoffset+" "+plot_y+" "+plot_x); // get ...
int[] minmax = findMinMax(arrayplottable); min = minmax[0]; max = minmax[1];
public void setAmpScale(float ampScalePercent) { this.ampScalePercent = ampScalePercent; this.ampScale = ampScalePercent*plot_y/(max-min); System.out.println("AmpScale "+ampScalePercent+" "+ampScale); configChanged(); }
return ((Rational) a).compareTo((Rational) b);
return ((Rational) a).compareTo(b);
public int compare(Number a,Number b) { return ((Rational) a).compareTo((Rational) b); }
return ((Rational) a).compareTo((Rational) b) == 0;
return ((Rational) a).compareTo(b) == 0;
public boolean equals(Number a,Number b) { return ((Rational) a).compareTo((Rational) b) == 0; }
this.setValidValue(true);
protected boolean setValueRaw(Object val) { if(val instanceof MatrixValueI) { mvalue = (MatrixValueI) val; this.dims = mvalue.getDim(); } else mvalue.setEle(0,val); return true; }
if(isConstant()) return;
public void invalidateAll() { setValidValue(false); for(Enumeration e = derivatives.elements(); e.hasMoreElements(); ) { PartialDerivative deriv = (PartialDerivative) e.nextElement(); deriv.setValidValue(false); } }
public void setStepEndTemp(int i, int t){
public void setStepEndTemp(int i, double t){
public void setStepEndTemp(int i, int t){ if (tempUnits.equals("C")) ((MashStep)steps.get(i)).setEndTemp(cToF(t)); else ((MashStep)steps.get(i)).setEndTemp(t); calcMashSchedule(); }
this.parser.setInitialTokenManagerState(Parser.NO_DOT_IN_IDENTIFIERS);
public VectorJep() { super(); /* Operator.OP_ADD.setPFMC(new MAdd()); Operator.OP_SUBTRACT.setPFMC(new MSubtract()); Operator.OP_MULTIPLY.setPFMC(new MMultiply()); Operator.OP_POWER.setPFMC(new MPower()); Operator.OP_UMINUS.setPFMC(new MUMinus()); Operator.OP_DOT.setPFMC(new MDot()); Operator.OP_CROSS.setPFMC...
int currentTryCount = Math.max( 0, allHostCount - hostCount - errorHostCount );
int totalCount = networkHostsContainer.getTotalConnectionCount(); int currentTryCount = Math.max( 0, allHostCount - totalCount - errorHostCount);
public void doAutoConnectCheck() { if ( !networkMgr.isNetworkJoined() || !networkMgr.isConnected() ) { return; } int hostCount; int requiredHostCount; if ( isAbleToBecomeUltrapeer() ) { // as a ultrapeer I'm primary searching for Ultrapeers o...
System.out.println("SeisPoint[0] forehand: " + seisPoints[0] + "dragged points: " + (pointsPerPixel * dragAmount));
private void drag(int dragAmount, int dragFrom, SeismogramShapeIterator iterator){ double pointsPerPixel = iterator.getPointsPerPixel(); int[] seisPoints = currentIterator.getSeisPoints(); System.out.println("SeisPoint[0] forehand: " + seisPoints[0] + ...
System.out.println("SeisPoint[0] afterhand: " + seisPoints[0]);
private void drag(int dragAmount, int dragFrom, SeismogramShapeIterator iterator){ double pointsPerPixel = iterator.getPointsPerPixel(); int[] seisPoints = currentIterator.getSeisPoints(); System.out.println("SeisPoint[0] forehand: " + seisPoints[0] + ...
System.out.println("Draggin left");
public void dragLeft(int dragAmount, SeismogramShapeIterator iterator){ System.out.println("Draggin left"); drag(dragAmount, -dragAmount, iterator); }
System.out.println("Draggin right"); drag(dragAmount, 0, iterator);
drag(dragAmount, 0, iterator);
public void dragRight(int dragAmount, SeismogramShapeIterator iterator){ System.out.println("Draggin right"); drag(dragAmount, 0, iterator); }
System.out.println("Plotting all points");
public void plot(SeismogramShapeIterator iterator){ System.out.println("Plotting all points"); iterator.setSeisPoints(DisplayUtils.getSeisPoints(dss.getSeismogram(), iterator.getTime())); iterator.setBaseSeisPoint(); iterator.setPo...
if (param instanceof Number)
if (param instanceof Complex) { return ((Complex)param).atanh(); } else if (param instanceof Number)
public Object atanh(Object param) throws ParseException { if (param instanceof Number) { Complex temp = new Complex(((Number)param).doubleValue(),0.0); return temp.atanh(); } else if (param instanceof Complex) { return ((Complex)param).atanh(); } throw new ParseException("Invalid parameter type"); }
else if (param instanceof Complex) { return ((Complex)param).atanh(); }
public Object atanh(Object param) throws ParseException { if (param instanceof Number) { Complex temp = new Complex(((Number)param).doubleValue(),0.0); return temp.atanh(); } else if (param instanceof Complex) { return ((Complex)param).atanh(); } throw new ParseException("Invalid parameter type"); }
queuePosition = uploadMgr.getQueuedPosition(uploadState) + 1;
queuePosition = uploadMgr.getQueuedPosition(uploadState);
private boolean evaluateHTTPRequest() throws IOException { String logMsg = "HTTP Request: " + httpRequest.buildHTTPRequestString(); NLogger.debug( UploadEngine.class, logMsg); uploadState.addToUploadLog( logMsg ); GnutellaRequest gRequest = httpRequest.getGnutellaRequest(); if ...
queuePosition = uploadMgr.addQueuedUpload(uploadState) + 1;
queuePosition = uploadMgr.addQueuedUpload(uploadState);
private boolean evaluateHTTPRequest() throws IOException { String logMsg = "HTTP Request: " + httpRequest.buildHTTPRequestString(); NLogger.debug( UploadEngine.class, logMsg); uploadState.addToUploadLog( logMsg ); GnutellaRequest gRequest = httpRequest.getGnutellaRequest(); if ...
queuePosition ++;
private boolean evaluateHTTPRequest() throws IOException { String logMsg = "HTTP Request: " + httpRequest.buildHTTPRequestString(); NLogger.debug( UploadEngine.class, logMsg); uploadState.addToUploadLog( logMsg ); GnutellaRequest gRequest = httpRequest.getGnutellaRequest(); if ...
int available = throttleController.getAvailableByteCount( true ); int ableToSend = Math.min( likeToSend, available );
int ableToSend = throttleController.getAvailableByteCount( likeToSend, true, false );
private void sendBinaryData() throws IOException { NLogger.debug(UploadEngine.class, "About to send binary range: " + startOffset + " to " + endOffset); uploadState.addToUploadLog( "About to send binary range: " + startOffset + " to " + endOffset ); // the upload is a...
public synchronized int getAvailableByteCount( boolean blockTillAvailable )
public synchronized int getAvailableByteCount( int maxToRequest, boolean blockTillAvailable, boolean markBytesUsed ) throws IOException
public synchronized int getAvailableByteCount( boolean blockTillAvailable ) { updateWindow( blockTillAvailable ); int bytesAllowed = bytesRemaining; // If there is another controller we are chained to, call it. if( nextContollerInChain != null ) { bytesAllowed = Math...
int bytesAllowed = bytesRemaining;
int bytesAllowed = Math.max( 0, Math.min( maxToRequest, bytesRemaining ) );
public synchronized int getAvailableByteCount( boolean blockTillAvailable ) { updateWindow( blockTillAvailable ); int bytesAllowed = bytesRemaining; // If there is another controller we are chained to, call it. if( nextContollerInChain != null ) { bytesAllowed = Math...
bytesAllowed = Math.min( bytesAllowed, nextContollerInChain.getAvailableByteCount( blockTillAvailable ) );
bytesAllowed = nextContollerInChain.getAvailableByteCount( bytesAllowed, blockTillAvailable, markBytesUsed ); } if ( markBytesUsed ) { markBytesUsed( bytesAllowed );
public synchronized int getAvailableByteCount( boolean blockTillAvailable ) { updateWindow( blockTillAvailable ); int bytesAllowed = bytesRemaining; // If there is another controller we are chained to, call it. if( nextContollerInChain != null ) { bytesAllowed = Math...
sb.append(" <YEAST_COST>" + yeast.getCostPerU() + "</YEAST_COST>\n"); sb.append(" <OTHER_COST>" + otherCost + "</OTHER_COST>\n");
public String toXML() { StringBuffer sb = new StringBuffer(); sb.append("<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>\n"); sb.append("<STRANGEBREWRECIPE version = \"" + version + "\">\n"); sb.append("<!-- This is a SBJava export. StrangeBrew 1.8 will not import it. -->\n"); sb.append(" <DETAILS>\n"); sb.app...
app.saveAsHTML(file, "ca/strangebrew/data/recipeToHtml.xslt", printOptions);
app.saveAsHTML(file, "recipeToHtml.xslt", printOptions);
public void actionPerformed(ActionEvent ev) { Object o = ev.getSource(); String font = fontComboModel.getSelectedItem().toString(); String fontSize = sizeSpin.getValue().toString(); String printOptions = " <PRINT FONTSIZE=\"" + fontSize + "pt\" FONTFACE=\"" + font + "\"/>\n"; if (o == prevButton) { File file =...
return calculateComplexValue((Complex) group.getRootVal());
return calculateComplexValue(group.getRootVal());
public Complex getComplexValue() { return calculateComplexValue((Complex) group.getRootVal()); }
AmpConfigData dssData = (AmpConfigData)ampData.get(sdce.getSource()); dssData.addSeismograms(sdce.getSeismos()); this.seismos = null; calculateAmp(); recalculateAmp(); fireAmpEvent();
AmpConfigData dssData = (AmpConfigData)ampData.get(sdce.getSource()); if ( dssData == null) { return; } dssData.addSeismograms(sdce.getSeismos()); this.seismos = null; calculateAmp(); recalculateAmp(); fireAmpEvent();
public synchronized void pushData(SeisDataChangeEvent sdce) { AmpConfigData dssData = (AmpConfigData)ampData.get(sdce.getSource()); dssData.addSeismograms(sdce.getSeismos()); this.seismos = null; calculateAmp(); recalculateAmp(); ...
Object val = Scaler.getInstance(mat.getEle(0,0));
Object val = mat.getEle(0,0);
public MatrixValueI calcValue(MatrixValueI res, MatrixValueI lhs) throws ParseException { if(!(res instanceof Scaler)) throw new ParseException("trace: result must be a scaler"); if(!(lhs instanceof Matrix)) throw new ParseException("trace: argument must be a matrix"); Matrix mat = (Matrix) lhs; if( mat.getNu...
assertEquals(userRole, authorizationDao.findUserRoleByNaturalId(userRole.getUser(), userRole.getService(), userRole.getServiceExtension()));
assertEquals(userRole, authorizationDao.findUserRoleByNaturalId(userRole.getUserGroup(), userRole.getService(), userRole.getServiceExtension()));
public void testFindUserRole() { // write list List<UserRole> userRoleList = writeUserRole(); // read UserRole userRole = userRoleList.get((int) Math.random()*userRoleList.size()); assertEquals(userRole, authorizationDao.findUserRoleByNaturalId(userRole.getUser(), userRole.getSer...
assertEquals(userRole, authorizationDao.findUserRoleByNaturalId(userRole.getUser(), userRole.getService(), userRole.getServiceExtension()));
assertEquals(userRole, authorizationDao.findUserRoleByNaturalId(userRole.getUserGroup(), userRole.getService(), userRole.getServiceExtension()));
public void testPersistUserRole() { //write UserRole userRole = createAndPersistUserRole(authorizationDao); hibernateTemplate.flush(); //read assertEquals(userRole, authorizationDao.findUserRoleByNaturalId(userRole.getUser(), userRole.getService(), userRole.getServiceExtension())...
this.parser.setInitialTokenManagerState(Parser.NO_DOT_IN_IDENTIFIERS);
this.parser.setInitialTokenManagerState(ParserConstants.NO_DOT_IN_IDENTIFIERS);
public MatrixJep() { super(); nf = new MatrixNodeFactory(); symTab = new DSymbolTable(mvf); opSet = new MatrixOperatorSet(); this.parser.setInitialTokenManagerState(Parser.NO_DOT_IN_IDENTIFIERS); Operator tens = ((MatrixOperatorSet) opSet).getMList(); pv.addSpecialRule(tens,(PrintVisitor.PrintRulesI) tens.getPF...
else return res;
return res;
public Object evaluate(Node node) throws ParseException { Object res = mev.evaluate((MatrixNodeI) node,this); if(res instanceof Scaler) return ((Scaler) res).getEle(0); else return res; }
else return res;
return res;
public Object getValueAsObject() { try { Object res = mev.evaluate((MatrixNodeI) getTopNode(),this); if(res instanceof Scaler) return ((Scaler) res).getEle(0); else return res; } catch(Exception e) { this.errorList.addElement("Error during evaluation:"); this.errorList.addElement(e.getMessage());...
public synchronized void doWs( StaplerRequest req, StaplerResponse rsp ) throws IOException, ServletException {
public void doWs( StaplerRequest req, StaplerResponse rsp ) throws IOException, ServletException {
public synchronized void doWs( StaplerRequest req, StaplerResponse rsp ) throws IOException, ServletException { File dir = getWorkspace().getLocal(); if(!dir.exists()) { // if there's no workspace, report a nice error message rsp.forward(this,"noWorkspace",req); } else { ...
File xsltFile = new File(path + xslt);
File xsltFile = new File(path, xslt);
public void saveAsHTML(File f, String xslt, String options) throws Exception { // save file as xml, then transform it to html File tmp = new File("tmp.xml"); FileWriter out = new FileWriter(tmp); out.write(myRecipe.toXML(options)); out.close(); // find the xslt stylesheet in the classpath // URL xsltUrl = get...
println("DJep: differention in JEP. eg. diff(x^2,x)");
println("DJep: differentation in JEP. eg. diff(x^2,x)");
public void printIntroText() { println("DJep: differention in JEP. eg. diff(x^2,x)"); printStdHelp(); }
DJep j = (DJep) this.j;
DJep dj = (DJep) this.j;
public void processEquation(Node node) throws ParseException { DJep j = (DJep) this.j; if(verbose) { print("Parsed:\t\t"); println(j.toString(node)); } Node processed = j.preprocess(node); if(verbose) { print("Processed:\t"); println(j.toString(processed)); } Node simp = j.simplify(processed); i...
println(j.toString(node));
println(dj.toString(node));
public void processEquation(Node node) throws ParseException { DJep j = (DJep) this.j; if(verbose) { print("Parsed:\t\t"); println(j.toString(node)); } Node processed = j.preprocess(node); if(verbose) { print("Processed:\t"); println(j.toString(processed)); } Node simp = j.simplify(processed); i...
Node processed = j.preprocess(node);
Node processed = dj.preprocess(node);
public void processEquation(Node node) throws ParseException { DJep j = (DJep) this.j; if(verbose) { print("Parsed:\t\t"); println(j.toString(node)); } Node processed = j.preprocess(node); if(verbose) { print("Processed:\t"); println(j.toString(processed)); } Node simp = j.simplify(processed); i...
println(j.toString(processed));
println(dj.toString(processed));
public void processEquation(Node node) throws ParseException { DJep j = (DJep) this.j; if(verbose) { print("Parsed:\t\t"); println(j.toString(node)); } Node processed = j.preprocess(node); if(verbose) { print("Processed:\t"); println(j.toString(processed)); } Node simp = j.simplify(processed); i...
Node simp = j.simplify(processed);
Node simp = dj.simplify(processed);
public void processEquation(Node node) throws ParseException { DJep j = (DJep) this.j; if(verbose) { print("Parsed:\t\t"); println(j.toString(node)); } Node processed = j.preprocess(node); if(verbose) { print("Processed:\t"); println(j.toString(processed)); } Node simp = j.simplify(processed); i...
println(j.toString(simp));
println(dj.toString(simp));
public void processEquation(Node node) throws ParseException { DJep j = (DJep) this.j; if(verbose) { print("Parsed:\t\t"); println(j.toString(node)); } Node processed = j.preprocess(node); if(verbose) { print("Processed:\t"); println(j.toString(processed)); } Node simp = j.simplify(processed); i...
j.getPrintVisitor().setMode(PrintVisitor.FULL_BRACKET,true); j.getPrintVisitor().setMode(DPrintVisitor.PRINT_PARTIAL_EQNS,false); println(j.toString(simp)); j.getPrintVisitor().setMode(DPrintVisitor.PRINT_PARTIAL_EQNS,true); j.getPrintVisitor().setMode(PrintVisitor.FULL_BRACKET,false);
dj.getPrintVisitor().setMode(PrintVisitor.FULL_BRACKET,true); dj.getPrintVisitor().setMode(DPrintVisitor.PRINT_PARTIAL_EQNS,false); println(dj.toString(simp)); dj.getPrintVisitor().setMode(DPrintVisitor.PRINT_PARTIAL_EQNS,true); dj.getPrintVisitor().setMode(PrintVisitor.FULL_BRACKET,false);
public void processEquation(Node node) throws ParseException { DJep j = (DJep) this.j; if(verbose) { print("Parsed:\t\t"); println(j.toString(node)); } Node processed = j.preprocess(node); if(verbose) { print("Processed:\t"); println(j.toString(processed)); } Node simp = j.simplify(processed); i...
Object val = j.evaluate(simp); String s = j.getPrintVisitor().formatValue(val);
Object val = dj.evaluate(simp); String s = dj.getPrintVisitor().formatValue(val);
public void processEquation(Node node) throws ParseException { DJep j = (DJep) this.j; if(verbose) { print("Parsed:\t\t"); println(j.toString(node)); } Node processed = j.preprocess(node); if(verbose) { print("Processed:\t"); println(j.toString(processed)); } Node simp = j.simplify(processed); i...
else if (o == crb || o == frb){ if (crb.isSelected()) boilTempULbl.setText("C"); else boilTempULbl.setText("F"); }
public void actionPerformed(ActionEvent e) { Object o = e.getSource(); if (o == okButton) { saveOptions(); opts.saveProperties(); ((StrangeSwing)sb).displayRecipe(); setVisible(false); dispose(); } else if (o == cancelButton){ setVisible(false); dispose(); } else if (o == colMethod1rb || o == co...
mashPanel.add(jLabel12); jLabel12.setText("Boil Temp (F):");
mashPanel.add(jLabel12, new GridBagConstraints(0, 2, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); jLabel12.setText("Boil Temp:");
private void layoutUi() { JPanel buttons = new JPanel(); okButton = new JButton("OK"); okButton.addActionListener(this); cancelButton = new JButton("Cancel"); cancelButton.addActionListener(this); buttons.setLayout(new FlowLayout(FlowLayout.RIGHT)); buttons.add(cancelButton); buttons.add(okButton); getContent...
mashPanel.add(boilTempTxt);
mashPanel.add(boilTempTxt, new GridBagConstraints(1, 2, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
private void layoutUi() { JPanel buttons = new JPanel(); okButton = new JButton("OK"); okButton.addActionListener(this); cancelButton = new JButton("Cancel"); cancelButton.addActionListener(this); buttons.setLayout(new FlowLayout(FlowLayout.RIGHT)); buttons.add(cancelButton); buttons.add(okButton); getContent...
boilTempTxt.setPreferredSize(new java.awt.Dimension(43, 20));
boilTempTxt.setPreferredSize(new java.awt.Dimension(45, 20)); boilTempULbl = new JLabel(); mashPanel.add(boilTempULbl, new GridBagConstraints(2, 2, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); boilTempULbl.setText("F"); boilTempULbl.setPreferredSize(new java.awt.Dim...
private void layoutUi() { JPanel buttons = new JPanel(); okButton = new JButton("OK"); okButton.addActionListener(this); cancelButton = new JButton("Cancel"); cancelButton.addActionListener(this); buttons.setLayout(new FlowLayout(FlowLayout.RIGHT)); buttons.add(cancelButton); buttons.add(okButton); getContent...
opts.setProperty("optBoilTempF", boilTempTxt.getText());
private void saveOptions() { // cost tab: opts.setProperty("optMiscCost", txtOtherCost.getText()); opts.setProperty("optBottleSize", txtBottleSize.getText()); opts.setProperty("optBottleU", (String) cmbBottleSize.getSelectedItem()); // Brewer tab: opts.setProperty("optBrewer", txtBrewerName.getText()); opts.set...
opts.setProperty("optMashVolU", mashVolComboModel.getSelectedItem().toString()); if (frb.isSelected()){ opts.setProperty("optMashTempU", "F"); opts.setProperty("optBoilTempF", boilTempTxt.getText()); } else { opts.setProperty("optMashTempU", "C"); double t = Double.parseDouble(boilTempTxt.getText()); opts.setDProperty...
private void saveOptions() { // cost tab: opts.setProperty("optMiscCost", txtOtherCost.getText()); opts.setProperty("optBottleSize", txtBottleSize.getText()); opts.setProperty("optBottleU", (String) cmbBottleSize.getSelectedItem()); // Brewer tab: opts.setProperty("optBrewer", txtBrewerName.getText()); opts.set...
boilTempTxt.setText(opts.getProperty("optBoilTempF"));
private void setOptions() { // new recipe tab: boilTempTxt.setText(opts.getProperty("optBoilTempF")); batchSizeTxt.setText(opts.getProperty("optPostBoilVol")); maltUnitsComboModel.addOrInsert(opts.getProperty("optMaltU")); hopsUnitsComboModel.addOrInsert(opts.getProperty("optHopsU")); volUnitsComboModel.addOrI...
boilTempTxt.setText(opts.getProperty("optBoilTempF")); mashVolComboModel.addOrInsert(opts.getProperty("optMashVolU")); frb.setSelected(opts.getProperty("optMashTempU").equalsIgnoreCase("F")); crb.setSelected(opts.getProperty("optMashTempU").equalsIgnoreCase("C")); mashRatioUCombo.setSelectedItem(opts.getProperty("optMa...
private void setOptions() { // new recipe tab: boilTempTxt.setText(opts.getProperty("optBoilTempF")); batchSizeTxt.setText(opts.getProperty("optPostBoilVol")); maltUnitsComboModel.addOrInsert(opts.getProperty("optMaltU")); hopsUnitsComboModel.addOrInsert(opts.getProperty("optHopsU")); volUnitsComboModel.addOrI...
public static void main(String args[]) throws IOException {
public static void main(String args[]) {
public static void main(String args[]) throws IOException { DJepApplet app = new DJepApplet(); app.init(); Frame mainFrame = new Frame("Wallpaper patterns"); mainFrame.setBounds(0,0,200,200); mainFrame.add(app); mainFrame.show(); }
if(build.getPreviousBuild()==null || changedFiles.isEmpty()) {
if(build.getPreviousBuild()==null || (changedFiles!=null && changedFiles.isEmpty())) {
private boolean calcChangeLog(Build build, List<String> changedFiles, File changelogFile, BuildListener listener) { if(build.getPreviousBuild()==null || changedFiles.isEmpty()) { // nothing to compare against, or no changes listener.getLogger().println("$ no changes detected"); ...
task.setFile(changedFiles);
if(changedFiles!=null) task.setFile(changedFiles); else { if(!flatten) task.setPackage(module); }
private boolean calcChangeLog(Build build, List<String> changedFiles, File changelogFile, BuildListener listener) { if(build.getPreviousBuild()==null || changedFiles.isEmpty()) { // nothing to compare against, or no changes listener.getLogger().println("$ no changes detected"); ...
if(changedFiles==null) return createEmptyChangeLog(changelogFile,listener, "changelog"); else return calcChangeLog(build, changedFiles, changelogFile, listener);
return calcChangeLog(build, changedFiles, changelogFile, listener);
public boolean checkout(Build build, Launcher launcher, FilePath dir, BuildListener listener, File changelogFile) throws IOException { List<String> changedFiles = null; // files that were affected by update. null this is a check out if(canUseUpdate && isUpdatable(dir.getLocal())) { changedF...
SimpleDateFormat df = new SimpleDateFormat();
SimpleDateFormat df = new SimpleDateFormat("MM/dd/yyyy");
public String toXML() { StringBuffer sb = new StringBuffer(); sb.append("<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>\n"); sb.append("<STRANGEBREWRECIPE version = \"2.0A\">\n"); sb.append(" <DETAILS>\n"); sb.append(" <NAME>" + name + "</NAME>\n"); sb.append(" <NOTES>" + comments + "</NOTES>\n"); sb.append...
canvas.drawString(name, xPosition, yPosition);
canvas.drawString(getName(), xPosition, yPosition);
public boolean drawName(Graphics2D canvas, int xPosition, int yPosition){ if(visible){ canvas.setPaint(color); canvas.drawString(name, xPosition, yPosition); return true; } return false; }
public String getName(){ return name; }
public String getName(){ return getSeismogram().getName(); }
public String getName(){ return name; }
public String toString(){ return name; }
public String toString(){ return getName(); }
public String toString(){ return name; }
return ( (Integer) iterate(CREDENTIAL_QRY_CNT, principal).next() ).intValue();
return find(CREDENTIAL_QRY, principal).size();
public int countCredentialByPrincipal(String principal) { return ( (Integer) iterate(CREDENTIAL_QRY_CNT, principal).next() ).intValue(); }
tblMalt.updateUI(); tblHops.updateUI();
public void displayRecipe() { if (myRecipe == null) return; txtName.setText(myRecipe.getName()); txtBrewer.setText(myRecipe.getBrewer()); cmbStyleModel.addOrInsert(myRecipe.getStyleObj()); cmbYeastModel.addOrInsert(myRecipe.getYeastObj()); txtPreBoil.setValue(new Double(myRecipe.getPreBoilVol(myRecipe .getV...
BorderLayout tblMaltLayout = new BorderLayout(); tblMalt.setLayout(tblMaltLayout);
private void initGUI() { try { this.setSize(520, 532); this.addWindowListener(new WindowAdapter() { public void windowClosed(WindowEvent evt) { System.exit(1); } }); { pnlMain = new JPanel(); GridBagLayout jPanel2Layout = new GridBagLayout(); jPanel2Layout.columnWeights = new double[]{0.1};...
/*
private void initGUI() { try { this.setSize(520, 532); this.addWindowListener(new WindowAdapter() { public void windowClosed(WindowEvent evt) { System.exit(1); } }); { pnlMain = new JPanel(); GridBagLayout jPanel2Layout = new GridBagLayout(); jPanel2Layout.columnWeights = new double[]{0.1};...
}*/
}
private void initGUI() { try { this.setSize(520, 532); this.addWindowListener(new WindowAdapter() { public void windowClosed(WindowEvent evt) { System.exit(1); } }); { pnlMain = new JPanel(); GridBagLayout jPanel2Layout = new GridBagLayout(); jPanel2Layout.columnWeights = new double[]{0.1};...
float[] fdata = seis.get_as_floats();
float[] fdata; if(seis.can_convert_to_float()) fdata = seis.get_as_floats(); else{ int[] idata = seis.get_as_longs(); fdata = new float[idata.length]; for(int i = 0; i < idata.length; i++) fdata[i] = idata[i]; idata = null; }
public void filterData(){ float[] fdata = seis.get_as_floats(); // remove the mean before filtering double mean = 0; for (int i=0; i<fdata.length; i++) { mean += fdata[i]; } // end of for (int i=0; i<fdata.length; i++) mean /= fdata.length; float fmean = (float)mean; for (int i=0; i<fdata.length; i++) { fda...
ObjComparator sc = new ObjComparator(); Collections.sort(styleDB, sc); Collections.sort(fermDB, sc); Collections.sort(hopsDB, sc); Collections.sort(yeastDB, sc);
public void readDB(String path){ dbPath = path; fermDB = new ArrayList(); readFermentables(dbPath); hopsDB = new ArrayList(); readHops(dbPath); yeastDB = new ArrayList(); readYeast(dbPath); // readStyles(dbPath); miscDB = new ArrayList(); readMisc(dbPath); styleDB = new ArrayList(); importStyles(dbPath); }