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. 🙁

Aftermath of memory management / designing for mobile / the need of something better

The aftermath… of all my chasing is that I got nothing. You heard me right. I spent days figuring out what was wrong just to receive one hell of a slap to the face that the OS doesn’t necessarily claim the memory back. But, I also noticed that memory started to be freed after changing the parent of QNetworkReply to 0, meaning I manage it manually.

Regardless, after some testing I’m happy to say that while I messed up big time the application is working as expected. I think the lowest I saw was the app using 18mb and that for me is more than enough.


Now onto designing mobile applications. See, I’m not a designer I know that, you know that. I don’t think I will get this right… but it’s time to let go honestly; I have spent too much time trying to have the “perfect” design and such thing doesn’t exists. Now I will sit one more time to work on a new mock up.


Perhaps I’m losing my mind. The more I think about it the more I notice that I’ve been preventing myself from experiencing something good. Not so long ago I pondered on getting a Macbook Pro for various reasons. The first being development, the second being Unix, the third being a polished desktop, the fourth being an stable desktop.

I get it, you love linux and I do too. It’s not enough. I want better printer support, better wireless support, better battery life because Linux can’t even do battery life management correctly and for a battery that last 2-3 hours using Windows I get only 1 hour. I just want a better desktop experience. See, windows provide that without me having to do much. Linux… provides that to a certain degree, once things start breaking apart due to upgrades then good luck because you will need it depending on the issue. The whole “well, you can just reinstall it back’ isn’t even a solution but a living proof that linux is still behind desktop experience.

It feels awful though, being a supporter and all, but once you start luring people in and seeing them running into problems it just feels all kinds of wrong.

Looking back: OpenSUSE 42.1 with latest KDE packages

I’ve been killing some time with other Linux distributions. As far as I can tell one of my favorite Desktop Environments is still struggling out there. plasmashell crashes everywhere, right now the right side of the panel is a mess with icons overlapping on each other. It makes me a sad penguin!

I think… in 2015 I just stopped caring about the current progress of KDE… as much as it hurts to say. Amusingly–for some–I’m looking forward to see the next iteration of elementary OS or maybe Linux Mint Cinnamon. The next iteration of Ubuntu LTS is around the corner needless to say, so I’m guessing that both elementary OS and Linux Mint will be ready when the time comes.

I am looking forward to that at least. I am glad that I chose to test over in a virtual box before installing this on my laptop, else I would have been pretty upset.

As for OpenSUSE 42.1 (Leap) I got no complains whatsoever. It seems relatively stable, excluding the KDE problem as that’s a problem that lies with upstream, not OpenSUSE team. I got Spotify working in less than 10 minutes, sufficed to say I’m impressed on that since last time I had to hop through a lot of obstacles just to get it working.

Well, I hope 2016 is a fruitful one for Linux users. I also hope that KDE finally stabilizes this year.

A tiny bite of GTK3

Update: I was able to fix YCM. Pretty happy about that 🙂

What a day it has been for me. I’m totally wasted after pretty much driving all day, I had no real plans for today either way but I wanted to get a bit of a head start with GTK3.

I’m a vim user, wait, I was a vim user. I’m not sure if it’s my disdain of spending too much time trying to get things to work but as of late Vim with YouCompleteMe has been completely crap, no iostream, no gtk, no sdl, nothing, nada. I’ve been left completely in the dark by YouCompleteMe. After some basic debugging and working with paths and realizing that compile_commands.json wasn’t making the cut as YCM wouldn’t bother checking ALL the methods available; I gave up, really. Opened CLion and with the same, unique header of #include <gtk/gtk.h> I was able to get all the methods, even the deprecated ones.

I hacked CMakeLists.txt to support c and find the right GTK3 headers and in less than 5 minutes I was already writing C with GTK3.

Screenshot from 2015-12-20 10:29:57

I’m honestly not sure how to feel about it. What I mean is that GTK3 design feels … weird in almost every account compared to Qt4 or Qt5. I’m more familiar with how things are laid out in Qt and this isn’t because I’ve been developing an application with Qt but because I’ve used other frameworks with a similar per module design. The classes makes sense, there’s nothing funky going out you also don’t have to write gtk_label_new() followed with a gtk_label_set_text() (yes, there’s gtk_label_new_with_text()) the whole “zen” is gone.

