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. ­čÖü

The weird case of foreign languages

I have noticed over the months I have been working on my app that managing foreign languages like Japanese, Chinese, Korean, etc takes a memory hit to the point that it spikes up the memory usage–as one would expect. Sure, I expect more memory usage… but we are talking about a spike from 60mb (normal usage) to 80-100mb usage per entry–thus I was forced to call garbage collector manually as I couldn’t wait for the QML/JavaScript engine to do the clean up when there’s “inactivity”.

So, I was worried and added initial linux support to my app (never been planned to be released under linux) and found out that languages such as Japanese walks a fine line of 40mb memory usage. The garbage collector works twice as fast as well. For example, in Windows I’d call garbage collector and it doesn’t do it that fast. In linux? Blazing fast. It’s not much about the speedness of how fast it takes to free the memory, it’s the usage. I’m talking that Windows still takes 60-80mb+ (and up) while the linux build keeps walking the 40-50mb line.

Now, initially I suspected a memory leak, but that wasn’t the case. The Windows build just takes that much memory, and it worries me. Part of what keeps me at ease is that since this will be an android application; I can expect the same behavior that I get here in my linux mint in Android. Memory will be freed and the usage will be kept at minimum.

Granted: Pure naked eye seeing memory usage is not enough to suggest there’s a memory leak or that there’s a memory mismanagement, that’s the job of a profiler After running valgrind a few times I couldn’t find any memory leak just petty warnings, so I proceeded to guard against it, well, it wasn’t much about guarding as I honestly needed to free the objects that are no longer needed after X time. Plus, I also rationalized the usage that Windows is just being Windows… maybe Qt is pulling something that requires big allocations in Windows, but not in Linux for whatever reason. I do think that it has something to do with the font mechanism in general… but who knows at this point.

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.

A challenge that must never be overlooked: User Interface

Only 2-3 weeks away to finish this college trimester. I’m really excited to know it’s “almost over” as this year has been full of challenges in real life, bumping into personal struggles and family issues can really suck your drive to develop.

My disgust with Ubuntu has been slowly dissipating, as I wrote in Disappointed I ran into issues with it, issues that permanently crippled my computer. As a former linux user, and as someone that loves the linux environment in general you know you will always have those little urges to come back and use linux as it’s pretty much “your home”.

Sadly–no, actually fortunately I’ve been investing a good amount of time learning Windows. Its set of APIs and technology it provides. Let’s sit down and be realistic for a moment that it’s hard and has always been hard to monetize open source projects, any developer will always choose their family over ideals.

So this brings me to today’s subject: Interfaces.

I’ll admit, I suck at designing. I’m good in coming up with interfaces ideas, but putting things together in a very concise manner to provide a decent user interface is incredibly hard. To maintain a balance of usability, functionality, and “modern appearance” of an application these days is hard.

I consider myself to be more of a backend type of person. I like working in the internals parts of the application. I love learning to improves ways of providing metadata so that the user interface can function without the UI being the become the dictator of how the backend should be designed (don’t mix business logic and view, etc) and thus allow me to target multiple platforms and gush out more views to different screens.

As I’ve been designing the application I’ve gone through three or four drafts. Each draft being 20-30% different from each other. Drafting also means that you are dedicating your time to solve possible corner cases, it’s not much about throwing pretty colors, gradients, and call it a day. (I wish.)

During the time I’ve spent drafting/sketching the interfaces I’ve found myself sinking a lot of time in the user interface planning stage. Whether that’s good or bad I don’t know myself. Time will tell, I guess.

So the easiest way is becoming a hardcore fan of your app

I feel like placing myself in the users shoes is MUCH, MUCH easier than sitting as a developer and concluding that I should throw everything in TableViews and TreeViews, with lots of checkboxes and call it a day.

So I began to give each view specific purpose, a mission that a view and its partials needs to complement each other to satisfy the user’s needs. User clicked on new section -> show loading animation -> a new view appears -> new view is a gridview in nature. Hint the user that you can press and hold each grid for more options. Each option complements what to do with said grid cell.

And so on. It’s a very, very tedious process in my humble opinion. Designing applications internally (OOD, modular system, etc) is hard, UX is hard, frontend is hard. Quite the obvious conclusion, I guess.

Something Happened: Windows 10 upgrade, and linux dual-booting

Two days ago I joined the many in upgrading my existing Windows 8.1 OS to Windows 10. There are plenty of features I’m very excited about such as Virtual Desktop.

Something happened.

Something bad happened, if you are a linux user there’s a high risk that if you are using the same hard drive disk to dual boot, as in having different partitions, then you are probably in for some struggle.

This stems from Windows 10 inability to actually tell which partition is actually the Windows one. Which is weird, this is my old partition layout:

  • / (ext4)
  • /boot (ext4)
  • /home (ext4)
  • swap
  • Windows (ntfs, duh)

