« first day (3344 days earlier)      last day (1587 days later) » 

3:45 AM
@CaptainSquirrel I used discord for image hosting, paste into discord and get permanent link, that was deliciously convenience
 
mr5
Math.Round(0.111, MidpointRounding.AwayFromZero) == 0
how can I make it 1 instead of 0?
 
Rob
Ceiling
 
mr5
!~>Math.Ceiling(0.111)
 
!=>1.0
 
mr5
3:48 AM
!~>Math.Ceiling(24.0111)
 
!=>25.0
 
mr5
@Rob thanks man
 
Rob
No problem
 
mr5
you always appear when I have a question :D
 
rob just a little faster because i check for ceiling have typo or not :(
!~>Math.Floor(24.0111)
!=>24.0
!~>Math.Wall(24.0111)
<!>'Math' does not contain a definition for 'Wall'
 
mr5
3:50 AM
lol
Math has up and bottom corner of the house but not wall
!~>Math.Corner(0)
 
<!>'Math' does not contain a definition for 'Corner'
Then creates it with extension method
 
mr5
what would it do then?
 
Math.Wall()=>return Math.Floor+0.5;
hehe
 
mr5
Math.Wall = (e) => Math.Tan(Math.Floor(e), Math.Ceiling(e))
I'm not sure if Tan accepts two param though
 
mathemagics
check this class, a struct version of string
and worked flawlessy
its inside some expensive commercial accounting software
 
mr5
4:00 AM
why would you do that?
what's wrong with System.String?
 
i dont know
im not using that
 
mr5
"accounting"
it's those who does money always makes everything extra complicated
I wonder what did they talk about when they created that type as replacement for string
So
somebody is claiming that int.TryParse is faster compared to int.Parse
then I remember this:
1465
Q: Try-catch speeding up my code?

Eren ErsönmezI wrote some code for testing the impact of try-catch, but seeing some surprising results. static void Main(string[] args) { Thread.CurrentThread.Priority = ThreadPriority.Highest; Process.GetCurrentProcess().PriorityClass = ProcessPriorityClass.RealTime; long start = 0, stop = 0, e...

and a custom TryParseInt would yield more performance increase compared to that built-in
it seems the bug hasn't fixed yet or int.Parse is just slow?
I thought int.TryParse is a lot slower but I was wrong.
 
4:24 AM
!~>()=>{
var i = 0L;
var t = DateTime.Now+new TimeSpan(0,0,4);
while (DateTime.Now<t){
i+=int.Parse("1");
}
return i;
}
!=>13564745
!~>()=>{
var i = 0L;
var t = DateTime.Now+new TimeSpan(0,0,4);
while (DateTime.Now<t){
var ti = 0;
int.TryParse("1",out ti);
i+=ti;
}
return i;
}
!=>13615489
no difference
 
4:54 AM
<!>The type or namespace name 'Diagnostic' does not exist in the namespace 'System' (are you missing an assembly reference?)
<!>'Stopwatch' does not contain a definition for 'Elapse' and no accessible extension method 'Elapse' accepting a first argument of type 'Stopwatch' could be found (are you missing a using directive or an assembly reference?)
<!>The type or namespace name 'Diagnostic' does not exist in the namespace 'System' (are you missing an assembly reference?)
 
mr5
!~>()=>{
var i = 0L;
var sw = System.Diagnostics.Stopwatch.StartNew();
while (i++ < 1_000_0000){
var b=int.Parse("1");
}
sw.Stop();
return sw.Elapsed.TotalSeconds.ToString("N2");
}
 
!=>"0.72"
 
mr5
!~>()=>{
var i = 0L;
var sw = System.Diagnostics.Stopwatch.StartNew();
while (i++ < 1_000_0000){
var b=int.TryParse("1", out var _);
}
sw.Stop();
return sw.Elapsed.TotalSeconds.ToString("N2");
}
 
!=>"0.71"
 
mr5
!~>()=>{
var i = 0L;
var sw = System.Diagnostics.Stopwatch.StartNew();
while (i++ < 1_000_0000){
var b=int.Parse(i.ToString());
}
sw.Stop();
return sw.Elapsed.TotalSeconds.ToString("N2") + "s";
}
 
4:56 AM
!=>"2.24s"
 
mr5
!~>()=>{
var i = 0L;
var sw = System.Diagnostics.Stopwatch.StartNew();
while (i++ < 1_000_0000){
var b=int.TryParse(i.ToString(), out var _);
}
sw.Stop();
return sw.Elapsed.TotalSeconds.ToString("N2") + "s";
}
 
!=>"2.20s"
 
mr5
there's a little difference
!~>()=>{
var i = 0L;
var sw = System.Diagnostics.Stopwatch.StartNew();
while (i++ < 10_000_0000){
var b=int.Parse(i.ToString());
}
sw.Stop();
return sw.Elapsed.TotalSeconds.ToString("N2") + "s";
}
 
-!!>SandBox: Unable to complete invocation by given 5 seconds
 
mr5
!~>()=>{
var i = 0L;
var sw = System.Diagnostics.Stopwatch.StartNew();
while (i++ < 5_000_0000){
var b=int.TryParse(i.ToString(), out var _);
}
sw.Stop();
return sw.Elapsed.TotalSeconds.ToString("N2") + "s";
}
 
5:07 AM
!~>()=>{
var i = 0L;
var sw = System.Diagnostics.Stopwatch.StartNew();
while (i++ < 1_900_0000){
var b=int.TryParse(i.ToString(), out var _);
}
sw.Stop();
return sw.Elapsed.TotalSeconds.ToString("N2") + "s";
}
!=>"4.35s"
it has a invocation benchmark in code worker by !~+
 
mr5
!~>()=>{
var i = 0L;
var sw = System.Diagnostics.Stopwatch.StartNew();
while (i++ < 5_000_0000){
var b=int.Parse(i.ToString());
}
sw.Stop();
return sw.Elapsed.TotalSeconds.ToString("N2") + "s";
}
 
-!!>SandBox: Unable to complete invocation by given 5 seconds
 
mr5
@nyconing is this a reply from you or bot?
 
!~+()=>{while (i++ < 1_900_0000){int.TryParse(i.ToString(), out var _);}}
!~+()=>{var i = 0L;while (i++ < 1_900_0000){int.TryParse(i.ToString(), out var _);}return i;}
!=>19000001
!>>CodeWorker complete in 5185ms
!~+()=>{var i = 0L;while (i++ < 1_900_0000){int.Parse(i.ToString());}return i;}
!=>19000001
!>>CodeWorker complete in 5048ms
well... difference is too little to be benchmark inside 5s
 
5:27 AM
The dumbest thing I've heard these years is digital nation
It keeps asking people to pay for them and become residents
Of the thousand people who have given money, I really don't know why they want to give money?
 
5:55 AM
i need help with immutable classes
i fil em with some data, later on i need them immutable
how the f do i do that?
 
 
1 hour later…
7:07 AM
is it possible to create a back end using asp.net for a mobile game using azure services
 
Yep
 
Good morning!
 
congolexicomatisation
^ english? spanish? france?
 
@Adan what don't you understand?
 
how to work the code into an immutable code
im ignorant to the concept
 
@Adan you can create properties with only private setters ` { get; private set; }` and take parameters in the constructor. Is that immutable enough?
I mean...the easiest way to have an immutable class is to not write code that changes it
 
7:34 AM
i appreciate the input ; ), let me try to update the code with that
would that go on the 'list' statement? or the class of variables segment?
 
On the class
 
thanks
 
Or are you asking to be able to stop the membership of the list from being changed? Or both?
 
Immutable is just the concept of making new objects instead of mutating them. Thus, for all your classes, don't allow setters of any kind. For collections, use Immutable* collections.
 
immutable objects can technically have state, but it must be entirely internal and shouldn't affect behavior when called using public methods
like, say, smart pointers keeping track of number of references or something I suppose
kind of a niche case though
 
7:47 AM
@RoelvanUden how do you assign their values then?
 
@TomW make new objects
 
How?
 
No, you explain what you mean
 
Why? You know this.
 
7:48 AM
If you have a class with properties, how do those properties get non-default values when the class is created?
 
Using a constructor or a builder pattern.
 
With explicit backing fields?
 
Doesn't matter if it's implicit or explicit. Just have no setters that mutate state.
 
@TomW you use the constructor to initially assign its values
beyond that, nothing.. they don't change
 
@TomW theres a for loop that tests the class
 
7:51 AM
@Neil I know that. Roel said "don't allow setters of any kind". Auto props won't accept an assignment anywhere including the constructor without a setter
 
if you wanted to create a modified version, you create method which uses the current instance and creates another using a constructor passing whatever values which are the same and whichever ones are different
 
And non auto props are like, dinosaur programming
 
after the loop all the members should start as original again, in my code, the class changed
so the loop cant run more than once
 
@TomW well that's a library limitation I suppose
 
that's why iwant immutability, so that the for loop can keep 'testing' the values in the class
 
7:52 AM
you can use a builder class then
 
what is that?
 
@TomW That's not true.
 
builder can have properties which save the values given, and then you call .Build() or something and it uses these properties to create a new instance of your immutable class via constructor
 
@Adan "implicitly goes back to its old state after being mutated" is not immutability
 
let's take this
  public List<UBTDataTable> UBTDataList { get; set; }

        public class UBTDataTable
        {
            public decimal BALANCE { get; set; }
            public int TIME { get; set; }
            public string EXPIRATION { get; set; }
            public int EXPIRATIONTIME { get; set; }
            public int MONTH { get; set; }
            public int DAY { get; set; }
            public int YEAR { get; set; }



        }
i fill values, if i modify them it becomes permanent in my 'test' loop
do i do a builder class? or immutability?
 
7:54 AM
@RoelvanUden really? Why?
 
You can have a property with a get only
 
im less ignorant to the concept now
 
    public class Example
    {
        public Example(string name)
        {
            Name = name;
        }

        public string Name { get; }
    }
 
first time workign with that
 
That works just fine.
 
7:54 AM
Since when? O.o
 
ah that is simple
i like simplicity
 
@TomW I don't know. Since forever?
 
i left this out though
the class gains values, but get's modified throughout
how do i let it be mutable, but only when i specify, be immutable?
 
That goes directly against the principles of immutability. Your immutable object should never change.
 
i see, so then immutability isnt what im looking for
 
7:57 AM
If you're in the process of building an immutable object, use a builder of some sort which eventually produces the object that is immutable.
 
yea, because as the values get filed, more get filled by modifying the old values
 
Once you've got code that uses the immutable, the whole idea is that it can rely on the object to never change
 
exactly
it's like setting it to immutable when needed
what am i looking for then?
 
immutability is good with threading and minimizing memory usage if you can reuse
it's bad if you end up with a lot of objects in memory
 
great, what should i use?
 
7:59 AM
it's got it's pluses and minuses
 
im new to these concepts
 
@Adan A builder. Separate the two principles of "populating" and "storing". Don't mix the two in one class. One class can be mutable that is the one responsible for populating, and it then needs to produce an object of the second that just stores the end-values (and is immutable).
 
yea
what's a simple builder? im really new to this
 
Damn, I'm wrong. I've been doing so much other bullshit that isn't C# for so long that I'm forgetting stuff
 
 public class Writer1
    {
        // Read-only properties.
        public string Name { get; }
        public string Article { get; private set; }

        // Public constructor.
        public Writer1(string authorName, string articleName)
        {
            Name = authorName;
            Article = articleName;
        }
    }
1
2
3
4
5
6
7
8
9
10
11
12
13
 public class Writer1
    {
        // Read-only properties.
        public string Name { get; }
        public string Article { get; private set; }
 
8:01 AM
The builder pattern is a design pattern designed to provide a flexible solution to various object creation problems in object-oriented programming. The intent of the Builder design pattern is to separate the construction of a complex object from its representation. It is one of the Gang of Four design patterns. == Overview == The Builder design pattern is one of the GoF design patterns that describe how to solve recurring design problems in object-oriented software. The Builder design pattern solves problems like: How can a class (the same construction process) create different representations...
The wikipedia has a good section showing examples
 
    public class UserBuilder
    {
        public string Name { get; set; }
        public int Age { get; set; }

        public User Build()
        {
            if (string.IsNullOrWhiteSpace(Name)) throw new Exception();
            if (Age <= 13) throw new Exception();
            return new User(Name, Age);
        }
    }

    public class User
    {
        public User(string name, int age)
        {
            Name = name;
            Age = age;
        }

        public string Name { get; }
@TomW It's the age kicking dementia in overdrive :-P
 
thanks
 
8:31 AM
morning
 
good morning.
 
Regarding yesterday's topic, I've chosen Unity.
Apparently UE for 2D games is a terrible choice.
 
mr5
o/
 
And there are some games made in Unity, like Ori and the blind forest... Oh boi.
Also C# code in case I need it, which I probably will.
Stuff like controllers, you have to provide in advance
 
mr5
await Task.WhenAll(taskList); // Resource intensive!

foreach(...)
   await taskList[i](); // No lag
Conclusion for today
 
8:37 AM
GoOoOoOoOoOoOoOoOoOoOoOd Mornin' pleberinos!
 
@Squirrelintraining were you the one fiddling with Unity?
 
@HéctorÁlvarez Have you also looked at Phaser?
 
@RoelvanUden yes, but that is a web-based engine isn't it?
 
8:48 AM
@mr5 Task.WhenAll simply creates a new task that completes when all child tasks completes. It doesn't do much on its own.
What's strange to me is the parentheses you have in the foreach loop.
 
mr5
consider that pseudocode
but you get the idea
 
@HéctorÁlvarez Yes, but widely popular. It might suit your needs for 2D.
 
mr5
I have observe the Task.WhenAll is not good for downloading multiple files concurrently
 
The idea is cool, yep. But I am more interested in an engine that I can evolve upon. If I eventually decide to make a 3D game, most of what I'm learning now can be transposed into Unity 3D games, whereas I'd have to use a different engine with different everything to make it if I went with Phaser, or any other similar engine.
 
@mr5 There's probably something else going on, because Task.WhenAll doesn't do much - it just waits for the tasks to complete. The foreach code will wait for the first one, but will do that while the rest continue running as well - if all downloads are more or less the same length, the first await will take a while, and the ones after will return immediately because they've completed already.
 
8:52 AM
My game works as a 2D thing, because it was conceived with that idea in mind, but it would look much better as a 2.5D with 3D assets.
 
2D + 3d glasses = 5d
 
@nyconing no, I think you need to multiply them, so it's 6d.
 
@HéctorÁlvarez No I wasn't.
A frriend of mine did
 
       public List<PhotoData> Images { get; set; }

        public class PhotoData
        {
            int ImageId { get; set; }
            byte[] Image { get; set; }
            string ImageName { get; set; }
            string ImageExtension { get; set; }
        }
 
which one in the scurry was it then... y'all have too similar names and pics
 
8:55 AM
@SpedoDeLaRossa You can press Ctrl-K to format code properly. You can edit your last message (press Up arrow) and do it.
 
is this normal behavior in C# language? I am asking, because I do not know how to fill PhotoData in the controller. :(
 
@SpedoDeLaRossa What do you mean by "behavior"? It's a straightforward enough class, yes.
 
@SpedoDeLaRossa I will suggest you don't start your property names with capital letters. Regarding your question, you didn't show us any behavior, only an object and its properties.
 
mr5
@AvnerShahar-Kashtan it seems to be that in Android, Task.WhenAll spawns a bunch of threads it can that would be alotted for every task
 
@HéctorÁlvarez What? PRoperty names should be PascalCased.
 
mr5
8:57 AM
Does Task behaves the same in every platform? @AvnerShahar-Kashtan
 
                List<PhotoData> photoList = new List<PhotoData>();

                foreach (var item in photos)
                {
                    photoList.Add(item.id, item.photo, item.name, item.extension);
                }
would try this in my controller, but this does not work
 
@mr5 Task.WhenAll "creates a task that will complete when all of the supplied tasks have completed". It doesn't spawn anything.
 
And I have the feeling I am mixing something :D
 
@AvnerShahar-Kashtan Yes you're right, I brainfarted there.
 
photoList.Add(new PhotoData{ImageId=1234, Image = read.ToEnd(), ImageName="Cat", ImageExtension="png"});
 
8:58 AM
@SpedoDeLaRossa You're skipping the step where you create a PhotoData object.
 
foreach (var item in photos)
                {
                    photoList.Add(new Photodata(item.id, item.photo, item.name, item.extension));
                }
Try that
@nyconing don't you need to use : instead of = for named arguments?
 
@mr5 The question is, who's creating the original tasks.
 
oh right, for sure. I need to create PhotoData
 
@HéctorÁlvarez It's not named arguments to the ctor, it's assignments in an object initializer.
 
and furthermore I need the keyword public in front of each line in the PhotoData class
 
9:00 AM
@HéctorÁlvarez its initializer, so... use = hehe
 
Oh damn, TIL.
 
@SpedoDeLaRossa simple word, just because your list is a list of PhotoData, so you need to add PhotoData, so you creates a new PhotoData instance by new PhotoData first, and then add into list.
 
Wait you're right, it's not a ctor...
I need breakfast methinks
 
Mine breakfast today is pepero and kitkat
 
I need all dem sugars.
 
9:05 AM
Yes, I got it @nyconing. Thank you chat! :)
 
good morning
 
@HéctorÁlvarez I wonder how you'll like Unity. Every time I'm just very confused because they tried to make it work without code.
 
mr5
@AvnerShahar-Kashtan the original call comes from the main thread. I tried wrapping it in Task.Run but not performance gain
 
@RoelvanUden so far, so good. Compared to what I've seen in UE, it's similar or better.
adding sprites was simple enough
 
mr5
await to Task individually seems to be a better option in the meantime since I can't figure out the reason why it's lagging on Task.WhenAll
if (previousRequestRefreshToken != null && !previousRequestRefreshToken.IsCompleted)
    await previousRequestRefreshToken;
 
9:16 AM
1 afternoon without any background in anything other than Allegro (very basic notions, not appliable to Unity either) and I already made a full map using a tileset where I placed my character with the camera stuck on it.
 
mr5
if the above code was called by multiple threads, what are the chance that previousRequestRefreshToken was assigned from other thread and still seen by other thread as null?
 
@mr5 Wrapping an I/O call in Task.Run will probably have the opposite effect - it will create more blocking threads.
 
9:39 AM
@HéctorÁlvarez Ah, cool :-)
@HéctorÁlvarez What kind of game are you making?
 
9:57 AM
o/
 
ahoy
 
@AvnerShahar-Kashtan can i ask you a question?
 
who the fluff invented the flavouring gooseberry-watermelon?
 
someone who's focus was on marketing to children, not adults
 
10:02 AM
I think if I were that marketer, I'd name them flavors which don't actually exist
 
@ntohl Basically, I believe they synthesize various organic flavor compounds in the lab, then give it to focus groups to taste, and write down what flavor they think it is, then market it as that.
 
apologies
 
No worries.
 
Fun fact: banana flavored candy tastes a little off from a typical banana because the artificial flavor was actually modeled on a different variety of banana which got wiped out by disease in the 1950s or so.
So everything banana flavored is actually an accurate representation of a variety of banana which no longer exists.
 
TIL: The word "flavor" originally referred to the element in taste which depends on the sense of smell, coming to English from Old French "flaor" odor, scent, from Latin "flatore", meaning that "flavor" is cognate with "flatulence".
 
10:07 AM
I suppose flatulence meant something a little different back in the day
otherwise I don't see why anyone would use that as the basis of a word for taste
 
@Neil It simply meant "odor".
> probably from Vulgar Latin flator "odor," literally "that which blows," in classical Latin "blower," from flare "to blow, puff,"
 
yes but odor didn't get associated with "taste"
why would flavor get associated with taste?
 
@Neil It's similar to grape flavored candy/juice, which are flavored based on fox grapes, not on European wine grapes.
95
Q: Why do grape-flavored foods taste different than actual grapes?

JoshGrapes are one of my favorite fruits, but I typically don't like grape-flavored foods. For example, grape jelly or grape candies (like Jolly Ranchers) have a distinctly different taste. I imagine some of the taste perception has to do with water content. Why is it so different?

@Neil Also, a commenter there claims your fact is a myth:
> it is a myth that artificial banana flavoring is based on a now-extinct cultivar of the fruit. While, yes, we now eat Cavendish bananas, and the Gros Michel variety has gone extinct due to a fungal infection [..] there is no actual evidence that artificial banana flavoring is based on this Gros Michel cultivar. It is just isoamyl acetate, which tends to evoke "banana" (and "pear") thoughts in everyone who smells it, and is found in all cultivars of bananas
And now, to lunch. I have made goulash, and I have brought goulash, and now I shall eat goulash.
 
@AvnerShahar-Kashtan If you come to Hungary, I'll show you how the proper "gulyás" is made.
 
because it give too much thick on flavoring, a light flavoring will taste similar to grape
 
10:20 AM
@RoelvanUden a 2D brawler. Still in the early stages, but I aim to have customization.
 
@AvnerShahar-Kashtan I suppose that's a reasonable claim. We'll never really know
 
@Neil I think this is valid. When labs have low budget, they will produce the same cheap flavor, and sell it with a new word for flavor, that's already in dozens of "flavored water" or energy drink
 
Still haven't decided about most details honestly, I have some great ideas in my head, but I know if I try to put everything in the game at once I'm going to screw up
 
@ntohl probably doesn't work that great for adults, but kids we'll try something just to try it
 
@HéctorÁlvarez have you played Brawlhalla?
 
10:21 AM
so long as you add enough sugar, they'll probably be reasonably happy
 
@ntohl Yes, I had it during beta, and played a few games afterwards... but not quite the idea.
I'm not really looking for the Smash bros feeling
 
not to downplay the intelligence of kids, but there wasn't a sweet thing that I didn't like unless it was cough medicine or something
 
Those games are really fun in terms of playing once in a while, but I prefer other kind of gameplay
Let's say punches are too lame.
You literally hit someone 40 times before the knockback is strong enough to make a difference.
Also strategy plays a very minor role, unless you watch pros like that starfox mirror match when they spend 30 seconds hitting each other mid air and fly around the map, most gameplay is about landing a hit or 2 and running.
 
@HéctorÁlvarez it's ok if it's imbalanced to start
that's part of the process
many games, especially ones with many different aspects, are difficult to balance properly without plenty of gameplay testing
also considering that with enough possibilities, testing all possible combinations is near impossible
 
@Neil for nostalgia sake I bought a kiwi flavored drink, and my boss was concerned about my health seeing that glowing green stuff
 
10:28 AM
@ntohl Next time I'm around. For now, I'll stick to my improvised meat-potato-and-a-lot-of-smoked-paprika stew.
 
Right. My concern at the moment isn't so much balance though, more like I don't want to start drifting away at this moment. First of all, I want a good core to build upon, and then I'll add all the cool features, that might not even be as cool as I picture them when I actually add more and more stuff.
 
we did really drink everything that was sugary enough.
 
@ntohl just tell him it's only uranium salt and a slice of lemon
 
@HéctorÁlvarez I liked the detailed mechanics of cooldown of jumps and evades
 
Yeah make sure he knows it's radioactive because you're convinced radiation kill free radicals
 
10:31 AM
radiation kills zerglings and drones also
my boss will be pleased knowing we prepared for zerglings also
 
@ntohl Right, but when you start punching someone you have to spam attacks a lot to make an effect. Compared to games like Mortal Kombat where a single combo can shave over 35% health if placed correctly, the differences are huge.
I've also had friends who were really frustrated because the character didn't do what they wanted to, mostly due to air acceleration.
 
@HéctorÁlvarez yeah. On my level we only smashed the strong punch. On higher level, it's always small punches
 
@HéctorÁlvarez Thats meeeeeeeeeeeeeeeeeeeee
 
@AvnerShahar-Kashtan if it's a-lot-of-smoked-paprika and dense enough, that's a correct way :D
 
In my head there won't be any air acceleration, because I never understood why a character could be able to move mid air at will (except if the character can fly or otherwise has means to do so)
@CaptainSquirrel Oh hey, I made some progress yesterday. Today I have to program a player controller, so I'm probably copying one from the internet and changing a few things on it
The default sucks
 
10:35 AM
I liked Kung Lao for the ↓+low kick
 
Yeah that sounds about right
I need to make better movement controls to be fair
 
what's the easiest way to shallow copy a class?
 
And fix my camera
 
public class test(){public string name {get; set;}
 
I've added freelook, but there's an issue that will rotate the actual character when you stop freelooking
 
10:36 AM
@Adan var other = one;
 
ALSO, if you need a multiplayer component
I'd recommend playfab.com
 
6
A: Does an uppercase property auto-create a lowercase private property in C#?

Dmitry BychenkoWhy not just have a look what's going on? public class Test { // private int myProp; public int MyProp { get; set; } } ... string report = String.Join(Environment.NewLine, typeof(Test) .GetFields(BindingFlags.NonPublic | BindingFlags.Instance) .Select(fi...

 
Seems like the best for pricing
 
Must be a great answer, but thus far I don't understand it. I hope I'll be able to someday.
 
!~msdn c# auto-property
[Visual Studio 2008 Automatic Property is the default snippet | Wriju's ...]
https://blogs.msdn.microsoft.com/wriju/2007/10/03/visual-studio-2008-automatic-property-is-the-default-snippet/
Oct 3, 2007 ... Now if you type prop and hit “tab” twice, this will bring the Automatic property not
the conventional property declaration. This is my new finding.
 
10:38 AM
@ntohl if 'one''s values change, does 'other' change aswell?
 
@nyconing fair enough
 
how do i take a mutable class 'a' and copy it to an immutable class 'b'?
what im trying to do is get mutable class 'a' and use a loop to test values, in which values will be modified, but when the loop is done, class 'a' should keep its original values
 
@Adan You can create a Clone() method which creates this sort of copy (shallow or deep, your code, your choice). You can use tricks to create a clone, such as serializing-deserializing to get a new instance with the same data. You can simply create the immutable type b with a constructor that takes an a and initializes itself.
 
and if class 'a' is changed, does 'b' get changed?
 
Depends on how you copy the values.
 
10:47 AM
i googled this:
public IList<T> Clone<T>(this IList<T> listToClone) where T : ICloneable
        {
            return listToClone.Select(item => (T)item.Clone()).ToList();
        }
 
public class A
{
       public int X {get;set;}
       public string Y {get;set;}
       public List<bool> Z {get;set;}
}
public class B
{
      public B (A source)
      {
          X = source.X;
          Y = source.Y;
          Z = source.Z;
      }

      public int X {get;}
      public string Y {get;}
      public List<bool> Z {get;}
}
 
@Adan I think so. Unless it's immutable or value type
 
In this case, changing the values of source.X after the B has been created won't affect it - the int is copied. Similarly, chaning source.Y won't affect it either, because strings are immutable, and any changes to source.Y will assign a new value and won't affect B's string.
But if you do source.Z.Add(true), it will affect the B, because what you copied in that constructor is a reference to the List.
 
ah
i asked like 3 people and googled
hours wasted
and you never fail to give the answer in like less than 1 minute
thanks
 
@ntohl That's one thing I want to avoid. It's only fun for a couple hours, and then the game loses all its value. I want to follow the idea of Fortnite, add stuff into the game that is really easy to understand, but fairly hard to master.
 
10:51 AM
But if you do source.Z = new List<bool>(), it won't affect it, because you're assigning a new value to source's property, not changing the instance that was copied.
 
ughh
i was hoping for an easy day today
but it will be the oposite
 
mean super easy day?
 
i need to install 4 cameras in a big washing hall with cars
then connect them to a pc
and make it all work with some software
never did this before
 
like everyone can click boxes and loot guns, then point at enemies and shoot. Or you can press a button and build a set of stairs, but it will take a couple hundred games until you learn to build in combat and shoot people, or gather resources at the right pace, or position yourself correctly.
 
no, means super hard day
 
10:52 AM
  public List<REGBDataTable> REGBDataList { get; set; }

        public class REGBDataTable
        {
            public decimal BALANCE { get; set; }
            public int EXMONTH { get; set; }
            public int EXDAY { get; set; }
            public int EXYEAR { get; set; }



        }
that's my class and list
 
and of course everything has to work before i leave
 
in other words, class A
 
@Hans1984 Looks fairly easy. CCTV or plug-and-play cameras?
 
lol Adan always make naming so funny, no one is normal from until now
 
if it's CCTV it's probably as easy as following the instruction manual. If it's PnP... well GL syncing them? Maybe you have another software that takes video input and syncs it.
 
10:54 AM
@HéctorÁlvarez its not easy if you never did it before
 
How did they links?
Network?
 
the cameras are connected to a switch via lan
the switch is connected to a pc
and i also have to connect some kind of hard disk
to the pc
for the cameras
 
Oh so it's CCTV, then you probably have to read the instructions on how to do that correctly.
 
of course
im doing this for the last 2 hours..
 
if I were to think "how do I make it work" I would just connect them to the switch, assign them static IPs from a router in the middle (unless the firmware allows you to map them one by one, in which case use it instead of the intermediate router), and then configure them in your CCTV software to be accessible.
But every CCTV is different, depends on how the manufacturer decided to approach it
 
10:58 AM
just a switch?
not poe?
 

« first day (3344 days earlier)      last day (1587 days later) »