Jul
31
2008
0

ReSharper Tip of the Day: Use Format string with StringBuilder

Some classes like StringBuilder build in the string.Format functionality. ReSharper knows this and helps you out. It’ll recognize you should probably be using a format string.

…and then turn it into the right method.

Written by Mark in: ReSharper Tip of the Day | Tags:
Jul
30
2008
0

ReSharper Tip of the Day: Templates Revisited, and the Surround With

Today’s ReSharper Tip of the Day is a guest posting from Josh Buedel,  It is a great tip that extends ReSharper’s use into the CSS and HTML space.

Resharper templates come in two flavors:  Live Templates which are invoked by typing keyword and pressing tab, and Surround With Templates, which are invoked against the current selection.

 

Did you know that R# templates can be used in any file type?  You aren’t limited to just the sections of files that it understands.  For example I’ve built up a handful of templates for Aspx pages.  Surround With templates are particularly useful in a markup language like html. 

 

I first invoke my custom Surround With CSS Comment (Ctrl+Alt+J). 

 

Then I type the keyword data and hit Tab, which invokes a custom live template for databinding code.

 

In this one I select all that and again do a Surround With, this time using my custom Link Tag (<a/>) template.

 

Lastly, I have this generic tag inserter. 

Notice how as I change the name of the opening tag, the end tag is updated right along with it.  I accomplish this by repeating my template variable (which I have named $TAG$) within the template.  Once the template mode is exited the cursor ends up positioned inside the opening tag, but just before the closing > character.  This is by design, by using the predefined $END$ variable, and is right where I would need to be to insert an attribute should one be needed.  Here’s the complete template for this:

 

Written by Mark in: ReSharper Tip of the Day | Tags:
Jul
29
2008
0

ReSharper Tip of the Day: Highlight Usages

To highlight the usages of a current symbol, you can press Alt + Shift + F11.

You’ll see all the usages both in the code view window:

…and in the right gutter:

As a bonus tip, you can click on the highlights in the right gutter to go directly to them in the source window.

Written by Mark in: ReSharper Tip of the Day | Tags:
Jul
28
2008
0

Angry Monkeys and the Save Icon

When was the last time you used one of these . Not the icon, but the actual physical media? I think it’s been at least three years since I owned a PC that could actually read them and a couple years before that since I’ve actually read something off of one.

Now everyone knows the Angry Monkey story right? To paraphrase it in a sentance:

Whenever you hear “…because we’ve always done it that way,” first shut off the alarm in your head and secondly, ask for another reason. 

It might be that the reason is valid, but it might be that no one knows.

Which brings me to the de facto save icon . I would be willing to bet the kids graduating college today have never in their years at university, or probably life, ever used a floppy disk, but every one of them knows it means to save their documents by clicking on it. Now, they know what one is, and might have seen a couple in their parents’ desk drawer, but as visual correlation to its function, it falls well short. 

Following the icons down the toolbar, the bold icon looks bold, the italics icon looks like it is read to fall over, but the save icon looks like a box, within a box.

But that’s always been the save icon

Yes it has, but why? Because I use to actually put something that looked like that into my computer, click that button, and then take my stuff floppy disk out and walk away. Surely since we don’t save to floppies anymore there has to be a better icon. Some progressive company like Google surely thought this up already and I’m sure they have a cooler save icon on Google Docs. Nope. They still use . That’s actually a different icon, even through they look identical.

So why is the blue floppy disk the de facto save icon? What would a better icon be? Will people in 10 years still be putting floppy disks on their Minority Report UI’s? How could you even change something that is already so installed into nearly every user’s brain of every software community.

There is probably no other visual clue that is so widely understood. Not even the X to close a window is shared across platforms as much as the save icon. So maybe that is the reason why it has never changed and Tom Hanks is going to punch his floppy disk floating in mid air. The cost of breaking those now decades of education is too expensive.

We’re all going to be angry monkeys because angry is the new content. We stop you from climbing the latter, not because we know the outcome, because if you climb it, we all have to climb it in order for it to work.

Written by Mark in: Uncategorized | Tags:
Jul
28
2008
0

Definition of Fooberry

This past weekend my girlfriend asked what in the world the name of my blog meant.  She said she didn’t understand the “Sweetness Without Context” sub title. After thinking about it for a minute I gave her an answer slightly less nerdy than this:

