GitHub and My computer problems

For help and support with Universal Media Server
Forum rules
Please make sure you follow the Problem Reporting Guidelines before posting if you want a reply
User avatar
mik_s
Moderator
Posts: 1115
Joined: Wed Aug 23, 2017 11:03 pm
Location: UK

Re: GitHub and My computer problems

Post by mik_s »

Thanks. I made a start but this is going to be harder than I thought :o
There is a lot in there and I'll have to learn what each part does before changing it. I'll chip away at it and see if I get anywhere. No guarantees though :lol:

My ram stick came though and now my PC is like a new computer. Much more responsive than it's ever been on win 10. The old stick must have been failing for a while with error checking kicking in to keep it running but slowing it down. Once there were too many errors for error checking to fix was when it stared to crash. That was the main reason for upgrading from win 7 as it was becoming slow and constantly accessing the hard drive.

Was a little worried when I couldn't get the computer to POST with just the new stick to do a memtest, had to put the old good one in too. must be that this new stick is faster than the old ones and having both in forces both to run at the slower speed.
I am now eyeing a £10 used 60GB SSD, while nothing special and with half it's lifespan gone, it will make a vast improvement.
Logs are important for us to help, Please follow This Link before asking for support. Just a forum cleaner, Will help if I can but no expert.
Nadahar
Posts: 1990
Joined: Tue Jun 09, 2015 5:57 pm

Re: GitHub and My computer problems

Post by Nadahar »

mik_s wrote: Sun Jun 28, 2020 6:42 pm Thanks. I made a start but this is going to be harder than I thought :o
There is a lot in there and I'll have to learn what each part does before changing it. I'll chip away at it and see if I get anywhere. No guarantees though :lol:
I think you will come around and realize that SWT might not be worth it once you've dug in some more... :P
mik_s wrote: Sun Jun 28, 2020 6:42 pm My ram stick came though and now my PC is like a new computer. Much more responsive than it's ever been on win 10. The old stick must have been failing for a while with error checking kicking in to keep it running but slowing it down. Once there were too many errors for error checking to fix was when it stared to crash.
Error checking? Are you running ECC RAM? :shock: If so, I understand why it's expensive...
mik_s wrote: Sun Jun 28, 2020 6:42 pm Was a little worried when I couldn't get the computer to POST with just the new stick to do a memtest, had to put the old good one in too. must be that this new stick is faster than the old ones and having both in forces both to run at the slower speed.
That sounds strange, but your BIOS/UEFI might not recognize it. I'd check if there are any updates to the motherboard, it's more "comforting" to know that the motherboard actually recognizes the RAM. If it doesn't POST, you can't get into the BIOS/UEFI to configure the memory settings manually either, so you're kind of screwed. I'm just thinking that if your other "old" stick dies too, it would be a shame to be "locked out".
User avatar
mik_s
Moderator
Posts: 1115
Joined: Wed Aug 23, 2017 11:03 pm
Location: UK

Re: GitHub and My computer problems

Post by mik_s »

no its not ECC, I was assuming it was something windows was keeping checksums of and doing the corrections, till there was too many for it to fix. I have no Idea if that was happening though.

I updated my BIOS/EFI (before UEFI) after upgrading to win 10 as now my windows is legal I didn't need the modified BIOS I was using for win 7 :shock:, but due to the age of my motherboard the last BIOS update was 2013 I think.

I hope my other stick doesn't die anytime soon. I tried to get a pair the same as what I have on e-bay so I would have one spare, but got outbid at the last second :(
Nadahar wrote: Tue Jun 30, 2020 3:00 am I think you will come around and realize that SWT might not be worth it once you've dug in some more...
Its not just the SWT. Trying to get my head round the object oriented programming thing. What I have done in the past has been linear and fairly straight forward and its hard to get used to oop. I got a handle on what private, public and protected means now and why they are needed.

what I do find confusing is things like

Code: Select all

button button = new button();
but I know this can be very powerful, just a a glance it seems to makes no sense. :?
Logs are important for us to help, Please follow This Link before asking for support. Just a forum cleaner, Will help if I can but no expert.
Nadahar
Posts: 1990
Joined: Tue Jun 09, 2015 5:57 pm

Re: GitHub and My computer problems

Post by Nadahar »

OOP is both loved and hated as far as I can tell. Personally I find it very useful, but I dislike all kind of fanaticism. There are those that claim that you have to do this and that to "stay true to the OOP philosophy", that's where I leave the train. I use objects when I find it useful, and I use other constructs when I find that useful. I think Java "forces" a bit too much "OOP ideology" sometimes, but it mostly works out reasonably well.

