Henry Wong

author
+ Follow
since Sep 28, 2004
Henry likes ...
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
New York City
Cows and Likes
Cows
Total received
141
In last 30 days
1
Total given
667
Likes
Total received
2234
Received in last 30 days
3
Total given
328
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Rancher Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Henry Wong

CodeRanch Book Promotions - This Year's Winners


A big Congratulations to all our winners!

See our BookPromotions2018Winners

DateCoverBookAuthor(s)PublisherWinnersStatus
January 8Electron in ActionSteve KinneyManningSalvin francis , Paul Anilprem , Tony Esposito , charles rossSent in winners (1/20/19)
January 15
Hands-On Software Engineering with PythonBrian AllbeePacktPaul Nisset, Carl Byrd, Scott Mac Donald, Campbell RitchieSent in winners (1/20/19) (Carl Byrd received)
January 22
Get Programming with Java (MEAP only)Peggy FisherManningtangara goh, Manos Marketos, Fred Kleinschmidt, Daniel AnderssonSent in winners (1/28/19)
January 29Java in a NutshellBen Evans & David FlanaganO'ReillyWill Myers , Vanessa Williamson, Dave Tolls , Cezar ApulchroWinner reported received (3/1/19)
February 12Java XML & JSONJeff FriesenApresspaul nisset, Carl Byrd, Jorge Ruiz-Aquino, ludoviko azuajeWinner reported received (2/25/19) (Carl Byrd received)
February 19Kotlin for Android App DevelopmentPeter SommerhoffAddison-Wesley ProfessionalSean Corfield, Dave MacLean, Terry Broman, paul nisset, Rania BradburyWinner reported received (4/9/19)
February 26Head First KotlinDawn & David GriffithsO'ReillyWill Myers, Celso Furtado, Al Hobbs, Ron McLeodWinner reported received (3/29/19) (Ron McLeod)
March 12Core Java, Volume II--Advanced FeatureCay HorstmannPrentice HallStephan van Hulst, Zulfi Khan, paul nisset, Tim HollowayWinner reported recieved (4/9/19)
March 19Python Continuous Integration and DeliveryMoritz LenzApresslRogerio Kioshi, Travis Risner, M Khalid, Carl ByrdWinner reported received (10/9/19)     (M Khalid Received)
March 26Head First GoJay McGavrenO'ReillyRyan Jumawan, Timur Radzhabov, Rob Spoor, Will MyersWinner reported received (4/5/19) (Rob Spoor)
April 9Servless Programming CookbookHeartin KanikathottuPacktLanny Gilbert, Lucian Revnic, Liutauras Vilda, Billy TsaiSent in winners (5/8/19)
April 16Production Ready Serverless (Video)Yan CuiManningCarl Byrd, Timur Radzhabov, Divya Shiv  Sent in winners (5/8/19)
April 23Serverless Applications with Node.jsSlobodan Stojanovic  & Aleksandar Simovic  Manningsourabh girdhar, Tim Holloway, Noorul Hameed, saad el khlifiSent in winners (5/8/19)
April 30Natural Language Processing in ActionHobson Lane, Hannes Hapke & Cole HowardManningpaul nisset, Claude Moore, Carl Byrd, Christian NicholsonSent in winners (5/18/19)
May  14Building Ethereum DAppsRoberto InfanteManningMichael Krimgen, Joe Cortee, paul nisset, ludoviko azuaje  Sent in winners (5/18/19)
May  21Grokking BitcoinKalle RosenbaumManningHimanshu Ahuja, Carl Byrd, Timothy Richards, Tim MooresWinner reported received (6/19/19) (Tim Moores)
May  28The Well-Grounded RubyistDavid A. Black & Joseph Leo IIIManningAnna Baik, meenakshi sundar, Tony Esposito, Sam MaghettWinners sent to publisher (6/18/19)  Received 6/20/19 (Anna Baik), Received 6/27/19 (Tony Esposito)
June 4Classic Computer Science Problems with PythonDavid KopecManningTim Holloway, D.J. Quavern, Piet Souris, Tony Esposito Sent in winners (7/17/19)
June 4The Joy of JavaScriptLuis AtencioManningSunderam Goplalan, Carl Byrd , satya Priya Sundar, Timur RadzhabovSent in winners (7/17/19)
June 11Programmers Guide to Apache ThriftRandy AbernethyManningTimur Radzhabov, Carl Byrd, Tim Moores, Randy TongSent in winners (7/17/19) Received ebook 7/18/19 (Randy Tong, Tim Moores)
June 25Java Database Connections & Transactions (e-book only)Marco BehlerSelf PublishedDinkar Chaturvedi, genos raman, Salil Wadnerkar, Ray JenderWaiting on winners info
July 9Learn Data Structures and Algorithms with GolangBhagvan KommadiPacktRhul Kug, Devanshi Arora, Stephane Clinckart, Shikhar Vinesh SinghSent in winners info (9/4/19)
July 30Reactive SpringJosh LongLean PublishingBaskar Krishna, Wirianto Djunaidi, Ravi Desai, Chintan SanghaviSent in winners info (9/4/19)
August 13Cloud Native PatternsCornelia DavisManningMatthew Keller, paul nisset, Carl Byrd, Liutauras VildaSent in winners info (9/4/19) Carl Byrd received
August 13Natural Language ProcessingHobson Lane, Hannes Hapke  and Cole HowardManningCarl Byrd, Terseer Anthony ShaguySent in winners info (9/4/19)
August 20Event Streams in ActionAlexander Dean & Valentin CrettazManningBabi Astimal Astimal, Stephan van Hulst, Raghunatha Reddy, Marco Schoolenberg  Waiting for winners info
August 27Phoenix in ActionGeoffrey LesselManningTimur Radzhabov, Milan Bhagwat, Carl Byrd, ludoviko azuajeWaiting for winners info
September  3The Java Module SystemNicolai ParlogManningSai Hegde, Will Myers, satya Priya Sundar, Piotr NowickiWaiting for winners info
September  10OCP Oracle Certified Professional Java SE 11 Programmer I Exam Fundamentals 1Z0-815 (e-book)Hanumant DeshmukhEnthuwareRanjith Kumar Kumar, Geff Chang, Adrian Grabowski, Elias Khan  Waiting for winners info