So basically, that was the layer I choose a long time ago. What Windows 10 kept doing was mistaking the /boot partition was the main one, trying to get meta information such as free disk space.

Solution?

Have a Windows repair disk at hand. There’s just no way of going around this problem. Basically I forced Windows to recognize ext4 partitions through ext2fsd project. It actually worked at first, but the main issue remained; the setup thought that the /boot partition was the primary one (containing Windows).

Knowing that there was no way around it I decided to just give in and delete all linux/swap partitions.

There’s a catch, you have to recover MBR and fix the boot records. You can do so!

Boot your windows repair cd. Use these instructions at your own risk. In no way I’m responsible for what happens to your computer.

Go to repair computer  
Advanced tools -> Command prompt  
type:  
bootrec /ScanOS  
bootrec /fixmbr  
bootrec /fixboot  
exit  

Reboot your computer

If something like /Boot/BCD error appears

Then boot the Windows DVD again

Go to repair computer  
Go to advanced options  
Go to a label that says "Automatically fix issues"  
It will find the issue and solve it. It will automatically reboot after it's done fixing the issue  

By now you should see Windows logo and everything is normal.

The catch

I’ve yet to test if dual booting is yet possible with Windows 10. I was planning to reinstall Fedora 22 back.

I’m reminded that the os-prober Fedora 22 ships may not detect Windows 10. This means that I’ll have to do a lot of lifting to actually dual boot.

Yet, how does it exactly guarantee that the dual boot is possible? It should be safe to assume that the boot loader is the same as Windows 8. But what if it isn’t? This is pretty much why I didn’t toy with the dual-booting option. I didn’t want to go through fixing mbr and records again, it’s actually very time consuming.

Windows 10

I’m finally in Windows 10. After all the decisions taken it feels good to actually use my desktop.

Windows 10 feels like it has taken inspiration from GNOME 3 and KDE. The taskbar in Windows 10 feels almost the same as KDE with Icon-only taskbar. The virtual desktops shortcuts behaves almost exactly as the one from GNOME 3.

Sadly, these are the things that the average user may never know.

I feel like Windows 10 took a lot from what makes the current desktop environments. Whether you share this feeling or not is completely understandable.

Cortana

I’ve had a lot of bad experiences with Google voice crap. Cortana? Cortana is INCREDIBLE. Privacy issues aside I’m looking forward to see how Cortana evolves from here.

And so it ends. A rather “straight to the point” post. I’m hoping to be more detailed in the future about Windows 10.

I cannot be the jack of all trades

Around thirty minutes ago I finished making the last additions to this theme, which I’ll be releasing soon under insert open source license. I’ve fixed various things that have been annoying me for a while.

I’m also planning to add a new color for the theme thanks to the abstraction made with Less CSS.


The jack of all trades is a very frustrating trade. Over the years I’ve touched various languages like Java, Python, C++, PHP, and there’s nothing more frustrating than forgetting the function members of each class, the global members.

Just a while ago I was staring at the screen wondering, “well, I need to google jQuery’s API documentation because I don’t remember a thing.”. I haven’t forgotten how to use jQuery; I’ve forgotten how to use certain things about it.

At the same time, if I start writing Python now I’ll probably be hours in the documentation as I wait for my memory to return.

This doesn’t have much to do with the syntax. Keeping all those languages and its quirks in pure muscle memory? Life has a way to make you forget. After 2-3 months without using the language it feels awful trying to get into a uninterrupted workflow.

Thus, this is why I have to reaffirm my direction towards C++ and C#. I’ll leave the details on that for another post.

Miscalculation.

Miscalculation.

There’s nothing more frustrating when you find out you have miscalculated something. In my case, I’ve miscalculated the time left in college. I’m not doing bad in college myself, plus my GPA is pretty high right now to even worry about failing (and I’m always on the lookout if I get a bad grade). College isn’t as challenging as I wanted it to be, regardless there’s no time for petty grievances.

So it turns out that I miscalculated my time in college. I still have to tackle eight courses, the good news is that out of eight I only have to do 2 courses that are related to my major. The others are pretty much generic courses.

This really put me against the wall in a way. I wanted to finish already, send my CVs to the U.S and be done with it.

Not everything is gloom though, it also means I have plenty of room for improvements. It’ll also give me time finish some business here with the family.

As for live outside where I live. All I hope, or well, all I want is to meet great people out there.

As for theme development, it’s time to say good bye?

I feel like front-end development in general doesn’t suit me. I think I should refine the scope of what I just said: Web Designing in general is a job I don’t want to keep pursuing.

After I released the theme In Touch for Ghost Blogging Platform there was this awful feeling of dissatisfaction. I can keep creating themes just fine and keep going till I capture a tiny portion of the market. Creating themes on a high-level is easy, creating to push innovation is hard and most of the time unrewarding itself as you can’t match the prices the market out there normally has.

