Wednesday, July 25, 2018

C++ aka: &#%*!!!!

Wow C++ is a nightmare when you are a noob at it! I'm building my notes, bookmarks, todo, whatever app in it. It is basically just parsing input from the user, and performing DB operations on it. It's essentially a super simple two column DB abstraction.

Apparently with C++ it is either 'all good in the hood' or 'OH HOLY CRAP THE EARTH JUST BLOWED UP!!!!!'. I'm trying to get a feel for what's best to put in a header file vs a class, trying to wrap my head around pointers (in real life.... they make perfect sense when explained, but when you dig in to use them... 'wait. what?!'), and classes in general in C++.

I worked forever and finally came up with a basic string splitting code block. So I could put the user's input into an array to work with. I have a Functions header so I can have global helper methods handy. I also have a DB header. I was thinking I would want that around everywhere and have it persist. All was good.

I created an Entry class. And defined a header with its definition in it. I created a variable of it and called its methods, all was good. Then I decided its database path should be a pointer to a path in the main so when it changes I don't have any maintenance to do. OH HOLY CRAP THE EARTH JUST BLOWED UP!!!!

I tried to track down what I was doing wrong and that only exploded the errors so they filled up the console. Ok. Nevermind. Later.

My database methods were in a header ao I could have a static callback method, for retrieving data. But I needed that header in main and Entry. Duplicate declarations. So I tried the compiler if/define trick. Nope. I made it into a class. After the earth blowed up a dozen more times I FINALLY got that to work.

So I guess I'm now a C++ guru. Ha.

Tuesday, July 24, 2018

Are We Through, Java?

There are plenty of strong opinions about Java. I've always been a fan. Mainly when I found Gnuroot for my phone. Then everything I did was a Java console app... because I could run it on my phone, and my desktop, laptop, work boxes, wherever!! Well thanks to Android, Gnuroot is dead in the water. I believe it is due to further file system lock down or similar. So that incentive was gone.

But at that point I had become very comfortable in Java and had come to actually enjoy it. I was a fan. I still am. My IF game engine turned out pretty cool. But SQLITE gets slow unless you do weird acrobatics. And now that I'm working on a game that requires real time movement AND data reading based on that movement, the SQLITE rooster has come home to roost. Even simple data transactions are disastrous. If I can't find a viable asynchronous solution, I'm afraid it is time for Java and I to part ways.

I'm currently looking into multithreading and tasks (I believe they are). Any solution will likely involve a decent learning curve, I've never really dug into asynchronous work in Java. I see there are some Java solutions out there that claim to offer asynchronous database interactions. I may have to explore those options.

We'll see what happens.

Monday, July 23, 2018

I Found Rust

Yes, it's about time. It's only been there since 2010. All this time I've never spotted it. Rust. But then again I don't often go about looking for new programming languages. Typically I'm trying to find out new ways of using the few I know fairly well. - And of course the periodic and futile attempts to successfully build something in c++.

Then completely by accident I stumbled upon Rust. I like the memory safety, 'lending', and race free concepts. I'm not aware of other changes from c++ yet but I may have to mess around with it. Of course I'm not terribly savvy at c++ so it'd be as steep of a learning curve as c++ itself would be.

We'll see what happens. I am currently at a crossroads. WorldWeaver is pretty stable currently. I've been doing some game building in it, but no real updates to the engine or admin tools. I have a space mining start in Java, but database interaction is too costly, I need to figure out how I'd deal with that. But not much on my plate.

Sunday, July 8, 2018

CPProgress

I've decided to take the plunge - finally - and learn c++. To do so I'm taking my nmx notes/bookmarks/todo/whatever app and recreating it in c++. It is a good candidate because I've been building it in one form or another for over ten years now. It was once a web-based GUI then it got rebuilt a couple times in Java as a console app. So I'm very familiar with what it needs to do and how to accomplish it. And it's much simpler than my IF game engine, which has its own custom markup language in it, as well as a help builder tool. The help system will be part of nmx, but I'll save it for later, when I'm comfortable with c++.

As I go I'm building a library of how to do certain things in c++ like file/folder manipulation and sqlite3 methods. The input parsing should be interesting, considering how tricky it was to get string to array functionality working. I'll convert it to regex, which I need to do for all of my other console apps in Java. I would like to be much more adept at regex anyway.

So far it's starting to fall into place, I have basic input handling and database creation in place. Once the DB is defined I'll probably tackle the regex piece. I'll also have to parse through datasets coming back from the DB.

Saturday, July 7, 2018

Ancient Nerds

It is so cool learning about how similar ancient scholars are to us. We come up with interesting problems that we can try solving with code, like the knapsack problem. Nerds in the ancient past also came up with interesting problems that they could solve - with mathematics. Like the bisect an angle with only ruler and compass problem. Then later the unsolvable 'trisect' an angle with only ruler and compass.

I can completely see how solving these problems would be every bit as exciting as wrapping up a function / feature / program and executing it. It was exciting to see how the bisection problem is solved, just as exciting as seeing knapsack solutions or other software solutions or algorithms.

And ALL of us have benefitted from the work of our nerdy ancestors.

Friday, July 6, 2018

Everyday Tasks

I love VIM. I've said it before. It's the only editor I use. The idea of being stuck using a non-VIM IDE is terrible. I would be spending hours working in software I don't like. I think maybe I feel a little bit like that with naming, capitalization, and formatting as well. I thought about this when I pulled up an editor and found that it defaulted its tab indenting to two spaces. Two spaces seems almost as bad as Notepad's 8 spaces. I personally prefer 3-4 spaces, and they definitely have to be converted to spaces.

It's not the end of the world but having to work in editors and styles joy don't like can affect the joy of development.

Monday, July 2, 2018

4DX Movies

I just experienced my first 4DX movie in Seattle. I saw Jurassic World: Fallen Kingdom. If you don't know what 4DX movies are they are like a two hour 4D ride (ala Star Tours etc). The seat moves with the action so you feel like you are falling, flying, running etc in sync with the action on the screen. It blows air on you, and your legs, shoots water mist on you, and flashes lights along the perimeter of the theater.

Some of the action is very convincing but the fight scenes can be overwhelming as the seat jostles you around. By the end of the movie I just wanted to relax. It felt like the movie was overloaded with action, maybe in a normal theater this wouldn't be the case, I'm not sure. The more subtle effects were cool. Flying or sweeping scenes were great and really pulled you into the movie. Other times however it was actually kind of distracting and took you out of the movie, back to reality.

It would have been cool to have it blow warm air - there was a lot of lava that would have been perfect for such an effect. All in all it was worth it. I would say try it once, you should experience it. However I'm not sure I'd do it again. Maybe with a mellower movie. A horror movie might be cool to see in 4DX.

5 VST Effects I Use in Every Song

VSTs are so great. I have a massive collection of free instruments and FX that I've tracked down. There are SOO many to choose from... B...