| algorithm - how to estimate time to complete |
|
 |
Index ‹ java-programmer
|
- Previous
- 1
- Castor XML Question: How to ignore wrapping elementsI have an xml file that looks something like:
<Response>
<Invoice>
<PrimaryKey>239</PrimaryKey>
<OrderTotal>5893.03</OrderTotal>
</Invoice
</Response>
I am trying to map <Invoice> to my Invoice.java class. How do you get
Castor to ignore the outer <Response> tag? I could always do
pre-processing, but I would like to know if it's possible to do this
in the mapping xml file.
Thanks,
Ankur
- 2
- Constraints in JPA (using Hibernate)Hi,
I have some @Entitys in JPA with Hibernate which create the following
relationship:
Brand 1<->* User
User 1<->* CreditCard
(where 1<->* means a bidirectional one-many relationship)
I want to be able to put a constraint on the CreditCard entity such
that the field CreditCard.CreditCardNumber is unique for a particular
Brand.
Without adding a reference to Brand in the CreditCard entity, is there
a way that I can achieve this?
Thanks in advance for any pointers!
Rich
- 2
- [ANN] Scala 2.5.0-RC2 releasedWe are pleased to announce version 2.5.0-RC2 of the Scala distribution:
| Scala smoothly integrates features of object-oriented and |
| functional languages and is fully interoperable with Java |
It fixes several bugs found in RC1.
http://www.scala-lang.org/downloads/changes.html#v2.5.0-RC2
Other release candidates may follow this version depending
on bugs reported by the Scala community (no changes/additions,
only bug fixes!); the final release (aka. 2.5.0-final) is
planned in 1-2 weeks.
Bye
-- Stephane
- 5
- JNDI/LDAP and PagedResultsControlI've encountered something that has stumped me for the past 2 days.
Perhaps someone on this list has seen this before or can explain why
this might be happening. I'm trying to use the SortControl and
PagedResultsControl classes that are part of the JNDI/LDAP Booster
Pack. In the code below, you can see that I create the 2 Control
object, stick them in an array, and set them as "request controls" for
the LdapContext. Thankfully, both the search and the sort controls do
the right thing - the items come out sorted with a page size of 10.
My issue is trying to get the "response controls" associated with
invoking the search() method on the LdapContext. According to the
JNDI JavaDocs, the getResponseControls() method "Retrieves the
response controls produced as a result of the last method invoked on
this context" (which in my case is the search() method). If I execute
a getResponseControls() call on the LdapContext immediately after the
search(), it returns null. However, after MUCH agonizing I figured
out that if I walk over the enumeration of results returned from the
search() method and do a getResponseControls() afterward, the proper
Control object array is returned (one for the SortControl and one for
the PagedResultsControl). I noticed that this was the common element
in code snippets I found on the Web that worked.
Can someone please explain to me why I have to walk through this
enumeration? I also verified that you have to walk over the entire
enumeration, not just an element or 2. Specifically, the hasMore()
method has to be called to get this to work. If I create a for loop
and walk through my page set (say 10 elements) and then try to get the
response controls, they're still null. It only works when hasMore()
returns false. This is really driving me bonkers?
Thank you in advance for anyone who can help me here!
String sortBy = "sn";
int pageSize = 10;
byte[] cookie = null;
int total;
Control[] requestControls = new Control[]
{
new SortControl(new String[]{sortBy}, Control.CRITICAL),
new PagedResultsControl(pageSize)
};
LdapContext ldapContext = new InitialLdapContext(environment, null);
ldapContext.setRequestControls(requestControls);
NamingEnumeration results = ldapContext.search(contextName,
searchFilter, searchControls);
//IF I DON'T WALK OVER THIS ENUMERATION, THE RESPONSE CONTROLS OBJECT
IS NULL
while(results != null && results.hasMore())
{
SearchResult entry = (SearchResult) results.next();
}
Control[] responseControls = ldapContext.getResponseControls();
if(responseControls != null)
{
for(int i = 0; i < responseControls.length; i++)
{
if(responseControls[i] instanceof PagedResultsResponseControl)
{
PagedResultsResponseControl p = (PagedResultsResponseControl)
responseControls[i];
cookie = p.getCookie();
total = p.getResultSize();
}
}
}
else
{
System.out.println("response controls is null");
}
ldapContext.close();
- 5
- JSP Tomcat link directoryes from 2 projects, help pleaseHi Everyone,
I have 2 Tomcat jsp projects which use many common directoryes. I wont
the directory from the second project linked to a directory from the
first, so I can change files on a single place. When I use something
like $ln -s ../project1/visualization ./visualization
and then make request from mozilla I get the error The requested
resource (/visualization/grid.jsp) is not available.
Any ideas
- 5
- java.lang.NoClassDefFoundError: org/aspectj/lang/SignatureHi,
Can anyone help me for this exception which I am getting whil trying to
conenct to MYSQL server thru TOMCAT.
Thanks
Maneesh
org.apache.commons.dbcp.SQLNestedException: Cannot load JDBC driver
class 'com.mysql.jdbc.Driver', cause:
java.lang.NoClassDefFoundError: org/aspectj/lang/Signature
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:164)
at
org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:730)
at
org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:518)
at foo.DBTest.init(DBTest.java:23)
at org.apache.jsp.test_jsp._jspService(test_jsp.java:51)
at
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:137)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:210)
at
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
at
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at
org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2422)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at
org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:163)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at
org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:199)
at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:828)
at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:700)
at
org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:584)
at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
at java.lang.Thread.run(Thread.java:595)
- 9
- Not debugging?Phlip wrote:
>
> Duane Bozarth wrote:
>
> >> The define "legacy" as "requires debugging".
> >
> > That's a bizarre (at best) definition of "legacy"...
>
> That's why Greg didn't understand why I used it like that.
I didn't either (and still don't) because it has nothing whatsoever to
to w/ "legacy" or not...
> Me: Strive to never debug.
>
> Greg: What about blah blah blah.
>
> Me: You are using something that you can't design
> fresh from scratch to resist bugs. So you must
> run the debugger more often than greenfield code
>
> Greg: It's not "legacy" it's embedded blah blah blah
In that sense everything is "legacy" -- I can't redesign a commercial
compiler, either.
...
> Just don't leave the emulator out of the loop. Greg implied using it would
> slow down the tail end of development.
At some point in most embedded systems, that <is> true...you get to a
point at which the depth of emulation required isn't worth the effort
that would be required. Once at that point, reverting is rarely
productive use of resources.
- 9
- Tomcat + Eclipse setupI have a brief question about my Tomcat config. I try to place the
webapps folder structure inside my Eclipse project strutcure, but
outside the Tomcat home directory. Example:
c:\Eclipse\MyProject
c:\Java\Tomcat\webapps
In order to do so I set in the server XML:
<Host name="localhost" debug="0"
appBase="c:\Eclipse\MyProject" unpackWARs="true" autoDeploy="true"
xmlValidation="false" xmlNamespaceAware="false">
mywebapp.xml:
<Context path="/mywebapp" docBase="c:\Eclipse\MyProject\mywebapp">
Question: I would expect mywebapp.war to be automatically unpacked
when I place it in c:\Eclipse\MyProject (it's the appbase). That's the
way it works when I leave the webapp dir unchanged (inside tomcat
home). However, it does not work when I set the dir outside the tomcat
home dir.
Any hints would be appreciated.
Regards HW
PS: Tomcat 5.0.25 on Win2k
- 11
- Question about help systemIs there a quick way to find out information about a particular method when
one doesn't remember to which class it belongs?
Thaks
- 12
- 15
- Portal Solutions for developersHello everyone,
For easy to use web clipping and application clipping tools and portal
development follow the link below:
http://clickmarks.com/solutions/portlet_solutions/portlet_factory.html
Cheers.
- 15
- Multiple server access jdbc/servletIf I have an applet, which is donwloaded to the local machine from server
A, and calls a servlet on server B.....can that servlet, via JDBC, access a
database on server C, assuming each of server's A, B and C are on separate
machines with separate URLs ?
Thanks, Ike
- 15
- hai dearhai friends,
"each day is a new adventure to dream search and discover"
www.goodhistory5.blogspot.com
- 16
- benchmarks? java vs .netOn Tue, 03 Jun 2008 16:18:34 +0100, Jon Harrop <email***@***.com>
wrote:
>There is no merit in comparing unoptimized code on .NET with optimized Java.
That's why posted it here so you can "optimize it". You fixed
mandelbrot but C# is still twice slower in three other benchmarks:
binarytrees
(the command line argument should be -server -Xms64m binarytrees)
http://shootout.alioth.debian.org/gp4sandbox/benchmark.php?test=binarytrees&lang=javaxx&id=2
vs
http://shootout.alioth.debian.org/gp4sandbox/benchmark.php?test=binarytrees&lang=csharp&id=0
revcomp
http://shootout.alioth.debian.org/gp4sandbox/benchmark.php?test=revcomp&lang=javaxx&id=4
vs
http://shootout.alioth.debian.org/gp4sandbox/benchmark.php?test=revcomp&lang=csharp&id=2
sumcol
http://shootout.alioth.debian.org/gp4sandbox/benchmark.php?test=sumcol&lang=javaxx&id=4
vs
http://shootout.alioth.debian.org/gp4sandbox/benchmark.php?test=sumcol&lang=csharp&id=0
also, C# significantly slower in recursion
http://shootout.alioth.debian.org/gp4sandbox/benchmark.php?test=recursive&lang=javaxx&id=0
vs
http://shootout.alioth.debian.org/gp4sandbox/benchmark.php?test=recursive&lang=csharp&id=0
>I have seen is on the Mersenne Twister PRNG where Java is 2x slower than .NET.
Post the benchmark. Let me see...
- 16
- Why braces around try/catch?In article <3f3393b6$0$150$email***@***.com>,
Jos A. Horsmeier <email***@***.com> wrote:
>
>I beg to differ; catch clauses are optional as in --
>
> try {
> // some statements making
> // up the statement block
> }
> // no catch
I'm not sure what you mean. If I compile the above I will get a
compile error along the lines of
'try' without 'catch' or 'finally'
Cheers
Bent D
--
Bent Dalager - email***@***.com - http://www.pvv.org/~bcd
powered by emacs
|
| Author |
Message |
worzel

|
Posted: 2005-2-7 14:41:00 |
Top |
java-programmer, algorithm - how to estimate time to complete
Not a problem as such, just a question about estimating time for producing
algorithms.
I recently had to write a class with a method that was to convert digits
(int) into their 'word' representation.
To begin with, converting say, 234, into "two three four", was easy enough.
But the method was also to 'sound english'
So, 234 now had to be converted to:
"two hundred and thirty four"
Some other examples:
"six million, three thousand and fifty six"
"six billion and one"
"eight billion,six million, three thousand, fourhundred and fifty six"
(like the way a person may write on a cheque underneath the digit amount.)
I wrote such a method. (which was actually a little more invoved than this
as it supports currencies, floating point number etc;) But, only after badly
underestimating the time involved for me to do so. There were were a few
elemenst about it that were not so obvious until I sat down to write it. I
ended up scratching a lot of stuff down on paper, and wrote it 3 times till
I was happy with it.
I have two questions here:
What is the best way to estimate time for rather small tasks like this? How
to you determine if a job will take an hour, a day, or a week? I know it
seems like a silly question - but I am just keen to see what sort of
responses come back from it.
Secondly, how long do you think it would take you to write a method such as
this? Personally, I allowed an hour and a half, and, like I said, was badly
mistaken. I know I took longer because I trivialised the problems till I ran
into them in live code, but still, it took way longer than I expected. (It
took me a whole day and a bit of the next day)
TIA
|
| |
|
| |
 |
Karsten Baumgarten

|
Posted: 2005-2-8 15:35:00 |
Top |
java-programmer >> algorithm - how to estimate time to complete
worzel wrote:
> Not a problem as such, just a question about estimating time for producing
> algorithms.
>
> I recently had to write a class with a method that was to convert digits
> (int) into their 'word' representation.
> To begin with, converting say, 234, into "two three four", was easy enough.
> But the method was also to 'sound english'
>
> So, 234 now had to be converted to:
>
> "two hundred and thirty four"
>
> Some other examples:
>
> "six million, three thousand and fifty six"
> "six billion and one"
> "eight billion,six million, three thousand, fourhundred and fifty six"
>
> (like the way a person may write on a cheque underneath the digit amount.)
>
> I wrote such a method. (which was actually a little more invoved than this
> as it supports currencies, floating point number etc;) But, only after badly
> underestimating the time involved for me to do so. There were were a few
> elemenst about it that were not so obvious until I sat down to write it. I
> ended up scratching a lot of stuff down on paper, and wrote it 3 times till
> I was happy with it.
>
>
> I have two questions here:
>
> What is the best way to estimate time for rather small tasks like this? How
> to you determine if a job will take an hour, a day, or a week? I know it
> seems like a silly question - but I am just keen to see what sort of
> responses come back from it.
There are a number of cost-models to estimate the required time (and
costs) to develop an application. One of those is called Constructive
Cost Model (COCOMO). The effort of development is measured in person
months and is mainly based on the KSLOC of your project (thousand source
lines of code). Though I doubt it would yield any useful output for a
more or less simple algorithm that stays well below the 1 KSLOC boundary.
More info: http://www.softstarsystems.com/overview.htm
Basically the best answer to your question would probably be:
Experience. All cost models I know of are based on empiric knowledge
about software development, in other words: they are based on
experience. :)
> Secondly, how long do you think it would take you to write a method such as
> this? Personally, I allowed an hour and a half, and, like I said, was badly
> mistaken. I know I took longer because I trivialised the problems till I ran
> into them in live code, but still, it took way longer than I expected. (It
> took me a whole day and a bit of the next day)
As far as I can see the algorithm should be more or less simple. But as
you had to learn yourself the hard way, looking at it and looking into
it are two different things. :)
Karsten
|
| |
|
| |
 |
