Win a copy of AWS Security this week in the Cloud/Virtualization forum!

Adrian Grabowski

Rancher
+ Follow
since Jun 22, 2018
Adrian likes ...
Mac OS X IntelliJ IDE
Cows and Likes
Cows
Total received
7
In last 30 days
0
Total given
0
Likes
Total received
37
Received in last 30 days
5
Total given
39
Given in last 30 days
2
Forums and Threads
Scavenger Hunt
expand Rancher Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Adrian Grabowski

For the front-end stuff, in addition to showing your websites here,  I recommend signing up for freeCodeCamp, they have some projects there that you can complete and the forums are very busy, you will get more feedback.

Anand Hariharan wrote:To a beginner to programming, would you really teach exception handling and KeyError in dictionary access, before you teach if statement?



I assume that they were taught "if" statements already and now are moving into more advanced concepts. I might be wrong.
2 weeks ago

Anand Hariharan wrote:

Logan Cherry wrote:(Hint: You may NOT USE any 'if' statements.)



I find that rather silly as a requirement and bizarre as a "Hint".



It might make sense in a learning environment I guess, you don't really need "ifs" for this assignment.

Logan, Python doesn't have a "switch" statement afaik so I guess you are supposed to use a dictionary, you almost got it right, google the syntax and; also, your program is supposed to read integers
2 weeks ago
comment out line 40 and print out just the (sum / count), this should give you some idea what you are doing wrong

however this error message comes from the fact that you are trying to fit a double in a float
2 weeks ago
I'm not sure but you might find it easier to use Maven:

https://openjfx.io/openjfx-docs/#maven
2 weeks ago

Stephan van Hulst wrote:Why does your business code double as step definitions?



I'm not sure if I understand, apologies if I have misused some terminology. I'm testing publicly accessible API, it's the most external part of the system at this point. I'm not testing UI if that's what you meant.
2 weeks ago

mike lim wrote:why does Java have to configure your router/firewall..



It's nothing to do with Java. If you host your server app on some VPN than your client apps can connect it with no problems just by providing the IP address (and port), no port forwarding needed.
You will need to find out your public IP address and then set up port forwarding on your router.
Thank you so much, I don't know how I missed that.. you saved me a lot of time

Stephan van Hulst wrote:

By the way, what's the point of keeping your request and response as instance fields? Just use local variables as I've shown above.



Yes, I don't like doing it like this way too but the response object must be visible to other methods too. I'm creating step definitions for my Cucumber tests and each step definition is represented by a method, using instance variables seemed like the simplest way to do it. Then I can reuse the same step in different scenarios. I'm not sure if it makes sense, there might be a cleaner way to do it but I haven't figured it out yet.
2 weeks ago
Hi

I'm writing some tests for my REST API using Apache HttpClient and I guess I'm doing something wrong, first few requests work fine but at some point, they just stop working. The server doesn't receive the request. The client code (test) doesn't fail, it looks like it's waiting for a response but nothing gets to the server. I can do another request in the meantime from browser or Postman and they work. The request that fails works on its own, just not when there were few requests before that.

That's how I create the httpClient:



And I call my API like this:



Any chance somebody could tell me what I'm doing wrong? I can't figure it out Many thanks




3 weeks ago

Tim Holloway wrote:That 1..n simply indicates a one-to-many relationship. And "n" can be zero in a case where your cart is empty.



Just wanted to clarify one thing: when I say 1..*, 0..* or 0..5 I mean the multiplicity on one side of the relationship where dots indicate the range, not the line between two classes.
3 weeks ago

Campbell Ritchie wrote:1....n does occur. It means you can't have an order without a customer ordering it.



There is 1 on the Customer side so I would understand it as exactly one Customer per order. n is on Order side so, according to my basic knowledge of UML, it means that we can have * (many) orders (including zero). If it was 1..* I would read it as "many orders but at least one".
3 weeks ago
I think that this arrow shouldn't be there. You have multiplicities on both sides which mean that both classes "know" about each other: each Order is associated with exactly one Customer and a Customer can have many orders (don't know why there is n instead of 0..*, haven't seen this one before). I don't think there is enough detail in the class diagram itself to implement it with code.
3 weeks ago
Double-check if you copied it correctly, the way it is now it's not going to compile.