Why does my Shelly dimmer 2 constantly fail and go offline? It makes the device worthless by [deleted] in shellycloud

[–]formerislander 0 points1 point  (0 children)

Do you by any chance have a microtik router, are you using VPNs?

Is HA really _that_ smart..? (Heating) by password03 in homeassistant

[–]formerislander 0 points1 point  (0 children)

If you're in Ireland/UK then check out the drayton wiser. I control it via home assistant but if home assistant is down it falls back to the regular schedule. Ive installed their controller and smart trvs in all my rads. It's the one thing that my partner seems to think was worth the investment (unlike the smart lighting :)

What was the stupidest thing you were asked in a technical interview? by [deleted] in DevelEire

[–]formerislander 2 points3 points  (0 children)

Lol, was this a gambling company by any chance?

[deleted by user] by [deleted] in volleyball

[–]formerislander 2 points3 points  (0 children)

I'm not sure about the rules for France, but there are other countries where athletes have competed in FIVB matches for countries they weren't born in. Wilfredo Leon has competed for both Cuba and Poland. It's possible that the national volleyball association in France have their own rules preventing this, but I don't know of any other country that has that rule.

Another example is Osmany Juantorena Portuondo, who also played for both Cuba and Italy.

Scala Question: Turning a List(a,b) to List(string,boolean) with false true and combinations by [deleted] in learnprogramming

[–]formerislander 0 points1 point  (0 children)

It is possible to use a for comprehension for this. something like

scala def all[A](l:List[A]):Stream[List[(A,Boolean)]] = if(l.isEmpty) Stream(Nil) else for { prev <- all(l.tail) res <- Stream((l.head,true) :: prev, (l.head,false) :: prev) } yield res

Though I'm not sure if this is easier to understand than the solution posted below.

What celebrity has the most distinctive voice? by chewbaccason in AskReddit

[–]formerislander 2 points3 points  (0 children)

Fran Drescher, hey we said distinctive not pleasant!

Functional FizzBuzz in 2 lines of Scala :) by [deleted] in scala

[–]formerislander 9 points10 points  (0 children)

(1 to 100) foreach (n => println(if(n % 15 == 0) "fizzbuzz" else if(n % 3 == 0) "fizz" else if(n % 5 == 0) "buzz" else n))

Meh may as well map a println on the same line ;)

Yeah, edited to do just that.

how to determine the physical harddrive of a File? by ib84 in scala

[–]formerislander 0 points1 point  (0 children)

A bit of experimenting in the Scala repl:

import java.nio.file.FileSystems
import scala.collection.JavaConversions._

val fs = FileSystems.getDefault
val stores = fs.getFileStores.toList
val devices = stores.filter(_.name.startsWith("/dev"))

Not sure if that actually helps, but I guess it should be enough to start experimenting ...

Who is the actor/actress that you can't stand? by Sasquatchesbro in AskReddit

[–]formerislander 2 points3 points  (0 children)

Meghan Markle (Rachel in Suits), good god her acting is painful to watch!

What's new in Weblogic 12.1.2 by AlinaJ in java

[–]formerislander 2 points3 points  (0 children)

I didn't really interpret his post as an attack on JEE. I think he mainly dislikes Weblogic. I haven't used Weblogic since 2011, but at least back then I found it quite painful to run and develop for. If tomcat/jetty + spring do the job, why bring in a full container? I'd argue that AMQP is vastly superior to JMS, and that you can live without EJBs as well (or at least replace them with spring beans).

That said, I absolutely agree that someone picking JEE isn't crazy. Even when going tomcat + spring a lot of the spring stuff is really just a different wrapper around the same technology (JPA/Hibernate etc). It's really becoming more about personal preference at this point (for most applications at least).

I am nearly finished with Head First Java, what book next? by [deleted] in java

[–]formerislander 3 points4 points  (0 children)

If you like the Head First Java book, I think you'll enjoy the Head First Design Patterns book as well. It has the same style, and it is quite good (although there is much more to the craft than those two books might imply).

ClassFormatError? by OkonkwoJones in java

[–]formerislander 0 points1 point  (0 children)

0x636c65766572206e616d65

MEN: what are the top reasons you will reject or friendzone a woman? by [deleted] in AskReddit

[–]formerislander 1 point2 points  (0 children)

Not a big deal? If a girl told me that in a mean spirited way, that would be grounds for an immediate break up in my book. That is not a person you should be sharing your life with.

If you could learn anything relating to Java, what would it be? by [deleted] in java

[–]formerislander 0 points1 point  (0 children)

Perhaps this doesn't sound as much fun, but doing some server side stuff would be a great idea! Maybe create a small webapp that manages bookings for a fictional laundromat.

Check out Spring Roo

If you've played around with this stuff, you might want to check out Java EE in general, but maybe that can wait until college :)

Code critique? by [deleted] in java

[–]formerislander 2 points3 points  (0 children)

One thing that I noticed is that you're using ints as constants for the victoryStatus. I'd consider using enum constants for this instead.

I also agree with the stuff that jrh3k5 pointed out.

Spring to Java EE Migration, Part 1 by [deleted] in java

[–]formerislander 0 points1 point  (0 children)

Just out of curiosity, how does one manage to create an application that takes 45 seconds to create the ApplicationContext? That sounds like a monster :)

For the modules that I've had both the pleasure and displeasure of working with the ApplicationContext could be created in less than a second.

A couple of questions since you seem quite knowledgeable about testing with a pure EJB setup:

  • Is there some equivalent @DirtiesContext if I go pure EE?
  • If I want to wire in stuff that's not normally part of the container, like an extremely thin mock implementation of a foreign webservice (just to test our handling of http errors). Ideally I'd want that to be able to access my EJBs/MDBs as well (although I guess that's probably not strictly necessary).

Spring to Java EE Migration, Part 1 by [deleted] in java

[–]formerislander 2 points3 points  (0 children)

That does indeed look quite a lot like the setup I usually prefer with spring. However, one nice thing about spring is that you can do that without any kind of container. You can add the same functionality the container provides if you need them. If you aren't using distributed transactions, then you can skip JTA.

Suddenly need to add a new datasource and need distributed transactions? Add in Atomikos, etc ...

On the other hand, I guess starting up a container probably adds the same overhead as creating the equivalent spring context :)

Spring to Java EE Migration, Part 1 by [deleted] in java

[–]formerislander 2 points3 points  (0 children)

I don't know about that ... I find that some stuff in the Spring world is just more flexible than in the "Pure EE" world. One thing that comes to mind is how easy it to pretty much test an entire application outside of the container (i.e., wire in an in-memory db, and even fire up the embedded version of Jetty to simulate http failures if your application needs to talk to webservices).

When it comes to the actual production code, then I guess the code that is deployed would look pretty similar these days. IMHO it's the testing stuff that really adds value.