Tag Archive: coding


auto-layoutsWell, here’s the accomplishment of the evening. Been working on the code project and managed to completely grok Objective-C auto layout including the Visual Format Language. And I’ve managed to do this with animations. It was very much a bumpy road; but the end effect is Soooooooooooo much better than the first draft of the UI for the screen.

Now of course, it’s really just pretty UI with dumb data. But, as noted in my previous post…. I’m looking to find someone to help me with less than dumb data. It’s been a very good run of code tonight. I’m going to check it in and show it off to the rest of the ‘team’ this weekend. (Oh, yes. There are people already working on this with me 😉

So short but sweet. But very happy.

blenderSome people ‘fire’ months, years, etc… I was very close to firing a whole lot more after a very bad week.

In a period of 6 days, my very expensive King Size Bed that we saved a lot for had the frame crack and the mattress drop. As a result, my spouse and I have been sleeping separated. She on the side of the bed that is okay with an equally expensive mattress that helps her back that was injured permanently by a careless 19 yr old driver. I on the other hand have been relegated to my office to sleep on a bed I got when I moved out to the West Coast to pursue being a software developer. About $200 from Ikea, 13 years old, survived the trip back to Pennsylvania… But it’s too soft for my dear spouse. This was strike one.

Monday, I did a very grueling presentation for work on a project I’d taken on myself. The presentation went okay, but there were chinks in it. Worn out, I came home and got hit with the flu. 102 temperature and the whole “useless as all hell” misery. I didn’t have enough energy to sit up most of the time. Water and the occasional saltine (so much for GF). This took me down for two days where I really needed to be fixing the chinks in my presentation. Make that strike two.

Today, my company and I parted company. I’m not going to go into a lot of details. There’s no need to. It was a good job, but the fit simply wasn’t right. I don’t know if I could have or would have changed enough to make it a good fit. These changes never come at a good time. It is what it is. The team/group will do what they will and I will do what I will. It just so happens that it will now be on two separate paths. But we can switch sports and call that the hat trick for the week.

So, I do what I always do at this point… Update my resume and contemplate semi-finished pieces of code projects that hit some stumbling block or another. Or at least I contemplate  contemplating it while avoiding all responsibility on my first night free by reading too much internet. (My random 80’s mix in the background has just started Rickrolling me)

One of the famous people I subscribe to on Twitter (I like to refer to this as Schizofreindia) is Producer/Writer Jane Espenson (@JaneEspenson). Apart from being a linchpin in the Buffy family, she’s also the creator of Warehouse 13, and she’s been a writer, executive producer, or contributing producer on everything from Once upon a Time, Torchwood, Dollhouse, to Tru Calling, Firefly and Angel. She is greatly respected in her arena.

A few weeks ago, I noticed she posts to twitter an occasional “writing sprint.” I’d love to blog more (and maybe I will now) but at the time, I think I noticed it in the evening as it was winding down. A writing sprint is basically an hour devoted to total focus writing on one project. It seemed like (given the chance) it would be at least motivation to try. Sadly, I just filed it away and didn’t think much of it.

Tonight, I am sitting in the living room contemplating what waste of time I will stay up too late watching on the telly. And then I see it:

Screen Shot 2013-11-08 at 10.26.02 PMNot “writing”… Any Project. I contemplated my latest block in a software project. I could go into very droll technical details but it is simply defined as “Multi-Threaded CoreData” Either of these terms can strike fear into even advanced Apple Coder Types, and here I was trying out how to get both at the same time. And honestly, I really wasn’t good at CoreData as it was without adding in the monster of trying to drag it kicking and screaming into the world of being Multi-Threaded; which I can guarantee you… It doesn’t want to be.

But, hey. I had a project, a goal, and at least an hour for bruising my head on the keyboard some more. Why not?

Why not indeed. At 50 minutes in; it worked. I didn’t simply make it work. But I understood why it worked, how it worked, and that I could make it work again. I also wrestled down a nice little steaming pile of other Apple coding technologies that I’d pretty much avoided.

In the world of coding there is a very important step. It’s called Source Control. What this is, is carefully storing your changes on a server so that you can see your work, roll back your work if you do something truly bone-headed, and have a secure way to share work with others. The act of saving your work is called checking-in. And sure enough, I hit the Check in and pushed to my save server and looked at the clock. 9:59.

I’m the type of coder (nay artist) who when I finally defeat something I will jump up, punch the air, shout “YEAH!”, etc.  (Did I mention… maybe not the best fit for my old job)

I had no choice. I had to revel in my schizofriendia just once.Screen Shot 2013-11-08 at 10.37.53 PM

You see “Schizofriendia” to define a term is not the act of following someone famous. It is the concept of writing to someone famous with (for example) nearly 100,000 followers and being the slightest deluded that your comment isn’t just fodder for the internet vacuum. I guess this instance wasn’t Schizofriendia. Because I wasn’t writing it for her, I was writing it for anyone else who might be following her tonight also trying to find their own motivation to succeed.

In a week of what one could call major failures. In a week where one could easily discard all motivation and just slide down a whole. One success can keep a dimming light burning.

One success can do that…

Screen Shot 2013-11-08 at 10.45.07 PM

But an added word of encouragement that was unexpected can light a new path in ways it has never glowed before.

Nothing gets fired, it just finds a new course and path. A better fit

I miss Max.

While it seems that I have little to show for it. I spent the entire week working on this blog. I’m really trying to detach myself from LiveJournal once and for all. Admittedly, on LiveJournal you have an easily wired audience. I will probably end up cross-posting summaries and links back here. But I think that my time with Frank the Goat is finally winding to a close.

Sadly,  even when I think that I can muster the emotional drama of a 14 year-old-girl (Will no ill-respect to my 1t cousin that I’m just beginning to get to know) I just don’t feel like posting it. Im not hungry for the responses from the 300-400 people who I don’t really follow anymore. I’m more interested in going back to the heart.

For me, I want to post what’s inside me. And if people choose to read it. They do. If they don’t… Amazingly, they don’t. Trust me, I’ve got metrics proving the latter. People are not reading my writings in droves. (I’ve always wanted to use that one.)

So, this is what I have to show for one week. An off-handed meta-post?

Well, no. I have spent the last week using the LiveJournal importer from my WordPress install. This is (IN THEORY) a nifty tool that brings down your posts, your comments received and puts them into your stand alone blog. I point out “in Theory” because it took me the better part of a week to figure out how to use it without throttling my server, spamming the internet, and finding the bugs in the code. (Which mind you… I haven’t found.)

Most of this week has involved me deciphering Object-Oriented PHP code. A talent that would have come in handy perhaps BEFORE my interview with the company that might have used me as an OOPHP dev. I basically found where the problem was over a few days. This involved me learning more about the language, figuring out how you debug ‘live PHP’, and shoving in a {en:Kluge} fix to get the thing to finally pass through. (If I get really bored and find myself to have time, I will talk in detail about the technical hoo-hah that I went through.)

So, here we are, a week later and only one new post of which you my faithful reader are….um… is…um….reading. However, on top of that, my recent post on being a caregiver for someone in chronic pain picked up two more comments. I also added 2915 old posts and some 12,480 comments from LiveJournal. Now admittedly, about 450 are currently pending approval because they were left as screened. Some had private info, some were screened due to the nature of the post. And so on.

One of the other problems was that I’d spent the last year pushing my aggregated daily twitters into a lone post on LJ. Those 230 posts need to be given their own post-category. The reason for that is to get them off the main page when on comes to the blog. (I’ve at least gotten the most recent 20 or so to vanish.)

Then there’s all the remaining stuff to do. I want to have my twitters auto post to this blog. I want to have summaries post to LJ with a link back here for commenting.

All this amazing work without a whole lot of content to wrap the work around. Wow, I could make an entire post on that theme. (rolls eyes)

But for now, it’s time for me to attempt to get sleep before 2 am.. or I suppose 1 am since the clocks are going to freak this weekend. More on what’s on/in my head soon.

Til then. Umm…

Witty Sign Off Line.

Algorithm note

I saw a post on one of my coding boards talking about a solution for an ‘interview-style’ problem.

The issue was to find the longest common substring.

What this means is: Given the word “abracadabra” you are looking for the longest repeated set of characters.

The longest repeated sub-string is “abra” which appears at positions 0 and 7 (counting from 0).

The solution the person presented involved putting the strings from smallest to largest into a dictionary (hash table) with counts of iterations.
a-4
b-2
ab-2

And then walking the tree to find the largest result. This solution seems odd to me.

My solution is to make a dynamic array that can be queried for contents. Further, doing it from longest to shortest:

Edit gwenix points out a string can’t be repeated until it’s no more than half the length. So start from longest string (len /2) rounded down.
End Edit

Solution:
Get longest string: abracadabra
Is string in array? YES? got answer and bail; No –> add to array
*Reduce look string by 1 character
Move to start of target string:
**Get look string: abracadabr
Is string in array? YES? got answer and bail; No –> add to array
Is look string at end of target string? Yes –> loop back to *; No –> move forward one character and loop back to **

This is massively not optimised for time or processing. But it’s a first stab.
Also, just pseudo code… loop counters would be my next pass.

Comments? Improvements?

Yesterday, I posted that Microsoft announced that Office 2008 for Mac would be released later this year.

This spawned the usual questions:
Will it be even bigger on my hard drive?
Will it be more buggy?
Why won’t it run on my 7 year old computer?

So, I’m going to actually wear my “Professional Engineer” hat and answer these questions from a general point of view. I can’t give any specific details.. because… well, I like my job and it’s not my place to announce specifics.

You might want to actually sit down for this… I really explain it to you.