Jump to content

kaddle

Member
  • Posts

    77
  • Joined

  • Last visited

Posts posted by kaddle

  1. I'm going to give my old Windows 10 computer to someone, which I built myself. I want to delete all of the data from the storage and have it give the "new computer experience", where windows goes through the initial process.

    I do not want the OS to be deleted.

     

    I've only ever reset computers to factory defaults back when I was using prebuilt computers, so I'm not entirely sure what the best approach is here.

    Any help?

  2. 1 minute ago, aisle9 said:

    What case are you looking at? Short version, you're almost certainly fine, but if you're buying a little Chinese hotbox, that could change.

     

    For reference, I have an Ryzen 5 5600 and an RX 6700 in a Silverstone SG13, which doesn't even have an exhaust fan, and I have never had any issues with overheating.

    I have not settled on a case yet.

    Most of the options between $100-$150 at my local store seem to have top vents.

    The problem is I don't think I'll have any extra cash for exhaust fans.

  3. I'm making a build with a Ryzen 5600X and RTX 3060.

     

    With this build, is it recommended to get a tower that has a top vent? How detrimental would it be for the cooling if there is no top vent?

     

    If the tower has a top vent, is it mandatory to install a fan for it or can I just leave it without a fan?

    If it can be left without a fan, is it safe to cover the vent with tape or something?

     

    PS:

    My room is very dusty. What should I do?

    I'm thinking the top vent should be covered due to the dust alone.

  4. 1 hour ago, SupaKomputa said:

    How do you measure it?

    If you copy from the HDD, yes the read and write will be dictated by the HDD max performance.

    Download speed is related to the internet speed not the storage.

    i just look at the stats in the task manager.

    how do i change it so that the speed is not dictated by the max performance of the previous drive?

     

    to be more accurate, steam was updating a game. i believe the 3.3mb/s was reflecting how fast it was writing the update to the SSD. my ethernet stats in task manager was showing over 25mb/s during that time.

  5. i cloned my HDD to a new NVME and it is definitely faster. i haven't experienced any lag from the disk which is a huge improvement.

     

    https://shop.westerndigital.com/products/internal-drives/wd-blue-sn550-nvme-ssd#WDS250G2B0C

     

    the problem is i barely see the read/write speed exceed 100 mb/s. it just doesn't feel like it's as fast as it's supposed to be.

     

    also, when steam was downloading something a while ago the download speed didn't exceed 3.3 mb/s of write speed, which is exactly the download speeds i had when using my HDD. my HDD is disconnected from the motherboard.

    strangely enough, my ethernet reported download speeds of over 25 mb/s.

     

    is this normal or is my NVME slow for some reason?

  6. i want to transfer all of the data from my HDD to an SSD.

     

    i originally wanted to wait until i have enough money for a new build to start using an NVME or SSD, but i just can't take it anymore. my computer has been almost completely locked out for the past 20 minutes because the hard drive is at 100% usage for whatever damn reason. it took me like 5 minutes to get here so i didn't watch any youtube tutorials for this yet.

    i need to get an SSD in my computer right now.

     

    this happens all of the time. whenever there is a download or whatever going on in the background, my computer gets locked out because of how dumb and slow this stupid HDD is. i heard about those mach 2 hard drives, like 4 f-ing years ago and i still haven't heard anything new about them.

    no more waiting. i need this upgrade.

     

    i haven't done this before so i could use some advice. if anything bad happens to my computer i'm pretty much screwed.

     

    my computer is not very powerful but it's not slow either. the HDD is pretty much the bottleneck. for general usage and mid tier gaming the other parts should be completely adequate:

    ryzen 1200, GTX1050, 16GB ram, etc.

     

    am i able to safely transfer all of the data from my HDD to an SSD? if so, will it affect the OS license (it was super expensive)?

    what are things that i should know before doing this?

  7. when i first bought this wifi adapter it was working great. over the past week i notice that it is starting to suck. i'm not 100% sure if the wifi adapter is the issue or if it's an issue with the distance and power of the modem, or a combination of both.

     

    we got a new modem recently. it's in the basement and i'm on the top floor. when i first connected to the wifi from the new modem i didn't notice any problems at all. it's been over 3 weeks since then and for the past week i've been having problems with getting a consistent wifi connection from the modem.

    Spoiler

     

    i test it by attempting to stream a youtube video on 1080p. it is supposed to buffer instantaneously. lately it has often been buffering slowly or not at all. when i turn off the wifi adapter and then turn it back on, it seems to work perfectly for a few minutes and then starts to crap out again.

    for the first time, i had to try adjusting the antenna on my wifi adapter. it has two massive (maybe 7-8 inches?) antenna. i would adjust the antenna until the youtube video starts buffering fast. just a few minutes ago it fully crapped out. i tried adjusting the antenna and it wouldn't connect, but it showed that i was still connected to the wifi and that the connection was strong, which is weird.

     

    the main thing that makes me think that the wifi adapter is the sole problem is that my phone is connected to the wifi and i rarely notice any connection issues. connection issues on my phone are so rare that they are more likely due to problems on the other end. so my phone is right beside my pc, which has the wifi adapter, but the wifi adapter craps out while my phone gets a great connection.

     

     

    i decided to use usb tethering to connect the wifi from my phone to my pc. my data is turned off so i'm hoping that it's not secretly using my data instead.

     

    anyway, is my wifi adapter dying or something? should i use usb tethering on my phone from now on or should i buy a new wifi adapter for my pc?

  8. does anyone know about any books (preferably on kindle) that can help me get started learning how to use unity, and how to script in unity using C#?

     

    preferably books that are friendly to people who are new to programming and game development. i pretty much have a decent understanding of most C# basics.

  9. i'm confused about the getset property auto implementation. i understand how the property itself works.

     

        class One
        {
            private int number = 50;
            public int Number
            {
                get
                {
                    return number;
                }
                set
                {
                    if (value >= 0)
                        number = value;
                    else
                        number = 0;
                }
            }
        }
        class Program
        {
            static void Main(string[] args)
            {
                var one1 = new One();
                one1.Number = -90;
    
                Console.WriteLine(one1.Number);
                Console.ReadLine();
            }
        }

    the getter allows other classes to read the value of the field. the setter allows other classes to set the value of the backing field. if the getter is private then other classes can't read the field. if the setter is private then other classes can't set the value of the backing field.

     

    this is where the concept of auto implemented getset property gets confusing.

    the book says that when you use the shorthand to create an auto implemented property, it creates an anonymous private backing field. so how are you supposed to know what the backing field is? i thought that the whole point of using the property was to give limited access to the field from other classes in order to protect the field. are there situations when i won't need to know what the backing field is?

     

    also, if using the shorthand allows full access to reading and changing the value of the backing field (aside from making the getter or setter private), is there any point to using it?

  10. can someone please explain polymorphism simply, and the difference between static polymorphism and dynamic polymorphism? i feel like i have a mild understanding of the concept, but it is still fairly confusing at this point.

     

    from what i understand, polymorphism itself refers to when a program uses the correct method for an object even though there are other methods with the same method signature in other derived classes or the base class.

    is this correct and is there more to it?

     

    also why can objects be created from two different classes? for example if you have a base class named human and a derived class named male you can do:

    human object = new male();

    i was under the impression that when creating an object it could only be using the same class name both times like:

    human object = new human();

    i'm pretty sure that this has something to do with polymorphism, but the book i'm reading is not explaining this and i can't find an explanation in some videos either.

  11. in the book i'm reading it states that there are two ways to create a constructor for the child class. it vaguely implies that the first way is for creating the child constructor is to create a parameter-less constructor and the second way is for creating a non parameter-less constructor, but it's not exactly clear on whether that is absolute. so my questions are about whether these two ways that i will demonstrate are the only ways to create child class constructors and if the parent constructor is always called.

     

    the code below is from the exercises that i am following in the book. the book isn't the problem. it's a good book. i just need more information.

     

        class Member
        {
            protected int annualFee;
            private string name;
            private int memberID;
            private int memberSince;
    
            public override string ToString()
            {
                return "\nName: " + name + "\nMember ID: " + memberID + "\nMember Since: " + memberSince + "\nTotal Annual Fee: " + annualFee;
            }
    
            public Member()
            {
                Console.WriteLine("Parent Constructor with no parameter");
    
            }
            public Member(string pName, int pMemberID, int pMemberSince)
            {
                Console.WriteLine("Parent Constructor with 3 parameters");
    
                name = pName;
                memberID = pMemberID;
                memberSince = pMemberSince;
            }
        }
    
        class NormalMember : Member
        {
            public NormalMember()
            {
                Console.WriteLine("Child constructor with no parameter");
            }
            public NormalMember(string remarks) : base("jamie", 1, 2015)
            {
                Console.WriteLine("Remarks = {0}", remarks);
            }
        }

    so in the code above we have the parent class Member and the child class NormalMember. from what i'm gathering from the book, the two ways to create a child constructor are the two ways displayed in the child class above. the first way is to make a normal constructor without any parameters, and the second way is to use the colon and base keyword.

     

    so as for my questions, am i right to assume that the only time the parent class constructor will be called when you create an object for the child class constructor is when you make a parameter-less constructor in the child class, or a non parameter-less constructor in the child class using the colon and base keyword?

     

    also, am i allowed to make a non parameter-less constructor in the child class without using the colon and base keyword? like a constructor that won't call parent class constructors when an object is made for it?

  12. i'm a bit confused by the concept of royal families. are they just like normal families but better? are they a certain part of a family that is merged with their nation's government? does each royal family serve different purposes and have different structures?

     

    i'm asking because i'm writing a story and i want to make a royal family. it doesn't need to be exactly like real royal families. anyway, it would help a lot if someone could draw a diagram or provide an explanation. i can't really find what i'm looking for on google and there are a lot of mixed answers.

     

    Royal Family Purpose:

    i'm thinking that this royal family in particular could have greater importance than the nation's government, but only the king and the heir would have actual authority over the government, and the government mainly serves the king, rather than the rest of the royal family.

    so the throne won't necessarily be merged with the government, instead they will rule over it as a superior party.

     

    also this royal family will exist in fairly modern times, so i probably won't have any sword wielding knights appointed to defend royal family members.

     

    Royal Family Structure:

    the actual structure of the royal family is what is most confusing. let's start with the king at the center of the structure since that will make it easier.

     

    King's Wife:

    in this royal family structure the ruler (king or queen) is not allowed to have more than one spouse at a given time, and they are not allowed to have concubines.

    does the wife of the king usually have any power? is she automatically considered the queen of the nation just for being married to the king? does it make any difference if the king's wife originates from a common family or was originally already a member of the royal family (like distantly related to the king?

     

    King's progeny (throne succession):

    let's say that the king has multiple children. i know that usually the heir is the firstborn. i think i'll keep that tradition in my story, but it won't be an absolute rule. the firstborn can decline the title of heir.

    so i understand that after the king retires and the new king comes, the line of succession continues with the new king. but what happens to the new king's siblings? what place do they have in the royal family after the line of succession shifts to the new king?

     

    Servant families:

    are servant families the same thing as branch families or different family houses?

    what is the social status of servant families relative to commoners?

    are different parts of the royal family served by different servant families?

     

    i'll edit this OP as needed.

  13. 13 hours ago, Majinhoju said:

    I'm guessing they let the strollers on first so that they could actually get a proper seat.  Some people don't like to move or get up for strollers, elderly, pregnant, disabled etc...  Though it's been forever since I've taken a bus and I'm ever grateful for it.

    that's not really an issue in my region unless the bus is very packed. there were a lot of people on the bus but not quite enough that it can't be considered packed. in my region, courtesy seating is just as mandatory as priority seating, so as long as the stroller gets on the bus, people need to move for it.

     

    even if everyone gets on before the stroller they still need to leave space for the stroller, and it's only an issue if there is no room for the stroller to get on the bus after everyone else does, in which case, the parent(s) and stroller should get on a different bus or the next bus, because the parent(s) and stroller usually takes up enough space for 4-6 people standing.

    6 hours ago, dalekphalm said:

    Either the bus has a design flaw, or the problem is over exaggerated. 

     

    The buses in my city can easily accommodate a stroller on each side at the front, and leave more than enough room for people to walk past. 

    the benches at the front of the bus are able to be lifted to allow more room for strollers, wheelchairs, etc. even though both strollers were at the front of the bus, neither of the benches were lifted, leaving no space to safely walk by the strollers. i can't remember how many other people were at the front, but the seats at the front only fit 3 each, so it was possible for people to stand and have at least one of the benches lifted.

     

    of course the size of the strollers should also be accounted for. both strollers were big.

  14. yeah... i just woke up. i wrote this when i was very tired and irritable due to me being in the process of fixing my sleeping schedule. i ended up going to bed 4 hours sooner than i wanted, but whatever. i'll try again today. of course, i was also feeling irritable when this situation was actually happening. everything that i typed is how i feel about it, but if i was not irritable then i wouldn't have bothered typing about it, and even if i did i would have been much less aggressive about it.

  15. for the sake of discussion, feel free to discuss your experiences with this topic, or other transportation issues..

     

    so earlier today i took the bus to the mall. usually i don't really get annoyed by much since i like to try to be a balanced person. the things that i can't stand the most are stupid people (not necessarily people with low iq, but people who just do very stupid things on a regular), virtue signalers, hypocrites, and liars.

     

    anyway, so when i was getting on the bus earlier there was a lineup of like 8 people or something. usually i am one of the first few people to get on since i have my change ready, and i know that i won't hold the line up. i also really don't want someone to just walk in ahead of me and then hold up the line for like 2-3 minutes before getting out of the way. this time i did not have my change ready.

     

    i don't mind if i don't get on first, it's just the way that it usually turns out. so right as i got my change ready and was walking to the bus behind someone else, the dumbass comes to a full stop right in front of me. i don't get it, but even though it's annoying for someone to randomly stop like that i didn't really care. so i look around to find a way around this idiot so that i can walk on the bus. as i am looking around i see that everyone else stopped as well, and there is this couple with a large fucking ass baby stroller. then i knew that i was fucked.

     

    let me explain. i know that the average folk somehow got it into their minds that the baby stroller should be let on the bus first. this notion is complete rubbish, and i have never allowed myself to be inconvenienced by this ridiculous nonsense before today. i will explain why it is stupid after i finish the story.

     

    so the dumbass in front of me is literally blocking my way and there is no way around her because a garbage bin and pole are right next to her. so they take their sweet ass time pushing the stroller onto the bus, and from the beginning of this process i had to stand there for over a minute, like i was a stupid fucking idiot, waiting for the stroller and everyone else to get on the bus because the moron in front of me didn't move when she was logically supposed to.

     

    when i finally got on the fucking bus guess what? there were a total of TWO baby strollers on the bus. the amount of space between them might as well have been non existent, almost blocking the entire passageway to get to the back of the bus.

     

    here's the problem. one of the strollers was blocking me from holding onto anything while i was dropping my money into the thing, so if the bus driver was careless and started driving the bus, i would have fell over onto the fucking stroller, most likely killing the baby inside of it. he almost did too. when the bus driver saw that i was falling the fuck over when he started the bus, he just stopped and waited.

    then when i was finally walking by the FUCKING strollers, the idiot asshole father didn't even try to the move the stroller more to make more walking room.

    "maybe he already moved the stroller as much as was possible beforehand".

    yeah, that's why the stroller goes on last, dumbass.

     

    i had the opportunity to test this out at least once before. the most memorable time was when i was at a bus terminal. like 15-20 people in line to get on the bus. when the bus showed up, every idiot stood aside for the stroller to get on the bus first. i took the opportunity to simply walk in front of everyone else to get on the bus and went straight to the back of the bus.

    after getting cozy, i watched as the mother struggled to get the baby stroller on the bus, probably also feeling a bit rushed by everyone's gazes behind her, then i also got to watch everyone waddle like dumbass penguins, struggling to walk by the baby stroller without bumping it, or falling on it, risking serious harm to the baby for each person that passes. i was waiting for like 3-4 minutes.

     

    if everyone without a stroller got on the bus first, and then the stroller got on, everything would have been much more smooth. in my region, both priority seating and courtesy seating are mandatory on public transit, so people wouldn't be allowed to take the space that the stroller would need. that would not be an issue. it's not "kind" to let the stroller go on first, because the kindness is already inherent in the courtesy seating rule.

     

    you simply cause unnecessary risk to the baby, as well as wasting more time. from now on whenever you see a stroller going on the bus with you, simply cut the stroller off and walk on first. then at least you don't have to risk tripping, falling onto a baby, and killing it. sorry for all of the swearing. i just never thought that i would become a victim of this horseshit. thinking about it made me burn with fury.

  16. i thought of and learned of various ways to aid in phone theft/loss prevention.

     

    1.

    the way you holster your phone has an impact on theft/loss prevention.

    if you leave your phone in your pocket, this can have different pros and cons depending on how good your pockets are. deep pant pockets towards the front of the pants are likely the most difficult to pickpocket from and the most difficult to have the phone fall out of your pants.

     

    keeping your phone in your bag is probably a hit or miss. most people would avoid checking other people's bags in public areas. if they have been watching you and waiting for you to leave your bag in a secluded area, it will simple for them to take your bag or your phone from your bag without incident.

     

    a phone pouch that hooks to the belt is likely the best balance. a good phone pouch will never let your phone fall out, and it's often very easy to be aware of its presence which will help you keep track of it. when standing up, your arm may often rub against it which prevents anyone from attempting to steal it. depending on the size of the pouch and the size of your shirt, you can often completely hide it while sitting down, so no one else will be aware of it. you may be able to hide it while standing up depending on what you are wearing.

     

    2.

    if you always have your earphones in while listening to music, you will know whenever your phone drops or is taken because your music will stop playing.

    always playing loud music will make it so that you can find your phone by hearing the music if it is dropped or taken. at the same time, loud music will alert everyone in your vicinity to the presence of your phone.

     

    3.

    there is a good app that i have been testing over the last couple of days called Anti-Theft Alarm. i have it on an android device, not sure about ios. you can customize a unique pin code or pattern to use with the app, you can customize the alarm sound, alarm timer, etc.

     

    you can set it so that the alarm will trigger whenever your phone charger is taken out of your phone, whenever your phone is removed from a closed space (like your pocket or a pouch), whenever the sim card is being removed, or whenever your phone is moved at all from the location that the alarm was activated.

     

    the alarm will continue to go off at maximum volume until the pin or pattern is entered.

  17. 6 hours ago, dgsddfgdfhgs said:

    its your choice to carry valuable items with you, there is no practical security measures. anyone can reset your phone in no time.

     

    bring along with your old nokia phone instead, no value to steal

     

    i know that simply not bringing the phone is an option. i'm not that worried about it and i need to bring it. the main reason why i decided to go on this trip is so that i can take pictures of the sights. whenever i went on trips before, i always regretted not having a good camera with me.

     

    what i'm getting at is that i would like to take measures to reduce the odds of my phone getting lost or stolen while i'm there, or learn of ways that i can get it back.

     

    by the way, would you mind elaborating about anyone being able to reset my phone in no time? wouldn't they need access to the power button as well as my password?

  18. do you have any tips/tricks/advice to aid in preventing phone theft and misplacement. this also includes advice to find a lost or stolen phone.

     

    as for me, well... my phone. i bought this phone late last year. i was going to buy a oneplus 6 but their tagline told me "never settle", so i bought a note 9 instead. it was my first experience buying a phone for myself, and before that i was using a super lame phones.

     

    i'm going camping in about a few days. it's an indoor camping experience and i am going as part of a church group. i frequented this church ever since i was about 15 years old, so i generally trust these people. i just don't want there to be a reason for me to distrust them. also if there really is someone whom i should not trust, i want to be ready to deal with that. therefore i need to make sure that i have ways to prevent my phone from getting lost or stolen. also to get my phone back if the worst happens.

  19. i started learning about the params keyword recently. i get the gist of how it works. i just have some questions so that i can get additional information. i'm very new to programming just to let you know. simple and detailed explanations will be easier for me to understand. i typed out the code below from a template in the book i'm learning from. the disposable array and the strings passed when calling the method don't have a significant meaning.

     

            static void Main(string[] args)
            {
                void NamePrinter(params string[] tasks)
                {
                    for (int i = 0; i < tasks.Length; i++)
                    {
                        Console.Write(tasks[i] + ", ");
                    }
                    Console.WriteLine();
                }
                NamePrinter("Jon", "Jan", "Kim", "Bak", "Hok", "Rip");
                Console.ReadLine();

    the way this method works has similarities to the code in last thread that i made, so i pretty much understand the way it works. i only have one question relating to the way that the method works.

     

    my first question is, is the params keyword only used in front of an array? like are there other ways that the params keyword is used? if so, any examples will be helpful.

     

    regarding the for loop variable 'i'. i know that this variable represents the element positions in the 'tasks' array. my question is does the value of 'i' increase depending on how many strings are passed when calling the method?

    for example if i put < NamePrinter("Bob", "Bil", "Ben"); > will the value of 'i' be 2 to represent each name that i put into the array?

  20. thanks everyone for the help. i pretty much understand both methods enough to work with the code properly now.

     

    there is one concept about the second method that still confuses me. it's not a problem with understanding how the code works, it's more about understanding why the code works the way that it does. i'll post the method below and explain as best i can. i'm still new to programming lingo so i might not be able to work this clearly or properly.

     

                int[] ReturnUserInput()
                {
                    int[] a = new int[3];
                    for (int i = 0; i < a.Length; i++)
                    {
                        Console.Write("Enter an integer: ");
                        a[i] = Convert.ToInt32(Console.ReadLine());
                        Console.WriteLine("Integer added to array.\n");
                    }
                    return a;
                }
                int[] myArray2 = ReturnUserInput();
                Console.ReadLine();

    so as i said before. thanks to you guys i understand the way that this method works and how to manipulate the code here. my confusion is about the concept of why the int i variable in the for loop works the way that it does.

     

    how exactly does c# know that the for loop is accessing the positions of the elements in the array 'a' by using the variable int i to represent the element position in the array?

     

    to put it differently, how does c# know that the value of int i is representative of the corresponding element positions in the array 'a'?

  21. i bought this keyboard last year and the media keys have always worked as normal. the change track and pause/play keys would always affect my music player. i use windows media player. i'm sure the problem is not the keyboard.

     

    yesterday when i use the pause/play media key on the keyboard, it started to affect youtube instead of my music player like normal. it only goes back to normal when i close youtube, but i almost always have a youtube tab open. the keys to change the track always work with my music player as far as i can tell. i need my media keys to always affect my music player, but i don't know how to make it function normally again. any help?

  22. i am at the point in the book where it is explaining the usage of arrays and lists in method parameters, as well as returning an array or list from a method. i get it for the most part, but there are some things that aren't explained in the book which are causing confusion for me. the process of using arrays and lists in the ways i will show bellow are similar, so i'll only be using array examples in this OP and translate what i learn to be used for lists as well.

     

    Printing Element:

                void PrintFirstElement(int[] a)
                {
                    Console.WriteLine("The first element is {0}.", a[0]);
                }
                int[] myArray = { 1, 2, 3, 4 };
                PrintFirstElement(myArray);
                Console.ReadLine();

    so the code in the example above is for printing out the value of an element in whichever array is passed into the parenthesis as a parameter when calling the method (if you've been reading my programming threads from before i started learning, you could see that i've learned a lot so far ?). so i get the gist of it. the problem is that the book doesn't explain the specifics of how this process works.

     

    looking at the method declaration, the parameter is (int[] a). so i can assume that the int[] part tells the method that it needs to take in the name of an integer array when the method is called. what on earth is the a character for? also, the a character is used again in the WriteLine() method, but this time it is placed before the array element. so my other question is what determines where the a character should be placed? after thinking about it i can only assume that it's a substitute for the name of the array or list, but you tell me please.

     

    Returning Array:

                int[] ReturnUserInput()
                {
                    int[] a = new int[3];
                    for (int i = 0; i < a.Length; i++)
                    {
                        Console.Write("Enter an integer: ");
                        a[i] = Convert.ToInt32(Console.ReadLine());
                        Console.WriteLine("Integer added to array.\n");
                    }
                    return a;
                }
                int[] myArray2 = ReturnUserInput();
                Console.ReadLine();

    the code in the example above is for creating a method that makes an array based on user input. this one is a little bit more confusing than the last one. i'm definitely confused about all instances where the a character is used. someone please explain. i'm also confused about the declaration of the int i variable in the for loop and the usage of before the conversion method. how exactly does this variable translate into the elements of the array that i would use the method to declare?

  23. i am mind shatteringly confused right now, and i have been for the past 24 hours. in the book that i am using to learn C# it ran me through an exercise to explain classes, properties, constructors, objects, etc. i have a basic beginner understanding of it for the most part. my confusion is in how the code is printed out by the compiler. i'm going to copy paste the entire program because i don't know how much of it is necessary for this thread. some of you might remember that i'm very new to learning C#, so i might make mistakes in my explanations and questions. i read a lot of the pages in the book for this exercise a few times over, but i still can't solve this issue. either the information isn't in the book or i kept missing it while reading and i'm right in being confused, or i am just a complete and utter idiot.

     

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;
    
    namespace Oop
    {
        class Staff
        {
            private string nameOfStaff;
            private const int hourlyRate = 30;
            private int hWorked;
            public int HoursWorked
            {
                get
                {
                    return hWorked;
                }
                set
                {
                    if (value > 0)
                        hWorked = value;
                    else
                        hWorked = 0;
                }
            }
            public void PrintMessage()
            {
                Console.WriteLine("Calculating Pay…");
            }
            public int CalculatePay()
            {
                PrintMessage();
                int staffPay;
                staffPay = hWorked * hourlyRate;
                if (hWorked > 0)
                    return staffPay;
                else
                    return 0;
            }
            public int CalculatePay(int bonus, int allowance)
            {
                PrintMessage();
                if (hWorked > 0)
                    return hWorked * hourlyRate + bonus + allowance;
                else
                    return 0;
            }
            public override string ToString()
            {
                {
                    return "Name of Staff =" + nameOfStaff + ", hourlyRate = " + hourlyRate + ", hWorked = " + hWorked;
                }
            }
            public Staff(string name)
            {
                nameOfStaff = name;
                Console.WriteLine("\n" + nameOfStaff);
                Console.WriteLine("--------------------");
            }
            public Staff(string firstName, string lastName)
            {
                nameOfStaff = firstName + " " + lastName;
                Console.WriteLine("\n" + nameOfStaff);
                Console.WriteLine("--------------------");
            }
    
        }
        class Program
        {
            static void Main(string[] args)
            {
                int pay;
                Staff staff1 = new Staff("Peter");
                staff1.HoursWorked = 160;
                pay = staff1.CalculatePay(1000, 400);
                Console.WriteLine("Pay = {0}", pay);
                Staff staff2 = new Staff("Jane", "Lee");
                staff2.HoursWorked = 160;
                pay = staff2.CalculatePay();
                Console.WriteLine("Pay = {0}", pay);
                Staff staff3 = new Staff("Carol");
                staff3.HoursWorked = -10;
                pay = staff3.CalculatePay();
                Console.WriteLine("Pay = {0}", pay);
                Console.ReadLine();
            }
        }
    }

     

    when the code runs, what gets printed out is:

     

    9087iyjufthn.png

     

    Spoiler

    so of course the program is a payment calculator. in the Main() method i made the three objects which each represent an employee. after the objects are instantiated, the HoursWorked property is accessed to change the value of the private field. then the pay variable is assigned the result of the CalculatePay method, which also takes in the values of bonus and allowance into the parenthesis as arguments in this case, before returning the value, but it also runs the PrintMessage() method before assigning the value (i'm probably wrong about that. it's very confusing). so then the WriteLine() method prints the value of pay, which i guess also prints out the PrintMessage() method? but what is even more confusing is that somehow it printed out the string that is passed in the parenthesis of the object, which are the employee names; and it also prints out the "--------------------" under the employee name.

     

    i am feeling quite stupid at the moment. in the Main() method the only code in the WriteLine() method is |"Pay = {0}", pay|.

    how exactly did the names of the employees, the "--------------------", and the "Calculating Pay." get printed out as well, and all in perfect order?

  24. i ended up buying the: https://www.canadacomputers.com/product_info.php?cPath=22_1195_700_1104&item_id=110653

     

    i've been using it for 4 days and there is an entire world of difference between the way my eyes feel using this monitor, and my old monitor. for some background, most of the time i was using my old monitor it was at max brightness without any reduction in blue light or any dark themes. it reached the point where every day my eyes were burning like crazy before going to bed.

     

    i eventually learned about dimming the brightness, reducing blue light and using dark themes on dim text. my eyes went from burning, to straining. it was a big improvement.

     

    this monitor takes it to a new level. my eyes feel very relaxed through most of the day, and by the time i am ready to go to bed, my eyes feel fine. i'm pretty much doing what i did with my old monitor. i have the brightness very low and i'm using f.lux to reduce the blue light. also a lot of dark themes. i'm guessing that the vast reduction in eye strain is because there is no flicker on this monitor.

     

    i don't know what all of this pwm stuff is, and i didn't bother using the low blue light features that the monitor has. when i use f.lux there is a noticeable reduction in blue light that i can control, and when i get used to that reduction the colors on the screen seem incredibly natural.

×