QLabel label("Hello");
label.setText("Hello there");

I’m biased as I like working with Qt, and not only that I’m probably being unfair as GTK3 design is meant to be different as it’s targeted (mainly) for C, and doesn’t support an object oriented approach unless you use gtkmm, which I could I guess.

This is just playing with GTK though, honestly I think I would go with Qt in the end. I WOULD like to write a minor app with Gtk3 some time in the future though.

Well, let’s keep it minty?

Screenshot from 2015-12-16 00:57:50

I’ve been dual booting to Linux Mint in my laptop for a few days. As to why Linux Mint… I’m interested in elementaryOS in general, but as I see it right now eOS isn’t ready and Linux Mint provides a full fledged desktop and a solid experience. If you have heard me talk about linux then you’ll know I will always put stability over cutting-edge (rolling release).

Although honestly, as time passes I just don’t care anymore. As long as I can do my daily stuff, and that my OS let me develop however I want? I’m happy anything that works and doesn’t require more than 20-30 minutes per whatever issue.

When I start doing platform integration though… that’s another story.

as for dropbox… I have moved all my sensitive files to sync

Another look at elementary OS (Freya)

As a Final Fantasy IX fan sometimes I look at the codename they gave it and grin as I recall the fond memories playing throughout FF9.

I scratched off elementary OS on the grounds that while it was heading towards the right path the terminal lacked customization. Sure, I could have called another terminal …. which I didn’t think of back then.

Screenshot from 2015-12-07 00:54:32

elementary OS is often called a “cheap OSX clone”, I think it’s unjust to just swear off the distribution due to that. I do think that they do have a potential audience to grab with their vision and mission. elementaryOS provides a more sensible user interface that doesn’t hint or give any complex trait that GNU/Linux share throughout its history. And what I mean by this is that compared to Linux Mint’s Cinnamon, eOS is like a complete overhaul of how a Desktop Environment should interact with users. And I feel it’s working for them.

elementaryOS is beautiful

And I might say, simple. Unlike the rather bad decisions GNOME 3 team made when designing the GNOME shell, eOS simplifies the interface providing a grid view of apps or a category-based list.

OSX is strong with this one

Screenshot from 2015-12-07 00:55:15

While I don’t mind the whole OSX gray-ish theme one of the changes they made to dolphin is that it supports a new type of view, you can see folders in a column view, which can be pretty helpful when you are organizing files.

Don’t take this as a review

I might add. This is a pretty “quick” take on elementaryOS. I like it so far and have considered putting it on my laptop a few times yet I don’t really feel like making any drastic change at the moment. Maybe in January, I’m just hoping they release their next iteration already.

Disappointed

So recently my laptop(the very one I’m using right now) got crippled by an Ubuntu 15.04 with an error

Error getting authority: Error initializing authority: Could not connect: No such file or directory (g-io-error-quark, 1)

Now, see this error appeared out of nowhere after using Kubuntu 15.04 for months, the last update killed it. So fine, I went ahead and reinstalled Ubuntu (not Kubuntu). After using it for a bit and installing all the updates I decide to reboot just to see it cripple again. That’s it, I’m fed up with a few things I’ve been dealing with linux over the years. I’m tired of fixing things that shouldn’t break. Most importantly, I made peace with Microsoft products, I made peace with how I’ll be dealing with frameworks that belongs to big entities like Microsoft, Google, etc.

A few weeks back I got a copy of Windows 10 through Dreamspark program. This was already enticing me to drop linux out of my life, for a short amount of time of course. I love linux, but I’d rather get a Mac than sit through the hell that is fixing rare corner cases. I plan to go back to unix through a mac eventually, either that or wait for Fedora to actually polish their KDE, and for KDE team to fix bugs on Plasma which will take even longer.

All in all, as you might have guessed I installed Windows 10 on my laptop and it has been working splendid. Anything web development related will be done through virtual machines as I just don’t want to spare more of my time fixing things in linux.

I am very disappointed, especially in Ubuntu because of all distributions I never expected it to cripple my laptop.

Rendering problems with virtual terminal emulators


I just finished the initial phase of troubleshooting one hell of an annoying problem recently. The symptoms for this is quite something at this time or age, and I’m even more surprised about the driver that’s causing it.

