Chris Treglio

Ranch Hand
+ Follow
since Jun 18, 2001
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
1
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Chris Treglio

I'm not sure this is the best way to do it, but when you create your Runnable to go a gradually load images from the network, you can pass it an empty Map (or something similar). The class that's kicking off your runnable should keep a reference to the Map, and make it available to whatever other threads might want to get images.

Then, you can use the String path to the image as the key to see if an image is loaded into your Map cache before you try to go get it on the network independently.

Is that what you're looking for?
11 years ago
I'm not really trying to turn a String into a Date object, I'm trying to pull out String dates from a longer String filled with other stuff. My String sources are like "bla bla blah blah 02-Apr-2011 blah bla blah".

Can you do that with the DateFormat/SimpleDateFormat?
11 years ago

I've got a long list of strings with dates in the format dd-mmm-yyyy which I'm trying to capture. I'd like to be able to handle missing leading zeroes in the day part (i.e. properly capture 01-Jan-2011 and 1-Jan-2011).

My current code doesn't handle leading zeroes.



I thought by changing the day part to ".*((?:[12][0-9]|3[01]|0?[1-9])-", I would make the leading zero "greedy" optional, and capture it if it's there. It does not. And furthermore, it turns dates like "12-Mar-2011" into "2-Mar-2011". Obviously, I'd want matches in the teens, twenties, or thirties to get captured too.

what am I doing?
11 years ago
I'm using html tags to do some text highlighting in some cells of my JTable. I've noticed that using <a href="whatever">whatever</a> produces text that looks like a hyperlink, but doesn't actually allow the user to click it and launch anything.

Is there a way to get link clicks in GUI components to actually function?
15 years ago
Could you react to intput made before a CR by subclassing FilterInputStream (with the original System.in as the underlying stream) and using your subclass to manually flush the member "in"?
15 years ago
Oh Cindy that's harsh.
Do you really think that using anonymous inner classes like the ones I posted above are lazy programming? I'm open to suggestions, but I always thought that they were good examples of encapsulation .... the chance of being able to reuse one outside the class is pretty slim, especially the Comparator.
18 years ago
I happen to have two of them in the class I'm working with right now ...
Here's a FileNameFilter

and here's a Comparator
18 years ago
Changing the classpath system property absolutely does not change the environment variable $CLASSPATH / %CLASSPATH%. If you want a java program to change the classpath that other programs (or this one) will use in future executions you probably have to use some file I/O on the startup script of that program and change the -cp argument.
18 years ago
can you post an example? all that gives me is a ParseException.
18 years ago
Joel's way is probably easier, but also consider Jakarta's POI project

http://jakarta.apache.org/poi/index.html

With this you can read and write directly to the file, with no ODBC-JDBC.
18 years ago
Does anyone know of a DateFormat implementation designed to work with the date format Apache uses in its logs? The format looks like

The SimpleDateFormat with a format string like "dd/MMM/yyyy:hh:mm:ss z" sort of works, but the time zone offset doesn't parse right.
18 years ago
Are people looting Japan? They are the second largest economy in the world, and have no military to speak of.
19 years ago

Originally posted by Mapraputa Is:
Unrestricted desire to become rich?


The lust for wealth, and the status it confers, is part of the fundamental human condition, and the desire, if not the opportunity, was just as alive and well under communism as it is here and now. That's why the powerful there always seemed to feel the need to exhibit their power with the same trappings we here refer to as extravangance. It might be why Marxism was not realized under Communism, or perhaps is not realizable at all.

Communists in the USSR made school education obligatory and college education free. Cruel animals they are...


By "free" I'm assuming you don't mean "inclusive of all the world's ideas," or "not constrained by the gov't?" Like when we say "free press?"
[ April 17, 2003: Message edited by: Chris Treglio ]
19 years ago
We may very well be emphasizing two different points, but in summary, here's mine : The stimualative effect of spending equal amounts is equal, whether it's made in little drips or one huge pile. The productivity increase (like you keep saying) will also be equal, because the market will encourage whoever these investors are to invest in small units where the industry wants that, or in big hunks when the industry wants that. Of course no coal mining exec would forgo a 200 ton crane to buy a million shovels, but a landscaper would forgo a millionth time share in the crane for 1.
We both agree that the money's going to find something useful to do, no matter to whom (or in what denominations) you give it. The stimulative effect, though, is gravy -- the real issue in favor of cutting taxes for the heavily taxed is justice?
19 years ago

Originally posted by herb slocomb:

I'm not really arguing that your purchase isn't a capital investment, what I am arguing is that your investment and those of others like you in the economy, will not substantially raise
per capita productivity in the same way as a larger more capital intensive investment would ...


Of course you're not -- it would be silly to try to label things like cranes and shovels "capital" and things like workboots "non-capital." An investment's stimulative value is better judged by how "capital intensive" it is. But what makes $10 million spent in one lump sum more "capital intensive" than $10 million spent in lots of little chunks? Some industries favor the latter.
Hey, I'm not saying that my $10 shovel outlay wasn't a bad investment. It would be a terrible investment -- I'd be out of business in five minutes! But I think we both agree that the gov't should not be trying to guess which investments will be bad or good ... If it consiously targets "stimulus" at larger investors with a "trickle-down" justification, that's what it would be implicitly doing.
19 years ago