Computers, Programming, Technology, Music, Literature

Archive for August 2013

TranslateMaid – Translate text right inside Visual Studio

leave a comment »

 

Working on a foreign language Code base in Visual Studio? Try TranslateMaid for Visual Studio.

http://translatemaid.codeplex.com/ – Download, install with a few clicks, see translated text right within Visual Studio.

TranslateMaid-HowToUse3 

With the release of Internet Explorer 8, Microsoft introduced Accelerators, and one of the accelerators were ‘Translate with Bing’. TranslateMaid.TryTranslate uses the same Microsoft Translator Preview Service.

I don’t know why I like IE, but sometimes it is just so hard to break a habit. While Chrome offers you a feature to translate the entire webpage, IE also allows you to translate just a selected text. I was thinking about bringing the same interface inside Visual Studio, and I pretty much achieved it. I had a tough time switching between a translator and visual studio understanding a lot of Dutch comments.

If you have some comments in your project files, I hope now you could save a couple of seconds switching between Google translate and Visual Studio.

Features:

1. Source Language is Auto Detected.
2. After the Translator window opens, you could convert the translated text to a variety of other languages.
3. Adds buttons to the Tools menu and Code Window’s context menu.
4. Keyboard Shortcuts enabled Ctrl+`, and more. Full documentation here.

KeyboardSnapForShortcutUsage

Try it. Pass it on. If you are curious about how it’s done, feel free to look through the source code at CodePlex. Tested thoroughly with VS 2012, VS2010, VS 2008 (inclusive of Business Intelligence Development Studio) on Windows 7 x64, and Windows Vista x86, but guaranteed to work with other versions of Windows as well.

If there is another version of this add-in, it might support an Options dialog with transparency control when the translation is shown, choice to switch between Google and Microsoft Translator Service. If you stumble on any bugs, bring to my attention.

 

What did it take to complete?

1. A Fiddler trace while IE is running that yielded me http://www.microsofttranslator.com/DefaultPrev.aspx?ref=IE8Activity

2. Visual Studio’s Addin template for the starters.

3. Classic WinForms tricks, and the interesting Mouse Hook in C#.

4. Extensive articles, code samples from MZTools.com  

5. and some long nights..

Spread the joy Winking smile Develop some apps, Make the world a better place Winking smile

Written by gmaran23

August 30, 2013 at 4:40 pm

Run as Administrator for .sln files and other context menu essentials

leave a comment »

 

This article was originally published for www.prowareness.com and could be located at http://www.prowareness.com/blog/run-as-administrator-for-sln-files-and-other-context-menu-essentials/ 

Download the file named RunAsEssentials-RegistryKeys.zip from the SkyDrive location http://sdrv.ms/1ds9pbZ.

Many a times you would want to run certain tasks as Administrator (yeah, to run a program as elevated). As a developer, you might typically find yourself doing it for Visual Studio Solution Files (.sln). I have been using a set of hacks to enable ’Run as administrator’ for .sln files, and to open any file with Notepad, or with Notepad as administrator and a couple more of them.

Below are some screenshots of what you would get when you download the zip file named RunAsEssentials-RegistryKeys.zip and run required .reg files or the .bat file from the aforementioned SkyDrive download location.

 

image
image
image

If you’d like to do it for any other file extension, let’s say for .csproj files, then locate the .csproj file extension under the HKCR registry hive, look for the default value of the .csproj key. If it is VisualStudio.Launcher.csproj.11.0 then navigate to that key location. Crack open the command subkey key under Open . Copy the default value "C:\Program Files (x86)\Common Files\Microsoft Shared\MSEnv\VSLauncher.exe" "%1".

Create a new key named runas and a subkey under it named Command . And associate the Command key’s default value as "C:\Program Files (x86)\Common Files\Microsoft Shared\MSEnv\VSLauncher.exe" "%1".

image

To add a Shield icon to the context menu option add a value named HasLUAShield to the runas key. LUA expands as Limited User Account.

image

Notes:

Adding keys to the HKCR makes changes to all the users in the computer. If you’d like to do it only for a particular user, then find and edit the file extension handlers under HKCR\Software\Classes.

If you get Access Denied or Merge failed or Cannot Import Error accessing the registry error messages, then open a command prompt as administrator and try running the .bat or .reg files.

image

Disclaimer:

Although it is said/recommended to take a back up of your registry before doing any changes, these registry files possess no harm per se. All these .reg files are provided in good faith and with goodwill, so use it at will.

Written by gmaran23

August 30, 2013 at 12:49 pm

Posted in Windows

Tagged with , , ,

Where is Windows Media Player in Windows 7?

leave a comment »

 

This article was originally published for www.prowareness.com and could be located at http://www.prowareness.com/blog/where-is-windows-media-player-in-windows-7/ 

 

Or to be a little more precise, “Where is Windows Media Player in Windows 7 Window 7 Enterprise N?

 

Story

With the advent of VLC media player, K Lite code pack, we forgot the existence of Windows Media Player. When you install multiple codec packs on a computer, there are ample chances that the encoding/decoding libraries of one codec packs might conflict with another codec pack and vie with each other to render a video format, they might even fail prompting you to download the recent version of blah, blah, and blah, and blah.. There comes a time when someone shares a video with you, edited/recorded by some software/device, and when you try to play it with all your fancy codecs, it wont play. This might be a rare case, one in half a million, or one in half a hundred, but it just wont play. You might also hear from friends and internet communities that particular video format was playable via Windows Media player, may be you think it’s the last resort and try looking for Windows Media Player on your Windows 7, it could be found nowhere.

 

Windows media player:

1. Would not appear in the Start menu search

2. Would not appear in Start –> All Programs –> Accessories –> Entertainment (wait, entertainment is not even an option)

3. Would not appear in C:\Program Files or in C:\Program Files (x86)

4. Would not appear if you search for ‘wmplayer.exe’

Out of curiosity, and after searching everywhere, you might think that Windows Media player is disabled from Control Panel –> Turn Windows features on or off

But you would not even see a Media Features option in Turn Windows features on or off dialog.

image

Note: How to Reinstall Windows Media Player in Windows 7 to Solve Problems

Suddenly a bulb glows near your head, you go run and check your windows version with winver.exe. You see an unusual N as in

image

Turns out that Windows 7 Enterprise N apparently means Windows 7 Enterprise Not with Media Features Winking smile

 

KB968211 states “The N edition and the KN edition of the Windows 7 operating system do not include Windows Media Player or other Windows Media-related technologies, such as Windows Media Center and Windows DVD Maker”.

Fix

1. Download Media Feature Pack for Windows 7 N with Service Pack 1 and Windows 7 KN with Service Pack 1 (KB968211).

2. Complete the installation, configure Windows Media Player. And, Enjoy Windows Media Player.

image

Btw, after installing the Media Feature Pack for Windows 7 N, you could reinstall/uninstall Windows Media Features from Turn Windows features on or off dialog anytime.

image

References:

1.  http://en.wikipedia.org/wiki/Windows_7_editions#Special-purpose_editions

2.  http://support.microsoft.com/kb/968211

3.  http://social.technet.microsoft.com/Forums/windows/en-US/7967abc0-b1fd-402e-86f3-79827d5f62c5/windows-7-enterpriseenterprise-n

Written by gmaran23

August 29, 2013 at 11:31 am

CandleWax

leave a comment »

This one was supposed to reflect so many things that are going on with the mankind today. Impetus was an intermittent and involuntary insomnia that ensued from responsibilities (read as tortures), restless heart syndrome. Try to relate to a man who is being squashed like a maggot, tossed around with responsibilities and opportunities, and he finds no time to breath, while he inhales and exhales, he doesn’t live. The whole mankind is going in a direction where there is no meaning could be sought out of someone’s life, well in that case, mankind doesn’t exist. Employers leeching on for cheap labors; plans and dreams get shatterred because of working on fulfilling somebody else’s day dream, 9-5 run of the mill job like a machine that runs the mill. Written back in May 2012 on a restless night. Here it is, rotandripe

 

Song:

With opportunities the mankind’s besieged

Plotted outcomes never achieved

Underpaid laborers  got leeched

In their minds remained deceased

Life fragmented prudent and wise

Indulging in Reluctant exercise

Forfeiting desires, what has been gained?

A fatigue soul, dazed and maimed

Mechanical way chosen to live

Realized to be addictive

Like gullible mule in turbulent maze

Bruised ego broken flowers in a haze

 

-rotandripe

From the draft section:

With opportunities the Mankind’s besieged

Plotted outcomes Never achieved 

Mechanical way chosen to live

Realized later they are addictive

Yielding to the war with Tyranny

The oppression dealt In agony

Razor blades under neck Sailing further

Rays of hope falling Apart farther

Jaws hooked in bait So dubious

A sinister that seemingly obvious

Life gone fragmented Planned prudent and wise

Indulging oneself in Reluctant exercise

Like gullible mule in Turbulent maze

With bruised ego broken Flowers in vase 

Forfeiting the desires What has been gained?

A fatigue soul dazed And maimed

Sedated to eternity Slept in peace

Slept in peace Opportunities un-seized

Written by gmaran23

August 28, 2013 at 5:10 pm

Posted in literature, poems, quotes, rage

Tagged with , , , , ,

Incorrect MSDN documentation: The space after Global:: should be removed

leave a comment »

 

Code sample posted at http://msdn.microsoft.com/en-us/library/ms228766(v=vs.100).aspx would not work and would yield you an ArgumentException with an error message as below:

Error message:

System.ArgumentException

The parameter is incorrect. (Exception from HRESULT: 0x80070057 (E_INVALIDARG))

   at EnvDTE.Command.set_Bindings(Object pVar)

 

Fix:

Fix it by removing the extra space after Global::

Code in the sample above should be changed to

//Notice there is no space after Global::
bindings[0] = "Global::CTRL+SHIFT+ALT+Y"; 
bindings[1] = "Global::CTRL+SHIFT+ALT+X"; 

 

Three hours for a triviality. Nothing unusual.

Related Links:

  1. Binding Add-In Commands to Keys – http://msdn.microsoft.com/en-us/library/5x1f46hd(v=vs.100).aspx 
  2. Visual Studio Add in Error Number 80070057 – http://www.codeproject.com/Articles/463969/Visual-Studio-Add-in-Error-Numbers-Troubleshooting#80070057

Written by gmaran23

August 27, 2013 at 7:45 pm