Protected: cars 12/18/18

This content is password protected. To view it please enter your password below:

Advertisements

Gift ideas

  • 3 pack of magnetic phone micro USB chargers for $15 – Link
  • Grow lighting for plants – Link
  • Alexis enabled kindle for $30 – Link
  • Laser projected keyboard controller for $30 – Link
  • Renaissance festival shirt $30 – Link
  • Laser projected mouse controller for $70 – Link
  • LeapMotion programming kit for $80 – Link
  • Neonode TouchBar – Touchscreen Capabilities for $70 – Link
  • Tobii eyeX – eye tracking for a mouse for  $70 – Link
  • Echo dot – Link

For stocking stuffers

  • NFC ID ring for $4 – Link
  • Cane handle, decorative – Link
  • NFC id rings for $18 – Link (size 9?)
  • Costume pieces:  99cents ring, $4 cross
  • Pacific Rim $9 – Link
  • Live, Die, Repeat $9 – Link
  • John Wick – $14 or $6 dvd – Link
  • No candy please.  Nor super sugary stuff.
  • Packets or jar of standard swiss mix (no marshmellow) are ok

Get J an army stocking – Link

Notes on Xpath / XML with css

Xpath adventures!

I was using a chunk of code that I found to be rather brittle for testing Xpath with Capybara in a ruby on rails integration test.  Originally I was just calling click_link on the first link within the .body tag.

The problem is that’s really brittle.  Any other links put in there before that will mess up the process.  Also, if I make that page a partial so I can reuse that particular list on other pages, then my test is broken.

So my practice now is to add a class or div to the top of all partials or pages even if I have the body & nothing else is in that page.

An example:

The partial _campaign.html.haml would have a .campaigns at the top wrapping it.  Then my html/css parsing with Xpath would be `.campaigns` to get into the section of the list I want to affect.

For my purposes that’s enough.  If you want to go deeper though – as you have more elements inside & need to be selective, then you would add more path hierarchy … .campaigns/.list-group/.list-group-item[1] … with the last [1] being select the first item in the list group.

Xpath best practices is to not stack too many or any nested items so they use within.  Still, probably best to only use two within‘s one to grab the first unique class/div name & the next to grab the last div or element before running the method against the result.

  • Instead the previous campaigns example, using the within would be combined with something else….
within('.campaigns') do
  first('.list-group-item').click_link('Join') 
end

Also, as a bonus I had to figure out the calls for using spaces in the names/titles.  There are two methods I like.

  • Exact matching with “multiple class selectors”… .something/.something_else – Link.
  • Matching Xpath to just search a string for a partial match with the xml/css  – Link.  I would still scope the search/match pattern (2nd method) by using a .within anyways as the whole point is avoiding brittle tests.

First time unity video game development Tic Tac Toe

I’m an hour & a half in now … just about to implement the win conditions on the Tic Tac Toe tutorial.

  • Explanation of the UI behaviors from Unity professionals – Link – not necessary for the Tic Tac Toe demo – would skip till later if you like to move fast, as it’s not needed for simple games.
  • Tic Tac Toe game tutorial using UI only – some limited scripting – Link
    • UY studio’s – Computer read version of the tutorial with mouse demo’ing where to click & explain several necessary items. – Link

 


First 20 watched & read ahead of demo on the UI behaviors

Next hour – followed along with the youtube link by automated reading voice to get a board fleshed out & some of the Game Controller scripts.

Next half hour – followed along with UY Studio’s to create scripting for GameEngine in 3 videos.

Next half hour – made my own C# script to simplify the end game checks (as they looked scary) …

void check3InRow(string button1, string button2, string button3)
 {
  if (button1 == button2 && button1 == button3)
   {
    if (playerSide == button1)
     {
      GameOver();
     }
   }
 }

I then fed in the win conditions with this chunk of code …

public void EndTurn()
 {
 /* Test row wins */
 check3InRow(buttonList[1].text, buttonList[2].text, buttonList[3].text);
 check3InRow(buttonList[0].text, buttonList[4].text, buttonList[8].text);
 check3InRow(buttonList[5].text, buttonList[6].text, buttonList[7].text);

/* Test column wins */
 check3InRow(buttonList[1].text, buttonList[7].text, buttonList[8].text);
 check3InRow(buttonList[0].text, buttonList[2].text, buttonList[6].text);
 check3InRow(buttonList[3].text, buttonList[4].text, buttonList[5].text);

/* Test diagnal wins */
 check3InRow(buttonList[0].text, buttonList[1].text, buttonList[5].text);
 check3InRow(buttonList[0].text, buttonList[3].text, buttonList[7].text);
 }

Next 10 minutes researching.