worzel

|
Posted: 2005-2-8 15:44:00 |
Top |
java-programmer >> algorithm - how to estimate time to complete
Thanks for the resposes guys. Much appreciated.
I have to say that the other side of my problem was that I went ahead with
the task believing it to be very very simple. As it turned out, it was
simple, but not quite as simple as I thought. There was a fair bit of logic
in figuring if 'and' and ',' were required in the plain english version of
the digits, and a bit in figuring out if we needed the likes of a 'one' or
in the case of a 'one' in the preceding column, an 'eleven'. Just silly
stuff like that - while none of it on it's own particulalry difficult, it
certainly added time on top of my estimate.
So basically, without formally undersatnding the problem until closer
inspection, it makes it hard to provide a manager, who wants an estimate
almost immediately, with an answer to how long a task will take. There is
obviously many approaches for managing the project as a whole, but seemingly
not to estimating times for very small tasks (1 hour to 3 days, say)
I guess this is just the nature of the business - managers want it all ASAP,
developers always need more time! And I guess the ultimate answer to my post
is "go tell your manager to allow you time to look into how how much time is
required" if he absolutely needs that info. Otherwise, just leave you to get
on with it, it'll be done when its done!
Anyway, thanks again.
"worzel" <email***@***.com> wrote in message
news:42085ef1$0$18909$email***@***.com...
> Not a problem as such, just a question about estimating time for producing
> algorithms.
>
> I recently had to write a class with a method that was to convert digits
> (int) into their 'word' representation.
> To begin with, converting say, 234, into "two three four", was easy
> enough. But the method was also to 'sound english'
>
> So, 234 now had to be converted to:
>
> "two hundred and thirty four"
>
> Some other examples:
>
> "six million, three thousand and fifty six"
> "six billion and one"
> "eight billion,six million, three thousand, fourhundred and fifty six"
>
> (like the way a person may write on a cheque underneath the digit amount.)
>
> I wrote such a method. (which was actually a little more invoved than this
> as it supports currencies, floating point number etc;) But, only after
> badly underestimating the time involved for me to do so. There were were a
> few elemenst about it that were not so obvious until I sat down to write
> it. I ended up scratching a lot of stuff down on paper, and wrote it 3
> times till I was happy with it.
>
>
> I have two questions here:
>
> What is the best way to estimate time for rather small tasks like this?
> How to you determine if a job will take an hour, a day, or a week? I know
> it seems like a silly question - but I am just keen to see what sort of
> responses come back from it.
>
> Secondly, how long do you think it would take you to write a method such
> as this? Personally, I allowed an hour and a half, and, like I said, was
> badly mistaken. I know I took longer because I trivialised the problems
> till I ran into them in live code, but still, it took way longer than I
> expected. (It took me a whole day and a bit of the next day)
>
>
> TIA
>
>
>
>
|
| |
|
| |
 |
