Les Morgan

Rancher
+ Follow
since Sep 29, 2015
Les likes ...
Netbeans IDE Oracle MySQL Database Tomcat Server C++ Java
Cows and Likes
Cows
Total received
23
In last 30 days
0
Total given
1
Likes
Total received
185
Received in last 30 days
5
Total given
168
Given in last 30 days
5
Forums and Threads
Scavenger Hunt
expand Rancher Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Les Morgan

I've never found a recipe program that has the measures that I learned... a cup is when you cup your hands together, a tablespoon is the thumb place flat in the palm, and teaspoon is a finger place flat in the palm, and a half of each is the tip... a 1/4 teaspoon is the tip of your little finger in your palm, and any smaller is just a pinch--literally.

it works remarkably well, for a small recipe, but triple or more and it really is thrown off.

it doesn't work well for hot liquids either lol ;)
4 days ago
i know it well, as i am a assembly and machine language programmer retread.
Sakshi,
you look at that as a good thing, it can make debugging a nightmare.  i have not done that much development in Python to say i'm an expert or even good at it, but no declaration of variables has always led to confusion in every language that i've use that allows it.
Les

Sakshi Chaudhary wrote:The most widely used programming languages are Java and Python. Both are high-level, general-purpose programming languages that are widely used. Developers currently utilize the Java programming language to create online and desktop apps. Python is used to create a machine learning and data science applications.
Python is a dynamically typed, interpreted programming language. It signifies that no variables need to be declared. Because Java is a compiled and statically typed language, declaring variables directly is required. Python comes with a broad and well-rounded standard library. The library saves time and effort for the programmer.

1 week ago
Paul,
I completely agree.  Java used to be a delight to develop with in comparison to MS's run for the change, but any more there is no difference.  I have a VERY difficult time selling any of my clients on Oracle Java any more when their developers are facing the same things, with better support included in their Windows contracts, than Oracle is giving.

I really miss the days of the Volvo type of bettering the product, instead of releasing new versions very few months--they are out Microsofting Microsoft--and that is not a good thing!!!
Les

Paul Clapham wrote:It would be nice if the Java folks would produce a Release Document which lists all of the changes like that. But when I tracked down this document:

API Differences between Java SE 16 (build 36) & Java SE 17 (build 35) Compiled by Iris Clark

I realized that it would then be a monstrously large document. For example there's 191 "contexts", which term appears to mostly mean "methods", which are new. I see there's a new java.util.HexFormat class whose purpose is to convert between bytes and chars and hex-encoded strings. It supports a variety of decorations too -- but this one is mentioned in the Release Notes. The new methods don't make it into the Release Notes so we're left to stumble over them when browsing.

1 week ago
getting out my crystal ball and trying to expand on what Carey said:



and change this:


to this


and if i am correct, you'll have an instance variable, which is what i think you want.
1 week ago
Eric,

Another observations and deduction of the original code:

it was never meant to be a reader as far as read a line and and hand it off.  it is a buffer filler that curates the data into the form that is wanted.  since the buffer is available to the caller, because it's an array making it a reference, the caller can see how much data is there and call again if they feel they need to do so, but the routine is a very Ms way of filling a buffer and returning curated data.  that gives the reader, buffer filler, a layer of abstraction that is not openly visible to all--a very slight obfuscation.

Les
3 weeks ago
Eric,

the more i look at the code, the more i have to think it was put together by an MS programmer, if it's yours, i will quit wondering.

the exception is thrown if there is an error, the caller or somewhere up the calling chain has to deal with that.  returning 0 is a very Microsoft thing to do as it is standard that 0 indicates no errors in the Microsoft world, as would be the case if no exception is thrown, but if an exception is thrown the caller never sees the return value, but control is given to the exception handler that is available to catch it.

the data can be used if the Exception is not thrown.  The reason it is not a void return value is, as i have said, 0 is a Microsoft standard return value meaning no errors.

the other parts of the routine are as i said in my previous posts.

