Frits Walraven

Creator of Enthuware JWS+ V6
+ Follow
since Apr 07, 2010
Frits likes ...
Android Eclipse IDE Chrome
Amersfoort, The Netherlands
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Rancher Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Frits Walraven

The problem is with the last enum value, that should end with a semicolon
1 month ago
Congratulations and welcome      
2 months ago

T h e . C o d e R a n c h . J o u r n a l  -  F e b r u a r y . 2 0 2 0 . E d i t i o n

A big howdy from all the CodeRanch staff, and welcome to the February edition of the CodeRanch Journal.

I n t e r e s t i n g . C o d e R a n c h . F o r u m . P o s t s
Here's some threads from this month that are worth giving a read:
  • Regex to parse simple fixed-format JSON
  • Question on Lower bounds
  • Help with Junit
  • pre-mature optimization: histogram
  • I want to ask why java doesn't support multiple inheritance
  • Avoid certification

  • Thanks to Kristina Hansen, Swapna latha, Prasanna Raman, Carey Brown, vibha Gupta and osko adamov for starting these topics and everyone else that joined in for the discussions.

    B o o k . P r o m o t i o n s
    There's a book (or software) promotion just about every week at CodeRanch. Just ask a question in the appropriate forum and you're eligible to win a copy of the book (or license).  Check the book promotions schedule

    Upcoming promotions in March:
  • Practices of the Python Pro
  •       Dane Hillard
          This book teaches you to design and write professional-quality
          software that’s understandable, maintainable, and extensible. Dane
          Hillard is a Python pro who has helped many dozens of developers
          make this step, and he knows what it takes. With helpful examples
          and exercises, he teaches you when, why, and how to modularize
          your code, how to improve quality by reducing complexity, and much
          more. Embrace these core principles, and your code will become
          easier for you and others to read, maintain, and reuse.

  • Deep Learning with JavaScript: Neural networks in TensorFlow.js
  •       Shanqing Cai, Stan Bileschi and Eric Nielsen
          With this book, you’ll learn to use TensorFlow.js to build deep
          learning models that run directly in the browser. This fast-paced
          book, written by Google engineers, is practical, engaging, and
          easy to follow. Through diverse examples featuring text analysis,
          speech processing, image recognition, and self-learning game AI,
          you’ll master all the basics of deep learning and explore advanced
          concepts, like retraining existing models for transfer learning
          and image generation.

  • Seriously Good Software
  •       Marco Faella
          Seriously Good Software takes you on a journey through software
          development best practices as you develop a simple inefficient
          implementation into a robust, professional-quality application.
          The deceptively-simple problem—balancing water levels in multiple
          connected containers—presents some interesting complexities as you
          optimize the code for speed, efficiency, and durability. Author
          Marco Faella’s passion for teaching shines bright as you learn to
          assess performance and write thread-safe code that’s easily
          readable, testable, and maintainable. Along the way, you’ll gain a
          keen sense of the trade-offs inherent to every programming task,
          no matter how simple.

  • TypeScript Quickly
  •       Yakov Fain and Anton Moiseev
          The book teaches you to exploit the benefits of types in
          browser-based and standalone applications. In this practical
          guide, you’ll build a fascinating blockchain service app that
          takes you through a range of type-sensitive programming
          techniques. As you go, you’ll also pick up valuable techniques for
          object-oriented programming with classes, interfaces, and advanced
          features such as decorators and conditional types.

  • Mastering Large Datasets with Python
  •        J. T. Wolohan
          Mastering Large Datasets with Python teaches you to write code
          that can handle datasets of any size. You’ll start with
          laptop-sized datasets that teach you to parallelize data analysis
          by breaking large tasks into smaller ones that can run
          simultaneously. You’ll then scale those same programs to
          industrial-sized datasets on a cluster of cloud servers. With the
          map and reduce paradigm firmly in place, you’ll explore tools like
          Hadoop and PySpark to efficiently process massive distributed
          datasets, speed up decision-making with machine learning, and
          simplify your data storage with AWS S3.

  • Hello World!
  •       Warren and Carter Sande
          Hello World! Computer Programming for Kids and Other Beginners,
          Third Edition introduces the world of computer programming in a
          clear and fun style. Using Python, a programming language designed
          to be easy to learn, each engaging lesson teaches skills that
          apply to any kind of programming. It brings to life the basic
          concepts of computing—looping, decisions, input and output,
          graphics, and more.

    This month's book promotion winners:
  • Docker in Action
  •       Winners: Ron McLeod, paul nisset, Will Myers and Tim Holloway
  • Secure By Design
  •       Winners: Campbell Ritchie, paul nisset, Vidya Nara and Jon Pelipas
  • GANs in Action
  •       Winners: navin rajpandey, Luis Trindade, Yury Nebieridze and Mike Savvy
  • WebAssembly in Action
  •       Winners: Campbell Ritchie, Bear Bibeault, satya Priya Sundar and Mike Savvy
  • Machine Learning for Business: Using Amazon SageMaker and Jupyter
  •       Winners: Gibran Castillo, Michael Ernest, meenakshi sundar and Harland Scott
  • Object Design Style Guide
  •       Winners: Knute Snortum, Mike Gosling, Mike Savvy and Campbell Ritchie

    And a big Congratulations to our past Winners

    T h e . M o o s e . i s . L o o s e . o n . S o c i a l . M e d i a
    The CodeRanch announces latest news/developments frequently on our social media outlets. You can find us at:

  • Follow / Like us so you don't miss a thing.

    O u r . S t a f f
    Thanks to all staff that volunteer their time and share their knowledge to make this site the friendliest place on the web to learn.  A special thanks this month to the following members ...
  • Marshals: Campbell Ritchie · Bear Bibeault · Paul Clapham · Jeanne Boyarsky · Knute Snortum
  • Sheriffs: Liutauras Vilda · Tim Cooke · Junilu Lacar
  • Saloon Keepers: Ron McLeod · Stephan van Hulst · Tim Moores · Tim Holloway · Carey Brown
  • Bartenders: Joe Ess · salvin francis · fred rosenberger

  • A b o u t . T h e . E d i t o r
    Ron McLeod has been a member of CodeRanch since 2013 and a Moderator since 2015.
    2 months ago
    Welcome Jeanne & Scott  

    Enjoy your book promotion week!
    Pass the test? Add your name to the wall, partner.

    OCMJEA Wall of Fame [order by Date]
    VersionNameFinal Exam DatePart 1 ScoreAssignment ScoreStoryAssignmentWhat's NextCountry
    JEE6Thierno DialloAugust 29, 201975%150/160-Retire EarlyTBDSwitzerland
    JEE6Adriano Palomino6th Apr 201981%148/160 Computer-Brazil
    JEE6Giritharan ThavalingamMay 25, 201876%140/160-Wireless Phone Company-Canada
    JEE6Mahmut ErenOctober 19, 201876%147/160-Quick Computer-Turkey
    JEE6Nataraj BasappaSeptember 26, 201873%152/160 Computer-UK
    JEE6Mustapha SENHAJIFebruary 03, 201873%142/160-Retire EarlyAWS Solutions ArchitectMorocco
    JEE6Gautam DebDecember 15, 201776%156/160-Retire Early-India
    JEE6Ernest BarrosoNovember 02, 201778%131/160Two months on the 3 stepsGemstone InternationalSpring Professional CertificationVenezuela
    JEE6Francesco FabiOctober 09, 201771%148/160-Team DoctorTOGAFItaly
    JEE6Om Narayan PandeyJune 26, 201780%156/160-Dream Car-India
    JEE6Samrat RoyMay 24, 201783%155/160 International-India
    JEE6Sanjay GarothayaMay 01, 201780%151/160-Team Doctor-USA
    JEE6Amine Ouali AlamiApril 02, 201778%156/160-Utility international-Morocco
    JEE5Rajesh NarayananMar 17, 201792%143/160-Team Doctor-India
    JEE6L. WitkowskiMar 1, 201771%140/160-Retire Early-Poland
    JEE6Rajesh Kumar SrivastavaJan 24, 201773%139/160-Utility InternationalExpertise in Machine Learning & AIIndia
    JEE6Raghavendra DesojuJan 23, 201783%149/160-Quick ComputerAWS Solutions ArchitectUSA
    JEE6Carlo CangemiDecember 23, 201688%144/160-Dream Car-Italy
    JEE6K. TsangDec 2, 201671%-(JEE5 upgrade)---Hong Kong
    JEE6Sergio Navarro GarzaMay 28, 201683%149/160-Utility InternationalTOGAFSpain
    JEE6Caio BessaMay 19, 201671%143/160-Retire EarlyIELTSBrazil
    JEE6Mithun M SMay 05, 201678%141/160StoryWireless Phone CompanyTOGAFIndia
    JEE6Yogaraj KhanalMarch 23, 201671%138/160-Quick ComputerOSCPNepal
    JEE6Angelo VerdicchioFeb 05, 201683%148/160-Factory HomesImprove design & architecture skillsItaly
    JEE5Sourav BiswasFeb 17, 201693%144/160-Retire EarlyImprove design & architecture skillsAustralia/India
    JEE6Siddhesh JogJan 27, 201676%146/160-Wireless Phone CompanyImprove design & architecture skillsIndia
    JEE6Mika KilpeläinenDec 7, 2015PP-Gusher OilHTML+CSSFinland
    JEE6Vijay SNNov 28, 201586%145/160 90%-Wireless Phone CompanyImprove Architect SkillsIndia
    JEE6Efthymia ArmanidiJune 2, 201571%149/160 93%-Team DoctorITILGreece
    JEE6Rodrigo CayresOct 19, 201581%153/160 96%-Big Smokes Cigar ShopOCEJEE6JSFD (JSF)Brasil
    JEE6Vijaya RaghavaSept 26, 201581%143/160-Team DoctorPMP, HadoopIndia
    JEE6Claudia ArévaloJun 25, 201588%153/160StoryFactory HomesTOGAFColombia
    JEE6Heliton Rodrigues Aranha FilhoApr-30-201573%NA (JEE5 Upgrade) (JEE5 Upgrade)TBDBrazil
    JEE5K. TsangMar 4, 201589%144/160part1 part2/3Quick Computer-Hong Kong
    JEE6Mike DegteariovMar-31-201578%151/160-Team DoctorHadoopCanada
    JEE6Bora SevenMar-12-201571%140/160StoryBig Smokes Cigar ShopTOGAF9Turkey
    JEE5Heliton Rodrigues Aranha FilhoOct-18-201471%141/160 HomesTBDBrazil
    JEE6Rahul SharesthSep-19-201483%141/160-DreamcarTBDIndia
    JEE6Mahavir SinghAug-10-201471%140/160-Utility InternationalImprove Architect skillsIndia
    JEE5Anuj SethiJul-1-201490%141/160-Team DoctorImprove architect skillsIRE
    JEE6Raffaele SangiovanniMay-1-201480%153/160-Wireless Phone CompanyScrumITA
    JEE5Pothiraj MarichamyMar-1-201495%P-Team DoctorTBDUSA
    JEE5Uma Monday2014-02-2895%145/160-Gemstones InternationalTOGAF9USA
    JEE5Sirish K Somanchi2013-06-1178%152/160-Team DoctorTOGAF9India
    JEE5Marco Bresciani2013-01-3164%134/160-Wireless Phone CompanyRuby and RoRItaly
    JEE5Subrahmanyam BV2012-12-1589%152/160-Team Doctor-India
    JEE5Sachin Dixit08-Dec-201278%144/160-Team DoctorPMPIndia
    JEE5Diego Lins de Freitas11-October-201285%140/160-Quick ComputerIEEE - CSDPBrazil
    JEE5Juan Gonzalez del Pino11-October-2012PPStoryGusher OilNot sureSpain
    JEE5Chandra S Billanuka15-July-2012PP-Wireless Phone CompanyTBDUSA
    JEE5Chennakrishna R Gottam29-July-2012PP-Gusher OilPEGAUSA
    JEE5Srinivasulu Kopparapo06-July-2012P71%"Here"Gusher OilJava Enterprise Edition Certified MasterUSA
    JEE5Sudha Sundar18-Feb-2012P153/160HereGusher OilOracle IT Implementation Specialist, PMPUSA
    JEE5Neeraj Javiya21-Jan-2012PPHereTeam DoctorTBDUSA
    JEE5Mahesh R. Desai12-Dec-2011PP-NA (JEE5 Upgrade)Oracle Linux Fundamentals, PMPCalifornia, USA
    JEE5Sada Kurapati22-Dec-201195%146/160Part I StoryGusher OilTOGAFUSA
    JEE5Mahesh R. Desai12-Dec-2011PP-NA (JEE5 Upgrade)Oracle Linux Fundamentals, PMPCalifornia, USA
    JEE5Eric Manuguerra04-Oct-201185P-Factory HomesTBDFrance
    JEE5Mayur Bodkhe27-Sep-2011P143/160-Wireless Phone CompanyTBDUK
    JEE5Sankha S Pathak27-Aug-2011P155/160-Wireless Phone CompanyTOGAFINDIA
    JEE5Vignesh Murali Natarajan21-Aug-2011100P-Big Smokes Cigar ShopPMP?India
    JEE5M. A. Riveros T.21-Aug-2011PP-DreamcarTBDColombia
    JEE5Jari Timonen29-JUN-2011PPPart1Factory Homes-Finland
    JEE5Roxana Crisan17-Jun-201193P-DreamcarTBDRomania
    JEE5Tan Chin Sheng12-Jun-201196P-Factory HomesTOGAF9Singapore
    JEE5Ashutosh Sharma29-Mar-2011PPHereBig Smokes Cigar ShopTOGAF9USA
    JEE5Martin Zisler19-Jan-2011PP-Gusher OilJEE6 WebservicesSwitzerland
    JEE5Wolfgang Unger21-Dec-2010PP-Big SmokesHoliday in BrazilGermany
    JEE5Jeanne Boyarsky17-Nov-201087PHereFactory HomesTBDUSA
    JEE5Rupesh Kumar17-Nov-201082P-Dream CarTBDUSA
    JEE5Sylvain Duchesne12-Nov-2010PP-Dream CarSCEA for Java EE6 - UpgradeCanada
    JEE 5Ravi Iyer21-Oct-2010PPStoryFactory Homes-India
    JEE5Kuppusamy Venkatasubramanian19-Jul-201085PHereDream CarTBDSingapore
    JEE5Varun Chopra03-Mar-201096PStoryFactory HomesTBD-
    JEE5Jose Luis Iturbide24-Apr-200971PStoryFactory HomesSpring & AndroidMexico
    J2EEGabriel Belingueres30-Dec-20088591-Fly By Night--
    J2EEStefan Meier29-Dec-20088977StoryFly By NightSCEA5 Upgrade-
    J2EEMahesh R. Desai12-Dec-20088189StoryFly By NightSCEA for Java EE6 - UpgradeCalifornia, USA
    J2EEPaul Michael5-Nov-20089177StoryFly By NightFlex or .Net-
    J2EEAbhinav Srivastava6-jul-20088995hereFly By Night  --
    J2EEAshish Sarin15-Aug-20087092hereFly By NightTOGAF-
    J2EEPatrick Williams14-Nov-20078587StoryFly By NightSCJD & Upgrades-

    Other Java Certification Wall of Fames

    SCJA Wall of FameSCJP Wall of FameSCJD Wall of FameSCBCD Wall of Fame
    6 months ago
    I am sorry about that, can you post the information here so that I can put it there for you?

    Piet Souris wrote:@Frits
    in your code snippet you changed OP's 'notify' to 'notifyAll'. You didn't mention it, that change is essential to make the code run, otherwise it is very likely to block. That becomes more apparent if you do: Producer2 p1 = new Producer2(c, 11 - i);

    You are right!

    @Mark: Can you explain why it is essential to use notifyAll?
    6 months ago
    Hi Mark,

    Great that you solved your problem, but you were actually almost there with your first implementation.

    1. When you call wait you tell the thread to wait but with my current understanding the thread can only be "awoken" by assigning it an object to listen to, often called a lock.

    Yes, but instance methods are synchronized over the instance of the class owning the method. So in your first example the CubbyHole was used as the object to lock on. Note also that you instantiated one CubbyHole object.

    Slightly changing your first implementation:

    results in:


    6 months ago

    Second question: I found (practically) that the following mapping:

    I can only answer your question from the specs (just looking at JPA 2.0 section 2.4.1)

    The correct mapping is is the one where you explicitly tell the JPA provider that the "masterKey" attribute of the OrderDetailKey contains the mapping to the OrderMaster. (you can leave out the "masterKey" attribute from the annotation @MapsId("masterKey") when the composite key of the OrderDetail and OrderMaster are the same, but the @MapsId should be there.)

    When using the @MapsId annotation, the specs state that:

    The embedded id attributes that correspond to the relationship are treated by the provider as “read only”—that is, any updates to them on the part of the application are not propagated to the database.

    That the mapping without the @MapsId works can be luck or can be a non-spec-related feature of the JPA implementation you are using. (it might not be portable to another JPA implementation)
    Hi Hanumant,

    Welcome to the ranch (again) and enjoy your promotion week!
    8 months ago
    Congratulations guys, well deserved  
    9 months ago