a Rubiks Cube, a father, and a son.

Note the lowercase f and s.

My father showed me how to solve a Rubik’s cube.

There were many things sub-optimal, perhaps, about my nuclear family of origin; however, some things that went very well:

  • In the 1980’s, when the Rubiks’ Cube became a thing, lots of people were writing books on how to solve it.
  • Not a lot of Maths books though. My father (Sat Pal Gulati) always wanted to be famous, respected, known, and he decided to write a maths book about the maths of a Rubik’s cube.  This was probably 1984?
  • He showed me, by example / osmosis, his solution..
  • .. which gave me a mindfulness of patterns.
  • This mindfulness of patterns has helped me in my programming career and in life in general.

Or maybe, I was always prone to pattern-recognition, and this was one of the first ways my mind used that skill.

My father was never able to publish his book – he finished it, and I remember him working with some printers in India to get it published, but he only printed a few (100?) copies, and never got a distribution channel to sell it.  But he was very proud of it, I think.   I would love to get a copy of it, but I don’t think I can.

My son enjoyed playing with a Rubik’s cube.

I’ve shown off my Rad Rubik’s Skills every now and then – mind, I’m not a speed solver.  Best time so far has been 1:58, usually more like 3:00.  Mostly as a party trick, I don’t own a cube of my own at the moment.

At a family gathering, my wife’s sisters’s husband’s brother’s son had a cube – and it was a big topic of conversation for the evening.  I showed off my inner child’s skills (thank you dad).   Later in the evening, my son (who is now a young man, on his own, with a son of his own), picked up the cube.. and I could see his gears turning, his fingers ruminating.  My heart melted.

So, for Christmas

I am investing.

I am investing in the availability of patterns for young (and not quite as young) minds to grab on to.

I am investing in my inner child who loved this stuff.

There’s a beauty that I cannot describe in working with these kinds of puzzles.   Its the same beauty that I see in Maths that people either get, or their eyes glaze over.

Just waking up in bed this morning, my mind started playing with a 4x4x4 cube, and I realized how the solution is the same as the 2x2x2 – the inner edges are the same as an inner 2x2x2.

What’s this Pattern / Solution?

Jade asked about being able to solve it, and I’ve been thinking about it.   I think there are some realizations that add up:

  • First you have to be able to see the “edge” pieces from the “corner” pieces, and the relationship to the “center” pieces.   Pieces are not in place till all the colors match their respective centers.
  • Then, given you have a face that is already solved,  you can find two moves:
    • one move A will remove one piece from that solved face.
    • a different move B, to put that one piece back in the solved face.
    • your solved face is still solved.
    • Sorry, we’re going into Maths territory here by giving things names like A and B.
  • Then, you study the effects of A+B on the rest of the pieces
    • some pieces swap with each other
    • some pieces go for a 3-way swap with either other
    • sometimes pieces rotate in place.
  • Now think about mirrors.  So if you do a move on a left side, vs if you mirror it, and do it on the right side.
  • Now think about (A+B) + (A’ + B’)  (yeah, I had to jump into Maths.  I could make a video if someone asks)
    • Some things will cancel out
    • This ends up moving a few pieces with surgical precision.

I wrote the above before I found the links below .. its so much easier to show.

What Specifically did my father show me?

My father’s system has you solve the top face first, and then work on:

  • Bottom corners placement
  • Bottom corners rotation
  • Bottom edges
  • Mid edges placement
  • Edge rotation

Pattern 1: To position and rotate corners

Click on the bottom row of buttons to move the cube around, S to stop rotation, R to reset rotation.

  • A+B: https://rubiks3x3.com/algorithm/edit.html?moves=rDRDFdf
    • A = rDR moves the Yellow-Orange-Blue corner piece out
    • then move the YOB piece back in with B = DFdf
    • omitting a final d .. better for combining below
    • Yellow face stays unchanged
    • White Corners:
      • Red-Blue unchanged
      • Orange-Green and Orange-Blue 2-swap (with a rotate)
      • Red-Green rotate (rotations are always in pairs, the other part of this rotate was in the Orange-Blue)
    • Use this move to position corners, don’t worry about rotation.
  • A’+B’: https://rubiks3x3.com/algorithm/edit.html?moves=LdldfDF
    • Same as above, but mirrored.
    • Same effects, except a different piece rotates.
  • A + B + A’ + B’:    https://rubiks3x3.com/algorithm/edit.html?moves=rDRDFdfLdldfDF
    • The two front bottom (white + orange) corner pieces don’t move.
    • The two back bottom corners (white+red) rotate so that white ends up on the back.  Ie, whatever was on the L+R is now on the bottom.
    • Use this move to rotate corners.

Pattern 2: To move things from the middle to the bottom edges

Pattern 3: Moving Edge pieces around

Rotating the cube so that the offending middle pieces are.. well, you’ll see:

Pattern 4: Rotating Edge pieces

This one is so simple, yet .. amazing somehow.

And that’s it.  That’s all I had to remember to get the cube solved.

The same moves apply to solving the 2x2x2 – there are no edges.

