Goodbye, QML

I’m “abandoning ship” and hopping on Xamarin/Microsoft bandwagon on creating mobile apps with C#. It pains me to say that getting things to work requires a lot of effort with QML. I feel like there’s so many, many things it can do yet it tries to be so many things. At the end of the day, I was put against these options:

  • To deliver applications rapidly and gush out iterations as I go
  • The need of high-level language as C++ can be a little tedious to do some things. One can easily run into type issues.
  • Less time working on C++ backend, less time trying to understand why certain QML elements consumes over 800MB in memory (hello TextArea, you sure can’t handle 10 high-res images).

Overall, QML and C++ combo, as powerful as it is has too many memory usage issues, a steep learning curve.

Today I went over Xamarin stuff, it was relative easy to get started. I noticed that I could finally work with Activities, unlike Qt, which you have to spend a lot of time learning the android/qt cycle.

It pains me, but as most of you I also want to put my application out there in the wild as “soon as possible”. With Qt/QML I completed one mission, and that was learning C++. I did, maybe not to an expert level, but I grasped plenty.

Looking for a new home

Recently received an e-mail by Digital Ocean that they will be removing the credits soon so that they can re-purpose the servers. The decision mostly affects students (like me), so soon enough I will be making a backup of the compressed archives I have published here. As for this blog? I’m not sure where to put it… I certainly don’t have the money to put out there right now just for one blog.

Updates, updates everywhere!

I’ve been watching Microsoft’s Build event, been doing so since last year and this year has been pretty darn exciting. I’ve yet to dabble into C# mostly due to most of my energy going to C++, it’s apparent that I want to work with C#, after working with Qt I feel like the reach for “easy mobile development” is a mere pipe dream. I feel… disappointed? I guess. The truth is that I’ve spent my time doing more workarounds and hack-ish solutions that actually working on my application. QML is a very, very insanely powerful language, the things it brings to the table is just awesome. Yet, the price to pay is having poor documentation on many QML elements.

Putting my feelings aside on Qt/QML for a moment. I think that I will eventually push for C#, in all honesty I just want to stay with one, maybe three languages to work with. Right now I’m just a jack of all trades, and I don’t like it that much.

Anyway! More updates

Recently I bought an SSD, a 256GB drive and it has been a huge step for me. I usually had to wait 5-9 minutes for a full boot in a normal HDD. Now it boots completely in 20-30 seconds.

2016-03-29

I also bought off a 970 GTX from a friend. I’m way behind games, and well, hardware in general. Once I installed it on my PC it blew my mind after playing games like Witcher 2 in pure 60FPS, Call of Duty: Ghosts was the one that called my attention the most with insane level of detail. I plan to snatch Advanced Warfare eventually too.

2016-03-26

Both hardware pieces have contributed greatly on my PC. The boot time is no longer a problem and Visual Studio opens in less than 10 second. Meanwhile games I had problem playing due to framerate issues are no longer an issue.

Now… there’s only one big worry I have. Software development interviews and getting hired. These are possibly my biggest challenge, as a person new to the industry I just don’t know what to expect.

Graduation around the corner

It’s been an awful week for me, sort of like a roller coaster. Like two weeks ago I got the notice that I qualify for graduation, there’s only two courses left that I have to take, that is the internship (which isn’t much of a course) and a history course. Time has passed, year after year I just wanted to get that degree already so I can finally drop my applications to U.S-based companies.

Obviously programming is a very competitive field. I already admitted myself that I will make mistakes and that “I know that I know nothing”. I hope that all the time I spent studying, tinkering, practicing with different programming languages comes to fruit. I’m thrilled and terrified, really.

I’m finally there though, these past three years have been hard, painful, agonizing even on multiple levels, ranging from family issues to profession issues. That said, it’s no use of thinking of the past, it’ll get you nowhere. Usually I just severe anything in between and carry on, for the better or worse.

Just three months more. o/

Reducing complexity

I feel awful, yet happy, yet tired.

A bit of an annoyance is when you spend hours doing something, then a week or two later you see a new library that does that and simplifies the code greatly; allowing maintenance and readability at the same time.

So, take it as you may but if you are using classes like QXmlStreamReader or QDomDocument do yourself a favor and try pugixml library. It’s said to be faster than the previously mentioned. In terms of code readability QDomDocument is the nearest that matches pugixml due to its DOM api, yet it’s also slower and consumes a hefty amount of memory in exchange, where as pugixml stays lean.

The inadequacy of HTML, delving into C, and pondering remote jobs

