New Zoom self-selecting breakout rooms

I live the new Zoom feature to be able to switch between breakout rooms. You have to be on the latest zoom and the feature has to be enabled for your meeting.

After clicking breakout rooms at the bottom, you see the choices along with who is in each room. The trick is mousing over the number. If I mouse over “5”, it turns into the word join.

You can join a breakout from either the main room or another breakout. And you can always go back to the main room by clicking “leave breakout room.”

This is far better than my hack of joining as my computer, iPad and iPhone and switching physical devices. It also lets the team know which session I am actually paying attention too!

Multi statement lambda and for each anti patterns

When I do a code review of lambda/stream code, I am immediately suspicious of two things – block statement lambdas and forEach().

What’s wrong with this? It’s functional programming right?

List<Integer> list = Arrays.asList(1,2,3,4,5,6,7,8,9,10);
		
AtomicInteger sum = new AtomicInteger();
List<Integer> odds = new ArrayList<>();
List<Integer> evens = new ArrayList<>();
		
list.forEach(n -> {
	sum.addAndGet(n);
	if (n % 2 == 0) {
		evens.add(n);
	} else {
		odds.add(n);
	}
});
		
odds.forEach(System.out::println);
System.out.println();
evens.forEach(System.out::println);
System.out.println();
System.out.println(sum);

Well? Not really. It does have a lambda. It doesn’t have a stream, but that’s easy enough to fix: list.stream().forEach(…).

All better? No. Just because you are using a stream doesn’t mean you are doing functional programming. I would much rather see this code as:

List<Integer> list = Arrays.asList(1,2,3,4,5,6,7,8,9,10);
		
		
list.stream()
   .filter(x -> x % 2 == 1)
   .forEach(System.out::println);

System.out.println();

list.stream()
   .filter(x -> x % 2 == 0)
   .forEach(System.out::println);

System.out.println();

list.stream()
   .mapToInt(x -> x)
   .sum();

Yes, I’m still using forEach(). But now I’m using it for one purpose (printing) rather than sticking logic in it.

Whenever I see a forEach() or lambda with more than one statement, my first thought is “could this be clearer or more functional.” Often the answer is yes. Filter(), map() and collect() are you friends.

And if I did need that List?

list.stream()
   .filter(x -> x % 2 == 1)
   .collect(Collectors.toList());

Scheduling Social Media Posts

I recently became responsible for managing the NYJavaSig social media. I’ve been using TweetDeck for scheduling Twitter posts. Today I researched scheduling Facebook and Linked In posts. Here’s what I learend

Buffer

Buffer.com was recommended to me. I like it. It is free for up to three channels/connections. There’s a limit on how many posts you can have in the queue at the same time, but it is way higher than I would need.

Once I registered, I immediately dropped the Pro trial so I could see what it would look like for me. Connecting Facebook was pretty easy. I had to sign in with Facebook to connect. It got dropped once and I reconnected. But after that, it seemed happy.

LinkedIn was tricker and I encountered two problems:

  • On the dashboard, there were buttons to connect instagram and twitter. So I though the limit of three social media channels was only those three.
  • I later learned you can click “manage social channels” and get access to your LinkedIn Account or a LinkedIn Page. However, it is not possible to schedule posts into a Group because LinkedIn has disabled that API

HootSuite

I learned about HootSuite from a linked in article about scheduling posts. I had two problems

  • HootSuite wanted permission to see my contacts. Why? This is not needed in order to post on my behalf. I didn’t want to give that.
  • It is no longer possible to schedule posts into a Group anyway because LinkedIn has disabled that API. (Yes the same problem as Buffer.)

Conclusion

I decided to split and use TweetDeck for Twitter and Buffer for Facebook. I may consolidate later. But I might not. I really like TweetDeck for Twitter!