And this morning I realized it would solve the 4x4x4, 5x5x5, etc, as well.

Thanks Dad.

Catch up Post – How to be a Grandpa

OMG! I haven’t posted in a while.. that’s probably because I switched over to my personal blog and released a bunch of emotion in political posts, which I felt did not belong here.

No Big. 

Okay, so what have I learned lately?   What have I tweaked lately?

  • I once again found a reason to write a mega-blog-post of all projects worked on.
  • Personally, I’ve been working on some code for tracking hierarchical todo’s; blog post to follow when i get reporting to work correctly. 
  • Workwise, on a WPF project, dealing with a fairly complicated screen, working against mocks of controls that are not available yet.
  • I got to create a pretty cool christmas card.  I’ll post it after it goes out..  I created a flowchart…

But most of my learning is happening here:

imageHow To Be a Grandpa

I did not have biological kids of my own, so this is my first experience at taking care of babies.

I have learned things like:

  • Different strategies for holding baby
    • support the neck is crucial, but after that there’s lots of options – the pin, the back-holder, the knee holder, the double handed neck buffer, etc.
  • Different strategies for burping baby.  
    • I like the over-the shoulder method most, but baby sometimes raises head up, so I have to stabilize between right hand and cheek, while left does the tapping. 
    • (the other method is in front, seated, with the baby facing to my right.)
  • Lots of baby songs.  Head/Shoulder/Knees/Toes
    • Spotify seems to have a very good selection of Kid’s stuff.
    • Amazon Prime Music has more repeats.
  • Diaper-changing.  
    • I’m still trying to perfect the vertical positioning, and the centering of the velcro on the front, without causing gastric distress.
    • There’s also the quick-shield skill .. baby loves to time things and gitcha with some surprises.
  • Bottle-feeding, and cleaning, and fixing.
  • That there are many different sizes of rectangular fabric, called by different names, used for different purposes.

I’ve also learned that as a mid-40’s person, I don’t have the resiliency I used to have regarding interrupted sleep patterns.  We take care of baby two nights a week, and one of those nights also translates into most of the next day. 

I’ve also learned that my wife, having been a single mom when she was raising her offspring, is frickin’ amazing.

I’m also discovering that there are many songs, which, while I may not play them for myself, I go back to to sing to the baby.  Because.. baby has NOT heard these songs.

Cheers!

Aftermath of an Election 2016

Been processing.  And .. here’s some interesting bits I’ve seen echoing.

CGP Grey Electoral College and other Voting System videos:

https://www.youtube.com/playlist?list=PLej2SlXPEd37YwwEY7mm0WyZ8cfB1TxXa   This is a playlist with 17 videos; #7 & #8 are the key ones, however, they’re all excellent sources on how the process works.

But the best bit was his update here:

