2015.03.11 – Refactoring

So much to change around in my code. I am working on making a JavaScript module and it is pretty straight forward but for some tiny syntax things I haven’t quite figured out. Putting functions into a module really does make sense in this instance though. It’s cleaner and keeps everything compartmentalized. My limited understanding of the language makes me think of a module as being similar to a method on a class but that’s not really true I’m told. I’d love a better grasp on things so I can understand why this is not the case. I’ll get there someday!

Today I learned that 1984 was a pretty good year for movies.

2015.03.10 – A Roundabout Way to the Answer

So the issue I’m having with Django is that I have to display some data in a template that is already rendered. I have macros in a template that do some of the processing and then my new template extends from this parent template. The problem is that when a user is not logged in, I need to send a request to the database to get the events and then display them in the page but the way it stands is the entire page would be re-rendered so things like the header and sidebar would be duplicated. Not good. Peter suggested I use Django includes as a last resort and everything I read also said that includes are not the best solution so I was trying to figure out a different way of solving this. I searched and searched and read through a bunch of Django books in Safari Books Online (thank you Mozilla!) but wasn’t getting anywhere.

Finally I asked Peter if he could help me out when he had time. He had time right then so we had a Vidyo conference. Peter decided to just live code through the issue and talk it over as he did so. He began with our assumption that we would try to avoid using includes so he made a helper function and pulled one of the macros out of the template. When he tested it he got various errors so fixed them as they came up. He had to add some attributes, decorators, and some imports. One of the imports was causing a circular import though so he had to put it inside of the helper function and that just didn’t seem right. He then gutted the helper function to it’s most basic needs by just passing the context but that was just an include so it was determined that an include was in fact the best way to go. Whew! The long way around to get there for sure but it was fantastic to watch his problem solving process. I’ll get there someday.

With that solved I had a path ahead so I got back to work on things until I had to head home. Alena was dropping the kids off early so she could teach a class and Dave could go to a job interview. On my way home I stopped in to a new yoga studio to ask if it was good for beginners and ended up signing up for a two week trial. Alice said she would go as well so now I’m committed! For two weeks anyway.

The kids showed up so we played and watched movies while Wayne made spaghetti, asparagus, and carrots. Alice made a salad and brought the first edible flowers of the season from our gardens. I love them.

Tonight for dinner night we had the six of us, Lauren, Sean, Jason, Alice, John, Spencer, Glenn, Dave, Alena, Tiberias, Rialla, and Anya.

Today I learned how to write a helper function even though I don’t need to use one at this point.

2015.03.09 – Just Because It Works Doesn’t Mean It’s Fixed

I was working from home today so I waited until late morning to even think about getting dressed. It was nice to work in my PJs! I was still messing with trying to get anonymous users’ events to display properly but I wasn’t really getting anywhere. After fighting with that task for most of the day I decided to instead test localStorage and sync for authenticated users.

I did a bunch of testing by adding and removing stars while logged in and logged out. It seemed to work perfectly! Everything was syncing and was spot on. Wow, finally something was going my way. I went upstairs to tell Andrew this good news and he replied, “That means it’s broken.” Wha?? Yeah, it’s broken because it’s only looking in localStorage and isn’t syncing properly to the server. If it were then nothing would be correct and that would mean it was less broken. Ugh! Back to the code. Apparently I needed to assign a value instead of just declaring it in my JavaScript. It was doing what I asked but then had no idea what to do with the value after it got it. Tiny little things…..

Today I learned that things may not be as they appear. Just because something seems to work doesn’t mean it’s correct.

2015.03.08 – So Many Choices

Jayde and I got up early and made sourdough waffles and vegan breakfast sausage. It was stupid Daylight Savings Time and we all forgot so I say we got up early even though it wasn’t actually so early. It was a delicious breakfast though! Andrew also made me some really good Golden Needle tea we brought back from our trip to San Francisco several months ago.

Wayne had taken down our upstairs hall light as well as the lighting for the stairway when he did the demolition so he wanted the three of us to go to Hippo Hardware and look for something vintage to replace them with.  They have an overwhelming amount of light fixtures to choose from. We were there for nearly three hours before finally deciding on a fixture for the hall and an unobtrusive sconce for the stairway.

By the time we were done at Hippo, we were all pretty hungry but still had to stop at Food Fight for some Beyond Meat burgers. We decided to just grab lunch at Hungry Tiger Too. Andrew had the vegan Reuben which he loved and Wayne and I split the Totchos. Nachos over tater tots. What could be better?! Really good. Really unhealthy.

