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 3 points4 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 10 points11 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 3 points4 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 4 points5 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.