|
Jo posted:I can see this happening and advise strongly in asking your professor if he's hosting the missing file somewhere. Email him NOW and CC a TA. I have; I sent him a message yesterday but it's gone unread so far. Figured I'd post here and see if that was a legitimate possibility, or if I was just totally missing something. This is the same professor who earlier in the semester hosed up and switched assignments around, leading to us getting assignments which required JavaFX nine weeks before "Intro to JavaFX", so it's possible.
|
# ? Dec 14, 2016 08:32 |
|
|
# ? Jun 13, 2024 06:20 |
|
AbrahamLincolnLog posted:I have; I sent him a message yesterday but it's gone unread so far. Figured I'd post here and see if that was a legitimate possibility, or if I was just totally missing something. As someone who just finished their own COP2805 course I can guarantee that's the case. My professor did this for 8 of 14 assignments and it drove me mad. If it takes a while for them to respond ask for an extension if they don't offer it upfront for the delay.
|
# ? Dec 14, 2016 13:13 |
|
AbrahamLincolnLog posted:So, I'm going to preface this with the point that this is potentially a very dumb question, but I have to be honest and say that I'm just totally stumped. http://www.cs.armstrong.edu/liang/intro9e/html/GenericMatrixWithLineNumber.html is this it? Still, I would hit up the professor.
|
# ? Dec 14, 2016 17:00 |
|
PierreTheMime posted:As someone who just finished their own COP2805 course I can guarantee that's the case. My professor did this for 8 of 14 assignments and it drove me mad. That's good to hear. At least now I know it likely isn't my fault. Just have to wait and see what he says. poemdexter posted:http://www.cs.armstrong.edu/liang/intro9e/html/GenericMatrixWithLineNumber.html is this it? Still, I would hit up the professor. Possibly! I found that too when I was searching; but again, that's from "Introduction to Java Programming, Ninth Edition", which is not our textbook. Every answer relating to a "GenericMatrix" class always comes from that textbook, which is what made me so confused.
|
# ? Dec 14, 2016 17:20 |
|
What's the current go-to webframework for small dumb projects that should better be done with something stupid like NodeJS? I just want to have a quick website where you can drag/drop images to upload and get saved, and then add tags. Thinking a little bit Ajax, autocomplete known tags, stupid backend to show tags by count, show images matching the tag etc... I swear I did something like this awhile back in Django but no idea where the source is. Was thinking Spark, but thought there was something else that people were recommending for tiny things like this but didn't see anything in 10 minutes of googling.
|
# ? Dec 15, 2016 08:50 |
Hughlander posted:What's the current go-to webframework for small dumb projects that should better be done with something stupid like NodeJS? I just want to have a quick website where you can drag/drop images to upload and get saved, and then add tags. Thinking a little bit Ajax, autocomplete known tags, stupid backend to show tags by count, show images matching the tag etc... I swear I did something like this awhile back in Django but no idea where the source is. Was thinking Spark, but thought there was something else that people were recommending for tiny things like this but didn't see anything in 10 minutes of googling. I'm in a similar boat. Would like to expand my horizons. Let me know if you find an answer to this.
|
|
# ? Dec 15, 2016 08:56 |
|
Hughlander posted:What's the current go-to webframework for small dumb projects that should better be done with something stupid like NodeJS? I just want to have a quick website where you can drag/drop images to upload and get saved, and then add tags. Thinking a little bit Ajax, autocomplete known tags, stupid backend to show tags by count, show images matching the tag etc... I swear I did something like this awhile back in Django but no idea where the source is. Was thinking Spark, but thought there was something else that people were recommending for tiny things like this but didn't see anything in 10 minutes of googling. There is no project that should better be done with nodejs. However, from the java side there are quite a few frameworks that can get you up and running fast:
One thing you may want to look into is to have that crap generated for you: jhipster (https://jhipster.github.io/) can generate a simple Spring Boot CRUD application in minutes (many minutes in my case since i didn't have nodejs installed and didn't want to give that little poo poo my root password to install global packages, so i had to do some reading first).
|
# ? Dec 15, 2016 12:18 |
|
How come nobody recommends Vert.x? Is it obscure, lovely, or both?
|
# ? Dec 15, 2016 12:24 |
|
Fergus Mac Roich posted:How come nobody recommends Vert.x? Is it obscure, lovely, or both? Personally I've heard about it but I have never used it (while i did use at least a little bit the others). So it could be that it is obscure or that I simply am not aware of it (ignorance). The same way for javascript frameworks (on the client). By default go to angular these days (1.5.x, gently caress 2.0) even though Vue did get some quite positive reviews and it may as well be as awesome as some say it is. One of these days I'll give that a try as well though, if i don't forget.
|
# ? Dec 15, 2016 13:56 |
|
Whats the best option if I want to read an Excel file and make objects out of rows?
|
# ? Dec 15, 2016 15:57 |
|
Apache POI is the library I've always used - https://poi.apache.org/
|
# ? Dec 15, 2016 16:24 |
|
Zorro KingOfEngland posted:Apache POI is the library I've always used - https://poi.apache.org/ This is the only answer for Excel imho.
|
# ? Dec 15, 2016 17:35 |
|
poemdexter posted:This is the only answer for Excel imho. It's great. PSA though: the Apache POI libraries work with the old binary Excel File format, and also with the new multi-file XML file format, but NOT with the Excel 2002 single file XML format: https://msdn.microsoft.com/en-us/library/aa140066(office.10).aspx https://en.wikipedia.org/wiki/Microsoft_Excel#File_formats That last one is still in use in some odd corners so could be a gotcha.
|
# ? Dec 15, 2016 22:57 |
|
Hughlander posted:What's the current go-to webframework for small dumb projects that should better be done with something stupid like NodeJS? I just want to have a quick website where you can drag/drop images to upload and get saved, and then add tags. Thinking a little bit Ajax, autocomplete known tags, stupid backend to show tags by count, show images matching the tag etc... I swear I did something like this awhile back in Django but no idea where the source is. Was thinking Spark, but thought there was something else that people were recommending for tiny things like this but didn't see anything in 10 minutes of googling. We were talking about Jersey. Check my post history. It was only a few weeks ago this came up. It sets up and runs quickly with tomcat, jetty and grizzly.
|
# ? Dec 15, 2016 23:15 |
|
AbrahamLincolnLog posted:At least now I know it likely isn't my fault. Just have to wait and see what he says. Professor responded. As everyone here suggested, he hosed up and didn't give us all of the code we needed for the assignment. It's now been uploaded. Thanks for the help, everyone!
|
# ? Dec 16, 2016 04:01 |
|
Has anyone had any luck slowly updating a legacy code base to newer technologies? The old code has SQL mixed in with controllers all over the place. It's pretty easy to pull out repositories and modes and such but it would be nice to stick in Hibernate and some kind of dependency injection framework but without breaking all the other existing code that we aren't touching yet.
|
# ? Dec 16, 2016 21:37 |
|
smackfu posted:Has anyone had any luck slowly updating a legacy code base to newer technologies? The old code has SQL mixed in with controllers all over the place. It's pretty easy to pull out repositories and modes and such but it would be nice to stick in Hibernate and some kind of dependency injection framework but without breaking all the other existing code that we aren't touching yet. I took something from old Spring to new Spring so we could get off the xml config. I also swapped it to Groovy so we could use that. src/main/java turned into src/main/groovy and the file extensions went from .java to .groovy with a couple @StaticCompiles where needed. If you have all of your business logic contained in a decent way, it might be easy to hop on Spring but I dunno. Depends on the codebase size and how messy it is. Good luck!
|
# ? Dec 16, 2016 21:40 |
|
I realize this isn't strictly a Java question, but I'm in a course that throws us headfirst into a new language every two weeks and gives an assignment in that language, and right now we're doing Clojure which at least runs in the JVM so I figure asking here might not be completely out of line. The current assignment is:quote:The first part of this assignment is to write a macro called safe that is intended REPL interaction is supposed to go like this: code:
Current state of our code: code:
This gives, in order, a properly printed divide by zero error, the number 5, and finally the bane of my existence: code:
I know I probably sound like a dumbshit to anyone with any grasp of Clojure or Lisp in general and, well, I kind of feel like one too. If anyone feels like they can give any hint at all towards figuring this out I'd be eternally grateful (and not to offer up bribes exactly, but if that someone would like a forums upgrade or avatar change in return I'd be happy to spring for it).
|
# ? Dec 16, 2016 23:44 |
|
smackfu posted:Has anyone had any luck slowly updating a legacy code base to newer technologies? The old code has SQL mixed in with controllers all over the place. It's pretty easy to pull out repositories and modes and such but it would be nice to stick in Hibernate and some kind of dependency injection framework but without breaking all the other existing code that we aren't touching yet. Why introduce Hibernate to codebase that used to be, mercifully, spared of it? I mean it's one thing to start off with it, but introducing it to a legacy application seems like asking for a bad time.
|
# ? Dec 17, 2016 00:20 |
|
What's wrong with Hibernate? I actually kind of like it.
|
# ? Dec 17, 2016 01:59 |
|
Woebin posted:macro questions When writing macros, I find it's easiest to write a few examples of how I think it should work. Try figuring out how the following s-expressions could look after the safe macro is expanded. Write an algorithm that transforms these examples to macroexpanded form. code:
code:
code:
|
# ? Dec 17, 2016 02:03 |
|
pigdog posted:Why introduce Hibernate to codebase that used to be, mercifully, spared of it? What ORM would you prefer? I found other ORMs to be quite young/unstable compared to hibernate. Hibernate is old, true, but is also very stable and mature.
|
# ? Dec 17, 2016 08:19 |
|
Volguus posted:What ORM would you prefer? I found other ORMs to be quite young/unstable compared to hibernate. Hibernate is old, true, but is also very stable and mature. Hibernate is nice and fast to hit the ground running, and to take care of simple data persistence in scenarios where the code drives the database. It's the whole concept of 1:1 mapping between in-memory objects and database that is ultimately awkward and problematic, IMHO. I really like JOOQ which takes care of some boring bits of JDBC, while giving the user the full power of SQL without an intermediate language, and best of all can provide typesafety with regards to your database types right in the IDE. It's not very well known because it's not free to use with commercial databases, but it's free for open-source databases, like Postgres.
|
# ? Dec 17, 2016 09:34 |
|
pigdog posted:Hibernate is nice and fast to hit the ground running, and to take care of simple data persistence in scenarios where the code drives the database. It's the whole concept of 1:1 mapping between in-memory objects and database that is ultimately awkward and problematic, IMHO. I looked some time ago at that library and at most I can say that is a joke. ORMs are not perfect by any means, and different implementations have their own quirks, but jqqq brings nothing to the table that you don't get from ORMs. It looks like a solution in search of a problem. It is better than JDBC , that's for sure, but it makes no sense to use it instead of an ORM.
|
# ? Dec 17, 2016 21:37 |
|
My team uses JOOQ, and we love it. It's like writing postgresql, but with type-safety. Can you explain the draw of a heavy-weight ORM to me? I've never had a good experience with one; it's only been another layer that I have to fight against when I want to do anything complicated. It's been my experience that ORMs like Hibernate are trying to solve the problem "database access isn't Object-Oriented enough," which is the wrong solution to something that isn't really a problem.
|
# ? Dec 18, 2016 04:31 |
|
Gravity Pike posted:My team uses JOOQ, and we love it. It's like writing postgresql, but with type-safety. Ease of maintenance. Ease of refactoring. After you write "select bla from foo" 5 times ... it gets old fast. Lazy fetch when you want it, eager fetch when you don't. HQL makes writing complex sql queries easy. If you really have to, writing native SQL statements is trivial, for all those 2-3 native queries you have to write in a huge project. I personally never had to fight ORMs since I've discovered hibernate back in 2003, so ... no idea what are you doing there. Do you know what you're doing there? Develop the project locally with h2, test with real DB in QA and with deploy to prod. That makes development environment setup a non issue (git clone, run, done). And a billion other little things. When i want plain JDBC , Spring JDBC is around the corner, and that offers everything that jqqqqq offers and more, if I really really don't want to bring hibernate into the mix. But hey, whatever floats your boat. I like going home in the evening. Some don't and I understand that.
|
# ? Dec 18, 2016 05:11 |
|
Gravity Pike posted:My team uses JOOQ, and we love it. It's like writing postgresql, but with type-safety. That's great buddy but I can't get my boss to pay $150/year for IntelliJ, how in the world am I going to get him to pay $450 per developer seat per year for a freaking ORM?
|
# ? Dec 18, 2016 06:39 |
|
The Laplace Demon posted:When writing macros, I find it's easiest to write a few examples of how I think it should work. Try figuring out how the following s-expressions could look after the safe macro is expanded. Write an algorithm that transforms these examples to macroexpanded form.
|
# ? Dec 18, 2016 16:36 |
|
Paul MaudDib posted:That's great buddy but I can't get my boss to pay $150/year for IntelliJ, how in the world am I going to get him to pay $450 per developer seat per year for a freaking ORM? That's a problem with the boss, to be honest. One of his/hers duties is to make sure the developers have everything they need to do their job and are more efficient at it. Even if that means that sometimes you get something that simply makes them happier. The boss should simply demand a logical argument (bullet points, everyone loves bullet points) why technology X is better than what you're using now and how he (the boss) will benefit from it. While I don't personally believe that either intellij nor jqqqq provide any benefit (to the contrary), one should be open to arguments that could change their mind. If one of the arguments against ORM (pro jqqqq) is, like Gravity Pike said: "ORMs are too drat hard" (paraphrasing), then the boss should simply invest in an ORM/JPA/Hibernate course. Like with any complicated enough technology, you can use it wrong, therefore negating any benefit that it may provide.
|
# ? Dec 18, 2016 17:50 |
|
Paul MaudDib posted:That's great buddy but I can't get my boss to pay $150/year for IntelliJ, how in the world am I going to get him to pay $450 per developer seat per year for a freaking ORM? Ask him why he's paying $2k - $25k per core for SQL Server or Oracle, then. For open-source databases like Postgres or MySQL it's free.
|
# ? Dec 18, 2016 18:30 |
|
edit: nevermind
pigdog fucked around with this message at 19:38 on Dec 18, 2016 |
# ? Dec 18, 2016 19:09 |
|
Woebin posted:Hey, thanks for this. I'm not quite grasping it yet but I'll spend some more time trying with your advice in mind. Let me know if you'd like some sort of reward for effortposting on my behalf! Hmm, realized I never actually explained how or why you'd write a macro. Macros are code transformations. Normally when you call a function, the arguments are evaluated before the function call, for example: code:
In general, function application takes place from the innermost function call to the outermost. Functions apply to values. Macros invert this behavior. They evaluate from the outermost macro call to the innermost, before function application begins. Instead of taking values as arguments, they take the unevaluated blocks of code. Instead of returning a value, they return a new block of code in its place that is evaluated instead. The simplest macro is comment, which takes code and replaces it with nothing. code:
The macro can make arbitrary edits to the code it receives: code:
The equivalence between function calls and let means we could implement our own let with function application: code:
Hope an actual example of a code transformation helps. There's some additional syntactic sugar for a few common tasks, but this should be enough for your homework problem. Here's good documentation for standard library functions, grouped by their usage: https://www.conj.io/ Here's a site with small Clojure exercises to help get used to its syntax: https://www.4clojure.com/
|
# ? Dec 18, 2016 20:28 |
|
The Laplace Demon posted:More macro help
|
# ? Dec 19, 2016 00:01 |
|
pigdog posted:Ask him why he's paying $2k - $25k per core for SQL Server or Oracle, then. For open-source databases like Postgres or MySQL it's free. Actually we don't pay a dime for Oracle. It's our client's database, they pay for it, we are considered "developer" seats and those are free on their license. Oracle charges by the production-server core, JOOQ charges by developer seat, totally different model. As for the client - yeah it's stupid but (a) they want someone they can call up when poo poo breaks, and (b) switching would require them admitting they're throwing away money. Our DBA was telling me that one of the enterprise-grade Postgres derivatives has a wrapper that basically makes Postgres look like Oracle and we might be able to move forward like that. Really they aren't doing anything that actually needs Oracle (which is probably a common story - CTO gets talked into fancy enterprise poo poo they don't need). We have maybe 50 million table rows in total, spread across ~25 tables. Our DBA spends so much time tuning queries and poo poo, and I think Postgres would probably just do it automatically just fine. Between a few poorly-designed tables that slow everything way down and the fact that Oracle's query planner is terrible and needs constant hand-tuning they think they need the big fancy enterprise products though. I don't know how you get a join to a primary key column to take 300 seconds, but that's a thing I've experienced thanks to Oracle. Paul MaudDib fucked around with this message at 02:10 on Dec 19, 2016 |
# ? Dec 19, 2016 01:32 |
|
Paul MaudDib posted:I don't know how you get a join to a primary key column to take 300 seconds, but that's a thing I've experienced thanks to Oracle. In my experience, you get it by believing things like this: Volguus posted:Ease of maintenance. Ease of refactoring. After you write "select bla from foo" 5 times ... it gets old fast. Lazy fetch when you want it, eager fetch when you don't. HQL makes writing complex sql queries easy. If you really have to, writing native SQL statements is trivial, for all those 2-3 native queries you have to write in a huge project. I personally never had to fight ORMs since I've discovered hibernate back in 2003, so ... no idea what are you doing there.
|
# ? Dec 20, 2016 02:22 |
|
JewKiller 3000 posted:In my experience, you get it by believing things like this: No I mean I went into a database client and types in SELECT * FROM TABLE_X JOIN TABLE_Y ON TABLE_X.FKEY = TABLE_Y.PRIMARYKEY LIMIT 50 and it took 300 seconds to come back. Dafuq. It obviously had to be attempting some kind of full table scan but that still shouldn't take 300 seconds with like 1M records in each table. Paul MaudDib fucked around with this message at 02:48 on Dec 20, 2016 |
# ? Dec 20, 2016 02:45 |
|
JewKiller 3000 posted:In my experience, you get it by believing things like this: Oh yes, because you just gotta pepper every single sql query with hints, otherwise everything will always do a full table scan no matter what. There is nothing one can do to make the RDBMS choose an optimal execution plan. If you're not writing 5 pages worth of text for every sql statement you're obviously doing it wrong ....
|
# ? Dec 20, 2016 04:28 |
|
Paul MaudDib posted:No I mean I went into a database client and types in SELECT * FROM TABLE_X JOIN TABLE_Y ON TABLE_X.FKEY = TABLE_Y.PRIMARYKEY LIMIT 50 and it took 300 seconds to come back. Dafuq. Depending on what the tables contain (100 megabyte blobs?), maybe it's the SELECT * part? Since JewKiller 3000 posted:In my experience, you get it by believing things like this: ... Anyhow, I've encountered an Oracle query that took 100 seconds to run on a table of a few thousand (small) rows. The contractor who had built the query hadn't bothered putting indexes on such a small table, yet Oracle's CONNECT BY somehow managed to do a full table scan for each relationship on each row. So the query ran at roughly O(n2) time. Putting an index on the column resulted in a cool 1000x speedup
|
# ? Dec 20, 2016 07:29 |
|
I like hibernate for the simple ORM that it gives you for the everyday CRUD operations. I also write plenty of straight SQL with it and use their transformers for the more complex queries into custom objects that are used for our REST interface. All of our queries have their own method each usually grouped into a manager class in some categorized way (usually based on the main table from which they are questioning).
|
# ? Dec 20, 2016 08:59 |
|
|
# ? Jun 13, 2024 06:20 |
|
Is the OP still accurate? Should I watch that video series to begin focusing more on Java?
|
# ? Dec 21, 2016 05:28 |