A pleasant walk through computing

Comment for me? Send an email. I might even update the post!

Revert PackageReference Project to Packages.config

The instructions below aren't tested in all scenarios, and assume familiarity with Visual Studio, NuGet Package Manager, etc. They should be enough to help.

Backup, branch, or otherwise protect your source first!

To revert from PackageReference to packages.config:

  1. Close the solution.

  2. Delete the project's obj and bin folders (which is where the Reference references are stored)

  3. Edit the .csproj file. Remove <RestoreProjectStyle>PackageReference</RestoreProjectStyle>

  4. Cut/Paste all PackageReference elements into a separate text editor, e.g.

    <ItemGroup>
        <PackageReference Include="MSTest.TestAdapter">
          <Version>1.4.0</Version>
        </PackageReference>
        <PackageReference Include="MSTest.TestFramework">
          <Version>1.4.0</Version>
        </PackageReference>
        <PackageReference Include="Selenium.WebDriver">
          <Version>3.141.0</Version>
        </PackageReference>
        <PackageReference Include="Selenium.WebDriver.ChromeDriver">
          <Version>2.44.0</Version>
        </PackageReference>
    </ItemGroup>
    
  5. Save and close the .csproj file.

  6. Open Visual Studio (but not the solution).

  7. Change the VS default package management format to Packages.config
    OR
    Check Allow format selection on first package
    OR
    Add a packages.config file to the project folder with this text:

    <?xml version="1.0" encoding="utf-8"?>
    <packages>
        <package id="MSTest.TestFramework" version="1.4.0" />
    </packages>
    

    Note: If you don't enable using packages.config, you must manually add at least one of the packages to the xml.

    Note: It's optional, but recommended, to add the targetFramework element with the correct moniker for the project's framework.

  8. Open the solution.

  9. If you manually created a packages.config file, restore missing NuGet packages.

  10. If needed, install remaining NuGet packages using package manager.

  11. Build and test.

Create a Simple Photo Album Site With Wix

My dad asked for some help creating a photo gallery web page. I suggested a free site on Wix. Now, Wix is a user-friendly site, but it's really useful to have experience with how content management systems work. My dad's a really good photographer and a terrific musician. He's used computers for a long time. But he's not software guy in the sense that I am. So, he asked for my help.

Below is a "here's what to do" guide to creating a simple photography site. It doesn't get into adding new widgets or even pages. Instead, it focuses on doing several things. Lots of people prefer working this way, because after a few clicks and edits they start to get how the application is intended to work.

I'll update this page with a link to his actual site once he's created it.

Confession
All the original (non-template) photographs in this post are mine. They're OK.

Be prepared to spend at least a couple of hours creating a simple site the first time around.

This tutorial assumes you've created a Wix account and have ended up on the first of the "getting started" pages.

So...after this page, you get asked some questions.

Here's the way I answered.

  • I want to create a site for myself
  • It should be a photography site, and
  • I've never done this before.

Pick a template. I liked this one.

Note: It's not possible to change the template afterward. So, either choose one you really like, OR expect that your first site will be a "play around" one.

Watch the video, because it'll be useful later, (the second time you watch it), then "Start now"

This is the editing page.

Click "AMANDA WILLMAN" to select the text box. Then, either double-click, or click Edit Text, to change the name. Then, hover over the top border and click/drag the name toward the top of the page.

Likewise, change and move the smaller text box. In my example, I also selected the text boxes and decreased the box sizes by dragging the handles that appear on the borders.

Click Save.

You'll get this prompt. Enter something appropriate like terry-flatt-photography. Save and Continue.

Do not publish, yet. You can change the domain name later, but remember you may decide to completely scrap this site.

Click Preview.

We can see the "A-W" needs to be removed, and also the Store at least needs to be hidden if not removed completely. We also want to change (or remove) the changing photo gallery, and the portfolios.

Click "Back to Editor. To hide all the controls, click the arrow-tab at the top of the page.

Now select the A-W text box and press Delete.

Next, click the main photograph. A menu will pop up. Click Change Images.

In the "Organize Your Gallery Images" tool, you can add, delete and move images, as well as add some descriptions. Let's start really simple. Delete all the existing images. Hover over each image and click the trash can.

Now click Add Images and choose a file from your file system. You can click Upload Media, or drag and drop files from a folder.

Note: Drag and drop didn't work for me, so I clicked Upload Media.

After it's uploaded, an Add Images tool appears. Select the image and click Add to Gallery.

Then, click Done.

That takes care of the first image a visitor will see.

Now let's hide the Store. Click on the Horizontal Menu.

Then Manage Menu.

Select Store, click the "triple dot" settings menu, and choose Hide (or Delete). Then close the menu manager by clicking the upper right X.

Next, select the Cart and delete it by pressing your <Delete> key.

Now, select the Horizontal Menu and Navigate

Chose "The Desert," which will open that page. From here, you can change the title and paragraph text as we have before.