foo·ber·ry /foo - ber - ree/ jargon

  1. A metasyntactic variable fruit used commonly* in computer science to represent a source of all natural, non-high fructose corn syrup, sugary sweetness.
  2. A derivation of a street near where I live, Hackberry Dr.
  3. A cool, at least to me, sounding blog name

* The term “commonly” is used for small definitions of the word common, meaning less than or equal to only one person.

None of that was much help, except maybe the last one. She still didn’t understand what I meant by “foo”. I decided to look up the etymology of “foo”, which was no help and even “foobar” had very little.

In technology, the word was probably originally propagated through system manuals by Digital Equipment Corporation in 1960s and early 1970s.

Even “FUBAR”, to which “foobar” is not suppose to be related, provided little certainy; however, one fact did stand out.

FUBAR may have been influenced by the German word furchtbar, meaning terrible. It is pronounced with a soft cht, and probably made the transition during World War II.

Maybe there is some lineage there after all. Knowing what is commonly implemented for “foo”, “terrible” is probably a good substitute. I wonder if the “Hello World” on the Enginma was written using furchtbar.

None of this has helped me explain “fooberry” to a non-techie. So basically, to me, “fooberry” is a term for something that sweetens whatever it is that you do.

That was actually much easier than explaining my last blog name: Ontological Reciprocity. That would take much longer, and I’m not sure I even totally understand it correctly, but it sure sounds cool.

Written by mark in: Uncategorized |
Jul
28
2008
0

ReSharper Tip of the Day: Go to File Members

Everyone uses, or at least knows about the member dropdown in Visual Studio

ReSharper will give you that same list of members in the current file via Alt + \ and let you search on it.

Again, don’t forget how powerful the ReSharper search boxes are. 

Written by Mark in: ReSharper Tip of the Day | Tags:
Jul
25
2008
0

ReSharper Tip of the Day: Go to Next Tip

It’s obvious that R# gives us outlines several problem areas in the right gutter.

Did you know you can use Alt+Page Up/Page Down to cycle between them?

Written by Mark in: ReSharper Tip of the Day | Tags:
Jul
24
2008
0

ReSharper Tip of the Day: Create a New Method

I needed to create a list of categories in my class that I want to populate using my facade. So instead of going to the facade and creating it there, let’s just do it right here where I need it. It’ll help get the signature right, granted this one is pretty simple. I type how I want to use it and press my handy dandy Alt+Enter.

Why yes Resharper, I would like to create a method with that exact name on that exact class. Thank you. It generates the stub for the method in the right class.

Here is where I start my unit testing.

Granted this method was really simple, but if you had two or three parameters it becomes much more valuable.

Written by Mark in: ReSharper Tip of the Day | Tags:
Jul
22
2008
0

The Mobile Me Paradox

I’ve been a .Mac subscriber for almost a year now and have found it pretty handy, mostly for iDisk, and the some Mac settings that sync. With the recent introduction of MobileMe, I’m left a bit perplexed. On launch day I tried to bring up http://mac.com, the old .Mac address and found the maintenance page telling me I needed to hold my horses. That’s fine. I fully empathize with deployment pains. So day two rolls around and I finally get to log into .Mac, now Me.com.

This was my nice greeting:

That’s od. I’m using FireFox 3.0 on Linux, but it only works with the FireFox on Mac or PC. Hmm… That doesn’t make any sense, but OK. Luckily there is a work around. If you install the User Agent Switcher plugin you can fake a browser, or OS version of the browser in this case. IE7 on Vista is a  user agent installed by default so I give that a try. It doesn’t work, but maybe the plugin doesn’t do what it says it does, so I reboot to XP, and try and bring up Mobile Me in Internet Explorer. Now I’m greeted with this:

OK again.You already told me you recommend FF 3.0 or Safari and maybe the plugin actually did work. I’m really not a fan of IE 7, so I’ll use FireFox. Great! I can use the web applications, but when I go to setup my Mobile Me Control Panel options, I’m given these choices.

Didn’t you just tell me I shouldn’t use IE, but you’re not going to sync my FireFox bookmarks? That doesn’t make any sense Apple!

Written by mark in: Uncategorized | Tags:
Jul
21
2008
0

Welcome to Fooberry!

Welcome to Fooberry.com where sweetness has no context. This is the replacement site for Ontological Reciprocity, which was too hard to type and to difficult to explain. This will be the new home to my ReSharper Tips of the Day and any other ramblings I might have.

So welcome everyone and I hope you enjoy what I have to say.

Written by Mark in: Uncategorized |

Powered by WordPress | Kredit | TheBuckmaker