|
I have the following snippet of code and contractModel.getName() returns "King’s" (truncated for this example but serves the purpose) String trustName = contractModel.getName(); trustName = trustName.replace("’", "'"); For some reason this doesn't replace ’ with '. In fact it seemingly does nothing. Any ideas?
|
# ¿ Jun 23, 2011 12:57 |
|
|
# ¿ May 19, 2024 22:54 |
|
Blacknose posted:I have the following snippet of code and contractModel.getName() returns "King’s" (truncated for this example but serves the purpose) Found the solution. ’ is extended ASCII character 146 and microsoft standard extended ASCII ignores a bunch of characters (127-150something?), so it needs to be escaped to the full unicode \u2019. That's 4 hours I'm never getting back. On the plus side I learnt more than I'll ever need to know about character encoding.
|
# ¿ Jun 23, 2011 22:22 |
|
Hibernate and Spring JDBC make life so much easier; it's hard to believe how much better they are.
|
# ¿ Jul 4, 2011 21:07 |
|
I need a good Spring MVC book. Any ideas?
|
# ¿ Jul 14, 2011 20:31 |
|
You could just catch a generic Exception.
|
# ¿ Jul 15, 2011 09:10 |
|
You're absolutely right, in this case catching Throwable would be the correct thing to do.
|
# ¿ Jul 15, 2011 17:12 |
|
I have a loving retarded question. I have a double, lets aay the value is 160.0, and I need it to be formatted as 160.00 (yeah, the cardinal sin of using doubles for currency, don't blame me, it wasn't my idea). I have tried Math.round, DecimalFormat etc and I'm pretty well out of ideas. There has to be a way of forcing it to 2dp and staying that way whilst also keeping it as a double but I can't for the life of me think what and it's now starting to really gently caress me of. Ideas?
|
# ¿ Aug 3, 2011 11:03 |
|
Already tried that and it returns a string, I need to end up with a double, same as when I started. I'm not actually 100% convinced it's possible.
|
# ¿ Aug 3, 2011 13:21 |
|
Yeah I was really scraping the bottom of the barrel by asking. It has to remain as a double, which obviously is a binary representation of a value, whih is then passed to an external api (jxl I believe) which then sticks it in an excel file. I didn't know if there was a way to attach formatting data to a double without using a string. The client is almost certainly going to want a numeric value with formatting which as far as I can tell just isn't possible. It's one of those situations where you're basically boned but I thought someone might know some miraculous way of doing it that defies the laws of coding.
|
# ¿ Aug 3, 2011 14:00 |
|
Jabor posted:If it's going into Excel, why isn't a string suitable? The client wants a numeric field in the spreadsheet for the software that will then read the excel file. Not my choice unfortunately. epswing posted:I don't think you're getting it. To "attach formatting data to a double" is senseless. You can round the value, or floor/ceil it, but numbers don't have "formats". Trust me I get it; I know they don't. That's why I said attach formatting to it as opposed ot 'format it'. I could probably have worded it better however. I'm not about to start pulling JXL apart, the client is just going to have to live with either a text field in excel or no dp, their choice.
|
# ¿ Aug 3, 2011 14:29 |
|
I thought the JXL formatters only dealt with fonts, borders etc but turns out that hidden away is the ability to format numeric cells. To get 2 decimal places on a numeric value use:code:
|
# ¿ Aug 4, 2011 10:25 |
|
tripwire posted:Use intellij I upgraded to eclipse indigo this morning for an ATG project (gently caress ATG, hybris all the way) and it crashed 10 times before lunch so I had to roll back to helios. I really, really wish I could afford intellij currently
|
# ¿ Oct 8, 2011 02:40 |
|
Spring and Hibernate is pretty much the standard I think.
|
# ¿ Jan 20, 2012 17:19 |
|
Pretty much the same as that, I've only seen it when redeploying big Spring apps.
|
# ¿ Jan 23, 2012 10:06 |
|
I need a good Spring/Hibernate textbook that walks through Spring MVC project setup etc. I've used Spring a lot but never done a complete greenfield project setup which I think is a pretty gaping hole in my knowledge.
|
# ¿ Jan 31, 2012 20:01 |
|
TRex EaterofCars posted:I don't think you need a textbook to do this, it's really not that hard especially with annotations in 3.0+. I would just make a few simple hello world-ish projects to get used to all the initial boilerplate web.xml stuff and some of the gotchas with dispatcherservlet and you should be fine. I guess you're right. I have used Spring quite a lot, it's mainly just setup and some of the newer features. I guess I'll make some kind of noddy little webapp and see how it goes. Now if I can just stop getting distracted by Scala...
|
# ¿ Jan 31, 2012 21:38 |
|
Something subclassed from InvalidStateException, I reckon.
|
# ¿ Apr 19, 2012 17:09 |
|
Oops, been coding javascript for 5 months, I think my brains gone a bit funny.
|
# ¿ Apr 19, 2012 17:19 |
|
pigdog posted:IDEA is even smarter than Eclipse when it comes to autocompleting and programming aides I'm trying to give IDEA a go at the moment and while stuff like that is really nice in it I just can't seem to get it to 'feel' right, if that makes sense.
|
# ¿ May 9, 2012 10:22 |
|
Yeah there's no good reason to code that from scratch.
|
# ¿ Aug 24, 2012 23:14 |
|
|
# ¿ May 19, 2024 22:54 |
|
yes
|
# ¿ Oct 5, 2012 16:19 |