We got home and there was plenty of sunshine left so we sat outside chatting with neighbors and just enjoying the perfect day. Wayne made a late dinner of burgers and I decided I do not like the Beyond Meat burgers. They were very meat-like to me.

Today I learned about all the different types of light fixtures a 1909 era Portland home may have had. It’s a lot.

2015.03.07 – Our First Hike

The weather continues to confuse and amaze everyone including us. Spring has sprung and everything is in bloom. I picked today to go on a hike with Andrew and Wayne. We were also going to have a picnic but it was our neighbor Leonard’s birthday. He has dementia so his wife thought he might like a big group of visitors in the afternoon. I dunno about that but we were happy to go.

We packed up some snacks and drinks and drove to Macleay Park where the trail began. We walked for quite some time along a small creek in the forest. There were lots of people out and about since the weather was so amazing. We eventually made it up to a road where there was a parking lot. Many people were starting their hike up to the mansion at this point. We left the little creek behind and followed a trail full of switchbacks up a steep incline. I am so out of shape that I had to keep stopping. It was ridiculous. We finally made it up to the top where there were amazing views of Portland. Wow! We could also see Mt. Hood and Mt. St. Helens. So beautiful! We sat and had our snack of hummus, pita chips, carrots and celery before heading back down. Down was SO much better!

Once we got nearly to the car I noticed I was feeling pretty itchy. Ugh, I was having an allergic reaction to something. It would get worse and then calm down and then get worse. I decided I was probably ok to stop at the grocery store so we could grab some fruit. We were going to game night at Dale and Miri’s house and were taking a fruit salad. By the time we were about done at the store I realized I really needed to get home. I was very itchy and not feeling great. I went to bed and the guys went across the street for Leonard’s birthday gathering. I ended up sleeping for a couple of hours and felt a lot better when I woke up.

Wayne made a really nice fruit salad and we all headed over to Dale and Miri’s. Baby Michael was wide awake and happy to see everyone. Kronda, Jess, Alice and Jason also showed up and we had a great dinner. Jason and Alice headed home after we ate and the rest of us played Taboo, Code 777 and a really fun block building game. I liked them all but we got mixed reviews on Code 777. It was getting late so we all called it a night. I’m a fan of game night!

Today I learned that it’s totally possible to make a delicious vegan potato kugel. Yum!

2015.03.06 – A Bit Better Day

Jordan came with me to Mozilla since his class is now just open lab while the students work on their final projects. He’s trying to go through a Django tutorial so I told him I could help him out if he needed. I ended up having an early Vidyo meeting with Peter which was nice. He gave me lots of pointers to get me back on track so I didn’t sit and struggle all day. We also had a chance to mull over some functionality issues and I now have some things to test. Speaking of tests, he said I can enable the new Selenium tests and I don’t have to worry about Docker so that’s handy. I’d like to get this star thing done so I can learn a bit about Selenium.

Jordan stuck around until just after lunch and I spent the rest of the day working on getting my anonymous user view of starred events. I left a bit early so I could get home while it was still nice out and ended up just missing a Max going my way. I decided I’d take the bus and ended up just missing that too. I stayed at the bus stop though and saw probably 3 yellow lines pass by before another 35 bus finally showed up. It was beautiful out though so it didn’t matter.

I decided to give my brain a break and just read a novel until dinner. Afterward I hopped back on my computer to try and make some progress. I was working away when someone asked for help in #airmozilla-dev. Everyone was gone for the day and I would have felt bad just ignoring them so I said I was there. I had no idea if I could actually help them but I stopped what I was doing and tried. They kept calling me “sir” which I found amusing. I don’t think I was much help though.

Today I learned about these sweet vintage looking LED bulbs.

2015.03.05 – Distractions

I was not very productive at all today. I got pretty frustrated so I took a break and worked on fixing some trivial issues and then called it a day. On the upside I was meeting my friend Lisa after work. We became friends while I was at Urban Airship. She is one of their data scientists. I walked over to Trader Vics where we were meeting for happy hour.  The weather was lovely and people were out in droves. It has been so ridiculously beautiful. Everything is blooming and sprouting early.

Lisa was already there when I arrived so I ordered a drink and some appetizers and we sat and caught up. Things are going well for her and she said she is getting to work on  real stuff now 🙂 She started working there shortly after I had. Andrew showed up a little bit later and we all had a nice time hanging out. After about an hour we all had to get going though. She needed to get home and we had a PLUG meeting to get to.

It was a pretty interesting talk by someone from the EFF. Andrew and I had quite the conversation about software licensing, BSD, Linux and lots of other stuff all the way home.

Today I learned about LLVM and GCC compilers. Apparently LLVM is ‘better’ but doesn’t run on very many architectures.

2015.03.04 – Need This Fog Lifted

