Showing posts with label off-topic. Show all posts
Showing posts with label off-topic. Show all posts

Wednesday, 19 June 2013

Learn to encode, please!

As a software developer, you should be aware of character encodings and avoiding several problems with encoded strings.

Thanks to many software developers' issues in understanding that (and Windows) (and paths with spaces), I have four home folders in my system.

Thank you for your understanding. Or should I say, please start understanding?

Friday, 17 May 2013

Undercutting - a personal rambling

My underpaid self has been thinking about his own life and actions. It turns out I am doing the wrong thing by sitting in the same place.

I have spoken to a friend about my salary and what I do at work, and she scolded me for helping undercut other people's well deserved salaries. She is quite right. She told me of how she and her group had lost a web and graphic design project to some company who promised to do the same for much less. They obviously ended up doing a terrible job, and screwed up someone else's opportunity in the process.

My current employer does do the same thing, but this post is not about companies undercutting each other. It is about workers undercutting other workers in the same sector. By allowing myself to be underpaid for my work, I am not just being a fool. I am undercutting other IT professionals who live around my area and have skill sets similar to mine.

When I started working at my current job, I was told that my pay would increase as soon as I had proven myself a valuable addition to my company.

I should have known it wasn't true as soon as I had learned that a colleague and old friend, who is a skilled programmer and most defenitely a valuable addition to the company, has worked for nearly three years in the company and earns little more (less than 1%) than I. It should have been blatantly obvious when I knew that another colleague, an IT tech and nerdy nice guy on whose shoulders the company runs a lot of its profit and stability (he runs the actual maintenance operations for the company's maintenance clients), is in a worse situation, since he actually deserves more than both of us, but earns the same amount we do.

And as time passed and I created websites, applications and whatnot, it was obvious that that "valuable addition to the company" line was just crap.

I feel like a sucker. Now my country is in a crisis. Prices going up, a higher tax on my salary. My boss is saying that if we ever get a raise we will only waste the extra money in luxuries. I guess that's how he sleeps at night. This shit revolts me deeply.

But I never stopped to think that I was actually harming someone else.

Sometimes people are not too picky about their jobs. People at the start of their carreer or people who have just lost a job are often happy to take whatever they get. Some companies (like my own) are opportunists and will use this instead of hiring qualified personel for a proper value. Some companies use excuses like "gathering experience", "prove oneself as valuable to the company", or "finantial issues" to postpone expectations of better pay for another day. Empty promises that I am sure have made many boost their dedication and productivity for nothing. Actually they ended up undercutting a lot of people and yet deserved better pay themselves. It happened to me. I have seen it happen to a dear colleague who was hired after me.

This snowball of bullshit has to stop, and not just for me and my company. If you are in a similar situation, you should at least consider trying to end it if you can afford losing your job for a few months. If everyone accepts crappy jobs and bullshit, someday we all will only have crappy jobs and bullshit, and nobody will be able to do anything about it.

Tuesday, 7 May 2013

PHP

Yesterday I have had the joy of writing some php code. It was marvelous. minutes later a syntax error popped from a regular function taking a string. I called my colleague, who had experience with php. We were both stumped. It used eval. I guess we are both dumb.

Php is so simplistic and easy to understand, it's painful. If I pass an undeclared constant off to a function, php goes all the way to interpret it as its own name for me. I guess that would make some code more readable. Why mix foo with "bar"? This syntax allows us to just go all the way and use constant name syntax everywhere. Then we just don't declare the constants supposed to be those strings. Such advanced magic.

They say that the best technology is indistinguishable from magic. I say the best technology goes ahead and makes my code run more easily, even if it has bugs which will pop up later. It's so smart right? Who cares about tomorrow? Everybody knows code is written just once and doesn't need to be maintained or anything like that.

Code for today. Write no abstractions. Php allows the ultimate freedom. If you want to shoot yourself in the foot, just do it. It's not like there is anything stopping you at all. It's your job, not mine. You know what you are doing. We all know that php is a language for experts, everyone will know better than to carelessly use unsanitized user input to form SQL queries (and HTML too!) It all comes from $_GET clean and safe with your magic slashes right?

</sarcasm>

It's not a language problem as much as it is a cultural problem. Although the former appears to have caused the latter.

Saturday, 16 March 2013

I plead insanity!

I don't know what I was thinking when I wrote this, but...


I'm dressing up. I'm currently solely wearing a skullcap and a pair of soles. They stay in the ground as I take a step towards the watch, doubt and terror haunting me. In time, I shall know the time.