Tip: If the Text Settings tool window gets in the way, click its header and drag it somewhere else on the page.

Now click a picture. This will select the Gallery. Click Manage Media.

This opens a tool very much like the one on the home page. You can add, remove and arrange photos. You can also add videos and text.

I deleted all the photos, then chose Add Media > Image.

In the media tool, you can choose previously uploaded photos, or upload by clicking Upload Media. You can upload multiple images at once.

Then, you can select multiple files to Add to Page by using CTRL/CMD + Click.

Back in the gallery, you can add titles and descriptions. Click Done when finished.

Select the Horizontal Menu > Manage Menu again. Select The Desert's settings, choose Rename, and change the name to Santa Fe.

You can use the same tool to add, remove and reorder pages.

This leaves the home page gallery links, and footer, to take care of. Use Horizontal Menu > Navigate to open the Home page again. Then, scroll down to the Desert photo. Select it, Change Image to one in the Santa Fe gallery, then change the text to "Santa Fe."

Scroll down further to the footer. Change the copyright text.

Show the Controls. Save the site, view it and then, if desired, publish it.

There is lot more that can be done with Wix. You might consider creating a "play" site that you don't publish, just to see what you can do with the tools. There's also lots of documentation. Like many photo editing tools, it's "easy once you know how."

For example, I changed the toolbar Design so it was more visible, and moved the name to the header so it appears on every page.

Happy site creating!

Three Rules for Successfully Starting a Habit

Image: Henry Mühlpfordt / CC-BY-SA-3.


This post is a summary of the November 6 episode of the Developer Tea podcast, 3 Rules for Designing Lasting Habits. I encourage you to listen to the entire episode, and to subscribe to Jonathon's excellent podcast.

Too often we conflate the goal with the habit. For example, getting up at 7am each morning isn't a habit. (It seems like one at first, right?) I'll use that goal to illustrate each of the three rules.

Concept: What is a Habit?

A habit is a repeated behavior we do in regular cirumstances.

A habit is part of us, it's normal. It's our default. For example, whenever I'm about to walk out of the house, or leave a restaurant, I pat my pockets to be sure I have everything: keys-phone-wallet. I don't even think about doing it. But if something's missing, I notice. My goal? To not lose those three critical items when I'm in transit.

Rule 1 - Focus on Triggers, Not Outcomes

What are the very earliest, small actions that will start the cascade toward the goal? They don't have to even directly support the goal.

Example habits:

  • Set an alarm for 7am. This doesn't guarantee I'll get up, but makes it harder to stay asleep.
    Note: since I'd set a repeating alarm, this isn't really a habit. It's a stacking action (see below)
  • Place my phone on my bedside table each night.
  • Before going to bed, write down the one thing I'll do at 7am the next morning.
  • First thing after lying in bed and lights out, envision with enthusiasm the first thing I'll do at 7am the next morning.
  • Schedule meetings for 8am whenever possible. This makes it unlikely I'll sleep in.

There are more, but this should give you an idea.

Rule 2 - Slow-Pitch Yourself Softballs

Make the first, small habits things you can easily accomplish. Make it easy to hit home runs, both by slow-pitching softballs, and by making the field smaller. Ramp-up instead of going all out.

Confession I've been getting this wrong most of my life. I'd barrel into not just one, but several new goals and habits all at once, succeed for a day or two, then collapse in frustration and shame.

  • For the first week, have only one meeting at 8am. The next week, two, and so on.
  • For two weeks, pick one day to turn on your alarm for 7am, and keep it off the rest of the days. It could be "Fresh-Start Monday." Then increase the number of days over remaining weeks.

It might seem like "Oh, I got up at 7am one morning, big deal." But it is a big deal. If you were getting up at 7 zero days before, then getting up early one day is--technically--an infinite improvement! Seriously, reward yourself for your accomplishments, no matter how small.

Rule 3 - Focus on Compound and Stacking Returns

Choose triggering habits that stack with the other habits. These can also be actions. An example from above is setting the alarm. That'sa one-time action, but it stacks on the habit of putting the phone on the beside table. The metaphor is compounding interest. What are the early habits and actions that make future habits even more valuable?

  • No computer or screen use starting an hour before bedtime. Research shows this improves sleep quality, which is a key toward waking up when I want to. This benefits every other habit, and carries other benefits for my health as well.
  • (Gently) stretch when I get up. Notice that this habit isn't time-dependent. But it's a natural and healthier way than coffee to start up the body's blood, oxygen, cortisol, etc.

While all the above are true, for this particular goal it might be valuable to check whether I'm working against my own body. Am I naturally a morning person? Or an evening person? Biology isn't always changeable, and often not easily changeable.

Encouragement

It's easy to say--or be told--"this needs to be a habit!" But knowing what a habit is, and how to form a habit, is too often left out of the admonition. The rules above can help you be successful. You can do it!

References

Jonathan Cutrell cites these two books in his podcast:

   Older