Valentines 2014 and beyond

No Comments

Yesterday, February 14th, my wife and I ate dinner at home which subsisted of grilled rib-eye steaks, a bowl of marble potatoes in honey mustard dressing, and we actually finished a bottle of White Zinfadel. This morning we had a fairly standard fried breakfast: sunny side up eggs, sauteed corned beef, home-made bacon slices and fried rice with bacon bits. Was it a good Valentine’s day celebration? NOPE.

Why not? The reason being I dont recognize Valentine’s day as a day to celebrate. I come from the school of thought that it is a capitalistic day created by the now struggling card company. The fare we ate is what I would call as something that we would eat when the whimsical need strikes us, and assuming we have the patience for the prep and cleanup. :)

I don’t celebrate Valentine’s day but I dont stop other people from celebrating it either. I just find it ironically hilarious that people would need to wait for a single day in the calendar to show their significant others how much capacity they can to “love”.

I do consider that Valentine’s day is to the advantage of those currently starting their relationships. As I have said this is a chance for them to show much possibility their (potential) partners can expect from them but its going to be a double-edged sword. I prefer on showing how much I am capable of showing love on a daily basis. I “celebrate” this concept of Valentine’s day everyday. I don’t buy flowers since I am never going to associate my feelings for something temporary. I won’t probably have any second weddings or renewal of vows either since I went into the ceremony of marriage with the understanding that it was meant to be forever unless I misunderstood that “till death do us part” bit.

What about the special food? I would turn the tables and ask “What about it?” The rib-eye was bought from the nearby grocery store last night on our way home. The marble potatoes has been in our refrigerator for more than a week now and it was supposed to accompany the buffalo wings that remains frozen as of writing. The bottle of wine has been languishing in the ref also for 3 weeks now if I am not mistaken although there are other bottles of wine there that is now applying for residency permit. :D

Again, if you want to show off then by all means celebrate Valentine’s day and I will suffer the insane traffic jams you contribute it as you flock to restaurants and other places of interests. I would like to reiterate the stand that if you are already in a steady relationship, show your love everyday. If you need a single day to show how much you care then it is not love.

[TipJar] Quickly transferring information to an android device

No Comments

For security reasons my internet access in the office is restricted and most if not all of the sites that allow saving of data is blocked by the office proxy server. This becomes a pain if I come across some articles and sites that would be good to read later or heaven forbid something that I need. The usual route that would allow me to schedule reading the article is to save the links in my company email drafts folder, or email it to myself so I can remember to move them to my bookmarking or reminder site when I get home. This setup has been fine but being the perennial procastinator (or busy if you want to put a positive spin on it) I sometimes forget to do it immediately. The other alternative is horrible: type the url on my android device as I encounter the sites and articles. That option is as pleasing as going to the doctor for a rectal probe. I forgot to mention that my Android device doesn’t have continuous Internet by the way, which would have made my life easier and this post an academic exercise. :)

I have an alternative solution which works if you have a QR reader on your device. The main gist is to transfer the information to the device using a QR code. The steps follow:

  • Ensure you have a QR reader in the device. Currently I use QR Droid which is free.
  • QR droid

  • Copy the link of the article, or in some cases even snippets of text, into the clipboard.
  • Open a web-based site to generate a QR code. My preferred site is https://www.the-qrcode-generator.com/ which allows the creation of QR codes for different types of information (free-form text, URL, contact number, SMS).
  • Use the QR reader app in your device to scan the resulting QR code.
  • Share the decoded information to your preferred note taking or reminder app. I would recommend Wunderlist Wunderlist-icon, Evernote evernote-icon or Google Keepkeep-icon.

This has saved me a lot of typing in the past. Please ensure that you are not copying or passing confidential information via this route.

Smartbro Wimax sucks a little less tonight

No Comments

Instead of having no internet connection I have a very slow internet. How slow?

— cs62.adn.edgecastcdn.net ping statistics —
53 packets transmitted, 29 received, 45% packet loss, time 52000ms
rtt min/avg/max/mdev = 4908.713/18702.236/32208.306/7853.188 ms, pipe 33

Yes, that is 5-32 seconds latency! If the site is not familiar to you that is what is being resolved by “pldt.speedtest.net”. That abysmal speed is leagues better than having no internet connection, right? It is as savory as like having a view of the beach from the safety of your prison cell.

Stress

No Comments

Rustling in my bed
Issues floating in my mind
Nightmares while awake.

[TipJar] Common Punk: replace my text

No Comments

The SOA server I am currently working with had a nasty quirk on its services that I havent figured out yet on how to fix: it fails on requests with an XML comment. We use SOAPUI to trigger requests and the quirk requires most of us to strip the comments that is automatically generated by the tool. This quirk however gives me a good segue on this IT tipjar: how to leverage pattern matching to batch remove comments. This should serve as an introduction in other pattern matching applications when dealing with text/ascii content.

A normal SOAP request template instance will normally contain XML comments for optional items similar to this:

Normally most programmer’s text editor will have an option to use regular expressions when doing file search and replace. As can be seen in the above, XML comments have a pattern wherein they start with “<!–” and then end with “–>” (note there should be 2 dashes and not a single long line). In these examples each comment goes into a single line which makes it easier to replace them.

Now to the useful stuff, here are a few ways to quickly remove those comments:

On your programmer’s text editor (e.g. PsPad, Geany,etc.)

  • open the search&replace editor
  • tick on the option for the regular expression
  • Enter the express <!–.*–> in the search field. (The dot and asterisk in the middle is important!)
  • Press on the OK or whatever button to make it go, and…

  • TADA!

Another beauty of regular expressions is that a lot of utilities have support for it. If you have access to a Unix/Linux shell then chances are you have access to the sed (stream editor) and grep (global/regular expression/print) utilities.

A quick cat command to display the contents of the original request:

The sed option is nice as it will work even if the comments are inline with other texts. Be wary though that if there are multiple - -> in the same line then the example shown above will greedily replace up to the last ending match. If you are pretty sure the string to be searched for is unique then you can even specify a partial match (see second invocation example):

Those limited to a very restricted Windows operating system need not worry. Microsoft provides the findstr utility that provides limited support for pattern matching.

Microsoft has introduced the PowerShell which has a more robust support for regular expressions and other unix utilities. Below is an example of a grep-like functionality. Take note of the ! before the $_.Contains function as it serves as a negation so only non-matching lines will be printed out.

This is just a basic introduction to text replacement via regular expressions. Regexps can provide more functionality for those who have the interest and time to learn some of its quirks.

Older Entries