I catch a glimpse of myself in the mirror, and quickly avert my eyes. This naked figure is an enemy of mine. For quite a few reasons. Fortunately, our eye contact was broken just in time for me not to get existential. It would be disastrous to not be able to lay my left foot on the wooden floor and instead lay the rest of my body on it, in a ridiculous pose, twitching and wondering how many years of life I have left, and what is it that I'm supposed to do in them.

Anyway foot meets wooden floor. It is the third instance of this mundane contact ocurring today. First it was my two feet finding the cold-ish floor at nearly the same time, and then I resolved to know the correct time and ventured forth, nearly becoming existential. Phew! Today has been quite an ordeal. I finally check my watch.

It's 7:32! I should be down the street right now! But I can't just go. As I run for the bus, countless little kids would appear from miles away just to enjoy the scene of my helplessly running almost naked and they would all in unison endlessly mock my flaccid flapping cheeks and weak, powerless, dandling arms.

Sometimes I wish I wasn't made fun of in elementary school. My fantasies could be starred by beautiful porn stars with beautiful hair and dirty mouths.

I have to get dressed before I can run for the bus. But that would be at least 64 seconds. Oh god. That would make the minute part of my watch NOT be a power of two! This must be corrected. I set the watch backwards one full minute.

The watch now reads 7:31. It's not so bad. I relax and take my time to dress up. Eventually I notice that it's 7:32 again, but then again I am almost dressed up.

I put on my coat with that ridiculous spin I started doing recently. It makes my arms swiftly and smoothly slide into the coat. It is very practical and saves me some time and frustration. It's good that indoors I'm safe from all those elementary school kids.

I face my terror, the dark impenetrable corridor to the heavy front door of my scary, scary apartment. I brave the 10 meters like a real grown man, mostly because I am so late.

I grab the trash which lied stinking by the door and dart down the stairs to the front door of the building. In time, I will know. Fuck the past tense.

Running to catch the bus, I see nobody in the street. It's creepy. There should be quite a few irritable people on the street. It's Monday, damn it. Give me some entertainment!

There are no cars around either. My power-walk to the bus is so silent I can hear every piece of dirt my boots crush as I go.

By now, my boots have met the ground many, many times.

The number of times I hit the floor was equal to the number of times I hit the floor and that hit was not equal to any of the steps I had taken up to that.

O(Tn)? O(n^2)? I don't think that's fast enough for the reader to understand.

There were as many different steps as the total amount of steps I have taken.

That's a bit more humane.

Each of my steps was unique.

Still not right.