Dag Sunde

|
Posted: 2005-2-8 17:22:00 |
Top |
java-programmer >> algorithm - how to estimate time to complete
"worzel" <email***@***.com> wrote in message
news:42085ef1$0$18909$email***@***.com...
> Not a problem as such, just a question about estimating time for producing
> algorithms.
>
<snipped/>
> What is the best way to estimate time for rather small tasks like this?
How
> to you determine if a job will take an hour, a day, or a week? I know it
> seems like a silly question - but I am just keen to see what sort of
> responses come back from it.
>
I usually tell my manager (only half joking) that:
* Make your best esimate.
* Multiply by two
* and then convert to the next higher unit.
So in your case, 1.5 x 2 = 3 hours, converted one unit
up = 3 days!
Mind you, this time includes design, comments, documentation & testing.
Ready for production.
;-)
--
Dag.
|
| |
|
| |
 |
Scott Ellsworth

|
Posted: 2005-2-9 7:21:00 |
Top |
java-programmer >> algorithm - how to estimate time to complete
In article <cu9pvh$r9r$00$email***@***.com>,
Karsten Baumgarten <email***@***.com> wrote:
> Basically the best answer to your question would probably be:
> Experience. All cost models I know of are based on empiric knowledge
> about software development, in other words: they are based on
> experience. :)
Experience is not enough - records also matter.
Many trying to figure out modelling and time estimation do not track the
actual and the estimated time, which makes it really hard to figure out
not just how far off your original estimate is, but in what way you
screwed it up.
If you are really, really into paperwork, Watts Humphries' Personal
Software Process has a pretty good set of machinery to track both the
kinds and the impacts of errors. (Estimation errors, bugs, defect
tracking, overhead, etc.)
It is a grind to do, but if you stick to it for a month or so, you will
have a really good idea of what you need to track, and what you need to
look out for. Even if you then drop it for an agile methodology, you
still will know your own personal strengths, and your own personal time
sinks.
Scott
|
| |
|
| |
 |
