Miss All Sunday

Rainy days


I love them. I simply love them, I much rather prefer a cloudy day in the city over a sunny day at a beach. Almost every outdoor activity is better when do it on a cloudy, windy day, specially running.

When its actually raining I like to take a moment and just watch the rain. Theres something quasi magical about it. We take it from granted but it really is a weird thing, water just falls from the sky, how awesome is that!

I sometimes imagine humans visiting from another planet or other dimension or something like that, on their earth theres no rain, something else has replaces it or theres a similar thing but not exactly like the rain we are all used to. I wonder how would they react? to them it must be shocking that water just starts falling from the sky. Of course this is not realistic at all, if we were to look it from a scientific point of view, been humans able to breath on the same atmosphere we do will only mean they will have a pretty similar atmosphere on their planet, which means they already be familiar with clouds, wind and of course, rain. But I'm going to put that aside and continue to enjoy my fantasy :P


I love those kinds of moments, on movies, books or TV shows, trying to explain something as "trivial" as the sun or the rain to someone who doesn't know what it is becomes extremely difficult, even if you are some kind of super genius or something, doesn't matter if you are the smartest human on earth, I suppose this is because we are soo used to it that we simply give it for granted.

Anyway, its been pretty rainy the last days around here, pretty awesome, even after a tiring day at work, the day just invites you to take a walk so thats what I did, I get up the bus earlier and just starting walking to my home, it was pretty relaxing. Much needed time to just clear my head, yet another big pro on rainy days!

People say rainy days are perfect to just stay home and watch a movie or something, well, if its heavily raining outside yes, but if its just cloudy of windy then its a perfect time to go out and do some outdoor activity or just go out and take a walk, some gardening perhaps, dunno. If the cloudy days continues I'm planning on spending a nice Saturday afternoon working on my small garden while listening to TR/ST relaxing and enjoying.

Nov 27, 2016, 06:53 PM query_builder
Write Comment chat_bubble_outline
face

Got a new member!



This place is pretty much dead or better yet, it was never alive in the first place. It only gets hit by crawlers, scrapers and all kinds of similar bots, google bot likes to come by every now and then.

So... when I got a mail telling me a new member has joined I went ahead and check it out, hearing a new member has joined this site is like watching rain over a desert :PC

Anyway, the first clue about this user been nuts its the rather cryptic first message, since English isn't his first language (just like me) I decided to let it pass.

Second and final clue came today, I woke up by the sound of my phone telling me I got a bunch of mail notifications, its Sunday so there is little chance it was from work or other similar matters. Turns out it was a bunch of notifications from this forum, someone just decided to flood my wall with comments.

First reaction was, OK, cool, someone visits this site!  but all that joy went straight down to the drain when I saw the same user from yesterday posting a bunch of videos about SS panzers "nibiru" and "white power"   .____.  along with the same link posted over and over again.

Sadly, this isn't the first time this kind of thing happens, in fact its the third one (without counting Gri, hes a good guy!) or so. OK, 3 times in 5 years?  not that bad right?  well, it wouldn't be that bad if there was some kind of community already established but there is none so the few lunatics that happen to get an infatuation with this site are pretty notorious.

This got me thinking two things:

- Why do I even bother?

- Why does this site attracts the wrong kind of persons


For the former, its easy, because I like to write and because I want to keep up some kind of records about what I did, how, when and why.  And its easily solved by disable registration and turn the forum into a full personal blog.

For the later, I dunno, I used to get a lot of weirdos registering with the vague hope of finding more pics of me, only to get quickly disappointing by finding none.  Those are pretty harmless dudes and I can deal with it. Its the unpredictable freaks the ones I have a problem with because you don't know how they are going to react.


Anyway, banned the weirdo and I just hope he doesn't get too fixated and try to come back multiple times...

Nov 27, 2016, 11:19 AM query_builder
Write Comment chat_bubble_outline
face

Quiet voices loud sound effects

Why do movies are like that?  its highly annoying...   the voices are too quiet to I need to turn the volume up and then theres an explosion or a car chase and its soo loud... its annoying.

      reddit says movies are meant to be displayed at theaters and on 5.1 systems, well that explains why my cheap speakers can't handle them...  I also tried all the tips and tricks, disable the bass, the dynamic range thing, and nothing... I eventually gave up and accepted it. I keep the remote control at any time and just adjust the volume whenever someone is about to speak.

      I was watching Drive.  It is one of the very few good movies the crappy clarovideo service has ::)

      

      Nice movie, I remember I watched it when it was released, didn't put that much attention to it, at that time it was just another fast and the furious clone, went there to just hand out, stuff like that.

      I re-watchd it last year, after found out the song I like was included on its sountrack. This time was completely different, people say there are movies that every time you watch them you always find somehting different  but this wasn't the case, the movie is stil there, it hasn't changed. Perhaps my attitude towards it changed?  mmm, nope really, I wasn't mad or angry the first time I saw it, I just didn't pay that much attention to it, the trailer made it look like yet another car movie and at that time I didn't paid much attention to details and I gotta admit, I didn't understand some of the scenes either :P

      This time was different, I loved the glommy atmosphere, the non linear story and the usage of both sound and silence to actually tell the story. NVM the scalating violence, too extreme? yeah sure but then again it feels like a part of the whole movie, I didn't remember the scenes and yet I wasn't surpriced by them either.

      Besides, I love the 80s :P

      And while I'm on the "re-watch movies" mood, theres another one I want to watch: Man Push Cart.  Oh, and I gotta stop watching Kung Fu Panda... seriously, I watch it at least once a month or something, its insane!

