by Jeremy Foster
30. March 2012 11:45
NoteHighLight on CodePlex
If you haven’t started using OneNote, you might want to consider it. You can create a notebook a free instance of SkyDrive and it makes note taking, collaboration, and sharing all very easy. The part I couldn’t live without is my ability to just hit [WIN + N] from anywhere in Windows and instantly get a new note. I don’t have to worry about saving it either. By default, it lands in my Unfiled Notes (in my SkyDrive notebook). I can move it to another location later for more organization if I want to, but honestly the searching in OneNote is so good, that I usually don’t bother. As long as I give it a good title, I’m always able to find it later. Actually, even if you paste images into your note, the indexer recognizes the text in your image and will even search on that!
On my Windows Phone 7, I can do the same thing. I pin a “New Note” tile to my start page and I can just hit that to create an unfiled note. The great thing is that both notes land in the same place… on my SkyDrive. So if I jot a note from the field, it’s available to me in Windows on my laptop later. Nice.
But I’m a software developer and I write a lot of code. Sometimes I just jot down little pieces of code. So I went looking for a syntax highlighter that worked in OneNote. I found it. It’s called NoteHighLight and it’s on CodePlex (here). The installer is in an asian font, so it was a blind install for me, but just choosing the default button on each page of the install wizard worked fine.
It installs into OneNote as its own tab. I decided I’d rather have it in the Insert menu, so I customized it like this…

Hitting Insert and then choosing one of these will get you a dialog like the following…

…and give you a nice way of typing or pasting in your code, and after completion, you’ll have something like this…