I’ve been working with HTML in low-level languages like C/C++ and I must say that it’s been a rather frustrating experience. One would think that the task I’m doing should have been done ages ago, since the conception of the project. Alas, that’s not quite right. What you fail to realize is that you should NEVER underestimate the dirtiness of HTML outputs all around the world. This whole week has been about cleaning/scrubbing/sanitizing HTML. I ended up grabbing to rather awesome third party libraries, one called pugixml and the other libtidy (also known as tidy-html5).

libtidy, being a pure C library took me a while to get the hang of as I’m not that experienced in C. Even though I’m writing C++ it doesn’t mean I’m working with pointers the majority of time (mostly on the stack). It was more of a game of “copy this chunk of memory and put it as an argument in this C++-powered method so I have more control over it with the classes I’ve built. But I needed it to work, regardless on how long it took to get right because without tidy it would be really, really hard to do any scrubbing. pugixml and other XML parsers can get quite cranky while parsing misplaced tags.

Which brings me to pugixml!

Apparently QtXml module is no longer maintained as it has reached a matured state. The array of classes QDomDocument have in general feels suiting to do the job, sadly the documentation stresses that it uses too much memory, and apparently “pugixml is faster than QXmlStreamReader”

In the end. I chose pugixml because it’s just simple, it doesn’t have the annoyances QXmlStreamReader brings.

Another subject I wanted to bring is the interest of the C language.

I’ve been thinking of learning more about C. At least the basics to defend myself from cases like libtidy. I also wanted to learn more about C due to Gtk3 and due to getting closer to system programming (not that C++ isn’t capable). Mix this interest with me wanting to work with microcomputers or embedded systems and I might make something out of it.

Lastly there’s that thought of me wanting to get a job related to my field. I might try to get a job remotely, well, time will tell. For now I’m too tired, mentally spent, yet as I finish this post I have a class to attend to in college. 🙁

SQLite and the importance of indexes

I didn’t spend too much time on this issue, but as someone who knows the basics to intermediate in SQL it still caught me off-guard on how easy it is to have insanely slow query performances.

Take an innocent query like this. Once would think it has some sort of meta information stored already, but it doesn’t

select mytable.*, 
   (select count(*) 
    from mytable2 
    where mytable2.id=mytable.id ) as count
 from some_table;

What it does is that it will get all the columns in mytable and additionally it performs a COUNT based on id in a subquery thus the result is the total count per ID.

It took 7662ms to perform the query on two tables that have 387, and 4,800+ rows respectively. That’s not acceptable in any way, putting that sort of query in production will make your customers leave eventually due to the slowness of the system.

I googled a bit on the issue and found that sqlite doesn’t store any meta or index. I went ahead and create an index based on the second table, as the first one already has an index (primary key).

I managed to trim those seconds to 240ms, which imho is pretty acceptable, yet makes me feel uneasy.

The result?

select mytable.*, 
   (select count(ROWID)
    from mytable2 
    indexed by my_awesome_index
    where mytable2.id=mytable.id ) as count
 from some_table;

That’s all it took.

I’m still not completely satisfied with results like this, I will continue finding a way to trim those 200ms away to 20 or 50. I have an idea on how to do it but for now this will do.

Repositories

If by any chance you click whatever github link related to my account I have to say that I’ve removed myself from Github and now use BitBucket as my go-to needs for “backing up” and collaborating. There’s also GitLab but I have found that their interface and site is so… so slow, compared to BitBucket.

Support

Yesterday, one of the most beloved wrestlers in the WWE, Daniel Bryan, announced his retirement followed by one of the most passionate, honest goodbyes in the WWE. Daniel retired due to medical reasons he was set to the final slot yesterday in Raw followed by the WWE Network for an extended time.

8v4kQ14

It was heartbreaking.

I love wrestling, really do. Seeing one of the wrestlers you cheered for go down for whatever reason hurts to some extent. Today though, I was reflecting on some of his words, his interactions with his family, and so many other things that made question, “what am I doing?”.

My interactions with people hasn’t been the best; I feel like most of the time I have spent has been wasted. I’ve been ungrateful. I seldom smile honestly, it’s something that I have taught myself to do over the years. I want to learn how to “act” normal, while missing the point of being yourself.

I wish I could say I tried, but this isn’t the case. I have given up so many times without trying, yet you see this guy, Daniel? He’s a fighter, he kept pushing on even with all the injuries. I didn’t. I always come around, really late, pick myself up and push once again.

Which is why it was never a matter of “trying harder” but having the desire to want it. There’s a lot of issues I want to resolve… I guess time heals old wounds. I did learn a lot yesterday, I just don’t think I can put it into words.