Nov 20, 2016, 06:30 PM query_builder
Write Comment chat_bubble_outline
face

Defensive programming




Its not a secret I write code in a very defensive way, SMF's own code kinda molded my like that, this isn't inherently bad, well, it depends on who you ask :P, but it can get in the way of aproaching new designs.

Now, this isn't a post about why X is better than Y or why Y is better than X. Nope. This is about a reccuring practice I do a lot, and I mean a lot! and its curios consecuences on other stuff.

Check any recent function I wrote, it will probably have 1, 2 params, always declaring default values for them:

Code Select
public function yay($string = '', $array = array())
{
if (empty($string) || empty($array))
return;

// Declare, always declare
$toReturn = '';

// Lots of empty checks

// Lots of "if" checks

// Do stuff!

// Internal middleground check FTW!
if (something is not right)
return $toReturn;

// Do more stuff!


return $toReturn;
}


There you go! this is the result of literaly years of having to deal with other people's code, yes I'm including myself on that group, my old me from two weeks ago! :P

Now, this thing was worked wonderfully for me over the years, more stable code means less support issues, ironically, having stable, bug free mods equals less people having issues, equals less people comming over to this site :( but thats prob material for another blog post.

The problem comes when I try to learn or use new patterns, designs,  or even in the way of new ways of coding.

While I was re-writting the Ohara class I bumped into a particular issue, its a minor one, perhaps not even an issue depending on your PHP version but it triggered a cascade of questionings.

The issue? use empty() on a property.

if (!empty($this->something))

I don't want to get too much into the highly opininated world of using empty on a property, magic methods, paterns, designs, overheat, etc etc etc.

I like empty(), I use it a lot, I also like weak typing and I pretty often like to combine those. I like it how PHP sees array(), '', false, 0 as false when using empty(), even the '0' case. But, some of these checks are redundant when working with objects. At least doing check for the existance of that property.

Starting with me always declaring any properties I'm gonna use,  rarely, pretty rarely I would have the need to create properties on-the-fly:

$instance = new class;

$instance->iDontExists = 'nope, I don\'t';


In fact I can't recall ever do it something like that.

So, using a recent example, the rssfeed mod:

$this->feedID = $this['data']->get('feedID', 0);

$feedID property is declared as int 0 and then it gets re-declared for any CRUD operation.

I know $feedID exists but I still ned to check it, not to know if it exists but to check its value, 0 means the feed doens't exists and it has to be created rather than updated.

The same for deleting, I need to check if a feed exists before it can be deleted, the check allows me to prevent doing a query to see if the feed exists, if its 0 then its pointless to check, if its not 0 then do the check.


And then theres cases where I don't know if a property exists or is not empty:

Code Select
public function get($var, $default = null)
{
// Forgot something?
if (!$this->_request)
$this->setData();

return $this->validate($var) ? $this->_request[$var] : (!is_null($default) ? $default : false);
}

On these cases an if check is still pretty much needed.

I dunno, I would like to not depend on empty() that much.

Nov 19, 2016, 09:11 AM query_builder
Write Comment chat_bubble_outline
face

Ohara 1.1


Today I finally finished porting all the mods I'm using on this site to Ohara 1.1.  For a few months now I've been toying with the idea of revamping the class and separate all the tools into their own classes, using Pimple as DI service.

The re-write was easy, the real difficult part was porting all the mods, every mod is different and quite often they all use different parts of Ohara, some uses the admin sections, some uses the default hooks, some even sues the "disable hooks"  thing.  So, porting one mod usually meant making changes to Ohara, update composer, get the new files, etc etc.  While annoying, this allowed me to fully test Ohara everytime I updated a mod, currently I'm using 8 mods:

   SimpleSEF
   Ohara YouTube Embed
   Topic Solved
   Birthday Posts
   Activity Bar
   Portal
   Rss Feed
   Breeze

Plus the "blog news" mod.  Breeze and SimpleSEF doens't use Ohara (although I'm temped to use it on Breeze) and I'm also planing on installing some of the other mods I have (emailinactive, FAQ, modsite) and even write some new ones, I always wanted to write a chat/shoutbox.  Making sure each mod has the "latest" Ohara build was annoying but needed.

Anyway, 1.1 is done, it adds a few new features (the much neeedd Form class :P) and they are all stored on their own classes.

I also kinda pseudo fixed the whole composer autoload thing (mods overwritting the autoload file created by composer), its not ideal and it requires extra effort from any mod author that uses it but its usable and I made extra efforst into making it as easy as possible.

I need to write some docs for it though, because I quite often forgot what thing does what or how to sue X or Y feature :P  and yes, even a few days of actually writting those features I often already forgot how to use them :P  Besides, theres always the naive dream of more mod authors using Ohara so gotta have some docs to fully explain what does what and why it does it that way :P

Also, to help combat "writer's block"  I created a small mod for autoposting blog entries every X time, I'm actually using this mod right now! This little mod was the resposible of me working on Ohara 1.1. I started building the mod around 1.1 and when I finish it I realized that I needed to update all the other mods...

The other thing I also want to work on is a category system for this blog, nothing fancy, just a way to be able to categorize my glob entries:

- rant
- useless stuff
- disgused rant
- annoying things
- happy things

etc etc...


Anyway, its been fun, learned a couple of things about polymorphism and encaptulation, namespaces an services, magic methods, setters and getters. Theres obviously the big risk of using a pseudo framework for an SMF modification, besides this site, I haven't really tested them on other SMF installations, theres always the risk of things getting deleted or a mod using an outdated Ohara version, etc etc...

Nov 09, 2016, 10:47 AM query_builder
Write Comment chat_bubble_outline
face