worzel

|
Posted: 2005-2-9 9:59:00 |
Top |
java-programmer >> algorithm - how to estimate time to complete
Thanks Lee - thats helps a lot.
"Lee Fesperman" <email***@***.com> wrote in message
news:email***@***.com...
> worzel wrote:
>>
>> Not a problem as such, just a question about estimating time for
>> producing
>> algorithms.
>>
>> ...
>>
>> I have two questions here:
>>
>> What is the best way to estimate time for rather small tasks like this?
>> How
>> to you determine if a job will take an hour, a day, or a week? I know it
>> seems like a silly question - but I am just keen to see what sort of
>> responses come back from it.
>>
>> Secondly, how long do you think it would take you to write a method such
>> as
>> this? Personally, I allowed an hour and a half, and, like I said, was
>> badly
>> mistaken. I know I took longer because I trivialised the problems till I
>> ran
>> into them in live code, but still, it took way longer than I expected.
>> (It
>> took me a whole day and a bit of the next day)
>
> I would tend to agree with the other posters that experience is the
> primary factor in
> being able to estimate well, though I also go along with the poster who
> recommended
> recording the information and tracking estimates against performance.
>
> Experience is no guarantee though. Nor is resources. Note that Microsoft
> with all its
> resources is very bad at estimates. In fact, I would say that the vast
> majority are very
> bad at estimating no matter the experience. OTOH, I find that few managers
> will accept a
> proper estimate and generally will force the estimator to cave in. I have
> lost contracts
> for refusing to give.
>
> I consider myself a very good estimator and have a long track record to
> prove it. At
> first, I used to go over each task in my mind to estimate the time and
> then add
> integration, testing, trips to the water cooler, etc. and finally some
> fudge for the
> unexpected (usually, external factors). After a decade or so, I find my
> intuition is
> pretty accurate, which is useful when the manager demands quick answer.
> Given the time,
> I would always prefer to study the problem properly. This also ends up
> benefiting the
> actual project.
>
> --
> Lee Fesperman, FFE Software, Inc. (http://www.firstsql.com)
> ==============================================================
> * The Ultimate DBMS is here!
> * FirstSQL/J Object/Relational DBMS (http://www.firstsql.com)
|
| |
|
| |
 |
Lee Fesperman

|
Posted: 2005-2-10 9:08:00 |
Top |
java-programmer >> algorithm - how to estimate time to complete
worzel wrote:
>
> Not a problem as such, just a question about estimating time for producing
> algorithms.
>
> ...
>
> I have two questions here:
>
> What is the best way to estimate time for rather small tasks like this? How
> to you determine if a job will take an hour, a day, or a week? I know it
> seems like a silly question - but I am just keen to see what sort of
> responses come back from it.
>
> Secondly, how long do you think it would take you to write a method such as
> this? Personally, I allowed an hour and a half, and, like I said, was badly
> mistaken. I know I took longer because I trivialised the problems till I ran
> into them in live code, but still, it took way longer than I expected. (It
> took me a whole day and a bit of the next day)
I would tend to agree with the other posters that experience is the primary factor in
being able to estimate well, though I also go along with the poster who recommended
recording the information and tracking estimates against performance.
Experience is no guarantee though. Nor is resources. Note that Microsoft with all its
resources is very bad at estimates. In fact, I would say that the vast majority are very
bad at estimating no matter the experience. OTOH, I find that few managers will accept a
proper estimate and generally will force the estimator to cave in. I have lost contracts
for refusing to give.
I consider myself a very good estimator and have a long track record to prove it. At
first, I used to go over each task in my mind to estimate the time and then add
integration, testing, trips to the water cooler, etc. and finally some fudge for the
unexpected (usually, external factors). After a decade or so, I find my intuition is
pretty accurate, which is useful when the manager demands quick answer. Given the time,
I would always prefer to study the problem properly. This also ends up benefiting the
actual project.
--
Lee Fesperman, FFE Software, Inc. (http://www.firstsql.com)
==============================================================
* The Ultimate DBMS is here!
* FirstSQL/J Object/Relational DBMS (http://www.firstsql.com)
|
| |
|
| |
 |
Tony Dahlman

|
Posted: 2005-2-28 11:04:00 |
Top |
java-programmer >> algorithm - how to estimate time to complete
worzel wrote:
> Not a problem as such, just a question about estimating time for producing
> algorithms.
>
> I recently had to write a class with a method that was to convert digits
> (int) into their 'word' representation.
> To begin with, converting say, 234, into "two three four", was easy enough.
> But the method was also to 'sound english'
>
> So, 234 now had to be converted to:
>
> "two hundred and thirty four"
>
> Some other examples:
>
> "six million, three thousand and fifty six"
> "six billion and one"
> "eight billion,six million, three thousand, fourhundred and fifty six"
>
> (like the way a person may write on a cheque underneath the digit amount.)
>
> I wrote such a method. (which was actually a little more invoved than this
> as it supports currencies, floating point number etc;) But, only after badly
> underestimating the time involved for me to do so. There were were a few
> elemenst about it that were not so obvious until I sat down to write it. I
> ended up scratching a lot of stuff down on paper, and wrote it 3 times till
> I was happy with it.
>
>
> I have two questions here:
>
> What is the best way to estimate time for rather small tasks like this? How
> to you determine if a job will take an hour, a day, or a week? I know it
> seems like a silly question - but I am just keen to see what sort of
> responses come back from it.
>
> Secondly, how long do you think it would take you to write a method such as
> this? Personally, I allowed an hour and a half, and, like I said, was badly
> mistaken. I know I took longer because I trivialised the problems till I ran
> into them in live code, but still, it took way longer than I expected. (It
> took me a whole day and a bit of the next day)
>
>
> TIA
>
Whoa! I think you made three or four mistakes, here....
First, it took me ten minutes to find out that this code has previously been written,
far more completely and scalably than you even imagined. (See link below.) And it
is free under a GPL-like license.
Second, if you think that the correct text to put on your checks for $234 is
"two hundred and thirty-four," then you missed something in your sixth- or
seventh-grade grammar book. (I know that many Americans talk that way, but
that is colloquial and therefore, arguably, acceptable.) Is it standard in
Australia, or should $234.39 be written:
Two hundred thirty-four and thirty-nine / 100 ______dollars ?
At least, other English-speaking countries will be using this, not your,
convention for writing numbers as text.
Third, you apparently did not even think about internationalizing these strings.
Fourth and perhaps most important, your boss's question about how long it would
take you to do this may have been intended to get you to think about the problem
rather than just doing calculations. Not speaking for the boss, of course, and
he/she may know nothing about software development and programming, in which case
the above doesn't apply.
It pains me (I'm a shareholder but never an employee) to think that IBM puts
this code out there, yet people don't notice. WORA means "run anywhere", so why
don't more people learn how to do that? (Not flaming you personally with that. :))
http://icu.sourceforge.net/apiref/icu4j/com/ibm/icu/text/RuleBasedNumberFormat.html
Regards,
Tony Dahlman
----------------------------------------
Please do not send follow-ups to my posted email address. I will never see them,
thanks to spammers who will surely send lots of crap there.
|
| |
|
| |
 |
worzel

|
Posted: 2005-3-3 22:44:00 |
Top |
java-programmer >> algorithm - how to estimate time to complete
re:
First, it took me ten minutes to find out that this code has previously been
written,
far more completely and scalably than you even imagined.
No good - not allowed to use any external code.
re:
> Second, if you think that the correct text to put on your checks for $234
> is
> "two hundred and thirty-four," then you missed something in your sixth- or
> seventh-grade grammar book.
Sure, this is just an error in my post, not the actual code. The code works
as expected. It,s not actually got anything to do with check or money, that
was just my way providing some insight into the problem.
re:
> Third, you apparently did not even think about internationalizing these
> strings.
Thought of, and dismissed. Not a requirement.
Thanks for your feedback. However, I was more interested in the estimation /
time management issue, not how to write the code as such.
"Tony Dahlman" <email***@***.com> wrote in message
news:email***@***.com...
> worzel wrote:
>
>> Not a problem as such, just a question about estimating time for
>> producing algorithms.
>>
>> I recently had to write a class with a method that was to convert digits
>> (int) into their 'word' representation.
>> To begin with, converting say, 234, into "two three four", was easy
>> enough. But the method was also to 'sound english'
>>
>> So, 234 now had to be converted to:
>>
>> "two hundred and thirty four"
>>
>> Some other examples:
>>
>> "six million, three thousand and fifty six"
>> "six billion and one"
>> "eight billion,six million, three thousand, fourhundred and fifty six"
>>
>> (like the way a person may write on a cheque underneath the digit
>> amount.)
>>
>> I wrote such a method. (which was actually a little more invoved than
>> this as it supports currencies, floating point number etc;) But, only
>> after badly underestimating the time involved for me to do so. There were
>> were a few elemenst about it that were not so obvious until I sat down to
>> write it. I ended up scratching a lot of stuff down on paper, and wrote
>> it 3 times till I was happy with it.
>>
>>
>> I have two questions here:
>>
>> What is the best way to estimate time for rather small tasks like this?
>> How to you determine if a job will take an hour, a day, or a week? I know
>> it seems like a silly question - but I am just keen to see what sort of
>> responses come back from it.
>>
>> Secondly, how long do you think it would take you to write a method such
>> as this? Personally, I allowed an hour and a half, and, like I said, was
>> badly mistaken. I know I took longer because I trivialised the problems
>> till I ran into them in live code, but still, it took way longer than I
>> expected. (It took me a whole day and a bit of the next day)
>>
>>
>> TIA
>>
> Whoa! I think you made three or four mistakes, here....
>
> First, it took me ten minutes to find out that this code has previously
> been written,
> far more completely and scalably than you even imagined. (See link
> below.) And it
> is free under a GPL-like license.
>
> Second, if you think that the correct text to put on your checks for $234
> is
> "two hundred and thirty-four," then you missed something in your sixth- or
> seventh-grade grammar book. (I know that many Americans talk that way,
> but
> that is colloquial and therefore, arguably, acceptable.) Is it standard
> in
> Australia, or should $234.39 be written:
>
> Two hundred thirty-four and thirty-nine / 100 ______dollars ?
>
> At least, other English-speaking countries will be using this, not your,
> convention for writing numbers as text.
>
> Third, you apparently did not even think about internationalizing these
> strings.
>
> Fourth and perhaps most important, your boss's question about how long it
> would
> take you to do this may have been intended to get you to think about the
> problem
> rather than just doing calculations. Not speaking for the boss, of
> course, and
> he/she may know nothing about software development and programming, in
> which case
> the above doesn't apply.
>
> It pains me (I'm a shareholder but never an employee) to think that IBM
> puts
> this code out there, yet people don't notice. WORA means "run anywhere",
> so why
> don't more people learn how to do that? (Not flaming you personally with
> that. :))
>
> http://icu.sourceforge.net/apiref/icu4j/com/ibm/icu/text/RuleBasedNumberFormat.html
>
> Regards,
> Tony Dahlman
>
> ----------------------------------------
> Please do not send follow-ups to my posted email address. I will never
> see them,
> thanks to spammers who will surely send lots of crap there.
|
| |
|
| |
 |
| |
 |
Index ‹ java-programmer |
- Next
- 1
- Linking native libraries in Win2KHi there,
I'm trying to get some 3rd party "Kit" working and I'm struggling
with a java.lang.UnsatisfiedLinkError.
What I use is IBM's Visual Age 3.5.3 (JDK1.2.2) and the library in
question is IBM's OnDemand 7.1.0.7.
What I did was to copy all the DLLs and INIs etc. from the
"IBM\OnDemand Web Enablement Kit" into my WINNT\system32 folder -
where they should be found by any app, because it is listed in my
PATH.
However, I get an UnsatisfiedLinkError and I don't even know which
library it is actually looking for, as the stack trace
java.lang.UnsatisfiedLinkError
java.lang.Throwable()
java.lang.Error()
java.lang.LinkageError()
java.lang.UnsatisfiedLinkError()
int com.ibm.edms.od.ArsWWWInterface.initialize(java.lang.String,
int)
int com.ibm.edms.od.ArsWWWInterface.initialize(java.lang.String,
int)
int com.ibm.edms.od.ArsWWWInterface.init(java.lang.String, int)
void com.ibm.edms.od.ODServer.initialize(java.lang.String,
java.lang.String)
does not really help and I found when trying to catch this and dump
the name of the library was "null".
I somehow can't believe I'm the first one to struggle with this.
Any help is greatly appreciated.
Thanks,
Martin
- 2
- Improving Jmeter - User Agent Switching for HTTPHello Testers
Many current dynamic WEB systems with XML/XSLT can customize page
output by detecting what type of user is accessing page. It can be
recognition of IE and FIREFOX, plain text page for PDA or no javascript
menu for search engine. Because this different templates have different
resource needs for correct testing is neccesery to implement EASY WAY
to change/define User Agent Switching in Jmeter.
---------- Implementation Notes ------------------------
1. Allow Custom User Agent
Be shure then we can change user agent strings in both HTTP probes by
adding User aggent header in current custom hedaer module.
2. Impelemnt changing by GUI
Chris Pederik author of "User Agent switcher" for Firefox and Mozilla
agreed to share with us logic for generating various user agent headres
emulating different Web browsers and utilites.
Code is in Javascript and XML under at
http://www.chrispederick.com/
There is also contact infos for Chris.
---------------------------------------------------------
The best actual source of warious user agent strings is:
User agent Strings
http://www.pgts.com.au/pgtsj/pgtsj0208c.html
List of Robot Agent Strings:
http://www.pgts.com.au/pgtsj/pgtsj0208d.html
Ing Rudolf Kutina
Practical tester
Prague
Reply
- 3
- (J2ME) CLDC1.0 and equalsIgnoreCase?When I try to compile a class using this method under WTK2.5 with a
CLDC1.0 target, I get:
cannot find symbol
symbol : method equalsIgnoreCase(java.lang.String)
location: class java.lang.String
The source compiles fine under JRE 1.5 and I can't see any mention
that equalsIgnoreCase was only added in CLDC1.1. Is the method not
available or am I doing something wrong? Thanks.
- 4
- How to start default browser when clicking on a labelHi,
I was wondering how I can implement a JLabel that references to a http link.
When I click that label the default browser should open and loading the webpage.
This is for a JDialog 'About' window.
I've seen this several times, but I've no idea how to implement this with
Java/Swing.
Regards,
Helmut
- 5
- "error: cannot read:" (use the list file name written in a file)Hello:
When I compile the java source using command
javac javatest\kernel\*.java
it's perfectly work
but I have a lot of source code and distribute over many directories
So I write a file that contains:
javatest\data\*.java
javatest\kernel\*.java
...
names this file as "makefile.txt"
and use the command
javac @makefile.txt
but I got a error
error: cannot read: javatest\data\*.java
please help me
Eric Chen
- 6
- 7
- struts action quiestionHello,
I have a short question concerning struts action context stack. I have 3
views. View A, B and C
To view C, I can get from view A, or B. In view C I have button "BACK",
Whenever I click BACK button, I want to go back to page that called view C
(A od B).
Is there any way to do it (remember calling view), or I have to implement my
own context stack mechanizm ?
thank you,
fera
- 8
- jikes dependenciesHi,
I try to find all the dependencies of a class file (which are the
class to recompile when I modify just one java file).
According to Jikes website, "C depends on D if and only if the
constant pool for C contains a reference to D".
So, for a particular class, E, I found with Jikes the following
dependencies :
A, B, C, D.
At the same time, I used the BCEL library from apache to have a look
at the constant pool and I just find references to the class A, B and
C.
The class C is a parameter of one method of my class E and the class C
implements the interface D.
I understand why the class E depends on the class D.
Is the Jikes assertion incomplete or should I understand "C depends on
D (and all its ancestor/interfaces) if and only if the constant pool
for C contains a reference to D" or maybe even "C depends on D (and
all its dependencies) if and only if the constant pool for C contains
a reference to D"??
Thanks for your help.
Eric Deshayes
- 9
- Users onlineHi,
How can I keep track of users online in a non web j2ee aplication.?
I thought using a Statefull EJB , one for each user created when the user
login and destroyed when he logs out.
Another option is to keep a table in the DB tracking this , maybe a CMP ?
Any sugestion ?
Thank you
- 10
- A bafflement moment on enumI have written enum code that works, but suddenly I had a sinking
feeling that it has no business working. I did a little disassembling
and sorted out the mystery.
let's say I create an enum with method next().
Then I override the next() method with custom code in the various
enum constants.
These methods live in anonymous inner classes of the enum (though
oddly they decompile as static).
Then I do something like this:
Breed d = Breed.DALMATIAN;
d.next();
How on earth does Java know to use DALMATIAN.next() rather than
Breed.next()?
The answer is that d contains a reference to the DALMATIAN inner class
that EXTENDS the Breed enum class as well as being an inner class of
it. So the next() method overrides the one in the Breed class.
--
Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.
- 11
- constructor inheritance/overriding?If I have a base class with some over-loaded constructors
that perform significant work before calling the
"main" constructor, what is the best way of achieveing
the same set of constructors in a sub-class?
e.g.
class B {
B(A a) {
... lots of stuff ...
}
B(D d) {
this(get an A from the d);
}
B(S s) {
this(get an A from the s);
}
}
class E extends B {
E(A a) {
super(a);
addition 'E' specific code
}
}
How do I implement E(D d), and E(S s)?
As I understand things, constructors are not inherited (unlike C++),
so I do need an explicit implementation of each constructor. But the
"obvious" minimal implementation:
E(D d) {
super(d);
}
would call B(D d), which would then call B(A a).
Thus the extra 'E' specific code would NOT be called.
I don't (unless I must) want to expose the inner workings
of the other constructors in 'B', for reasons of data hiding
and code maintainance.
This question must have arisen before, but my googling failed
me.
Anyone have a solution?
BugBear
- 12
- exe within a jar fileI want to package and run an exe within an executable jar file. I've
tried using the getClass().getResource("relative/exe/location"), but
receive the following error when running the jar
java.io.IOException: CreateProcess:
jar:file:\E:\test\TestProgram.jar!\myexe.exe error=2
this occurs when I run the following code:
Runtime rt = Runtime.getRuntime();
Process proc =
rt.exec(this.getClass().getResource("/myexe.exe").toString());
I would appreciate any help or suggestions on the subject. We've
considered extracting it an running it from a temp location and
cleaning up the directory, but we would like to avoid this. Thanks!
- 13
- addRow error when further editing is doneHi All,
Quick question (hopefully an easy answer).
Using JBuilderX--a GUI with a JTable component, I click a button
calling a method that adds a new row to a TableDataSet table in the
Database. This code in a datamodule class method:
openIMTable();
DataRow item = new DataRow(imTable);
item.setString("COLUMN1", "SOME TEXT");
imTable.addRow(item);
Returning to the GUI, the row is visually added, everything is fine.
The new row is highlighted in the JdbTable component. I click on an
empty column field in the new row and type some info--press Enter and
get the following error message: "Unable to set value because could
not post or leave row 0". If I select a different row with the mouse
and then reselect the "new" row I can add other fields with no
problem.
What am I missing?
TIA
Mark
- 14
- focus gained received twice for the same buttonI have two buttons in a JPanel (default FlowLayout), which is nested in a
BorderLaout panel's SOUTH slot. The panel implements a FocusListener, and
I'm using the focus gained event to as follows:
/**
* 1) To ensure the next widget, if it has selectable contents (i.e.,
like a JTextField),
* has it's content completely selected.
* 2) To update the status bar with any tool tip text.
*
* @param event
*/
public void focusGained(FocusEvent event)
{
Component c = event.getComponent();
// debug
getStatusHandler().setStatus(c.getClass().getName());
// displayToolTipText( (JComponent) c);
if(c instanceof JTextField) {
((JTextField) c).selectAll();
}
}
For some reason, when the last button in the panel has the focus, it takes
two tabs to get it off. While there is no visual indication after the first
tab as to where the focus is, the debug trace I put in is displaying that
the Component in the focusGained method is still a JButton. The only
modification I made to the KeyboardFocusManager is to add the ENTER & shift
ENTER keys to the forward and backward traversal keys.
Thanks in advance,
- Eric
- 15
- IDE for JFSWhat IDE you would recommend for JSF based J2EE development using JBOSS
AS.?
|
|
|