Overview of the symptoms (usually with xterm or urxvt)
  • Screen flickers: constant screen flickering (a little is normal, constant is that every time you type it flickers)
  • Slow rendering: The text won’t render correctly, you have to either press tab again or complete the action.

I made mistakes when I was observing the issue. Initially I thought that because xterm and urxvt are old it means that it no longer meets the modern criteria of a what makes a “modern terminal”, whatever that is.

I kept thinking that urxvt xft setting was underperforming, but that wasn’t the case.

So, before I go onto why I keep using urxvt (urxvt256c-ml in my case (256 stands for 256 color support and ml equals to multilanguage)) I had a very frustrating problem with uxterm, it didn’t read japanese characters correctly and thus it didn’t read anything beyond western characters.

So urxvt worked in the end and I decided to phase out xterm because it wasn’t worth putting more than the embarrassing hours I’ve sank “fixing” rendering problems.

What’s causing it?

The funny thing about this rendering problem is that it’s actually caused by NVIDIA blobs. If you use open source drivers you’ll notice that there are no rendering problems at all. But if you turn on NVIDIA drivers, the rendering problems on gnome-terminal, xterm, urxvt appears.

There’s no fix.

As far as I know there’s no fix for this. It doesn’t matter if you stop using xft or turn off `buffering. It won’t solve the redrawing problems at all. Something in the NVIDIA drivers is causing instability.

Take with a grain of salt

Whether you believe me or not, removing NVIDIA blobs is how I solved the rendering problem.

VPS + SSH bruteforce attacks

Out of nowhere I had a sudden urge to know “how many people have tried to brute force my VPS?”. The thing about these brute force attacks is that they are all automated and you can’t really filter out “manual” attacks.

I’m surprised that, even though I’m some random person in the internet with no background I’m a target.

33k+ lines of denied access were found in my /var/log/auth.log, that’s sort of scary in a way. I want to find a way to ban (through IP) these attacks.

What to do?

If you got curious and took a peek at your log files. First of all? Change to SSH publickey authentication (more information). Using SSH public key authentication can prevent a lot of headaches due to weak passwords or passwords falling into the wrong hands.

Attacks won’t stop, that’s for sure. So why not take some time and at least protect your personal VPS.

Home, sweet home.

There are a few things I’ve been wanting to write about. I guess I should start by saying that a new Ghost theme is under way for this site.

I installed Fedora 22 back on my main computer along with Windows 10 in the same HDD. Both OS have stabilized, I’ve learnt to accept the fact that GNU/Linux will always be part of my life as a person who tinkers, who develops, and love to see new things.

One of the things I’ve been meaning to tackle is what to do once I graduate. There are certain variables right now that makes it nigh impossible for me to move to the U.S.

While it’s something that’s been a constant in my worries; there’s something worth analyzing and that is how much of your job defines you as a person.

I’m not by any definition the humblest human being. Like any other I have goals to achieve. Sadly, those goals have been getting stomped to an illness I have. Well, not sure if I should call it an illness. I suppose.

Basically, I don’t want my profession to define who I am as a human being, rather define myself for who I want to be, more than “the go-to guy” or “that crappy programmer”. I recognize that I’ve spent a huge amount of my life studying programming, and plenty of things related to computers.

It all boils down to being social. Eventually in ten years from here I might lose my passion, or I might redefine the goals I have right now to something more family-oriented or people-oriented in general.

This field comes with a lot of snark, a lot of pessimism. I’d say it’s the perfect field for anti-social people like me.

Rather, I want to tackle these things now so in the long run I don’t become overly attached to the profession. I’m not going to become “irresponsible” all of the sudden either.

Spreading to other things that aren’t computer-related (including video games) is one of my goals starting now. Programming is awesome, and at the same time can drive you nuts, yet I feel like I’m missing so much more.

I think it’s self-explanatory, isn’t it?

So, I’ve been thinking of picking up the cello (instrument) and maybe find other things to do. More outdoor activities wouldn’t hurt either.

As for posts in this website. I know there aren’t many solid posts, most of them are garbage while other contains a lot of helpful content like the WINE guides. I’ll try bringing interesting subjects to write about, no promises!