|
hooah posted:I've got an Oracle SQL database at work that has a Date-typed column which has always been relative to central time. We're in central time, but our new technology stack just leaves the JVM in UTC. After some poking around, I thought I would be able to use a ZonedDateTime object to easily convert the current UTC time to central. Except when I do the conversion to Date, it's back in UTC: I wish I still had access to the code I wrote at Experts Exchange, because we went through this exact problem. We'd been storing timestamps in Pacific time for the company's entire history and I finally got sick of DST loving everything up twice a year, so I started working on moving columns to UTC. Since our servers were all running in Pacific Time (again, because they always did), I had to do some nasty conversions when going to and from the database. In your case, though, note how the middle line in your output has a time of "00:14-05:00" when it should be "19:14-05:00". So your translation from LocalDateTime to ZonedDateTime is already messed up somehow.
|
# ? Mar 16, 2018 02:42 |
|
|
# ? May 27, 2024 18:02 |
|
I went around and around some more this morning, and it turns out that java.util.Date will always be in UTC when its toString method is called. I suspect this is what the jdbc driver is doing. Since this thing runs in its own JVM, I'm just going to set the JVM's time zone.
|
# ? Mar 16, 2018 14:37 |
|
A Date object does not have a timezone. Neither does an Instant. Yes, Date prints a timezone when you call toString and it has a method called getTimezoneOffset, but both will always be TimeZone.getDefault(). code:
code:
CPColin posted:In your case, though, note how the middle line in your output has a time of "00:14-05:00" when it should be "19:14-05:00". So your translation from LocalDateTime to ZonedDateTime is already messed up somehow. edit: About the JDBC part, DATE columns in Oracle don't have a timezone either. So when it loads the results from the database it will implicitly attach the default timezone. If your JVM is running in some other timezone than what the value in those columns represent you will get an incorrect Date object. There are a couple of solutions: - Run the JVM with the same timezone as the values in those columns (which is what you did), and hope that they all have the same timezone, and nobody forgets this - Ask your JDBC driver for a LocalDateTime (not an option with Oracle) - Do the conversion to LocalDateTime yourself code:
code:
M31 fucked around with this message at 12:35 on Mar 17, 2018 |
# ? Mar 17, 2018 11:30 |
|
hooah posted:Since this thing runs in its own JVM, I'm just going to set the JVM's time zone. Something to watch out for: If you use JodaTime anywhere, it has its own time zone setting. Generally in sync with the JVM one but if you manually update the JVM one...
|
# ? Mar 19, 2018 12:52 |
|
Does anyone know why java.com only offers to install Java 8 Update 161 for a desktop user? Hasn’t Java 9 been out for a couple of months? https://java.com/en/download/
|
# ? Mar 22, 2018 12:55 |
|
smackfu posted:Does anyone know why java.com only offers to install Java 8 Update 161 for a desktop user? Hasn’t Java 9 been out for a couple of months? Probably because it's the most compatible with applications and applets right now. Lots of applications with probable issues running on Java 9. You can get Java 10, which just came out, here http://www.oracle.com/technetwork/java/javase/downloads/index.html
|
# ? Mar 22, 2018 14:11 |
|
smackfu posted:Does anyone know why java.com only offers to install Java 8 Update 161 for a desktop user? Hasn’t Java 9 been out for a couple of months? Java 9 is already EOL. Java 10 is out and will be EOL in September. Java 11 will be out September and will be TLS for 3 years. Java 8 will be EOL January 1, 2019. I'm working on getting our app / build running on 10 now. Just have to get over a liquibase hurdle. I don't really foresee any major problems. We're not really in need of leveraging jigsaw at the moment. Here's a good answer to really the only major thing to get done for migrate past 8 https://blog.codefx.org/java/java-9-migration-guide/ https://stackoverflow.com/questions/48204141/replacements-for-deprecated-jpms-modules-with-java-ee-apis/48204154#48204154
|
# ? Mar 23, 2018 04:15 |
|
If you need a quick course on Spring Boot, check out this playlist on youtube, it's an excellent starting point because the instructor explains a lot of the magic that Spring does behind the scenes. Most tutorials I've seen are just "Here's how easy it is to make TodoApp", where they just go "see how easy this was" without telling you why, and more importantly what you can change to do something that is not TodoApp
|
# ? Apr 12, 2018 17:05 |
|
Thanks for that playlist. I started messing around with Spring Boot a little bit ago using "see how easy?" type stuff, so it'll be nice to get a better handle on what's actually going on. Especially since my project was trying to figure out how Spring Boot + Thymeleaf + Ceylon could fit together and the Ceylon folks want me to write up an article on my findings. It'll be a better article if it looks like I actually know what I'm talking about!
|
# ? Apr 12, 2018 20:05 |
|
CPColin posted:Thanks for that playlist. I started messing around with Spring Boot a little bit ago using "see how easy?" type stuff, so it'll be nice to get a better handle on what's actually going on. Especially since my project was trying to figure out how Spring Boot + Thymeleaf + Ceylon could fit together and the Ceylon folks want me to write up an article on my findings. It'll be a better article if it looks like I actually know what I'm talking about! I don't know anything about Ceylon, but I already dislike the package.ceylon and module.ceylon files sprinkled everywhere instead of contained in a single build.gradle or pom.xml. I understand Ceylon is trying to support java and javascript at the same time, but meh... (just opinion) Here's a ping pong ELO app I wrote using thymeleaf and spring boot super quick for the last company i worked at if it helps a little. I kept the "business logic" in the controllers because I was lazy and doing this when I had spare time in afternoons before anyone gives me poo poo about MVC practices. We played way too much ping pong and I'd rather do that than write code to track rankings. https://github.com/poemdexter/rn-pingpong I wrote this with groovy so it already has a lot of features that Ceylon has. Look how clean my model is! https://github.com/poemdexter/rn-pingpong/blob/master/src/main/groovy/com.rnpingpong/models/Player.groovy Looks like a lot of the features from ceylon are already in groovy with the big exception being support of javascript. But then again, javascript.. poemdexter fucked around with this message at 21:00 on Apr 12, 2018 |
# ? Apr 12, 2018 20:51 |
|
poemdexter posted:I don't know anything about Ceylon, but I already dislike the package.ceylon and module.ceylon files sprinkled everywhere instead of contained in a single build.gradle or pom.xml. I understand Ceylon is trying to support java and javascript at the same time, but meh... (just opinion) Yeah, the package.ceylon files can look pretty pointless, since they're not used for a whole lot. All they typically do is declare some documentation and flag whether the package can be seen from other modules. When a module has only one package, they look pretty superfluous. As for module.ceylon, the language designers looked in the future from the Java 7 era, saw Jigsaw coming, and figured it'd be best to modularize sooner than later. They actually managed to get it looking pretty close to how Java 9 does it, except with explicit version numbers. poemdexter posted:Looks like a lot of the features from ceylon are already in groovy with the big exception being support of javascript. But then again, javascript.. Ceylon's main draw, for me, is the type system. Union types, intersection types, mandatory handing of null cases, etc. I have only a few months of experience with Groovy, but so far I've felt like I've been in a car wash full of farts. I'd get more use out of the JS support if I did anything on Node.js, but it's nice when you have a module that isn't declared either Java-only or JS-only and it (mostly) Just Works on both platforms.
|
# ? Apr 12, 2018 21:29 |
|
edit: I'm dumb. JS != Java Birudojin fucked around with this message at 21:08 on Apr 16, 2018 |
# ? Apr 16, 2018 20:54 |
|
Birudojin posted:Is there some obvious approach I'm missing here? Possibly, but this is the Java thread, so who's gonna know for sure? vv CPColin fucked around with this message at 21:33 on Apr 16, 2018 |
# ? Apr 16, 2018 21:05 |
|
Hah ^^ Sorry, brain is melting here and missed the obvious in the title. Removing content for thread cleanliness, leaving post as record of stupid
|
# ? Apr 16, 2018 21:09 |
|
JS should have been named WebScript
|
# ? Apr 17, 2018 00:19 |
|
Zaphod42 posted:JS should have been named WebScript How much nicer life would have been had VBScript won the day ....
|
# ? Apr 17, 2018 00:30 |
|
Zaphod42 posted:JS should have been named WebScript It's going to end up being renamed JakartaScript and history will repeat. Volguus posted:How much nicer life would have been had VBScript won the day .... Who hurt you?
|
# ? Apr 20, 2018 03:01 |
|
It should be renamed Jayess.
|
# ? Apr 20, 2018 04:36 |
|
Anyone have strong opinions on Mac vs Windows for java dev? New job is asking which I want. I've always used Windows but if there's some tool that works better on Mac I'm not opposed to switching.
|
# ? May 15, 2018 15:41 |
|
Pedestrian Xing posted:Anyone have strong opinions on Mac vs Windows for java dev? New job is asking which I want. I've always used Windows but if there's some tool that works better on Mac I'm not opposed to switching. Really shouldn't matter if it's Mac, Windows or Linux. All the major Java dev tools are written in Java and run on all three platforms. The only reason to prefer Windows over Mac or Linux is if you have other Windows apps you need to run. e: Though if you do need to run some Windows apps you could just use Parallels or VMWare Fusion in Mac OS or VMWare Workstation in Linux. I've even used GPU passthrough with VMWare in Linux for gaming and it worked really well.
|
# ? May 15, 2018 16:12 |
|
Pedestrian Xing posted:Anyone have strong opinions on Mac vs Windows for java dev? New job is asking which I want. I've always used Windows but if there's some tool that works better on Mac I'm not opposed to switching. I have a strong opinion against Macs for the simple reason that I used one for 6 months (company issued laptop) and I have found that I am not able to use that UI. It is unix, once in the terminal pretty much everything is there, but the UI has been designed by drunken monkeys high on cocaine. During my 6 months of using it there haven't been 30 minutes going by without me screaming WTF in frustration to yet another dumb thing that OS did. And being a company issued laptop they didn't let me nuke MacOS and install linux on it. That's the UI. The hardware is good, except the keyboard. It hurts to have to type on that thing for too long (1 hour or so). But, this has nothing to do with java development (or any development specifically). Just plain usage. I know people who love their macs and do development on it just fine. Mac is a thing that you either love or hate. Since it is very light on customization ability there's not much one can do to make it bend to your will. You have to bend to its will, something I am not willing to do (and never will), or it will just not work out. My recommendation would be to try it out. It is the cheapest way to see if you like macs. If not, I presume you can always go back to a normal laptop.
|
# ? May 15, 2018 16:29 |
|
Volguus posted:I have a strong opinion against Macs for the simple reason that I used one for 6 months (company issued laptop) and I have found that I am not able to use that UI. It is unix, once in the terminal pretty much everything is there, but the UI has been designed by drunken monkeys high on cocaine. During my 6 months of using it there haven't been 30 minutes going by without me screaming WTF in frustration to yet another dumb thing that OS did. And being a company issued laptop they didn't let me nuke MacOS and install linux on it. That's the UI. The hardware is good, except the keyboard. It hurts to have to type on that thing for too long (1 hour or so). Not sure if Pedestrian Xing has a preference for or against Mac OSX's UI but you could check out Elementary OS (https://elementary.io/) for a Linux distro that has a similar UI. On the Linux side I'd recommend going with OpenSUSE or Manjaro for dev work. They're generally much more current than Ubuntu based distros.
|
# ? May 15, 2018 16:45 |
Volguus posted:I have a strong opinion against Macs for the simple reason that I used one for 6 months (company issued laptop) and I have found that I am not able to use that UI. It is unix, once in the terminal pretty much everything is there, but the UI has been designed by drunken monkeys high on cocaine. During my 6 months of using it there haven't been 30 minutes going by without me screaming WTF in frustration to yet another dumb thing that OS did. And being a company issued laptop they didn't let me nuke MacOS and install linux on it. That's the UI. The hardware is good, except the keyboard. It hurts to have to type on that thing for too long (1 hour or so). Can confirm, Macs are overhyped. They're not bad, per se, but especially if you're used to windows they can be a pain. A windows 10 PC and an IT team that includes bash for windows in their image is all you need.
|
|
# ? May 15, 2018 17:26 |
|
ChickenWing posted:A windows 10 PC and an IT team that includes bash for windows in their image is all you need. Yuck. It's Frankenstein's monster.
|
# ? May 15, 2018 17:43 |
|
Pedestrian Xing posted:Anyone have strong opinions on Mac vs Windows for java dev? New job is asking which I want. I've always used Windows but if there's some tool that works better on Mac I'm not opposed to switching. I do java dev in windows, mac and linux and find them all equivalent.
|
# ? May 15, 2018 18:08 |
|
benisntfunny posted:Yuck. It's Frankenstein's monster. WSL + OpenSUSE is the best thing to happen to Windows. It's a great SSH client, great for scripting, etc.. Just horrible if you need anything with a GUI. Yeah, you can use a local XServer but... Ugh.
|
# ? May 15, 2018 18:08 |
|
I find windows a step down from mac mainly because the terminals all have massive latency on keystrokes and minor commands for stuff like git. The fact that fonts look worse basically everywhere in the OS doesn’t help, considering the job is to stare at text and think about it and manipulate it.
|
# ? May 16, 2018 08:23 |
|
Out of curiosity, do any of you work places where Linux isn't an option for your development computer? I've never worked anywhere where it wasn't, but I've never worked anywhere that was large and/or regimented.
|
# ? May 16, 2018 15:16 |
|
venutolo posted:Out of curiosity, do any of you work places where Linux isn't an option for your development computer? I've never worked anywhere where it wasn't, but I've never worked anywhere that was large and/or regimented. My last job, in county government, was Windows-only. They had a bunch of vendor applications that were Windows- or IE-only and had no institutional knowledge of how to deal with a Linux machine. My current job was also Windows-only, but at least had encountered Mac OS and Linux in VM's, so I promptly installed Linux and forced the issue. Had to turn off Secure Boot a few times to get it working, though. Also had to set up a Windows VM anyway, because the password management is some Windows-only tool. My favorite part of that VM was when one of the sysadmins made it join the corporate domain and I was suddenly locked out from installing anything on it.
|
# ? May 16, 2018 15:29 |
|
venutolo posted:Out of curiosity, do any of you work places where Linux isn't an option for your development computer? I've never worked anywhere where it wasn't, but I've never worked anywhere that was large and/or regimented. My current job is all macs. I'm not crazy about it but I don't really care. Don't feel like doxxing myself but its a pretty major company, the largest I've worked at. In the past I worked at startups or small-to-mid-size companies, and if anything linux was the norm. My last job we had linux desktops to work and compile on, and windows laptops to test on and stuff.
|
# ? May 16, 2018 20:00 |
|
For large scale Java development, there can be some issues on Windows. Where I'm at (one of the major players in the Java ecosystem) you can choose any of the three. Overall I've noticed a few minor areas where Windows pulls up the rear for doing Java development: git performance was lower on Windows (may have been fixed recently), our projects could still sometimes result in paths too long for Windows Explorer to handle, and the overall integration of tools most of the dev team uses was sub par in cygwin. There's also the lack of bash on Windows by default so our product ships with both bash and batch startup scripts, but this thing runs on z/OS too so Windows isn't so bad. For smaller-scale Java development, I really don't see any difference. Use what you like.
|
# ? May 16, 2018 20:17 |
|
Zaphod42 posted:My current job is all macs. I'm not crazy about it but I don't really care. Don't feel like doxxing myself but its a pretty major company, the largest I've worked at. We're all Macs as well. We almost had the option to move to linux if we wanted in hopes of saving some money on macbooks and instead designing a kickass setup on System76 for 2/3s the price, but our VP nixed that idea wanting all of the devs to have identical machines :/ I have a Win10 machine for gaming and that's about it. But I don't think I can go back to Windows full time, especially for development. A lot of the little day-to-day things really keep me from going back. I'm a slave for Finder and how fast its search is vs Windows Explorer. Volguus posted:I have a strong opinion against Macs for the simple reason that I used one for 6 months (company issued laptop) and I have found that I am not able to use that UI. It is unix, once in the terminal pretty much everything is there, but the UI has been designed by drunken monkeys high on cocaine. I like the UI. It's minimalist and doesn't throw 500 options at you. The base setup for the average user is nice as well. Open Finder and 95% of everything the common person needs is right there in the left nav. Windows and the start menu has always pissed me off and I would spend hours customizing everything I needed to be available in it so I didn't have tons of clutter on the desktop. With Macs, CMD-Space is all you really need to fire up anything once you discover it.
|
# ? May 17, 2018 01:49 |
|
geeves posted:I like the UI. It's minimalist and doesn't throw 500 options at you. The base setup for the average user is nice as well. Open Finder and 95% of everything the common person needs is right there in the left nav. Windows and the start menu has always pissed me off and I would spend hours customizing everything I needed to be available in it so I didn't have tons of clutter on the desktop. Yeah, well, I like/need 5000 options (which is why I use KDE and not Gnome). And i tried, but i couldn't figure out who that "average user" is for which that abomination was created. One can do a lot of things with that UI ( such as posting poo poo on SA or Facebook) except the only thing that I needed to do: work. All in all I see macbooks as very expensive facebook machines. It's fine for who wants that. I don't.
|
# ? May 17, 2018 04:03 |
|
Volguus posted:Yeah, well, I like/need 5000 options (which is why I use KDE and not Gnome). And i tried, but i couldn't figure out who that "average user" is for which that abomination was created. One can do a lot of things with that UI ( such as posting poo poo on SA or Facebook) except the only thing that I needed to do: work. Please never design a user interface. Good god.
|
# ? May 17, 2018 04:05 |
|
carry on then posted:Please never design a user interface. Good god. Because providing options to the user is bad? Jesus, has the mac culture of "my way or the highway" has brainwashed people that much? Good UI should help a user get their work done and get out of the way. There are different users and there are different workflows. What works for me will not work for you. Me imposing my ideas on you is frankly stupid. This is why UIs and applications have options. So that for whoever is so inclined,m they can customize poo poo so that they can work more effectively. If anything, anyone, that should stop designing user interfaces would the Apple designers and the Gnome (which copy apple) designers. Their entire paradigm goes against the user. They impose workflows do not help a user make them. Un-loving-believable.
|
# ? May 17, 2018 04:13 |
|
Volguus posted:Because providing options to the user is bad? Jesus, has the mac culture of "my way or the highway" has brainwashed people that much? Good UI should help a user get their work done and get out of the way. There are different users and there are different workflows. What works for me will not work for you. Me imposing my ideas on you is frankly stupid. This is why UIs and applications have options. So that for whoever is so inclined,m they can customize poo poo so that they can work more effectively. If anything, anyone, that should stop designing user interfaces would the Apple designers and the Gnome (which copy apple) designers.
|
# ? May 17, 2018 04:18 |
|
carry on then posted:Cramming a million buttons and toggles into every view and menu is in no way "out of the way". The "just make an option" brigade never stops to consider that the model of accessibility and intuitiveness isn't Eclipse. And it's loving precious that you think your way is some sort of universally acceptable approach given how you sneer at anyone who doesn't share your preference for bad Linux DEs. Step outside of your own personal use case for once and learn that not everyone is a programmer or worships the computer nerd. I do step outside of the "computer nerd", which is why I always have sane defaults that 80% of people should never need to touch. Unlike apple designers, however, I do not assume to know better and for whoever is so inclined there should be an option for most things. As a programmer, however, yes it is easier to not give you options. It is the wrong approach, however, one that is dictated by laziness and not by anything else. You (they) are the ones in the wrong here.
|
# ? May 17, 2018 04:22 |
|
UIs For Hoarders™
|
# ? May 17, 2018 04:25 |
|
Volguus posted:I do step outside of the "computer nerd", which is why I always have sane defaults that 80% of people should never need to touch. Unlike apple designers, however, I do not assume to know better and for whoever is so inclined there should be an option for most things. As a programmer, however, yes it is easier to not give you options. It is the wrong approach, however, one that is dictated by laziness and not by anything else. You (they) are the ones in the wrong here. "Should never need to touch" but have to scan past and ignore every single time they use your software. Or worse yet, have to figure out whatever dumb config file format you've chosen to hide all the options you so lovingly provide in. But there's an option!
|
# ? May 17, 2018 04:26 |
|
|
# ? May 27, 2024 18:02 |
|
Yes, providing options is generally bad. Every option increases the level of technical expertise required to use your product. It makes it harder for users to get help, because they people they ask for help might have different options set. It compromises all later UI design, because now that work has to take into account all possible settings of the option. If you have a very good reason to provide a particular option, and the upsides of having that particular option outweigh the general downsides, then okay, it's fine to make it an option. But most of the time (especially in open source software), options get added because the developers can't decide on which way to go, and so they get all of those downsides without any actual upside. Those options suck.
|
# ? May 17, 2018 04:31 |