Happy note taking!
aac9911c-9f8e-492f-9c2b-20e399efdfb1|3|5.0|96d5b379-7e1d-4dac-a6ba-1e50db561b04
Tags:
Productivity
by Jeremy Foster
30. March 2012 10:16
Ready for the shortest blog post in history?
Looking for a time in Windows 8? Look no further. Just drop this code into the App constructor on the App.xaml.cs page…
var d = new DispatcherTimer();
d.Start();
d.Tick += (sender, o) => { Debug.WriteLine("tick"); };
Now go take a look at Visual Studio’s Output pane and watch it tick.
37ec1042-65c3-4c17-8f64-66f82cfe9ca9|2|5.0|96d5b379-7e1d-4dac-a6ba-1e50db561b04
Tags:
Windows 8
by Jeremy Foster
30. March 2012 09:17
(function main(){
me.state = “excited”;
me.reason = "syntax highlighting plugged in to my blog now";
})();
0c32aa29-b480-48d0-9e8a-315e5423377b|0|.0|96d5b379-7e1d-4dac-a6ba-1e50db561b04
Tags:
Productivity
by Jeremy Foster
29. March 2012 14:16
There’s more than one way to skin a cat and more than one way to do a search in Visual Studio. There are 5 (that I know of, comment if you know of another) to be precise.
Navigate To (CTRL + ,)
Search for a file, object, object member, etc. anywhere in your project. For instance, if you know that you have something in your app called Widget, but it’s just too much to think about where exactly you put it, then just hit CTRL + , and type “widget” and you’ll get results for the class itself along with any other members with the word widget and any object members.
Search in Solution (CTRL + ;)
This one is new to VS11 (actually, you may have used it with the Productivity Power Tools in VS2010) and allows you to filter your Solution Explorer to show only files that match your query. It’s especially helpful in my opinion for filtering out anything except for a certain file type. Querying for “.js” for instance will get rid of anything except for JavaScript files.
Quick Launch (CTRL + Q)
This one was in previous releases of Visual Studio, but it wasn’t as prominent and was often overlooked. I use Quick Launch to quickly find that option that’s buried somewhere in Tools | Options but I know it’s going to take me about 4 minutes and 25 seconds to find exactly where. Take line numbers for instance. Now why line numbers are not turned on my default is absolutely beyond me, but turning them in used to be an arduous process on a normal day and all but impossible at the end of the day, or on Monday, or before coffee, or with a slight headache. Now you just hit CTRL + Q and type “line numbers” and you’re in good shape.
Find (CTRL + F)
Also introduced with Productivity Power Tools and then brought native into VS11, Find is best used for finding text in the current file (although it will search multiple files as well). It’s a quick way to search and has the added benefit of highlighting all results for you.
Find in Files (CTRL + SHIFT + F)
Although able to search only in the context of the current document, this command is most often used for finding files across the solution or project. I like to dock this dialog in the lower right pane with Properties so that I always know where it’s going to be and I can keep it up across multiple searches.
053adc85-9544-434c-9c8c-5470d609e13b|0|.0|96d5b379-7e1d-4dac-a6ba-1e50db561b04
Tags:
Productivity
by Jeremy Foster
27. March 2012 15:35
I used to think that Visual Studio had an incredible set of keyboard shortcuts and productivity features. Then I installed ReSharper. Now a vanilla install of Visual Studio feels a bit vanilla.
Sure all of the refactorings are awesome, but what I end up missing when I’m missing R# is the little stuff. It’s the extend and shrink selection (Ctrl + Alt + Right Arrow/Left Arrow). It’s the next and previous member (Alt + Up/Down Arrow).
With R# 7 EAP, as with the Windows 8 Consumer Preview, I installed it the same day it was available. I was thrilled at first too – ready to blaze through my Windows 8 projects at the speed of sharp. But I discovered shortly that my IntelliSense was not working. For JavaScript behind Metro apps, I got an IntelliSense menu, but the entries were all wrong. And an acquaintance had the same issue. This was a deal breaker and I sadly uninstalled R# from my machine.
Today I tried again and low and behold everything works! So my mood swing is back at its acme and I’m ready to blaze through the code again.
Here’s the link to the EAP: http://bit.ly/resharper7eap
0c165a01-0ecd-428b-914d-65735179db18|0|.0|96d5b379-7e1d-4dac-a6ba-1e50db561b04
Tags:
Productivity
by Jeremy Foster
27. March 2012 10:46
You know those sonic noise guns that you can shoot at people and they supposedly just stop in their tracks because it’s physically disorienting? I felt like I got hit with one when I ran across this little nugget.
Want to move your Metro experience from your primary monitor to another screen - say your second (or fourth) monitor or even to the projector for a show? I’ve been told that the start menu appears on the primary monitor (without resorting to the simulator). Period. But that’s not the case! *look up* *thank God*
If you press WIN + PGUP/PGDN, you can change which monitor the start menu and all Metro apps appears on. Now that’s awesome! Until now, I was resorting to the simulator for getting my icons on my second monitor or projector to show people. News must spread. Tell everyone.
4e103e25-7feb-4ab6-8e4b-6fdeae5d75ec|1|5.0|96d5b379-7e1d-4dac-a6ba-1e50db561b04
Tags:
Windows 8
by Jeremy Foster
26. March 2012 12:05
I’ve done it. I’ve moved off of WordPress. I’m not sure what it is I didn’t like about WordPress, but I just didn’t. It’s not that they’re too big… shoot, I work at Microsoft. It’s not that their blogging solution doesn’t work because it definitely does. I guess I just felt like I was in a machine. I like to feel free.
I don’t like to feel like any second I’m going to get hit with another $12/yr charge because I want to add such-and-such feature.
I’m using BlogEngine.NET now and it has thrilled me so far. It plugged in easily to my own self-hosted site and seems to have the perfect set of features. Now I feel like I can customize all I want. I feel free.
3948a9fb-2a0f-45de-a839-b75a943d3bfe|1|5.0|96d5b379-7e1d-4dac-a6ba-1e50db561b04
Tags:
by Jeremy Foster
26. March 2012 11:10
If you create a blank JavaScript application in Windows 8, you get just that – a blank application. You don’t get page references to the WinJS library, you don’t get a grid or a list or any other navigation structure, and you don’t get the navigation code to implement the Microsoft recommended navigation method – single page navigation.
If you want to implement navigation, you can obviously just create a new application from the Navigation Appliction template (built-in), but if you’re like me, it’s nice to add in all of a given piece of functionality from scratch for understanding’s sake.
Follow these steps to add navigation to a blank application. And I encourage you to actually type all of the code instead of just copying and pasting. If you type it, your brain will pick it up better.
- In Visual Studio 11, create a new Blank Application using JavaScript
- Add an html folder at the root of your project
- Right click on the html folder and Add | New Item…
- Choose Page Control and call your new item page1.html
Note: You’ll see that you got your new .html file as well as a .css and a .js - Drag the .css file into the css folder and the .js file into the js folder
- Modify the css link reference and js script reference on your html file changing “page1.js” to “/js/page1.js” and “/css/page1.css”
- Grab a copy of navigator.js from any other sample app or template app. You can create a throw-away project from the Navigator Application to get a copy of this file if necessary.
- Modify the navigator.js file changing the name of the namespace to the project name of your application. For instance…
WinJS.Namespace.define("YourProjectName", { ...
- Add a reference to the navigator.js file into the default.html file
- Add a PageControlNavigator to the body of the default.html file like the following…
<div id="contenthost"
data-win-control="Application2.PageControlNavigator"
data-win-options="{ home: '/html/page1.html' }"></div>
Note: the data-win-control makes this an official WinJS control. The data-win-options “home” property tells this control which page to start with and which page to return to when the user elects through the navigator to go home.
Learning a new environment or framework or object model always takes some time and exposure, so take some time, exposure yourself to tasks like this, and have fun.
fdbc7e9a-33e6-498b-b5be-b4ae0f7d314f|0|.0|96d5b379-7e1d-4dac-a6ba-1e50db561b04
Tags:
Windows 8
by Jeremy Foster
25. March 2012 12:39
If you’re in the greater Seattle area and haven’t registered for this event yet, you need to go here and get registered. You get to learn, mingle, network, ask questions, and eat and you pay $0.00. That’s a good value.
de75313a-6672-4541-a9f0-c822b821c07f|0|.0|96d5b379-7e1d-4dac-a6ba-1e50db561b04
Tags:
by Jeremy Foster
19. March 2012 11:42
This may be obvious to many, but as we all know what’s obvious to us is not necessarily obvious to a billion others. So we may as well throw it out on a blog for the betterment of mankind. Actually, that may be a lofty expectation for my next tip, but here goes.
If you use an internet site like Meetup or Facebook to manage calendar appointments and you want to see those events on your Windows Phone, do it like this.
- Go to calendar.live.com and log in with your Live account. If you don’t have a Live account, you can obviously get a free one and hopefully you know that this doesn’t mean you have to get a @live.com or @hotmail.com email address. Even if your email is george@joescrabshack.com, you can sign up for a email address.
- Now click subscribe on the top
- Keep Subscribe to a public calendar selected
- Now go get the URL to the .ics file published by your site and paste it into the Calendar URL
- Give it a name
- Choose a color and a charm if you’d like
- Click Subscribe to calendar
Now you can see this calendar on your Windows Phone if you go to the calendar settings.
This is making my life a lot easier. I hope it enriches yours as well.