I’ll be available for hire, there’s no doubt in my mind about that. Although I’ll be focusing on desktop and mobile development for now. The more proficient I become in C++ more doors will open for me. Generally, I want to keep a good knowledge of C++ and C#/XAML.

I’ll be pushing the last fixes for intouch. I noticed there are like 2-3 problems with it that are visible.

Keep the iterations goin’

Alright, I’ve been meaning to sit down and post something not so enlightening; I feel like many of you should know this already, yet there’s always the person who hasn’t sat down to think about it.

The need for more software, the need for more forks, the need for improvements. I’ll be integrating web applications in “software” very, very loosely because at the end this post wants to tackle that too.

Whether you are building a commercial software or open source software there’s always a time where we have to ask ourselves, “has this been done before?”. Creativity is one of the most exhausting tasks in software. Yet, the thing that developers and end-users asks is:

“Why color the wheel blue when it’s already black?”, or “this has been done before. There’s blogging software a dime a dozen doing the same functionality”.

True, so true. I’ve stumbled upon so many blogging software solving different scopes and Content Management Systems that seems to focus so much on the internals while leaving the user interface in poor state.

If a software works for you, hurrah, that doesn’t really mean we should stop developers from wanting to improve, innovate products regardless if it’s commercial or open source.

You know that awful feeling when you are proud of your work yet you get shut down because “it has been done a million times”. I know, it strips you from any emotion you had about it, thus abandoning the project or half-assedly work on it.

Thing is, it serves as a purpose of growth from all the trials and errors. The developer grows, he or she might have not launched a successful product but the experience had was there, and that says a lot more than the people mindlessly attacking it.

More than that. Maybe a feature has been added that was never seen before in a workflow. Or the developer altered the workflow in such a way that it’s a delightful experience to use, yet the end-users doesn’t have all the features they have from X software that has been in the game for a whole decade.

So to sum it up, we need more iterations, more forks, more innovation out there. It might be a camouflaged wheel under the hood, who knows though, maybe that wheel can get you to your goals faster than the old trusted brand.

Personal growth, site fixes, and my new project

There are a few things that I’ve been meaning to talk about over this month. I’ve two or three drafts that I’ve to revise before posting as it contains certain subjects regarding the linux community. It’s more of a matter to neutralize the language and choice of words. Personally, I’m not a fan of sugar coating, sadly I know that sometimes people just read one line and they are already writing an essay on how wrong I am.

That’s not the case today, thanks god!

Personal growth is something I’ve been meaning to take care of. It’s been one of my goals to socialize and know more about people I meet. If you know me at a personal you’ll see that I’m more of a straight arrow, especially at work. You bark the orders and I’ll follow them without looking right or left.

Toning down the participation in internet communities have allowed me to relax and focus on myself rather than wasting time on useless debates on how to handle corner cases, or which is the best editor. I no longer have the patience to sit down and write long paragraphs sharing my views with other people online; I’d rather have a talk in person which is more enjoyable than seeing a person trying to prove he or she is smart while slamming programming languages such as PHP, or whatever library as a method to find friends or colleagues.

I’ve stopped caring about stuff. I don’t want to meet you if all you do is:

  • being negative all the time
  • slamming frameworks, and other methodologies because it’s the popular thing to do
  • always looking to be right rather than being human. I’m not sure about you, let’s say you are right for a second, what exactly did you win? Pretty sure it’s not the lottery.

Every day I’m feeling better, and more capable of taking on issues. My goal this summer is to be less critical, and be more understanding when it comes to people’s issues. I know not everyone has thick skin and I’ve made a few mistakes in life that might have made some people feel awful.

Don’t get me wrong. I also do it because I want them to see the other side of the coin.

Site fixes!

I wrote a small code to fix Ghost blogging platform database. I had this problem where all posts were scrambled in Ghost content section. The issue happened because updated_at field in the database had NULL value in them, thus EmberJS didn’t handle them gracefully.

I’ll submit the fix I did after this post.

My new project


So basically, I know I’ve said in the past that I’ve been looking for open source projects to contribute code. Sadly I didn’t find any project that was interesting for me. Even LibreOffice became a chore rather than something to look forward to.

This project is a productivity tool that helps the user reduce the tasks of file handling greatly and gets you organized in no time. I did the first commit today after 3 weeks of brainstorming day and night.

This has taken a great deal of my time mostly because not being a C++ developer means that I’ve to learn the language and the libraries available to do things. And the idea being “unique” meant that I had to put extra time and effort to come up with a decent workflow.

A workflow is, in my opinion, one of the most important things in this application. Which is why I’ve been analyzing each use-case and making sure that the user receives the best experience ever.

We’ll see how things go from here.

Even if it fails, so what? I got from it a lot of knowledge that I can now put to use in the real world.