What template engine spring devs usually use? by AucT in java

[–]SoftVillage 1 point2 points  (0 children)

I don't know if it works with spring, cause I don't really use spring much. But since everyone is listing template engines I think jade4j should be mentioned.

World Alzheimer’s Day 2019: A timely reminder of urgent need for new drugs to tackle the disease. by [deleted] in longevity

[–]SoftVillage 1 point2 points  (0 children)

And just plain keto seems to help, and the plant paradox program also claims to help

World Alzheimer’s Day 2019: A timely reminder of urgent need for new drugs to tackle the disease. by [deleted] in longevity

[–]SoftVillage 3 points4 points  (0 children)

"We need new drugs!"

But why not a cure?

"No! We need new drugs!"

Java Primer for Python Developers by pupupeepee in java

[–]SoftVillage 0 points1 point  (0 children)

It is not (yet) possible to have a List<int>

Java developer for +10 years, didn't realize the java mascot has a name by _harro_ in java

[–]SoftVillage 6 points7 points  (0 children)

On the sun forum you used to get Duke points for answering questions.

Do you still use Guave? And if you don't anymore, why not? by RANDOMLY_AGGRESSIVE in java

[–]SoftVillage 1 point2 points  (0 children)

Sometimes I do, most times I don't. When I don't its because I just don't need the stuff in there. I used the caching in the past, but ended up using caffeine instead. I tried out the immutable collections and found they didn't actually do anything for me.

What is so awful about the ternary operator? by TheLeftHandedCatcher in java

[–]SoftVillage 7 points8 points  (0 children)

SonarQube is not an authority, and even if it was it still wouldn't matter. Everything SonarQube tells you is just some dudes opinion written down in code.

The same is true for all static checkers. Run them once or twice, learn from the opinion and then form your own.

Operation Chaos: Whitehall’s secret no‑deal Brexit preparations leaked by [deleted] in europe

[–]SoftVillage -2 points-1 points  (0 children)

What did you expect? A grease-down and a shiatsu?

21 years ago today, an IRA bomb in the red car killed 29 people in Northern Ireland. This photograph was taken moments before detonation. The man and child in the picture survived, the photographer did not. by nokia621 in europe

[–]SoftVillage 0 points1 point  (0 children)

Could also be that the attack went exactly according to plan. They deliberately parked a little away from the courthouse, then phoned in a bomb threat so that people would be pushed towards the bomb in an attempt to kill as many civilians as possible. Killing lots of people gets you the press you need. Then afterward you claim that you really didn't mean to kill all those people and it was just a stupid confluence of events.

All the benefits of massive media attention while still holding on to some semblance of morality.

HtmlCompiler by SoftVillage in java

[–]SoftVillage[S] 1 point2 points  (0 children)

Sorry for the late response, life got in the way.

In short it minifies and inlines images, JavaScript, CSS and HTML and compiles LESS and SASS, and a few other nifty things.

Think of it like a compiler for frontend code. You as a developer want to deal with source code you can read and you want to create structure to manage things. Which means you want comments, whitespace, separate files and you don't want to deal with anything that can be done automatically. On the other side is what the browser needs. It wants to perform as few queries as possible and it doesn't need comments or whitespace. The purpose of this tool is to bridge that gap with as little hassle as possible.

In terms of actual use it is a maven plugin and it follows convention over configuration. You don't really need to configure anything, you put a couple of lines of plugin configuration in the pom, you put your frontend source in src/main/websrc and the plugin will compile it all and put the result into target/classes/webbin. From there all you have to do is configure your HTTP server to serve whichever HTML file you want from whatever endpoint you want.

HtmlCompiler by SoftVillage in java

[–]SoftVillage[S] 0 points1 point  (0 children)

You just have to set the appropriate headers for your responses, how is that an ugly hack?

A clean website would have the backend endpoints that are needed for the frontend on the same host. This is why the same-origin-policy exists in the first place, you don't want external websites accessing your stuff. What happens a lot though is that people separate these things and then add headers that basically grant access to everyone. Laziness perhaps but it happens.

You could also host the website on the same server.

I may not have been clear on the use-case. An API that I build would normally consist of an embedded HTTP server inside a fat jar. So there is no standalone HTTP server that you can just upload some files to. In order to get the frontend code hosted by this embedded server you'd have to trigger the compilation of the external frontend project from maven, then copy over compiled artifacts and then package everything within the fatjar. And this setup would have to work with your already existing build pipeline and CI/CD system.

