I learned today that there is a class design tool in Visual Studio which took some years to figure out. It's not a built-in part of VS2019 but should be. Seeing the class hierarchy in visual level shows "problems" in inheritance very clearly. Although the class hierarchy can be anything you want, but often a tree-like hierarchy is better, from simple to more complex classes.
There are huge stacks of single use classes in both Kaduria and Teemu which looks kind of funny. I think with this new tool it's easier to fix class hierarchy and it's going to be my short term life goal for sure.
I don't yet know what to do with Teemu's github adventure. I actually hate github and source control, because as we saw anything can happen. I feel it's also unneccessarily complex system, but that's typical in the linux/open source scene. Everything is super complex and obfuscated for no clear reason.
Saturday, 29 June 2019
Tuesday, 28 May 2019
Realtek LAN problem solved
Remember the Asus Prime H370 Plus' Realtek Lan unable to connect to internet? The actual problem was that not even Asus knows the lan chip in their motherboard is Intel I219V, not a Realtek. The installation program in original driver CD has the proper driver and I found out that just by trying it, even they often have outdated drivers. The new computer doesn't have a CD drive, but my old has, so I copied everything from there to usb stick.
I've been thinking to create just one blog for my ramblings, but maybe later. The new plan for Teemu and other projects is that Teemu is going in github, but maybe not Kaduria, at least not yet. Not in the development stage. It makes more sense, because Teemu has always been "open" source (the source code is available).
The new PC is nice and fast, but it still does have couple of problems. Since the case fans are DC type (three pin) they for some reason can't be set less than 800-900rpm so they are quite loud. The processor is running average 30C temp, so it's cold and I guess doesn't need case fans to run that fast. So I need to get quality PWM case fans. Another stranger thing is that when I turn on power from switch outlet the lights in the keyboard lit and they stay on (caps and scroll lock lights) until computer is turned on, then they start to work as usual. It may be even some kind of grounding issue, but I have no idea what it is. Related problems when googled are opposite, when people turn off the computer the keyboard lights stay on. But in this case the computer is not even turned on, just the power.
I've been thinking to create just one blog for my ramblings, but maybe later. The new plan for Teemu and other projects is that Teemu is going in github, but maybe not Kaduria, at least not yet. Not in the development stage. It makes more sense, because Teemu has always been "open" source (the source code is available).
The new PC is nice and fast, but it still does have couple of problems. Since the case fans are DC type (three pin) they for some reason can't be set less than 800-900rpm so they are quite loud. The processor is running average 30C temp, so it's cold and I guess doesn't need case fans to run that fast. So I need to get quality PWM case fans. Another stranger thing is that when I turn on power from switch outlet the lights in the keyboard lit and they stay on (caps and scroll lock lights) until computer is turned on, then they start to work as usual. It may be even some kind of grounding issue, but I have no idea what it is. Related problems when googled are opposite, when people turn off the computer the keyboard lights stay on. But in this case the computer is not even turned on, just the power.
Saturday, 18 May 2019
Hardware problems
I have a new computer, a tabletop PC I built myself. I was surprised it started the first time and everything seemed to be ok, but then Windows 10 failed connecting internet. The problem seems to be Realtek's LAN and/or Windows. Obviously I tried to find a solution, but nothing seems to fix it. Reading other people's experiences I'm also going to try a LAN card which is going to have Intel's chip. In fact my current PC has Intel's LAN and I never had problems with it.
This is one of those strange things about PCs and hardware. How hard it would be for OS to figure out what exactly is wrong? Windows 10 doesn't really help that much, it just says the driver is not installed. When I install the driver from motherboard's site it doesn't do anything and the driver installation software is giving another error which tells it's not connected. It is and the cable works in my older computer. Maybe the cable or router is too old? No. It can't be. We'll find out about that when the card arrives in couple of days.
I'm really bad at working with hardware. I just want the computer to say it's ok. I spent a lot of time learning about new PC hardware just to be able to select proper parts that fit together. I don't know about the motherboard, it sure does look like it was not the best one to have (Asus Prime H370 Plus). Then again when you build from generic parts it's easier to change them. I even got a retail Windows 10 which means it's not tied to the motherboard (oem) so I can in theory change everything.
I also hate the way internet is full of "information" about how to fix these problems, because in most cases it's just noise. It's so hard to find actual solutions. I think the best one I've read this far was to remove memory and install it to another slot. You know, to fix that LAN port. I think the companies who build this crap should give us confirmed user stories how these have been fixed, but it's not likely, because companies like Realtek are way too large to have any kind of connection to regular computer users. I don't even want to talk about my bad experiences with computer repair, it's just not worth it to send a defected motherboard to repair. You have to remove it and wait for several weeks for it to come back with a note that it works.
This is one of those strange things about PCs and hardware. How hard it would be for OS to figure out what exactly is wrong? Windows 10 doesn't really help that much, it just says the driver is not installed. When I install the driver from motherboard's site it doesn't do anything and the driver installation software is giving another error which tells it's not connected. It is and the cable works in my older computer. Maybe the cable or router is too old? No. It can't be. We'll find out about that when the card arrives in couple of days.
I'm really bad at working with hardware. I just want the computer to say it's ok. I spent a lot of time learning about new PC hardware just to be able to select proper parts that fit together. I don't know about the motherboard, it sure does look like it was not the best one to have (Asus Prime H370 Plus). Then again when you build from generic parts it's easier to change them. I even got a retail Windows 10 which means it's not tied to the motherboard (oem) so I can in theory change everything.
I also hate the way internet is full of "information" about how to fix these problems, because in most cases it's just noise. It's so hard to find actual solutions. I think the best one I've read this far was to remove memory and install it to another slot. You know, to fix that LAN port. I think the companies who build this crap should give us confirmed user stories how these have been fixed, but it's not likely, because companies like Realtek are way too large to have any kind of connection to regular computer users. I don't even want to talk about my bad experiences with computer repair, it's just not worth it to send a defected motherboard to repair. You have to remove it and wait for several weeks for it to come back with a note that it works.
Wednesday, 8 May 2019
How other languages can help
Wish I had tried other programming languages way before. I knew what Basic is, because it was my first language contact back in the 1980's. But then I moved to C and later C++. Recently I have tried out languages like D, C# and most recently Go. I think they can help by giving back more motivation to work with C++, because most other languages suck.
Yes, they suck. Even though C++ is far from being a perfect language it has the least amount of suckage.
So what is the problem with other languages? It's often not the theory behind the language, it's the implementation of it which should give the developer more or less painful access to things like graphical output. Yeah, about that... It's mindblowing to realize that the main output type of languages like Go is text output in the terminal or console window. There are external gui libraries, but in case of Go they are quite difficult to install/use and also they are bloated because some weird reason the language works. Maybe it's the garbage collection memory model or something like that.
I guess some of these languages were never designed for desktop use, but then why do people still ask why C++ is the most common language when the answer is obvious. It's because you can actually write desktop software in C++, even it's an ancient language and GUI support is quite bad with bloated antiquated gui libraries like wxWidgets. The point is it's still better than anything else.
Not only I'm sick and tired of all those things, but then there are people who religiously defend some sucky language like Go. Don't these people have anything else to do, like write actual working computer programs. They never do that, because they can't.
Yes, they suck. Even though C++ is far from being a perfect language it has the least amount of suckage.
So what is the problem with other languages? It's often not the theory behind the language, it's the implementation of it which should give the developer more or less painful access to things like graphical output. Yeah, about that... It's mindblowing to realize that the main output type of languages like Go is text output in the terminal or console window. There are external gui libraries, but in case of Go they are quite difficult to install/use and also they are bloated because some weird reason the language works. Maybe it's the garbage collection memory model or something like that.
I guess some of these languages were never designed for desktop use, but then why do people still ask why C++ is the most common language when the answer is obvious. It's because you can actually write desktop software in C++, even it's an ancient language and GUI support is quite bad with bloated antiquated gui libraries like wxWidgets. The point is it's still better than anything else.
Not only I'm sick and tired of all those things, but then there are people who religiously defend some sucky language like Go. Don't these people have anything else to do, like write actual working computer programs. They never do that, because they can't.
Wednesday, 24 April 2019
Visual Studio 2019 first contact
The install procedure as side-by-side version was smooth. Sadly the installation is the best part of the new Visual Studio. Let's list the things I didn't like.
1. Everything is slower in noticeable way. Solution loading is slower, the editor also and compiling. It's less an issue if you have a modern PC which I don't have.
2. Automatic formatting of source code by default. I just don't like it. Why not leave everything off and let the user add formatting as needed?
3. In some cases when you press arrow up it doesn't go up, but warps to the end of the line, for unknown reason. Didn't yet figure out how to turn that off.
4. The already infamous extra horizontal toolbar area under the menu. No one needed it, but there it is and of course you can remove tools from it, but not the bar itself and "live share/feedback" buttons. I think the feedback button will be used to give feedback about this feature. Everyone who is actually programming knows that you need vertical space for text editor, but this strip is taking 2-3 lines of code away for no reason at all. At least make it optional, it can't be that hard to do.
I really hope Microsoft isn't slowly crapping VS, because it's probably the best piece of software Microsoft has ever released. Even with these new features you can work with it, it's not that bad. And there is no competition so you have to take it.
1. Everything is slower in noticeable way. Solution loading is slower, the editor also and compiling. It's less an issue if you have a modern PC which I don't have.
2. Automatic formatting of source code by default. I just don't like it. Why not leave everything off and let the user add formatting as needed?
3. In some cases when you press arrow up it doesn't go up, but warps to the end of the line, for unknown reason. Didn't yet figure out how to turn that off.
4. The already infamous extra horizontal toolbar area under the menu. No one needed it, but there it is and of course you can remove tools from it, but not the bar itself and "live share/feedback" buttons. I think the feedback button will be used to give feedback about this feature. Everyone who is actually programming knows that you need vertical space for text editor, but this strip is taking 2-3 lines of code away for no reason at all. At least make it optional, it can't be that hard to do.
I really hope Microsoft isn't slowly crapping VS, because it's probably the best piece of software Microsoft has ever released. Even with these new features you can work with it, it's not that bad. And there is no competition so you have to take it.
Sunday, 31 March 2019
Daemons everywhere
Banana Rogue has already 6 files that compile which can be seen as a minor success. It tells that once you get old C translated to C++ compiler it will be "fine" if we forget about memory management problems of C like raw arrays etc.
Function pointer stuff in daemon and daemons modules doesn't work, because the function signature has to match the pointer in C++ which is more strict about types. If I'm lucky it will be fixed by changing all 'void' functions to 'int' return value, even if they don't use it. Or check out if the functions actually are all void type.
The gui refactoring is almost ready. Most of the action happens in Window (previously WINDOW) struct of curses which I replaced with a class. Window is used inside io module through procedural function wrappers which makes it "easy-ish" to replace later with other type of implementation. Everything works in ascii level, the Window is simply a rectangle of ascii data. It's quite brilliant. The only connection to SDL2 will be Display which shows the window. Then also you need SDL2 in keyboard routines which are also simple in case of ascii codes. There will be some complications if you want to use modifier keys or any special keys like arrow keys, but it can't be too difficult to fix.
The rest of bigger problems are in save game routine, options module (which can be easy, I have skipped it) and linked list routines. The internal type for linked list data is surprisingly char* which is a mystery, because malloc itself is void type or typeless.
Function pointer stuff in daemon and daemons modules doesn't work, because the function signature has to match the pointer in C++ which is more strict about types. If I'm lucky it will be fixed by changing all 'void' functions to 'int' return value, even if they don't use it. Or check out if the functions actually are all void type.
The gui refactoring is almost ready. Most of the action happens in Window (previously WINDOW) struct of curses which I replaced with a class. Window is used inside io module through procedural function wrappers which makes it "easy-ish" to replace later with other type of implementation. Everything works in ascii level, the Window is simply a rectangle of ascii data. It's quite brilliant. The only connection to SDL2 will be Display which shows the window. Then also you need SDL2 in keyboard routines which are also simple in case of ascii codes. There will be some complications if you want to use modifier keys or any special keys like arrow keys, but it can't be too difficult to fix.
The rest of bigger problems are in save game routine, options module (which can be easy, I have skipped it) and linked list routines. The internal type for linked list data is surprisingly char* which is a mystery, because malloc itself is void type or typeless.
Saturday, 23 March 2019
When otherwise
The strange 'when' keyword was just a macro for break;case pair which I think is cute. I may even keep that macro, but some macros may have to go. Oh, I'm talking about Banana Rogue, a derived game from Advanced Rogue. I've now gone through source files and mostly created missing header files. Somehow it was possible to compile the source without header files back in what year it was made, because they weren't missing from the source, otherwise there would have been #includes for them, right?
The year is also a mystery (well, guess I could google more about it...) because the source says it's 1985, but it can't be that early, right? Also, the xcrypt source code which is some kind of strange encrypting method for wizard's password is from 1994. I think 1990's is much better guess for this game, they just didn't put it into the source code, but kept some random year, maybe the year they started to work on this game.
Xcrypt can be removed, because it's used for networking (password) which is going to be removed also. The system they programmed this had some kind of built-in networking, this was I think before widespread use of internet as we know today.
What is quite surprising is how clean the source code actually is. There aren't too much parameters in functions and the game has only few datatypes. Probably the most dangerous one is the linked_list which is as mentioned before a linked list type and when you combine C's memory management to that it could be a source of bugs. It's maybe too big task to replace it with C++ version, but it's early to tell. Maybe the internal implementation can be changed.
I'm not too concerned about "destroying" the original source code, but at the same time it's silly to replace everything that looks "bad" from C++ perspective.
The year is also a mystery (well, guess I could google more about it...) because the source says it's 1985, but it can't be that early, right? Also, the xcrypt source code which is some kind of strange encrypting method for wizard's password is from 1994. I think 1990's is much better guess for this game, they just didn't put it into the source code, but kept some random year, maybe the year they started to work on this game.
Xcrypt can be removed, because it's used for networking (password) which is going to be removed also. The system they programmed this had some kind of built-in networking, this was I think before widespread use of internet as we know today.
What is quite surprising is how clean the source code actually is. There aren't too much parameters in functions and the game has only few datatypes. Probably the most dangerous one is the linked_list which is as mentioned before a linked list type and when you combine C's memory management to that it could be a source of bugs. It's maybe too big task to replace it with C++ version, but it's early to tell. Maybe the internal implementation can be changed.
I'm not too concerned about "destroying" the original source code, but at the same time it's silly to replace everything that looks "bad" from C++ perspective.
Subscribe to:
Posts (Atom)