Burk Hufnagel

Ranch Hand
+ Follow
since Oct 01, 2001
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
3
In last 30 days
0
Total given
0
Likes
Total received
27
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Burk Hufnagel

Tim Holloway wrote: that you were able to obtain so many Pi Zero's! Those things were hard to get hild of even before The Great Pi shortage.

My journey started a year or so before Covid, I made many trips to local computer stores, buying one or two at a time when they were on sale.

They're all Pi Zero W (wifi) and the demo was at work, but I found something similar on YouTube at https://www.youtube.com/watch?v=qSpfWP-Fgjc.
5 months ago
Frank,
First, thanks for being here. I'm a long-time Java developer who saw a great demo of six Raspberry Pi Zero Ws running multiple instances of a Java app using Docker and Kubernetes. It looked really interesting so I went out and bought six Pi Zeroe Ws, 32GB RAM cards for them, and a 300MBps wireless router to connect them all, but I have no idea how to make it all work. Do you know how to hook them up?

Either way, I'd like to be able to get some experience running Java-based applications and microservices on them. Do you have a recommendation on whether to go with something like Micronaut to reduce the size and startup time or would you recommend something else?

Thanks,
Burk
5 months ago
Venkat,
This sounds like something we'll get better at as we get more experience with using Lambdas and the FP style of coding.
7 months ago
Don,
The lambda syntax is different from "normal" Java code, but I don't think it's confusing. If you look at this description from W3Schools I think you'll agree that it's not that hard to understand...

Hoping this helps,
Burk
7 months ago
Venkat,
Ah. OK, that makes more sense. It's always nice to have an expert around to answer questions.

Thanks,
Burk
7 months ago
Venkat,
I noticed that this is the Second Edition of the book and both Amazon and the Pragmatic Programmer's website say "Updated to the latest version of Java, this edition has four new chapters on error handling, refactoring to functional style, transforming data, and idioms of functional programming."  Without posting large chunks of the chapter, could you give me a feel for how to go about "refactoring to a functional style"?   I think part of my problem is the idea that refactoring means not changing the code's behavior, how can you refactor code that has side-effect to a functional style?

Hoping this makes sense,
Burk
7 months ago
Venkat,
Thanks for sharing your experience. I haven't gotten involved with FP yet but your book looks like a good way to get started with it.

Thanks again,
Burk
7 months ago

Anil Philip wrote:@Venkat Subramaniam
Can you please look at this post I made in the certification forum?
https://coderanch.com/t/775369/certification/Sybex-Ch-Lambdas-difference-compiler

per Jeanne's comment,

In location B, the lambda isn't in scope anymore so "c" doesn't produce such a conflict.



I still do not understand why the variables are in scope in 'LOCATION A', but out of scope in 'LOCATION B'.
To me, a lambda expression is something inserted that exists beyond the life of that code block.
It will be executed sometime later on, outside the life of the block.
It is like an alien visiting earth
So, both locations A and B have to be taken into account.



I think this answers your question.
Here's the code you're asking about:


And here's the code to be inserted:


If you insert the code at location A then variables "start" and "c" are already declared which causes problems when they're re-declared in the lambda. However, at location B, the variables declared inside the lambda are "out of scope" because they're declared inside the lambda and the closing curly bracket for the lambda occurs before we get to location B.

Hoping this helps,
Burk
7 months ago
Venkat,
I was wondering how well Test-Driven Development works with Functional Programming and found a FaceBook posting by Kent Beck at Functional TDD: A Clash of Cultures. In it, he describes some issues he had trying to to TDD while learning Haskell, and I'm wondering if you've had similar problems trying to write automated tests in Java while using a functional approach, and if you have any suggestions on ways to make it work.

Thanks!
Burk
7 months ago
Venkat,
Welcome to the Ranch - or should I say "back to the Ranch"? Is this your first time visiting, or have you been here before?

Either way, welcome!

Burk
7 months ago
Welcome to the Ranch, Wouter!  

I'm curious, is this your first book? I know it's published by Manning but when I googled your name I got a link to Simon & Schuster and they listed you as a author and showed "The Creative Programmer", which has me wondering if S&S owns Manning - do you know?

Also wondering if you find bread baking as potentially creative as programming? I suspect there are limitations on what you can do and still have it recognizable as bread, but I think that may be similar to being restricted by the syntax of a language... does that seem reasonable?

Looking forward to reading the book and learning,
Burk
9 months ago

Khalid A. Mughal wrote:Hi Charles,
Yes. You are right. It is a bummer.
But I guess that would be the case with any publication that had your notes and was updated by the publisher.



Ouch. Seems to me that they should at least keep the notes - you could remove anything that's no longer needed.  As for highlighting, minimally it could be kept for any text that hasn't been changed from the previous version. And if you had something highlighted that was changed, they could go back and see if the new part should be highlighted...  As a developer, that doesn't sound like a tough feature to add.

Simon Roberts wrote:The memorization issue depends on a) making it difficult for exam takers to take questions away with them (there are people who send candidates to these kinds of exams professionally for no purpose other than collecting a few questions verbatim--hopefully this is not happening as much as it used to, but who knows) and b) on cycling new questions into the pool. We used to do that pretty continuously, but I can't speak for Oracle on that topic.



I know that for the Sun exams, the pool was much larger than the number of questions on the exam, which encouraged people to actually study so they understood things and not try to just memorize answers.