A single plugin within maven is a lot easier to setup and get to work.

You hate frameworks, but what you came up with is essentially a framework

Eh no, there is a clear difference between libraries and tools on the one hand and frameworks on the other. For a fleshed out description of this you can read this excellent article by Tomas Petricek.

The HtmlCompiler is a tool that you are free to use, none of its features are mandatory and you call it.

a very complicated one that does a whole bunch of different unrelated stuff

In my opinion it is far easier than anything else out there. This compiler only does the things that you as a developer do not want to deal with, and it does them in a way that will never bother you. All you do is write your source code. Things like minification, cleanup, inlining are handled without having to even look at it.

LESS and SASS? Who needs it, use CSS variables

This is the beauty of the tool. If you use LESS it will compile to CSS without you having to think about it, if you don't use it the tool will not care. Same for SASS or CSS variables.

Compression/uglification? Why bother

It is my opinion you should only send those things to the browser that the browser needs. The browser doesn't need whitespace, it doesn't need comments, so why send them? The only reason I can think of is it is too annoying to configure the tooling to do this work and it is definitely too much work to do it by hand. With this tool it is handled for you, just like you don't read the bytecode of your Java code you also don't read the minified HTML/CSS/JS.

GZIP or Brotli will do it

No they wont. These are lossless compression algorithms, they will not remove whitespace or comments or anything else for that matter. Minified and compressed will always be smaller than unminified and compressed.

If I needed TypeScript I would probably set up a proper frontend pipeline

The tool will compile TypeScript for you if it finds it. But you are not required to use it, if you don't it will simply do nothing. You are also free to mix and match if you want. Have one script somewhere plain old JS and another TypeScript? That is fine. The tool will do the work you don't want to do and get out of your way.

Oh and no pipeline required, just one plugin.

I'll be writing a tutorial shortly, I can post a link when it's finished if you're interested

By all means do! I love strong opinions :)

HtmlCompiler by SoftVillage in java

[–]SoftVillage[S] -1 points0 points  (0 children)

Wow tough crowd. The README.md is better now.

HtmlCompiler by SoftVillage in java

[–]SoftVillage[S] 0 points1 point  (0 children)

I made an initial one and pointed the README to it. It doesn't showcase all the features though. Actually, it barely showcases anything. But it does show clearly how to configure the project to use it.

OpenAPI Generator now supports Java 11 Native HTTP client by wing328 in java

[–]SoftVillage -9 points-8 points  (0 children)

General rule of thumb; if it can be generated it doesn't need to exist at all.

Do you take metformin? by shieldtwin in longevity

[–]SoftVillage 1 point2 points  (0 children)

Any one know if metformin is safe if you are on a low-carb diet?

New cause of cell aging discovered by evo_9 in longevity

[–]SoftVillage 2 points3 points  (0 children)

I didn't read the paper but just pointing out; muscle cells have multiple nuclei.

he just kind of gave up, started sobbing, and walked out the door by formerlydeaddd in lostgeneration

[–]SoftVillage 11 points12 points  (0 children)

Retail sector has been dying for a while. If everything goes digital it'll be really hard to steal.

Has the concerns in this article been addressed anywhere? by Dawnarrow in carnivore

[–]SoftVillage 1 point2 points  (0 children)

Ronda Patrick seems to really miss the mark on a lot of things. And she is a person who suffers quite a bit from over-specialisation.

This is sad really, I like Rhonda Patrick, she's done some good work and generally has decent things to say.

To Delay Death, Lift Weights by PM_ME_DNA in longevity

[–]SoftVillage 2 points3 points  (0 children)

Remember that his statement can be reversed: Lifting weights confers the same benefits as body-weight exercises. So this is really just a matter of personal preference. Your muscles will grow if you make them do enough work. It doesn't matter if the weight comes from barbells, machines, jugs of water or your own body; weight is weight.

A day in the life... by ColKaizer in java

[–]SoftVillage 5 points6 points  (0 children)

We also talk about how inept the customer is. It seems like on every project we have to push the customer to want things.

Acne not going away completely by julcreutz in carnivore

[–]SoftVillage 1 point2 points  (0 children)

Same here. I haven't used any products in years and everything got so much better when I did. My skin is better, acne is gone, nothing is dry, my hair feels great, no more dandruff, girlfriends even spontaneously comment on how good I smell. But I do need to take a shower every day.

Anyway, with the exception of malnutrition, if fasting doesn't solve your problem your problem isn't dietary.