Note: All dates in mm/dd/yyyy format.

Go back to the main BookPromotions page.

For questions about this page or to schedule a promotion, contact: bookpromotion AT javaranch DOT com
4 days ago

First, a big thanks to Hanumant Deshmukh for being here to promote OCP Oracle Certified Professional Java SE 11 Programmer I Exam Fundamentals 1Z0-815.

The winners are:

   Ranjith Kumar Kumar
   Geff Chang
   Adrian Grabowski
   Elias Khan

Please send your snail mail address to bookpromotion AT javaranch DOT com. To ensure the quickest response, please provide the following:

Your name (first and last - if your CodeRanch name is different, please include both your real name and Ranch name)
Email
Country (needed even if requesting an e-book)


Also, please include the following as the subject of your Email.

Promo Winner - OCP Oracle Certified Professional Java SE 11 Programmer I Exam Fundamentals 1Z0-815 - Tuesday, September 10th, 2019


Image from https://images-na.ssl-images-amazon.com

As noted in the Book Promotion Eligibility Requirements and Legal type stuff, the winners have 8 days to submit their information. Within 3 days of receipt of your email, we will reply to let you know we got it. If you don't hear back, the goat might have eaten your email. Please let us know by posting in the Ranch Office so we can check on it. Once you have received your copy please let us know by editing the Book Promotions Winners Page and updating the 'Status' column to say you have it.

Thanks and congrats to all the winners.

This week, we're delighted to have Hanumant Deshmukh helping to answer questions about the new OCP Oracle Certified Professional Java SE 11 Programmer I Exam Fundamentals 1Z0-815.


The promotion starts Tuesday, September 10th, 2019 and will end on Friday, September 13th, 2019

We'll be selecting four random posters in this forum to win a free copy of the electronic book/resource provided by the publisher, Enthuware .


Image from https://images-na.ssl-images-amazon.com

Please see the Book Promotion page to ensure your best chances at winning!

Posts in this welcome thread are not eligible for the drawing, and should be reserved for welcoming the author. Questions posted in this topic are subject to removal.

First, a big thanks to Alexander Dean & Valentin Crettaz for being here to promote the book Event Streams in Action.

The winners are:

   Babi Astimal Astimal
   Stephan van Hulst
   Raghunatha Reddy
   Marco Schoolenberg

Please send your snail mail address to bookpromotion AT javaranch DOT com. To ensure the quickest response, please provide the following:

Your name (first and last - if your CodeRanch name is different, please include both your real name and Ranch name)
Email
Country (needed even if requesting an e-book)
Address
Phone Number


Also, please include the following as the subject of your Email.

Book Promo Winner - Event Streams in Action - Tuesday, August 20th, 2019


Image from https://m.media-amazon.com

As noted in the Book Promotion Eligibility Requirements and Legal type stuff, the winners have 8 days to submit their information. Within 3 days of receipt of your email, we will reply to let you know we got it. If you don't hear back, the goat might have eaten your email. Please let us know by posting in the Ranch Office so we can check on it. Once you have received your copy please let us know by editing the Book Promotions Winners Page and updating the 'Status' column to say you have it.

Thanks and congrats to all the winners.
3 weeks ago

This week, we're delighted to have Alexander Dean & Valentin Crettaz helping to answer questions about the new book Event Streams in Action.


