Frances Holland

Greenhorn
+ Follow
since Apr 29, 2021
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
1
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Frances Holland

Campbell Ritchie wrote:Welcome to the Ranch

We haven't worked out the “spam” problem, yet, but are still trying.
If you have a nested class with a static getPopulation() method, there is something iffy about that design. Why is MaleWC a nested class in the first place? Why is its population static?



Thanks for trying to help with Spam issue. Not a big deal, feel this is a bit of a lost cause.

MaleWC is a nested class (assuming the nested class bit is referring to creating it in the proto and then using it in the class, my syntax is bad) because there are several services that interact with several rooms and the original idea was that if population changed in one service it would be reflected in another. The dreams of mice and men. The goal has been massively scaled back due to how lost I am but that was the original intent. My first attempt was creating Room as it's own proto but I couldn't compile it so I settled with putting it in the most relevant proto.

MaleWC is static because if static is not added to I get the following error on the if clause and on other lines like the following

Cannot make a static reference to the non-static method MaleWC() from the type CapacityService




As for why the original class Room is the way it is, it's a generated class and I can't tell. It has this warning on top and I've been adhering to it

// Generated by the protocol buffer compiler.  DO NOT EDIT!

2 years ago
I had to reduce the code in the intended post to the bare minimum to avoid the Spam filter so can add any additions needed below upon request. Given the way this project has been going I will be glued to my PC for the next 60 hours
2 years ago
Hi, tried to post with the full code but got flagged as Spam so I'm trying it with the barest of info here. I am trying to write an if loop with this comparison but it isn't working at all, I think because the variables aren't assigning properly. I can't figure out how to debug it as it's a service initialization and us run from the client, which only debugs the client


Here, CapacityService is the service name, Male WC is an initilialization of a room class which was created in a different services proto. The initialization is as follows, the proto will be below that. Again, the room code from the proto comes from a different proto to the service being used




I genuinely have no idea what is wrong and am completely unsure of how to attack the problem. I have tried changing the if line to lots of things, the only thing that worked was 2>1. Any help appreciated

EDIT: I think it's possible everything is initializing as zero, hence the issues. Having a similar problem with a different, much simpler function. Used Bloom RPC to just test the input and modified the code to print out the request and got 0 as opposed to the input. Shown below.



Here, running the non commented out test, when I input  180, Bloom returns zero.
2 years ago