Staying home yesterday made today feel like Monday. I got to Mozilla and worked on some little naggy things like changing how data is serialized. I did it one of the ways I had suggested so the change is only in the JavaScript. Peter might hate it but I think it looks cleaner.

Now I really need to get my brain in gear and figure out how to display starred events for anonymous users. Python can’t talk to the browser but can talk to the database, JavaScript can’t talk to the database but can talk to the browser so can grab the localStorage event IDs. Currently I have starred events only displaying for users that are logged in because my view filters them based on user and event ID. I need to grab the IDs from localStorage and then use those IDs to retrieve the events from the database for display. It sounds really simple and it probably is really simple but I’m having trouble figuring out how to accomplish this.

I had a nice break after lunch and met Dave for coffee. We went to Courier Coffee nearby and since I’m a tea drinker I got the London Fog. Yum!

After lunch I got back into my mental gymnastics but didn’t really come up with any solutions. Barbara came down and worked so I had some company for the remainder of the work day which was nice. Jordan had gotten a ride home with a friend so I took the Max home rather than have Wayne come down just for me. It was a beautiful walk home down our street. I LOVE living here!

Today I learned that my friend’s cousin was finally released from East Timor after six months.

2015.03.03 – So Much Food

It was an early morning as I had to get Lauren to the dentist by 8:00 for a root canal. Fun! I had about 45 minutes to read a book though so that was really nice and she seemed to be a lot better once it was done.

Afterward we stopped at Goodwill so I could grab some pans. I would be cooking dinner for a friend in need and figured I could put the food in pans I didn’t need back. She could keep them or pass them along to someone else down the road. While I looked for what I needed Lauren looked for some clothes. She found a few really cute things! I love shopping at Goodwill.

I got back home and got to work on my bug. I had to refactor some of my JavaScript and add some code to my template to check for user login. With these changes it seems I might be able to bypass an anonymous user GET completely and that would be pretty nice. I do need to figure out how to get anonymous event IDs out of localStorage though and I’m not sure how to do that yet.

I was having an error in my JavaScript that I couldn’t figure out. It was saying something about an undeclared variable. I poked around to see what that meant and came across this article. It was encouraging and intimidating all at the same time. On the one hand it shows that anyone can make a mistake like this no matter how much they know. On the other hand I read the comments and that was discouraging and intimidating. Whyyyyyyy do I read the comments??

14:00 rolled around and it was time to get in the kitchen and start cooking for our friends and dinner night. We’d be having chili and cornbread so it would be easy to make two huge pots of chili and two huge pans of cornbread. Our friends are a family of seven so I made enough for them to have dinner and lunch leftovers. Between theirs and ours it was a LOT of food!!

Once theirs was done, Wayne and I drove it over to their house. They live in SW Portland so it ended up taking about an hour there and back with the traffic. They weren’t home so we left everything on the porch and I let her know it was delivered. I hope it will all be ok!

Once we got back home I made our cornbread and a peach cobbler. Alice and Jason showed up and Alice started on the salad. We had the six of us, Taylor, Delaney, Spencer, John, Lauren, Sean, Alice and Jason. Miri and Dale were trying to make it over but it didn’t work out. We all ate a ton of food and then found room for cobbler. Glenn came over just in time for cobbler.

Today I learned that sometimes the Goodwill people don’t check pockets very well.

2015.03.02 – Learn to Remember to Test….the Hard Way

I pushed up my changes so Peter could look them over. I was pretty happy with how things were progressing but yikes, after all the comments I feel like I was off track for sure. There is just so much to consider and I haven’t learned how to do that very well yet I guess.

I read through the comments and began making some changes. When I went to check them out and make sure everything was happy POST didn’t seem to be working. Ugh! I didn’t even think to check it yesterday when I made other changes. I backed out of any new changes and sure enough POST was still broken. What the heck did I do?? I wasn’t getting any sort of error so that was less than helpful. I guess I knew what I would be spending my time on until I figured it out.

That took a long time! I even had lunch in between. It seems my new flag for is_logged_in is the culprit but only in the JavaScript. Now that I’ve spent half the day tracking down the ‘what’ I will probably spend the remainder tracking down the ‘why’. Good times!

I decided to just leave the offending code commented out for now and work on the jQuery serialization issue. I had commented my fix with several alternative fixes but Peter had yet another way. I tried his suggestion but I got HTTP 500 errors. Well hmm…I just put it back the way I had it until we can look at it together.

I spent the rest of the day just trying to wrap my brain around the suggested changes. It was a loooooong day!

Today I learned that a photon was photographed as a particle and a wave at the same time! That’s pretty fucking cool.