The promotion starts Tuesday, August 20th, 2019 and will end on Friday, August 23rd, 2019

We'll be selecting four random posters in this forum to win a free copy of the book provided by the publisher, Manning Publications.


Image from https://m.media-amazon.com

Please see the Book Promotion page to ensure your best chances at winning!

Posts in this welcome thread are not eligible for the drawing, and should be reserved for welcoming the author. Questions posted in this topic are subject to removal.
4 weeks ago

Bhupinder Verma wrote:It sound funny that I am replying on this post after so long, but it may be helpful to someone else stuck with similar sort of problem.

Any feedback is highly appreciated.



Wow. After five years? That's dedication... Have a cow ...

Henry
2 months ago

Sanjana Senthil wrote:
Hey everyone, I keep getting a syntax error for the else statement....i'm pretty sure my curly brackets are fine .....help would be very appreciated!



There is no such a thing as a while-else statement (meaning else following while) in Java.

Henry
2 months ago

Vaibhav Gargs wrote:
Hi Campbell, I am not sure if any such CPU exists but since these are some special instructions such as CAS etc. which made me think that these instructions will be supported by all CPUs or not?



The CAS instruction is supported by all modern day processors. Keep in mind that the CAS instruction is also needed by the JVM to implement synchronization, so, if the CAS instruction doesn't exist (like with really old JVMs), then a work around has already been implemented.

Henry

Arun Singh Raaj wrote:what kind of lock system does AtomicInteger uses?



The AtomicInteger class uses a technique call "optimistic locking". This means that there isn't any locks...  

Instead, there is a mechanism that is used to detect collisions -- and of course, if it does collide, then there is a mechanism to resolve it (which is just to retry the operation, in most cases). The idea is... since a collision will not happen for a majority of cases, it will run really fast (since there isn't any locks).

Henry

First, a big thanks to Roberto Infante for being here to promote the book Building Ethereum DApps: Decentralized Applications on the Ethereum Blockchain.

The winners are:

   Michael Krimgen
   Joe Cortee
   paul nisset
   ludoviko azuaje

Please send your snail mail address to bookpromotion AT javaranch DOT com. To ensure the quickest response, please provide the following:

Your name (first and last - if your CodeRanch name is different, please include both your real name and Ranch name)
Email
Country (needed even if requesting an e-book)
Address
Phone Number


Also, please include the following as the subject of your Email.

Book Promo Winner - Building Ethereum DApps: Decentralized Applications on the Ethereum Blockchain - Tuesday, May 14th, 2019


Image from https://m.media-amazon.com

As noted in the Book Promotion Eligibility Requirements and Legal type stuff, the winners have 8 days to submit their information. Within 3 days of receipt of your email, we will reply to let you know we got it. If you don't hear back, the goat might have eaten your email. Please let us know by posting in the Ranch Office so we can check on it. Once you have received your copy please let us know by editing the Book Promotions Winners Page and updating the 'Status' column to say you have it.

Thanks and congrats to all the winners.
4 months ago

This week, we're delighted to have Roberto Infante helping to answer questions about the new book Building Ethereum DApps: Decentralized Applications on the Ethereum Blockchain.


The promotion starts Tuesday, May 14th, 2019 and will end on Friday, May 17th, 2019

We'll be selecting four random posters in this forum to win a free copy of the book provided by the publisher, Manning Publications.


Image from https://m.media-amazon.com

Please see the Book Promotion page to ensure your best chances at winning!

Posts in this welcome thread are not eligible for the drawing, and should be reserved for welcoming the author. Questions posted in this topic are subject to removal.
4 months ago
Integer objects are immutable. You can't just increment it. When you do that in Java, the compiler will generate code (as syntactic sugar) to unbox, increment, and box the value again. This means that it is a completely different object after the increment.

And in your application, which has different references pointing to what was originally the same object -- they are now different references pointing to different objects (with different values).

Henry

John Losty wrote:

Then at runtime, order of evaluation is always left to right: ...



also this isn't clear to me as at some point he stopped evaluating from left to right and first evaluated inside brackets.



Actually, this is not true. Others have already posted information on how to interpret the evaluation, so, I will not continue on that... except to add...

Evaluation to completion are not equal -- meaning it takes longer to complete evaluation of a longer sub expression (either with parenthesis, or added parenthesis which were done to respect precedence/associativity). When the Java specification states that the evaluation is done "left to right" (in addition to the rules on respecting precedence/assoc, parameters, etc.), it is referring to when the evaluation of the sub expression starts -- and not when it completes.

If you review Stephen's example again, and look at when the evaluation starts, you will see that he is indeed, evaluating left to right.

EDIT: Okay, in reviewing again, it may not be that easy to see. If I have time later, I will do a quick write up, and the start points, and how it is left to right.

Henry
4 months ago