Les
3 weeks ago
imo: it is because the author of the routine is an MS programmer and not really a Java programmer--0 means no errors in MS land.

Eric Movsessian wrote:

Les Morgan wrote:Eric,

the 0 is just a flag saying it has completed, the byte array is an object reference, so it's a reference to the buffer from the super... the InputStream.  The routine is massaging the buffer and substituting the values show into the buffer (b) at the appropriate places and when the routing is done, the byte buffer has the massaged data inside of it--since it is a reference the caller has access to the massaged data.

Les

Eric Movsessian wrote:Hello)

So I have the read(read[] ) method overridden on my CustomInputStream which extends the FilterInputStream. The programm works wxactly the way I want it to.
I was wondering how does it even work if it says "return 0"?
What is the concept behind this?






Thank you very much for your answer.
I think I understand that but I was wondering that if the wanted result is reached and in this case I absolutely do not use the "0" that it returns then in what cases could the data that is returned be used? Why didn't they make this method void?

3 weeks ago
Eric,

the 0 is just a flag saying it has completed, the byte array is an object reference, so it's a reference to the buffer from the super... the InputStream.  The routine is massaging the buffer and substituting the values show into the buffer (b) at the appropriate places and when the routing is done, the byte buffer has the massaged data inside of it--since it is a reference the caller has access to the massaged data.

Les

Eric Movsessian wrote:Hello)

So I have the read(read[] ) method overridden on my CustomInputStream which extends the FilterInputStream. The programm works wxactly the way I want it to.
I was wondering how does it even work if it says "return 0"?
What is the concept behind this?


4 weeks ago
Campbell,

you are correct, but you have to prove libel or slander to collect damages.  Just because someone says something and it causes you hurt, doe not give grounds to collect damages, even though real loss may have occurred.  So in the absence of libel or slander, then there is truth.  if the truth was printed or said, then the damages are not collectable.  For instance: if you are a famous blonde model, and someone prints that you are, in fact, a natural redhead and it causes you financial harm, then the battle will be to prove who is right--the "lie" that you are a blonde, or the "truth" that you are a redhead.  once that is established, then libel or slander can be proven and damages can be collected.

i am not a lawyer, but so says my books on copywrite and business dealings in the software industry.

Les

Campbell Ritchie wrote:I didn't think you could prosecute anybody for libel and slander. You can only sue for compensation.

1 month ago
is it just the windows 10 firewall?

Maxim Markaitis wrote:tomcat 9
windows 10
standard settings
port: 8080

maybe firewall settings?
i have a standard windows 10 firewall

1 month ago
You will have to open the port for throughput in the firewall.  if i recall correctly, and i believe i do, requests are blocked by the firewall.

Maxim Markaitis wrote:tomcat 9
windows 10
standard settings
port: 8080

maybe firewall settings?
i have a standard windows 10 firewall

1 month ago
lol... yes, i cannot believe none of us did that---and here it is:

you are doing integer division.  integers are truncated for any non whole number, so 1/n always = 0.  you need to either cast everything to doubles or use doubles in your calculations--at least floats, but doubles would be better.
1 month ago
you have a very simple progression of 1/(i*2), where i runs from 1 to 50.  gives you ever even that you have shown, but that 1 becomes a non trivial problem unless you are given the series starts a 1 and you just have to generate the fractions.  if you must generate the 1, the problem becomes a lot less trivial as a series.
1 month ago
a1 is set to null, what that does is: the variable a1 referenced an object that was created and is now released--no references to it.  That object that a1 used to reference is now an orphaned object, no references to it, and is now eligible for garbage collection.

the object a2.b2 gets a reference to b2, it also has static reference a b1 object.  a2 is not set to null, so it retains it's references to its assigned objects.  the b1=null and b2=null only sets the variable reference b1 and b2 to null and does not affect the references in the a2 object. the object a2 remains in scope and referenced by a2 so it is not eligible for garbage collection.