Tuesday, November 3, 2020
FPS Mismatch Pain
Wednesday, July 1, 2020
Clipboard Project
Thursday, June 11, 2020
Never Say Always
Thursday, April 16, 2020
I've Done It
Monday, April 13, 2020
The MP3 Problem
Saturday, March 21, 2020
Slick Help
Saturday, January 4, 2020
Data Data Data
Sunday, December 22, 2019
Simple Service
Tuesday, November 12, 2019
Granular Collection
Wednesday, November 6, 2019
Oh the Memories
Wednesday, May 8, 2019
Clipboard Trouble
In my foray into c++ so far there's one piece that is still eluding me: copying to the clipboard.
I want to be able to copy field values directly to the clipboard. So far this is eluding me. I've seen qtclipboard snippets but I've yet to get that class successfully added to my includes - even after installing qt on my laptop. I think that part of my problem is I'm trying to maintain a single code base. I don't mind needing to build windows binaries all the time, I DO need to structure everything so I don't have a nix directory and a windows directory (AND yet not have messy directories). I want one copy of the code files, one copy of the help defs, that's it.
At this point, after trying a few different options, I've put it on the back-burner.
Monday, May 6, 2019
Simple Fixes
I'm not sure if I'm a lazy developer, but I like my code like I like my computer's desktop - minimalist. I can appreciate engineering a solution for flexibility and robustness but either my skills are way below the people who write such code or their code is really difficult to decipher and update - or simply implement. If I'm looking for reusable code snippets I can use, as soon as my eyes start to glaze over I move on and look for a simpler piece of code. I'm pretty sure that says more about my skills than the snippets authors.
A great example of my minimalist tendencies is a fix I made this morning. I don't code in Python but I currently support an image data extraction script written in it (So I'm doing a lot of hilariously noobie web searches). I need to run large batches through it via input file of DB record IDs. The trouble is it isn't 'resumable'. So if it works all day and crashes before the batch is done, it has to reprocess everything from the top.
I'm not sure what other developers would do, here's what I did:
If it doesn't exist, I create a file:
<input file name>.bmark.txt
Where the script reads the input file into a tuple, I set bookmarkid the first row of the bmark file.
For each row of the input file... If bookmarkid is not "", is the current input id the bookmarkid? If so, clear the bookmarkid.
So the next row in the input, we have a bookmarkid of "" so we add the input id.
Later as we run the ids through SQL, as each one completes, I replace the bmark file contents with the successful id.
When everything is done, I delete the bmark file, just to be tidy.
So that was my minimalist solution to the problem. I added a little file to persist the last successful id that was processed. And when the script is started, I grab any 'bookmarked' id and check for it (The code was already reading the rows into a tuple, I just skipped adding them to the tuple until the bookmarkid == ""), resuming at the next row.
Win Build on Nix
I have completed a functioning version of NMX (Note Matrix - a project I've been building and rebuilding in various languages and platforms for - probably almost 15 years). It is a console-based notes / bookmarks / todo list / contacts etc app. It uses SQLITE for its database and every time an entry is viewed it creates a txt file of that entry, so you can view your data in any text editor (This feature came about in the Java version, so if you have Java issues, or the DB becomes corrupt, or incompatible with future versions of NMX, you can still read your data).
Being a total c++ noob, compiling the Windows binary was a challenge. I setup a virtual Windows box and tried Mingw. I had a hard time getting the SQLITE .dll linked. After a few attempts I decided to go with an IDE to build it. I went with a free lightweight app: Code::Blocks. I got my c++ files loaded into a blank project and linked the SQLITE .dll and it built!
My only concern was that the Windows OS in my virtual box would expire in about a month or so and I would have to rebuild it. So my goal was to be able to rebuild the Windows binary from within Wine.
I downloaded and installed Code::Blocks and Mingw in Wine. I had to get the Ming Gcc/G++ installed then it worked! I had to find and add the .dll versions of the standard libraries. I put these in the same directory as my sources. I tried creating a .bat file to call the same commands that Code::Blocks does when it rebuilds, but this didn't seem to work, so I'm stuck with Code::Blocks, but at least I can run it in Wine instead of a virtual machine.
Wednesday, April 17, 2019
CPP Progress
I have made progress at last. My implementation of my note-taking app now parses input, doing wildcard matches on the users input, against pipe delimited possibilities. It now creates new Entries and has a method to show them. I need to create the view entry command and I need to format the output, but it's a solid start.
I'm slowly beginning to feel more comfortable with the language and how to accomplish what I need. Pointer types are still tough, but getting better. I finally resolved the re-declaration error from header files being included more than once.
I'll have to setup a Windows vbox so I can grab the SQLITE .dll and compile it for Windows.
More to come...
Monday, April 15, 2019
C++ No Class
I've always worked with OOP patterns, even when I didn't know what I was doing. Honestly it makes sense to me, naturally. It is easy for me to wrap my head around how large problems can be broken down into manageable objects. I feels organic and natural to me. As many OOP explanations point out, it mirrors reality. I have a much harder time understanding functional paradigms. it just feels like the dreaded 'spaghetti code' to me.
However, as a high level language developer digging into C++, my feelings are a bit reversed. When I attempt to define and consume classes etc, I keep running into all sorts of issues - redeclared variables due to includes. However if I remove the offending includes I get 'cannot find X'. I feel as though I'm in a catch 22.
So for my first C++ project I've decided to avoid the headache altogether and code everything within functions. Sort of a noobie functional paradigm. Instead of classes I'll have header files containing that element's functions which are called in main and in turn can call other functions if needed.
So far I have sqlite hooked up and some basic string parsing - which is frustratingly difficult so far. I'm amazed at how difficult simply doing a string split is in C++. More on that in future articles.
Tuesday, February 12, 2019
My Java Project Structure
I do all of my Java coding 'by hand'. I don't use an IDE and I don't use build/packaging/deployment tools. I like to get my hands dirty and I like to know everything that is in my project, I don't want any black boxes. Of course if a project were to become so complex, or powerful, or huge as to require additional tools I will use them. But I would be sad that I had to.
I use little shell scripts I wrote to do the compiling of code and packing of .jars. I use VIM to write all the Java code. I have a common structure that I use for all of my projects and I will share that with you here.
ROOT
Each project is a self contained unit. It lives within the project root directory. In this article I will use WorldWeaver (My IntFiction engine) as our example. All of the client code, classes, and output, and anything else for the project lives in:
~/worldweaver/
At this root level I have any shell scripts I use for compiling and running etc.
CODE
The code directory contains all of my source code (.java). I follow title case for all of my classes. - However, I'm bad, I use title case for my methods as well. And I use title case for my public variable methods, camel case for my private variables etc. I think this is a habit from my .NET days.
COMPILED
The compiled directory is where I have my .class files built. This directory also contains my manifest file.
RELEASE
The release directory is where my jar file is compiled. It contains any files that are to be distributed with the app, including data files, config files, and databases etc.
The full structure is:
ROOT
|__ CODE
|__ COMPILED
|__ RELEASE
I use javac with parameters for all of my building, copying and calls to java -jar in my shell scripts for launching, although I could also chmod the jar as executable and double click it like in Windows or Mac OS.
Monday, February 11, 2019
Regex, TDD Style
I've not done a ton of Test Driven Development (TDD) but from my understanding of it I like the idea. It's like checking your work in math, only backward. It forces you to check your work. You can't say: I would have checked my work but I ran out of time. At least that is my layman's perspective.
But I think the benefits of TDD may actually stretch into the core problem solving of programming. We know you have to think differently when taking a TDD approach, but I think that it could actually make the problem solving easier, and actually make learning new languages or syntax easier too.
What am I talking about? I just watched a video that walks the viewer through building regex expressions and the host did so by taking a TDD approach. He started with a valid value, and wrote a simple regex that would pass anything. Then he began to harden up the expression until it properly found only the desired values. I went away from the video with a far greater understanding of regex than I had before (I typically hamfist my way through regex use, scouring regexlib and using their tester tool to make sure what I find will work for me. Now I actually understand the syntax and rules of basic regex expressions - AND I saw a great way to actually author my own instead of copying/pasting existing expressions.
All through the use of TDD style regex expression writing.
Monday, February 4, 2019
API
I'm looking to build an API-based application. It's been a while since I've done any serious web work.
As I look into beginner API development it is becoming obvious how little I know. Apparently I've been spending too much time in the back end. It's going to take me a bit to get up to speed. Postgres was frustrating, couldn't even get a DB created. So that will be the first thing I tackle.
Ultimately my goal is a complete system of just APIs that could be used to build whatever UI a developer wants. The 'social end result could be a console app or a complex, full blown website or mobile app. Features could be included / excluded as desired. In an age where software is constantly taking away our ability to tweak and customize it, I want to go the opposite direction.
Sunday, January 27, 2019
No Idea
I feel like I haven't actually coded in my free time in a long while. I've definitely been busy with projects but they don't involve coding. I am building the Atomic Cage IntFiction game, and working on modeling some cars for a game, and doing tweaks to my murdered out Jreepad. No real coding.
I want to code stuff, but I don't have any idea what. I love console apps, and nerdy tools like VIM and would love to build something along those lines. I'm limiting myself in my choice of languages - Java. I can mimic multi-line input but it's funky and basic. Also it is difficult to launch other applications.
I have my contacts / todo list maker / bookmark manager but I've been working on it so long there isn't much I can add to it.
As I work on the game and meshes I'll ponder project ideas but so far I don't have any.
Friday, January 11, 2019
The Tutorial Path
Tutorials are such a great tool. I find that I learn best using them. When I'm interested in a particular goal or project often I'll follow a tutorial or two. After doing so I typically have enough tricks or knowledge under my belt to begin to tweak the project to my liking. From there I become more and more independent of guidance.
Recently I've been going that route with abstract 3D art. I've done three tutorials and tonight I built a creation that is more my own making than a closely followed tutorial. It is probably still obvious which tutorials I learned from but the end result is definitely different from them. And I have some ideas for future pieces that I will most likely be able to pull off on my own.
I am a beginner for sure, but I now know a few tricks that will get me closer to being able create what I envision.
Introduction to WorldWeaver
A New Iteration I've been working on the second manifestation of my Interactive Fiction engine - WorldWeaver - for about a year now. I ...
-
In my foray into c++ so far there's one piece that is still eluding me: copying to the clipboard. I want to be able to copy field value...
-
So I've been using Shotcut for a while now, for my YouTube videos... and music videos. I love the application. Slicing clips, doing fade...
-
Is it just me or is selecting text on a phone a major headache? Surely there must be a better way. It seems like a good idea in theory. A s...