« first day (3935 days earlier)      last day (1007 days later) » 

9:31 AM
Yo
request.AddParameter("application/json", "{\n \"orderId\": 123456,\n \"tagId\": 1234\n}", ParameterType.RequestBody);
How would you replace the orderId value with an object like order.OrderId
I was thinking of using $"{order.OrderId}" - but this does not in this case.
 
10:18 AM
it would
you probably just didnt do it correctly
other than that, perhaps it is easier to not mix languages
first make the object that you want to send, then convert that to json using something like json.net or newtonsoft.json
 
 
3 hours later…
12:59 PM
Okay thanks @Wietlol
 
 
2 hours later…
3:24 PM
Trying to get MySQL Connector/NET working on Ubuntu. Downloaded the compiled mono version and made sure to install mono-complete. Yet I keep running into FileNotFoundException: Could not load file or assembly 'System.Data, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of its dependencies.. Anyone here maybe able to give me some insight on how to solve it?
 
mr5
Can you try to remove that dependency?
 
3:44 PM
@mr5 Afraid not. The moment I remove it, tons of errors start popping up with the Connector
 
mr5
You can just re add it again.
Probably some cache related issue in VS
 
Oh no, that error doesn't pop up in VS, haha
VS works perfectly fine. It pops up after compiling my source that uses the connector and trying to run it on Ubuntu
 
mr5
Did you compile it against Release configuration?
 
No I compiled it against Debug
 
mr5
Which platform did you compile it with?
 
3:53 PM
Windows. Well not the connector DLL obviously. That one is just downloaded and used as a reference. It also works perfectly fine on Ubuntu as long as I don't use the connector. The moment I do, that error pops up
 
mr5
Probably a different version of .net runtime?
 
I actually asked the question here: stackoverflow.com/questions/68520169/… Maybe that'll make a lot more sense to you than just the few things I explained here
 
mr5
Why are you compiling and running it on a different platform btw? You can already build dotnet on Linux distros
 
My Linux knowledge is honestly pretty basic. I'm happy I can install it and do basic operations, but that's pretty much where my knowledge ends. Also, the Linux distro is a server. No UI. It wouldn't be that great to try and work on this through SSH
 
mr5
You just clone your code base in the Ubuntu, then dotnet build, and that's it.
When you install the dotnet cli, it will probably fix something on your Ubuntu.
Try to do this on your Windows machine as well.
And you might not need to compile this on Ubuntu, just ship the executable and run it.
 
4:01 PM
Hmm, well I can give it a go. There is no executable though. This is just a class library
 
mr5
then ship the .dll
Tried to reopen my project again after 4 months then NuGet starts asking me for credentials :/
 
 
2 hours later…
5:49 PM
What is the appropriate name for a class that contains the following fields:

float discount;
float numberofunit;
float unitprice;
Later I will make a list of objects of this class and calculate the total bill that someone must pay.

float sum=0;
for(int i=0;i<list.length();++i)
{

sum+=(1-list[i].discount)*list[i].numberofunit*list[i].unitprice;
}
 
MyExampleClass
 
@Wietlol Not good name.
 
every tutorial ever disagrees with you :)
 
I want to make a cash register with Android.
 
but generally speaking, you do not name classes based on their properties
you name it based on what it represents
so... what does it represent?
 
5:53 PM
There will be a recyclerView with a list of these objects.
It represents an item purchased by someone.
 
class ItemPurchasedBySomeone
ez pz
on a slightly less retardic note... PurchaseItem
 
CartItem OK. Solved. Thanks.
 
or CartItem
 
OK master. Thank you!
 
I initially thought OrderItem, but it would depend on if your purchases are always orders
CartItem, out of these, is the least ambiguous, so it is a very nice name
 
5:56 PM
I am leaving to continue my coding. Thank you very much!
 
(considering order and purchase can be both nouns and verbs)
hf
 
hf=?
Energy of one photon?
 
have fun
 
OK
I read from many sources that using BigDecimal is recommended for finance. So it is necessary to switch from float to BigDecimal for my CartItem fields mentioned above?
For you convenience, let me repost the previous fields:
float discount;
float numberofunit;
float unitprice;
 
6:54 PM
float and double are base 2 real number formats
BigDecimal is a base 10
so it wouldnt have rounding errors
usually, it doesnt matter a lot, but it is easier to just use BigDecimal and not worry about anything
also, BigDecimal has theoretically infinite precision and scale
unlike float/double
also, perhaps you should join the Java room
 
 
3 hours later…
9:28 PM
@Wietlol: Thank you master!
 

« first day (3935 days earlier)      last day (1007 days later) »