Each of my steps is a different step (that's better) in which I mercilessly stomp the floor in order to move forth just a bit more. I have failed to narrate them all. But right now such details are of no importance.

As I walk down the street, it's so silent that the walls scream back at me every sound of my boots' fight with the ground.

It's been raining. And it's been cloudy. And it's been cold. Or so I have been told. I have been lied to. I have been led to believe things which were not real. The weather hasn't been nice. Not even outside.

I seem to be alone in these streets. Although they are the same streets I trod each day, they are very much different on this particular day. Who knows if there's even a bus? Who knows anything at all? I'll know. Given time. I just have to believe in my self. Or this. It doesn't matter, though the latter is not good practice.

Given time, self knows.

The Street Where The Bus Comes is close. Many steps are to be taken, and yet, many steps were taken already. I check my watch. I forgot it in my bedroom. It reads 7:40. It's not a power of two. I don't feel pumped up at all anymore. I lay in the nearest bench until the time is right again.

The ground is not so friendly. It seems unreasonably cold and wet. It's a good thing I'm laying down on the bench. It's not clear what my watch reads. I know I will know.

The time comes. A new power of two. It's 7:64, which can mean one of two things. Either time has gone crazy and allowed this to happen, or I am infinitely late. I don't know who to blame. Do I blame Time? Or myself, for wasting nearly twenty-four minutes?

It's much too late. At the bus stop, a 10 seconds' walk away from the bus, there is no sign of people waiting for the bus. I'm late. I'm screwed. Shit.

However, a large vehicle right in front of the bus stop quickly gets my full attention. It's much bigger than an elephant, but not as yellow as the real thing. No, this is not gray at all.

It's the bus.

I enter the bus and look at the driver in the eye. Either I am looking at a very invisible driver or my line of sight merely passes through the gas I am swimming in, the driver's window, more of that invisible gas, and ends up crashing helplessly outside the bus.

Being a much simpler explanation, my common sense screams for me to accept my first theory as to why I can't see this driver. Of course he is invisible! It may be that my brain is just complaining about the complexity of the second explanation, refusing to even process that load of crap. Who knows?

A lot of questions start popping up. How did this simpleton become invisible? I know quite a few drivers. Which one is he? How do I greet him if I don't know where his eye level is?

Faced with all these terrible questions, I run away from the terrible bus, not even noticing it is full of invisible people. The less I know, the better.

This is insane. Am I dreaming? My cell phone is ringing. It's on my pocket, and it's not the alarm clock application.

I can sense which applications are active because I hacked my phone and my brain, and plugged a wireless dongle in the latter. I can also tell the rings apart, but that is just too simple of an explanation. I don't remember ever having any brain surgery but it sure is fun to believe I did this.

I take the call. I am going to be given a ride. I remember something like that being spoken yesterday. I run to the rendezvous location with a sparkle in my eyes and a wag on my tail. My invisible tail is adorable, I tell you.

I run into a dark car with a purple-haired girl as its captain, and my white-haired friend as the remaining crew. Both have no names today.

They tell me stories of their own waking up. I listen, to the wonderful tales of normality and boredom. I wish my life was like theirs.

The purple-haired girl tells me of how she could only be awake if the minute part of the time was a number in the Fibonacci sequence. But only if it's seven.

"Good thing it's almost nine", she says.

"Nine! Shit! I am going to be late!", I say.

"Nah", she says. I sure hate it when people refute simple logic like this.

But there is something I'm not aware of. She takes one of her many hands and rests it on a huge button. The button reads "hyperdrive". I just read it out aloud, and looked like an idiot. I see an ant. I'm sure that ant is laughing at me. I strike it with my index finger, but she judo throws me out of the car window.

Damn ants.

Back in the car, hyperdrive is still starting up. I take my seat, carefully observing the black body of the black hearted, black belted judo ant.

I wait. Hyperdrive is a few minutes away.

I wait. My white-haired friend chews gum. I ask for some of it. He punches me. I thank him. He was so fucking smart.

I wait. I am bored.

I wait. The sounds of hyperdrive are loud and unbearable.

I wait.

It's ready.

Defying the speed of light and taking like 2 years' life from all the occupants, the dark vehicle speeds forward. Its captain proudly steers it by barking orders at the slaves.

The damn paint of the car threatens to fall off. I see the car's true colors.

Orange and green.

How lame.

The glass windows and windshield start cracking.

And the dashboard.

The dashboard melted, but we still had the radio.

That said, we were there. I dropped from the car, weak-legged, heartbroken and heavy.

The judo ant didn't really throw me off. Its Elvis haircut did.

I reach for my watch again. I forgot it at home. It reads 8:50.

Damn hyperdrive. We went back in time a bit. Now I have to wait.

I wait forever. Forever minutes later, my batshit insane boss comes with his batshit insane ideas. He only speaks buzzwords. Leadershit, proactiveness, success, key, concept. He knows no punctuation. So you can't really talk to him because you will soon be drowned in bullshit. He is also incredibly thin and dazzlingly beautiful. I have no idea why I am still heterosexual with him around. Any other dude would bone the intended recipient or a few days in the intended recipient. You get the idea.

I take my seat.

It asks that my ass be more lightweight today. I ask him to go fuck himself.

The end.

Wednesday, 7 November 2012

AAAAAAAAAA

A AAAA AAAAAA AA AAAA AAAA AAA AAAAAAAAAAAAAA.

    >>> def AAAAAAAAAA(s):
    ...     import re
    ...     return re.sub('\w', 'A', s)
    ...
    >>> AAAAAAAAAA('I want to know what Guido eats for breakfast.')
    'A AAAA AA AAAA AAAA AAAAA AAAA AAA AAAAAAAAA.'
    >>> AAAAAAAAAA("I have found a new way to encode messages. But it's irreversible.")

    "A AAAA AAAAA A AAA AAA AA AAAAAA AAAAAAAA. AAA AA'A AAAAAAAAAAAA."
    >>> AAAAAAAAAA("You have a way with words.")
    'AAA AAAA A AAA AAAA AAAAA.'
    >>>

AAAAA AA AAA AA AAAAAAAAAAAAAA AAAA.

And a thousand pointless points are given to whoever decodes this post.

Wednesday, 6 June 2012

The most useless thing in the world?

One day, I will need something like this.

>>> class CallableInt(int):
...    def __call__(self):
...       return self
...
>>> a = CallableInt(1)
>>> a()
1
>>>

Won't I?

Tuesday, 13 March 2012

Creating my new employer's website

Been a while since I posted.

What I've been doing:

Both at work and in my spare time, I've started messing around with the Android SDK, and am planning a small mobile app. I'm usually very concerned with the UI aspect, so I believe I'll make something good and useable.

I've changed jobs, and my previous bosses at António José Moreira decided that I wouldn't get paid for my work in the month of January. They state that the work was being done on a per-objective basis and that they haven't been satisfied with my work. However, they always paid a constant monthly salary.

Working at António José Moreira was a challenge, but I was always aware of their ruthless nature. As a company, they never cared for the well-being or satisfaction of their customers, or even cared to pay their suppliers or service providers at all.

I doubt that they will pay my salary willingly. However I have earned my pay with hard work, and I'm determined to get it.

My new company and their new website

I work at a company called Descontel Consulting now. They are a small company with less than 20 employees (Not sure of the exact size though).

I've already made their new website. I used Joomla! CMS for the first time, and I must say it was fun customizing a template and making it work with all the components.

First I created the above image (grayscale helps me focus on organisation of content rather than how the page looks like)


Then I was asked to take Twitter off the top of the page, so I decided to make the above 3-column layout. The black thing to the right was a screenshot of the Twitter plugin I thought I was going to use.


After that, I colored it and started coding the HTML


No programming was involved, since everything was handled by Joomla. My work there was just creating the template, planning and organizing content and a lot of HTML and CSS. I used this great jQuery plugin for the slider up on the top. The site currently loads the jQuery library twice, though, because of the twitter module. I'm going to have to optimize that.

I had to support Internet Explorer 6, and I did so using a second stylesheet and a conditional comment in the page header.

Like this:

<!--[if lt IE 7]>
<link rel="stylesheet" href="<?php echo $this->baseurl ?>/templates/<?php echo $this->template?>/css/style_ie6.css" type="text/css" />
<![endif]-->

It does make the browser download another stylesheet, but it's not a big one, and I didn't have the time to support IE 6 properly.

Friday, 19 August 2011

I'm sysadmin!

I have a job now! It's my first job. I'm sysadmin on a store that sells wood and construction material. You can check out their site here: www.ajmoreira.com. There's much to do about the site...

But there's more!

They're going to install new terminal and server software, due to new regulations from the capitalist pig which require companies to upgrade their software to have a link to our country's financing, helping our country get every last cent we need to get out of the financial crysis while keeping the political class nice and spoiled.

I digress. I'm going to be a key element to help with this upgrade. The people working there need training and help with the new software, and I'll also have to move the old data from the old Unix server, to the new system. I'll also have to find a way to create backups of all the data, dealing with never-ending (but not very serious) data growth. Will zlib and a python script cut it? Do I really need full redundancy? Where will I keep the data? External 1Tb hard drives? How often to backup? Nightly? What's the best way to schedule this?

Another task is the website. A website replacement might be in order, complete with full design, and everything. I'm also going to have to find a way to link the website to the database of the system without having to query the system for every page loaded. I could build up a cache, put it online. Cache would be built nightly, as well. Do I really need to update everything on the cache? How could I avoid that?

A lot of problems to solve, and a lot of interesting ideas to solve them come up all the time. A huge system in my hands, I hope I'm up to it.

Wednesday, 17 August 2011

The Emo Programming guide, Part 1


  1. Get Python from http://www.python.org/

  2. Open it up

  3. Type: print ('Goodbye, world!')

  4. Cut yourself

Monday, 15 August 2011

Started a project outside school -- Finally!

I started a project with a few colleagues from college. It's meant to help you use public transportation. We wish to solve difficulties like having to check multiple websites and manually cross-referencing information, just so you can catch the right bus(or buses) to get you to your destination. We consider this to be hard, so we are creating a website, coupled with an android app and a smartphone-ready website, to help people find their way using public transportation.

It's probably going to be hard, since we're thinking of putting up a graph structure for our app, and we'll search it quite often, so we need to optimize a lot!

I've read somewhere that drawing the interface of a user-interfaced application helps programmers in its development. Since we don't really know where to start and our ideas for features are a little vague, That's where we start :)

I'm really excited about this. It could become big, but even if it doesn't, it's bound to be a wonderful learning experience.