Since the need for developers have become so great as the world have moved to using more and more software for everything, the "quality" of the "average developer" have fallen a lot in my experience (there simply aren't enough people with the right abilities available). This has lead to some strange trends like "functional programming" and languages that doesn't let the developer handle threads (and thus thread-safety). I just feel sad when I see this, but I guess it's just the way it has to be when the world wants to "dumb down" programming.

My impression is that there's quite a lot of people on the "functional programming" bandwagon these days, and they generally despise OOP. I strongly suspect that these people doesn't really grasp OOP, so they just find it frustrating. It's a bit funny really, because as I see it, "functional programming" is exactly what we had before OOP.

There's no reason to have to choose, my view is that you use whatever best fits the task at hand. Even though Java doesn't have "pure functions" (functions that doesn't belong to a class/object), there's already a well established tradition of making "utility classes" which are simply collections of static methods - aka "functions". Static methods in Java doesn't belong to any particular instance/object, and are thus in reality the same as a "old fashioned" function. They are useful when you want to process data instead of "creating control logic for an object".

What OOP comes down to is basically code reuse and logic separation. By using inheritance, you can make a "base class" (e.g a car) that has the fundamental properties that all cars share, and then you can make a subclass that inherits from the "base class" (e.g a blue sportscar). By doing this, you reuse the code that is common for all cars, while you only write the code specific for blue sportscars in the subclass. When this is done, it's much quicker when you want to make a red, electric city-car, since you already have the code for the fundamental things for a car, and you just have to make the specifics for that variant. If you didn't use OOP, you would have code for the blue sports car, and you would then have to copy/paste that code and modify it into a red city-car. You would then end up with two sets of code that were similar but not equal, and whenever you wanted to implement electric windows you'd have to do it for both types of cars. With OOP you can add electric windows to the "base car", and make it available to all the sub-types.

There are some terms in OOP which aren't intuitive (at least not to me) and that can confuse somewhat until you get familiar with them. Classes is one such thing, I still don't know how to accurately describe them, although I know very much what they are. Often, classes are physical (*.java) files, but not always. It is possible to declare classes within other classes, so some files will contain multiple classes. A class is... "the code that governs how a particular object type will behave". It's like the blueprint for the object, but the object/instance itself doesn't exist until it is created at runtime. Objects/instances are usually created using the "new" keyword, although there are other possibilities.

So, if you have a "base car" class and a "blue sportscar"subclass, you can create a new instance of a blue sportscar with "new BlueSportsCar()". You can create as many blue sportscars as you want when you have the class file(s) describing how to make one. Instances can also be destroyed, although not explicitly in Java. Java handles free'ing of objects for you, so all you have to do is to make sure that you no longer keep a reference to the instance, and Java will free it when it feels like it. This can take a while though, which is one of the reason why Java has a tendency to use more memory compared to languages where you have direct control of destruction. The plus-side is that you can't really create memory-leaks, and of course, you don't really have to think much about clean-up.

I don't really believe that you found the code you posted:

Code: Select all

button button = new button();
It doesn't make much sense to me at least. Instead, I guess it says:

Code: Select all

Button button = new Button();
That means something completely different ;P The reason is that convention dictates that classes starts with upper-case while variables/fields and metods starts with lower-case. What this code does is thus quite simple: It creates a new instance of class "Button" and assigns it to a new variable called "button". The first "Button" is the declaration for the new variable "button", and it dictates that it will be of type "Button". The part after "=" is the creation itself, which is done by calling the constructor for class "Button". In this case the constructor has no arguments, classes can have many constructors, and they often have a variety where you can choose the one that fits your use case best. When using a no-argument constructor, you will usually get a new instance with most things set to their defaults, when using constructors with more arguments, you can customize the new instance more to fit specific needs.

I've preached this many times before, but I claim that OOP is fundamentally quite easy to understand once you grasp the concepts. It can be complicated if it's used in a "complicated way", but fundamentally it's very straight forward. But, until you understand the fundamental concepts, nothing makes much sense at all.

I think it's helpful to think of the fact that when a class exists itself, it use no memory - it's only a blueprint. It's first when you create an instance, that memory for that object is reserved and populated by whatever information the class holds. For each new instance you create, new memory is reserved. The code in the class doesn't use memory, only the fields defined in the class ("class variables") that aren't static. If you have a field for "top speed" in your "car" class, memory will be reserved to hold the top speed value once for every car instance you create.

So, although public, protected and private certainly is a part of OOP, it's not where I would start when trying to understand it. These merely regulate the "access" to the class, field or method from other classes. Personally I almost feel like "private" should be banned, it sure is over-used in a lot of Java code. What it does is make inheritance impossible or at least very unpractical in many cases. It's such a waste IMO, so much code that needs to be duplicated just because some developer have decided to make some particular field or method private. Usually for no good reason in my view.
User avatar
mik_s
Moderator
Posts: 1115
Joined: Wed Aug 23, 2017 11:03 pm
Location: UK

Re: GitHub and My computer problems

Post by mik_s »

That code was from memory but I did see it used in one of the tutorials, but I'll have to pay attention to the caps. Good thing Eclipse highlights them in different colours to differentiate them.
WindowBuilder creates similar code as a default button, but that is more understandable

Code: Select all

Button btnNewButton_1 = new Button(shell, SWT.NONE);
Nadahar wrote: Tue Jun 30, 2020 6:10 am I've preached this many times before, but I claim that OOP is fundamentally quite easy to understand once you grasp the concepts. It can be complicated if it's used in a "complicated way", but fundamentally it's very straight forward. But, until you understand the fundamental concepts, nothing makes much sense at all.
I'm getting there and is starting to make more sense
Logs are important for us to help, Please follow This Link before asking for support. Just a forum cleaner, Will help if I can but no expert.
Post Reply