[youtube=http://www.youtube.com/watch?v=zcZTTB10_Vo]
[UPDATED VERSION!] The Trouble With The Electoral College

Which leads us to The National Popular Vote initiative:

http://www.nationalpopularvote.com/  pasted from them, my emphasis added:

The National Popular Vote bill would guarantee the Presidency to the candidate who receives the most popular votes in the entire U.S. It has been enacted into law in 11 states with 165 electoral votes, and will take effect when enacted by states with 105 more. The bill has passed one chamber in 12 additional states with 96 electoral votes.  Most recently, the bill was passed by a bipartisan 40–16 vote in the Republican-controlled Arizona House, 28–18 in Republican-controlled Oklahoma Senate, 57–4 in Republican-controlled New York Senate, and 37–21 in Democratic-controlled Oregon House.

Link with graphic:  http://www.nationalpopularvote.com/written-explanation which has a lot more words.

And then there is FairVote:

http://www.fairvote.org/  which .. its not obvious, but its the STV system listed in Gray’s videos.  Or, better explained with a graphic:

image

This was a real ballot.  And Maine has now voted to make it state-wide.   Apparently they did that after a particularly horrible candidate got in due to the previous system.   Hopefully this system can grow to other states as well.

There is this note on violence:

[youtube=http://www.youtube.com/watch?v=abwc7AAXn3A]
A Breif, Personal Letter from America

A meaningful (for me) excerpt with my emphasis added:

“Not everyone who voted for Trump is a ___ … despite what filter bubbles would have you believe, uh, they’re not, but:  All the ___ voted for Trump.  And .. the trouble is that now the ____ think the country and the world agrees with them, so as it was with Brexit, the hatecrimes in the UK spiked, and .. no matter how many of his policies Trump actually gets to implement, that spike of intolerance, ____ is going to happen, and  I reckon its going to last longer.” 

I’m leaving out the word he used so that it doesn’t cause a stir; he didn’t mean it to cause a stir either.

The point being, the violence that will be broadcast… remember folks, its a bunch of deluded individuals.   I will hope that they are incorrect, and they will be relatively unsupported, and it will pass, as it did in the UK – its hard to find, but “The peak daily total between May and August was seen on 1 July, when 207 alleged race or religious hate crimes were recorded.” (http://www.independent.co.uk/news/uk/crime/brexit-hate-crimes-racism-eu-referendum-vote-attacks-increase-police-figures-official-a7358866.html)

How It Happened

This article is the best I’ve found on what happened:  http://www.cracked.com/blog/6-reasons-trumps-rise-that-no-one-talks-about/.  My takeaway is, there are people who have been ignored: Rural America.  And I don’t even like that word Rural there.  It almost sounds like “backward”.  What I mean is.. Small town, maybe?   I didn’t grow up there, but I have many friends who did.   And yeah, if they found somebody whom they resonated with, I could see the slight additional turnout on their side.

So, note to future leaders:  Please consider the needs of the non-city as well, as you go about your stuff.

OTOH, you can look at voter turnout (in k) – Registered, and Voted, and %:

image

(this is from an older version of the Wiki page:  https://en.wikipedia.org/w/index.php?title=Voter_turnout_in_the_United_States_presidential_elections&oldid=748821487 … the current one has no % for 2016 because numbers are still in flux.) 

And Neat Exit-Poll Breakdowns

http://college.usatoday.com/2016/11/09/how-we-voted-by-age-education-race-and-sexual-orientation/

(lots of cool charts)

Not Yet the Stage for a Woman President

My mom had an excellent point.  Even if H had won.. she would have been hamstrung by the republican controlled House and Senate.   And since everybody seems to blame the president for what everybody else does on their watch .. maybe not the most auspicious. 

And there’s the possibilities of change

https://assets.donaldjtrump.com/CONTRACT_FOR_THE_VOTER.pdf

Granted, likely none of the good stuff might happen.  However, term limits on Congress … I agree with that.    There’s a ton I don’t agree with, but there’s not a lot I can do about that, but that is one thing I do agree with.

However, reading through his 100 days thing – wow, yeah, terrifying.  Here’s a line by line analysis of the above:  http://www.npr.org/2016/11/10/501597652/fact-check-donald-trumps-first-100-days-action-plan

OTOH, maybe we need more pain before people can see the bigger picture.    Hope the planet survives.   And I hope people can see the bigger picture and not just scapegoat yet another thing.   Wait, I’m going negative, that’s not the intent here.

Ah well.    its going to be several interesting years.   

Hang in there folks.  And if you need a hug, just ask.  I give hugs freely, for all.  

Addendum:  reading up some “news” about the hate-speech going on ..  very sad.  Hate is so.. powerful an emotion.   So viral.  And to be on the receiving end of it .. to have that blanket of security ripped away from you .. it hurts.  I wish I knew how to love on people such that they didn’t need to hate anymore.

Voting 2016 (opinion)

I have a jumbled thread of stuff in my head, that .. maybe if I put it out as a post, I can clear my mind.   I would not normally make this post here; but as I think about it — this is definitely a good indicator of how I think.  This blog is about showcasing my strengths.  This is a strength.  So yes, I’ll post this here, and claim this part of myself as part of my public persona.

“Why are you always defending ____?”   asks my wife.  Resulted in a lot of internal conversation, which resulted in this post.   TLDR: I want to make gazoonkingly sure that I have opinions but don’t hate holders of the opposite opinion.  So I feed myself from both plates, make sure my emotions are stable, and then make a perspective choice, rather than an emotional one.

I don’t want to feed the craziness out there, I’d rather help bring unifying order.   Yet, I am not in control of other people.   However, someone I respect urged, if I don’t state my opinion, how can those who want to listen, listen?   Also hence this post.

As I expressed to a friend, if 51% of the country votes for Trump, even if I disagree am not in agreement with them, their group conscience has spoken.  If that does happen, I think it will be a spectacular 4 years, which will end in either “wow, we didn’t want to go here” unification, or, even more polarization.  At some point in time, with enough polarization, it might warrant a country-sized split.

My perception of Hillary

  • Takes lots of notes.
  • Listens very much.   Absorbs.  Understands.
  • Tries to find middle ground.
  • Very smart.
  • Well integrated into current system – for better or worse.
  • Does want to change things for the better, for such outcomes of better as are practical and possible.
  • Does not go for radical changes / that don’t have a high chance of success / unless personally held belief of moral ground makes this imperative.
  • Not inherently evil.
  • Very plugged in to surrounding system, and  thus any failures of that system could be laid at her feet, but that would also be incorrect.
  • Has to wear a large emotional protective barrier / thus can’t hang out, be personable, etc / unless you are allowed into her barrier / yielding the conflicting reports of “very warm” and “cold”.

The ickier perception.

How does one tell somebody, that I think they’re being take advantage of?    Maybe its not possible.  I’ll approach it from another angle.

That sets the background.   Then, enter this:

  • Ratings – http://www.people-press.org/2015/05/19/hillary-clinton-approval-timeline/
    • Specifically when she’s not running for something, its high, but if she’s applying for a job, [the spin cycle starts and] it dips low.   This was my first clue that maybe all the emotions that were being tapped about this candidate, might have been planted, and were not for warranted.  This is when I went looking for additional information to form my own opinion.

What I think is going on is, a pretty long-running campaign, that uses some cognitive viruses out there – tap on people’s emotions.  Once the emotions are tapped, folks’ minds close down.

There’s some reference to some of the .. crazy depths that this got to, here:  https://www.whitehouse.gov/the-press-office/2016/10/13/remarks-president-ohio-democratic-party-dinner  (search for: “political expedience”).

Interestingly, any time somebody wants to bring “logic/reasoning” etc in to talk about stuff, there’s a programmed defense that the virality goes for: Call them “IYI”, intellectual-yet-idiot.  If you google that phrase, fun times.

So, summary –

  • for political expedience
  • viral memes have been fed to media to feed to people
  • this worked well for media because “flashy” sells better than “sensible”
    • and they are a business that needs to make profits
  • viral memes lead to polarization and self-agreement cliques
  • emotions have taken over
  • that’s that.

At this point, only the folks with something to sell, would benefit in this system.   Discourse is right out the door.

Also at this point, for anybody in the middle of such a system to risk entertaining any new thought – would be to risk cultural rejection of the culture that surrounds them – and just won’t happen.   The backlash would be too hard.

How did I change my mind?

I started off in another camp – I had several soundbites in my head, of how horrible HC was.    I decided to abandon them, and go searching for pro-candidate information for all the candidates in question at the time, which were Bernie, HC, DT.   I also went looking for stuff on GJ, I didn’t get a chance to research JS at the time.

The best piece I found on HC was this one:

Note, I would have been pro-Bernie, but I think they made the right choice.    I think his platform was too radically different, and thus change would have been much harder.

I did go looking for stuff on DT.  I wanted to find something that showed him as intelligent, thoughtful, concerned.     I couldn’t find it – most of the stuff that I found was using virality and emotions to effectively do a sales job.    I would LOVE to have found something where he was in a business meeting being very intelligent and being a good leader and directing people in a way that brought them up – that’s the leadership style I prefer – and I am biased and this is about me – and I couldn’t find that.

GJ – I liked what he _said_ he represented, however, I found him too easy to excite.    And at times, he seemed, well, stoned.   So while I agree with him on many points, not sure that he would be effective.   His running mate, on the other hand – amazing and wow.   Wish he would run.

JS – recently anyway, I didn’t look her up earlier –  I found her to not have an in-depth understanding of the details of issues, kinda waving her hands in the air, broad gestures.   I don’t think she would be effective.

Pro-DT Culture

I have several friends who are voting for the T.     Here’s what I perceive about them – this is also a bit of creative rambling, me casting things onto them, that’s probably more a reflection on me than them:

  • Love family.  (100% of them)
  • Country Music.  (several; related to: love of family).
  • The world has to do with several stages, that you pass through, one after the other, nostalgia, emotions, but the “way” is effectively set, there is strength in that knowledge, the way things should be, ought to be, is known.
    • Pretty danged close to classic Asian-Indian culture, btw.
  • Trust the system, because the system is part of the stages.
  • Love that which is known, ignore the stuff outside of it.

None of them are overtly racist.  None of them overtly hate.    And if you don’t get them, then they’ll nod, sigh, wish you got them, and then they move on, with their world, and you don’t matter to them.

I love them, and I get to honor them.  That’s the world they live in.

There might be other Pro-DT folks who are, shall I say, edgier, but in general, I don’t know / maintain relationships with / people who hate.

Splitting the Vote

Why not vote GJ instead of HC if I don’t agree with DT?

I often see this diagram in my head on this subject:

image

https://flowingdata.com/2016/08/02/small-percentage-of-americans-actually-picked-clinton-and-trump/

Granted this is about the primaries, and I think turnout is higher for the actual election, but the idea is that, if everybody actually turned out and voted, it would be very easy to get an independent elected.  So vote your conscience, vote independent.      That would work for me, IF I didn’t think that HC had some merit.  However, I DO think she has merit.    So, I’m –10 about trump, probably an 8 about HC and maybe a 6 about GJ.  Lets say I was a 10 about GJ.    I’d rather do an STV vote, and put GJ first, then HC, and just not include DT, to make sure he NEVER got my vote.

But we’re not in STV.     And I do think HC is more fit for the job than GJ, assuming that there’s support in the congress / senate, which is another beast entirely.

Conclusion

I think that’s about it.   I don’t think this would convince anybody about anything.    I am one small vote in a large sea of votes, and this is approximately how I reasoned my way to where I’m at now.

I would hope that the country I choose to call home will go for listening, acknowledging, lifting people up, but also not enabling dependent behavior.

Making Educational Videos for Code Louisville

I volunteered to be a mentor for the latest session of CodeLouisville, on the .Net side.

No big deal, I thought.. and then, TreeHouse was unable to get their Entity Framework videos ready on time, so we, the mentors, volunteered to pick up the slack.

Naturally, I don’t do well when given an open ended problem, so I went into crazy-detail-mode.    I paid $15 for a 1-year subscription to https://screencast-o-matic.com/home  (VERY GOOD), and I started making videos.

And I ran out of steam.  Because, of course, I chose the slow, measured, one-thing-at-a-time approach, and I created far too much work for me to do myself.

Luckily, two other mentors suggested that we do X for our mentoring session – so if what I was doing was from top down, they were going bottom up.  Basically, show the fast way to create an MVC website, Code First, Scaffold, and let the students backtrack from there.

This worked VERY well.   It boot-kicked the students into effective land.  At least one of them showed me some working code in their project in the same week.

Lessons Learned

I am too. detail-oriented for my own good.

When in doubt, ask people what they need.

Sometimes, you just have to show the finished product and NOT explain everything, then go back and explain what is needed.   Its okay, people are resilient, they will survive Smile.

I like screencast-creation, but not more than a few hours a week: For a 20 minute screencast, it takes about 40 minutes of recording, about 2 hours of editing, another 20 minutes of rendering and uploading.   So basically plan on 4-5 hours for a 20 minute video on a topic.    Thus, I can probably sustain generating 10 minutes of educational content a week.

What Did I make

This is a walkthrough of LocalDB:   https://docs.google.com/document/d/1tTDKTQsfGPr_nFSbEifGQRc8dc-FfrxbPUfnc7CyKoc/edit?usp=sharing

This is a walkthrough of C# talking to SQL:  https://docs.google.com/document/d/1lSt-C5-L3VwLLGE6oJO3A_UOpIu2lYA-EWMhzAo-Ye0/edit?usp=sharing – it has links to 5 videos, and (eventually) links to code in github.

Unit Testing vs Integration Testing

Unit Testing

  • mock everything external to your code.
  • mock everything up to the thing to be tested
  • do some stuff
  • assert one thing.
  • Don’t continue a test – instead, mock up the environment to match the new thing to test, and write that in a new test, with a new assert.
  • Its cheap to run lots of tests
  • Its cheap to mock things.

Integration Testing

  • Its expensive to set up data
    • That’s a talk to itself, on how to do that in a sane repeatable way.
  • There is no mocking. Its real stuff, all the time.
  • Thus, when you achieve one milestone, your test (more like a “flow”) continues to the second milestone. Examples:
    • Upload, Pause, Continue Upload, Download, Pause, Continue Download
    • Upload, kill upload, Upload again
    • Upload, Download, kill Download, Download again.
    • Create item, edit item, rename/move item, delete item.
    • Its too expensive to try to get to a middle state, unlike mock-land.
  • Along the way, you print out “assessments” (to go with a AAA-style term) of where your test is at and what data its seeing.
    • ie, Arrange, and then
    • Act Assess Assert
    • Act Assess Assert
    • Act Assess Assert
  • In case of failure, you compare the log of the failed test with the log of a successful previous test to see what’s different.
  • The test can be VERY complicated – and LONG – and that’s fine. You only know the detail of the test while you are building it.
    • Once it goes green in a CI system, you forget the detail, until it fails.
    • If it does fail, you debug through the test to re-understand the test and inspect data along the way.
  • Expect flakiness
    • Sometimes things just fail. Example: locks placed on tables in PostGres for Unique in their UAT environment by some other process.
    • Sometimes things fail because of a reason
      • Somebody changed a schema.
      • Somebody deleted some key data
      • Some process crashed
      • Previous other test left behind data that FK locks the data you want to work with.
      • All these need human care and feeding and verification, its not “mathematically sound” like unit tests are.
    • Its a good idea to put an Assert.Ignore() if any failures happen during Arrange() section (ie, databases are down, file system full, etc – no longer a valid test. Not failed, but not valid, so ignored.
      • Can postpone this till a test starts to be flaky.
  • But when it works
    • you know that all the stuff is CORRECT in that environment.
    • And when it works in CI day after day after day, any failures = “somebody changed something unexpected” and needs to be looked at.
      • Fairly often its a shared DB, and somebody else changed schema in a way that you’re not yet accounting for.
      • Or somebody changed the defaults of something, and your test data that you’re hinging a test on has not been updated to match.

Which Ones To Use Where

  • Use Unit Tests to explore the boundaries and paths inherent in a piece of code.
    • Faster
    • Many of them
  • Use a single integration test (or just a few) to run through the code with all dependent systems
    • try to hit every SQL statement / external service at least once
    • If it worked, combined with all the unit tests, you’re probably good

SQLite for C#/SQL Developers

Current project uses sqlite3 for local storage of stuff for various reasons.  This was our first time working with it.  We’ve learned a few things that are not obvious.. coming from a SqlServer world —

Tooling

SQLite Expert for the win.  It has a chocolatey package as well, although that failed to install once for me (but worked twice.  Who knows).

Note that SQLite is multi-process-open-able; data inserted by your program shows up automatically in the Data tab in SQLite Expert.  However, if SQLite Expert has the .db3 file open, can’t delete it to scrub it clean.

All the same: varchar nvarchar and text

SQLite doesn’t care.   It has 5 types of “data” it can store, depending on what the data is.  Handy reference: http://www.tutorialspoint.com/sqlite/sqlite_data_types.htm.

So when we were doing “uniqueidentifier” it was actually doing BLOB under the hood.

Its entirely dependent on what you’re trying to store, as to what gets stored.   So you can store a string in an int field.   https://www.sqlite.org/faq.html#q3  — its a feature, not a bug.

GUIDs as binary, beware Endian.

Most programmatic forms of storing Guid data end up storing it as Binary/Blob.   You know its binary if you do:

select id, hex(id)

And you get two things that look about the same size in length, but are shuffled around:

{E589C188-2575-4AC6-BD41-A66A00A1AF22}

88C189E57525C64ABD41A66A00A1AF22

You might say “hey! bad Endian!”  but actually its Guid.ToByteArray() that’s doing the re-shuffling.

So, if you see the value {E589C1… in a grid result, and you want to select it, and you say

select .... where id=x'e589c1...'

That doesn’t work!  you have to give the bytes in the other order (as returned from hex(id)).

Foreign Keys Not On By Default from C#

This one was a shocker.  Its a pragma to turn foreign key checking on.  However, tools such as SQLite Expert do this automatically for you.

What we ended up with is a GetOpenDbConnection() call that did both .Open() and executed the pragma.

Logging Generated SQL from Dapper

A lot of this got figured out after we could see the SQL Generated by the various libraries we were working with. Turns out, that’s 2 statements after your connection is opened:

con.Flags |= SQLiteConnectionFlags.LogAll;
con.Trace += (o, e) => { Console.WriteLine("SQL: " + e.Statement); };

In Conclusion

These are the bombshells we’ve experienced over the last week.  Hopefully, all the bombshells are done with now.

Other than this learning curve — very solid, very fast, very nice.  2 Thumbs Up. Plus One. Heart It.

git rebase

I’ve never done a rebase before.  I figured today would be a good day to try it out.   It’s a simple case —

imageimage

From the client’s point of view, origin/master is ahead by one commit.   It happens to be a conflicting change.

In Tortoise (I’m starting out easy), I pick “Rebase”, and I’m saying I want to change my branch SG-EndToEndTest to be “re-based on” remote master.

image

  • Its showing me the list of commits that I’ve had, since I started my branch from wherever
  • Everything is picked.  Could choose to not-pick some stuff, leave it behind, like config file changes for local debugging.

I click “Start Rebase”.  It starts from the bottom of the list (ID=1) above and triest to re-apply the commits to the new root.   It runs into conflicts –

image

I right click on the conflict, edit it .. turns out TortoiseDiff doesn’t think it’s a conflict, I can easily mark it as resolved.  I have to do this twice, both in .csproj files.

When its done, its all still local – server’s not any different – but local shows:

image

  • The old commits are still there.
  • But they’ve been cloned and re-grafted onto a new source node, and the label has been moved.
  • If I had to, I could undo everything by force-moving SG-EndToEndTest to be based on ad1c.

If I now push up to the server – I get an error:

image

Instead, I have to push with –force (“may discard unknown changes”) (ie, “tell the server to do stuff where it discards changes that I, the client, know nothing about – JUST MOVE THE REF”)

image

Now the server looks like this:

image

That was my first, very simple, rebase (without squashing).

The pull request that I had open against that branch survived as well, and changed from “Cannot merge – conflicts” to “Can merge automatically”:

image

Goodbye to old code and dreams of immeasurable wealth

imageIn the Beginning

I would always hear about people who wrote simple pieces of software, who were in the right spot, at the right time, and their stuff got used and they became famous, and.. perhaps even rich. 

Every time I heard such a story, my baby tyrant would say: “I want that!  Lets DO that!”

To which my Fuddy-grownup would say, “Honey, you probably won’t become famous, and it probably won’t work out.  Are you sure?”

And the Couch-Buddy would say, “Ah, too much work.  Lets read some more facebook.”

I Made a Decision

I started coding this thing that I thought would be a good start of things.  It was an app to make reading twitter easier – less context switches.  It was also an experiment in using Azure, Visual Studio Online, and a little bit in starting bootstrap from scratch.

I got it working.

I started the code 7/26/2015, and by 9/22/2015 I was ready for the big time.   This was mostly an hour or two during a workweek in the evenings, and maybe an hour or two on a Sunday morning.

I had a logo created, bought a bootstrap style, I had added what I thought were the key features I needed, I rebranded it, and I bought a domain name.

image  image

I stopped.

And then life got complicated, and I let it sit – costing me monthly $, btw.  $17 per month to keep it hosted at the cheapest level I could get away with, AND have a domain name.  I used it for a while. 

Eventually, I got cheap, and work distributed a full MSDN license to me with an azure subscription, so I nuked it.

I’m letting it go.

Very recently, I put it back online under my MSDN license –  You can use it here:

http://twit-sort.azurewebsites.net/

I’ve cleaned up the code that I deployed, removed all the passwordly bits from it, and uploaded it to github.  Here’s the guts of it:

https://github.com/sunnywiz/twit-sort/blob/master/azuremvcapp1/Controllers/ReadController.cs

Letting go the dreams as well

I would have liked to have seen this thing become better.

  • I could have done a face lift on the front page.  Too many words.  Replace with screenshots of the configuration page and the read page.
  • I could have made it more colorful. Orange and Blue!  You can see this in the icon a bit.
  • I could have made it front-end js only, with no server side talking to twitter, using local-storage for persistence
  • I could have added “click hashtag or username” to create additional groupings on the fly.  delete groupings on the fly as well.

The good news is, all these dreams live on, in a future project – that works with Facebook, instead of Twitter

Conclusion

Letting this one go to make psychic room for other things that interest me.   May it bless others.  If you write a good one like this I’ll use it.

A different set of eyes

TL;DR – this post ends up going almost nowhere.  Lots of politics-related things. If nothing else,  read the last 2 paragraphs.

This morning I was listening to Grey and Haran chat about Brexit.  The point Grey brought up was that while the politicians may not be enthusiastic about the decision of the people, the people definitely voted for exit.  And Brady brought up that it seemed like the stayers had a low opinion of the exiter’s apparent intelligence, and that may not be .. respectful.

Then, I listen to the RNC convention.  And.. channeling Brady’s accent – “I must say, I do not think I am the target audience for that convention”.  But, the point remains.  All these people who do resonate with that message – how can I love on them? how can I respect them?

So, let me word a picture.   Its a very hazy picture, mind you.  I’m trying to lob idea-smoke-bombs over a large distance, not use a sniper-rifle here.   I’m trying to work my way to a place where I can love everybody and respect everybody.

Frogs, pools.  That didn’t work, I couldn’t capture resource acquisition well.

Setup 1.

  • I think the world has grown closer together via technology and travel.
  • I think the many interactions this has brought, has made life much more complex.
  • I think that due to {reason A to be discussed later}, life has become hard.
  • I think that there are some people of a bent of:  “excitement”, faith in humanity, “yes I want to let it all in and find a way to make it work”.
  • I think there are other people who this scares the tim-tams out of them.

Question Stop 1.

  • Is it right that we INSIST on integrating everything, finding a way through this mess, and NOT address the fear of the folks who are scared tim-tam-less?
  • Is it even possible to go back to the previous world, with less interactions?
  • Is it possible to at least not welcome the interactions?

Setup 2.

  • Conjecture, {Reason A} is, in all the new opportunity that the more integrated world has presented, or perhaps by some other mechanism, wealth has polarized (the 99% thing).
  • Conjecture, that there are people/entities whose desire/goal is continued acquisition of power, wealth, ownership, control (? this is shaken up below)
  • Conjecture, it is very useful for said people/entities to have a scared population, one that is not seeking smooth integration of the world.  Thus, they focus on a set of fears of that population, as well as reinforce “and here’s how you can live your life in safety”.

Question Stop 2.

  • Is it possible that the conjectured entities/people mentioned in Setup 2, might be altruistic?  They truly believe that a less-integrated world is possible and desirable, where strong borders are the way to go, and that truly is better?

This is where my bias definitely comes in.  My bias says no.  They can’t be that naïve.    I have not found one of these people to talk to directly, honestly, and so I have no way of working my way out of that bias.

Level Set What I think is happening.

Camp 1:

  • The world is a dynamic crazy place
  • We are but one entity in a sea of other entities, but we have lots of leverage
  • Do our part in the world, as part of the world.
  • our system:
    • Try to get faulty parts of our system up to snuff to match the existing working systems in the world.
    • our system mostly works, just need to leverage/use it more
  • Make room for all at the table.
  • Our culture is in need of updating to handle the new world.
  • No God statements are necessary.

Camp 2:

  • The world is a really crazy unsafe place
  • We are a strong entity and can withstand the world, but stop making it easy for them to attack us.
  • We need to protect our stance, remove our direct enemies and obstacles, and thrive.
  • Make sure we have enough to eat.
  • Our culture is proven, strong, and works.
  • Don’t change shit that ain’t broke.
  • Trust that God will take care of us against them.

Where the Heck am I going with this

Every time I try to approach Camp 2, to really feel it, to be a part of it, I get stalled.  I can’t do it.   I’ve been exposed to too many people, my world is too big, my world is too complicated, to fit back into Camp 2.

If I try to totally be in Camp 1, I get to a place where its hopeful- and sounds good, but ends up impractical and hopelessly complicated and lots of compromises and.. basically what happens when a person tries to do stuff without spirit involved.   And then shit goes bad, and when shit goes bad, Camp 2 really sounds better.

As best as I can, maybe I can marry them, but adding my own opinions to the mix:

  • The world is a crazy dynamic place, full of clashing cultures, opinions, and also dangers.
    • Staying better half of average of the world does not have to involve pushing somebody else down.
    • But we do need boundaries on what we’re willing to give and what we’re not, and what we’re willing to accept.
    • If we have it and can give it safely, then give it.
    • But don’t ignore self, expense self, in favor of others.
  • There are many entities in the world
    • Some of them don’t like this new world at all, and would rather we didn’t exist because it makes their lives better.
    • Some are just trying to make themselves better.  If we can, we can help them.

Then, I start to run into opposites that don’t seem to be marry-able.

Take for example:

  • Is the old way of doing things (“Safe Again”, “Great Again”) even feasible?
  • I am reminded of a pack of dogs, and the biggest, meanest dog, is the leader.
    • Is that who we want to be?
    • Is it genetics, biology, the way it is, that there has to be a few big mean dogs, and if we’re not one of them, we’re bantha-fuddu?
    • Is it a myth that we can all get along peacefully without warring?
    • What is human- or animal- nature?
    • What is Spirit-nature?

So it seems the practical human- or animal- nature thing would be, to be the biggest dog and be secure.  Yet it seems the spirit-nature thing would be to transcend that, and love thy neighbor, love thy enemy, etc.

Another example.

  • Do we have enough to eat?
  • Not the best question.  we do have enough food, but maybe more like, do we earn livable wages?
    • I earn a livable wage, I think, but I’m lucky.
    • I’m watching my kid try to earn a livable wage, and its very hard.  If he didn’t have previous-generation-assistance, he could not make ends meet, not without extreme cost-sharing (lots of roommates), two jobs, etc.
    • What the heck is going on here?
    • I suspect there’s a zone of wealth-distribution that works well for most.  If you go too polarized, it doesn’t work so well. Ref: The Spirit Level
      • However, historically, much-more-polarized wealth distribution was norm. Think Downton Abbey.   And how did that de-polarize?
      • “Modern Society” is a very young experiment, relatively speaking.  Middle-Class, etc.
      • It might be that as modern society fails, several folks are basically saying “f-ck it, i’m going to win, I don’t care who it hurts”.
      • Or it might be a correcting pendulum.  From polarized- to distributed, and then the human urge/need to polarize comes back, and it swings back to polarized, and eventually it will swing back again.  maybe.
  • Which camp?
    • I think I’m in the “things are broke inside and they need intervention to fix” camp.
    • Not the “trust the system, its fine” camp.  Its clearly not fine.

The “God” one.

  • This one irks me. For “Our God” to protect us against “Them”, that means that “Our God” is against “Them”?
  • I can NOT draw a circle to exclude them.   They are Spirit’s children too.
  • It really PISSES me off, to see {politicians/marketeers/people-programmers} manipulate people by manipulating concepts related to God/Spirit.

I don’t know where I’m going with this.

  • I’m sad in that I perceive people being taken advantage of, programmed.
  • I’m sad in that the human condition seems to lend itself to a focus on scarcity and survival-of-the-fittest.  (I’m not that fit)
  • I’m glad that there are others who seem to see the same issues as I do.  Sadly, I don’t think any are left represented in this current race.

Yeah, I don’t know diddly.

Good luck, world, I’m going to go nap now.  I hope we survive.

 

PS: If T does win, I think it’ll be okay.  I think he’s very good at understanding people and manipulating things for a particular benefit.  And I think that if he can make himself look good on the world stage, that will actually be just fine for the United States.   And, it will give those folks in the states who are scared, a sense of relief.  Perhaps the relief will be real, and us high-browed intellectuals will get to learn something, or the relief will be quickly broken, and the folks who thought that was a way to get relief will learn something.  Either way, somebody learns something.   And all the stuff that he’s said he’ll do .. build a wall, lock her down, etc – I suspect a lot of that will be just like UKIP when they won the vote — Oh, no, I didn’t say that, that’s not what I meant, it was misrepresented, etc.  Won’t be that radical.  Don’t buy the marketing message folks, its not reality.

PS: If C does win, I have no clue. I don’t have a feel for her.  Whatever marketing campaign it is she’s running, it falls flat on me.  No spirit involved.  I trust that she’s relatively effective at the jobs given to her, she has no fear of taking on a job to big (and doing the best possible at it)

PS: I miss B.   And I will miss O.  I’ve watched the heck out of him, and he’s been very consistent.  And all the hatred that’s levelled at him – I can see the marketing roots of messages planted.   I hope O sticks around on the world stage, the world needs him. However, he’s definitely a Camp-1 person, with little regard for those who need Camp-2.

Idea! Camp 3.

  • The world is a crazy, dynamic place, as Spirit intended.
  • We have grown into the world faster than we were ready to, and we’re lost and hurting and grabbing for whatever we can and consuming whatever we can in a daze.
  • Universe/Spirit has a plan, and that plan does not end in hatred and death, but rather in love and creativity and productivity.
    • Spirit, please guide us in stepping back our outward concerns, to take care of inner ones.
    • Spirit, please guide us in loving one another.
    • Spirit, please guide us in calming those who are hysterically afraid.
    • Spirit, please guide us in tough love – letting those who are not walking in spirit, have the consequences of their actions, not enabling them.
    • Spirit, please guide us in letting go our consumption-at-the-expense-of-all.

Good enough, that’s positive in my book.  I’ll wrap it up now.

PPS: 12 Traditions as applied to countries?  just sayin’.