How to use multiple views in Notepad++

May 19, 2012

Good editors always have some support for showing multiple editor windows. This is supported in many ways. See this for a comparison of the available document interfaces.

Multiple Views
NotePad++
I was happily surprised to find that Notepad++ also supports this. The trick is to right click on an edit window’s tab and choose “Move to other view” or “Clone to other view”.

Eclipse IDE
By the way, Eclipse IDE also supports multiple docking of edit views. You can even open two views into the same file. However, Notepad++ allows you to synchronize this. Which, afaik, Eclipse does not.

Multiple instances
While the above is great, sometimes you want two Notepad++ instances to, for example, open them each in their own display monitor. For that you just have to add to the notepad exe startup: -multiInst. For example on my Windows 7 instance my Notepad++ shortcut has:
“C:\Program Files (x86)\Notepad++\notepad++.exe” -multiInst

References
Comparison of document interfaces
Managing two views in a single Notepad++ instance


Show hidden windows utility on PC

March 4, 2012

Sometimes a program may crash or show deranged behavior and one of the dialogues cannot be accessed. This just happened to me. A program looks like it is stuck in a thread issue. When I look on its thread list it seems to be waiting for user input. There is no dialog visible. Clicking on the program’s window just gives the waiting mouse pointer. Sure you can just kill the program but this may not help you find out what the problem really is.

I remember years ago I used a utility that could show these hidden windows. Good luck searching on web for something like “show hidden windows” or better phrases. You won’t find it. Well, yea, you could. I did. But, I’m good, smirk.

Note that this utility is pretty basic, just shows a list of window objects. Some of them should not be unhidden, they will lock the utility itself or cause other problems. Perhaps there is something out there that is better? Seems this should be part of the Sysinternals utilities.

Links

  1. Unhider
  2. Windows Sysinternals

Use SED to print Windows path, split with line feeds

December 17, 2011

Yea, this is easy, IF you use SED much.

With cygwin installed, SED, the stream editor is available. In a command shell, execute:

set path | sed s_;_;\n_g

Explanation

  1. set path will print the Windows path. File path entries are separated by “;”.
  2. sed will invoke the cygwin installed linux SED command. Cygwin\bin is part of the executable path.
  3. “s” indicates the substitute command
  4. “_”, the underscore is used as the delimiter to each part of the substitution.
  5. “;” is the regular expression to use for a match.
  6. “;\n” is the string to substitute with.
  7. “g” is the substitute flag, global replacement

No doubt there are more direct ways of doing this. Using PowerShell would be the most appropriate if it is available.

Example
If your path is: C:\fee;d:\fi;c:\foo;\fum

The result would be:
C:\fee;
d:\fi;
c:\foo;
\fum

References

  1. Copy of this post on new blog
  2. GNU sed
  3. Sed – An Introduction and Tutorial by Bruce Barnett
  4. SED, stream editor

 


David Darling – Cycle One: Namaste!


alarm clock windows media player via PowerShell

August 27, 2011

The modern personal computer is so powerful, yet using it as a alarm clock is not so easy. There are a few commercial and free “PC Alarm Clocks” available, so all is not lost.

But, there is already a media player in Windows and a task scheduler, so it should be a piece of cake to schedule Windows Media Player to play a song or playlist every morning.

One way not to do it is to just schedule Media Player to start up and play a song as shown in this article ““Windows Media Player Alarm Clock using Task Scheduler“. As the author of the article states:

The only problem with this alarm clock is that if you are LOGGED OUT or the system is in standby prior to activating, it will run WMP as admin and you wont even see it open when you log in. To turn it off you will have run Task Manager and actually kill the process. A small price to pay for the reliability of a loud clock ….

What we need is a programmatic solution, and fortunately Windows now has a decent scripting language, PowerShell, with access to the Windows features. Thus, we use a script (from “Weekend Scripter: A Cool Music Explorer Script“):

Add-Type -AssemblyName presentationCore

$mediaPlayer = New-Object system.windows.media.mediaplayer
$path = "C:\Users\Public\Music\jazz\Oregon\1000 Kilometers"
$files = Get-ChildItem -path $path -include *.mp3,*.wma -recurse

foreach($file in $files)
{
 "Playing $($file.BaseName)"
  $mediaPlayer.open([uri]"$($file.fullname)")
  $mediaPlayer.Play()
  Start-Sleep -Seconds 10
  $mediaPlayer.Stop()
} 

And save it as a ps1 type file, for example: c:\batch\PlayMedia.ps1
In the above script, change the file so that ‘$path’ points to your own music folder. Note that the script plays each mp3 it finds for only ten seconds. How would you change it to just play the whole work?

Next you’ll open up the Task Scheduler and create a new basic task. The Actions tab is where you’ll edit how to run the task. So, enter into the dialog box:

Action:  Start a program
Program/script:  powershell
Add arguments (optional): -command "& 'C:\batch\PlayMedia.ps1' " 

Of course, set the days and times, and you can even select that the system will wake the computer to run the task.

I learned how to run PowerShell in scheduler at “How to schedule a Windows Powershell script“.

Advantages?
Well, now that you can program the system to act like a musical alarm clock, you can tweak it to use playlists, radio, etc. Soon you’ll be getting it to wake you up with “A Night On Bald Mountain” shaking the house, and while you are running around the bedroom screaming from fright, the PC will calmly start a batch of whole wheat pancakes and pouring on the real maple syrup; slowly the aroma from the coffee it started brewing wll start to permeate your consciousness , and no, that giant Chernabog is not coming for you.

What is PowerShell?
Surprisingly, many technical people have never heard of PowerShell. This is Microsoft’s innovation in their management infrastructure. Before, the “command shell” and associated batch language were really decades old DOS-like behavior. That shell could not compare to Unix/Linux shells like bash. PowerShell is an object-based scripting language and shell. Afaik, it is unique in that instead of using only text manipulation, as in most unix pipe examples, it pipes objects.

System

  • Windows 7 64bit Professional
  • Windows Powershell 2.0

Further Reading


Can’t save a new TiddlyWiki in IE

October 7, 2010

I wrote before about saving issues in Chrome Browser, I now have a similar problem. I downloaded a new TiddlyWiki version and when I try to save a change in it, I get problems in IE browser. I don’t have administrator access to this system, so maybe this is an issue?

Here is the fix which someone mentioned in the TiddlyWiki forum. Just copy the file and save to a new file name. This won’t work with just a file level copy. You have to copy the internals themselves: open the new file in a text editor, I used GVim, then copy the contents into a new editor file and save to a new file. When you open this new file you will get the usual first time IE security and activeX warnings. After that, the TiddlyWiki file is now a “normal” instance.

BTW, I recommend the SinglePageModePlugin. It allows the setting the way TiddlyWiki opens Tiddlers, less confusing, especially for casual TiddlyWiki use.

What the heck is TiddlyWiki? See “TiddlyWiki for the rest of us” for an end-user guide.

Links

  1. Duplicate: Can’t save a new TiddlyWiki in IE

Why a Repository for Java Dev?

August 4, 2010

Excellent article on why a Repository Manager is crucial for software development process.  Makes the case that not using a Repository Manager is the cause of many anti-patterns. It could be that the Repository is the next essential besides the VCS in development best practices.

The article is using Maven as a case in point and also it is selling a product (nothing wrong with that) so perhaps one could be a little wary. However there are other dependency managers like Ivy which are used by other Build systems like Gradle available.

I have seen places that do not use a Software Configuration Managment (SCM) Version Control System (VCS).  And, then there are places that use a VCS incorrectly; as this article points out the VCS becomes an ad hoc file store for everything.   I remember one place where our partner gave us access to their SCM to download a project source, and we got everything!  They had application executables, utilities, documents, binaries and other things like their Office apps and other tool chains, which had nothing to do with the project we wanted the source of.  Someone must have accidentally  imported their whole PC into CVS, yikes.

Enter the Repository which, I believe, first became “popular” with the introduction of Maven.  When I tried to introduce use of an internal Repository into a former company I got push back:  “It’s very easy to just put one’s jars and dependent binaries into version control” or  “Who needs that Repository play toy stuff!”  Oh well. In that situation, it was probably the best decision, there is initial complexity in adopting any tool that aims to reduce complexity.

Is just using Mavan or Gradle with an internal Repository as proxy to external ones enough Repository Management (which Sonatype calls stage one: Proxying Remote Repositories) or does one have to use a full blown Repository Manager subsystem? Why does using the internal Repository for one’s own output destination require a Repository Manager (which Sonatype calls ‘stage two’)? The Maven site has this to say:

Aside from the benefits of mediating access to remote repositories, a repository manager also provides something essential to full adoption of Maven. Unless you expect every member of your organization to download and build every single internal project, you will want to provide a mechanism for developers and departments to share both SNAPSHOT and releases for internal project artifacts. A Maven repository manager provides your organization with such a deployment target. Once you install a Maven repository manager, you can start using Maven to deploy snapshots and releases to a custom repository managed by the repository manager. Over time, this central deployment point for internal projects becomes the fabric for collaboration between different development teams. — Repository Management with Maven Repository Managers.

If you don’t think this is important you probably have not been on a project where disasters like xxx.jar was sent to a customer and we don’t know what version it is and who made it. You know, using version numbers as part of binary files would defeat the purpose of using a VCS no?

On a side note: Why did the Java development community develop its own repository system when there were plenty out there such as the application-level package systems used by the Linux community?

Links

Maven Repository Managers for the Enterprise

Why Do I Need a Repository Manager?: link

Maven Repository Manager Feature Matrix: link

Archiva

Artifactory

Nexus

Gradle:  http://www.gradle.org/

Ivy:  http://ant.apache.org/ivy/

Manage dependencies with Ivy

Maven:  http://maven.apache.org/

Ant:  http://ant.apache.org/

Continuous Integration:  http://en.wikipedia.org/wiki/Continuous_integration



How to auto redial busy line with iPhone?

July 13, 2010

Short answer is you can’t.

Background

At least I have not been able to find a procedure or free app that does this.   I found some web pages that say to use the Call button to dial the last call in the recent list.  The use of the Call button on the keypad gui didn’t work for me.  Still requires multiple key presses and did not bring up the last dialed number as stated.

Update: the Call button method will use the last dialed number, not the most recent number in the Recent list.  So, using Call is a viable approach.

Suggestion

So what to do?  The easiest way I found is to add the target number to your favorites list.  Now to rapidly redial just tap the contact in the Favorites list, then tap the Speaker icon.  Busy?  Just tap “End call”.  Repeat.

Questions

My question:  why doesn’t the iPhone have a real redial capability, other smart phones do?   Is it some kind of industry requirement or for reduction in negative possibilities?

Update
August 12, 2011: Anything changed about this feature or lack thereof? I am still using the first iPhone (yup, doesn’t even update anymore, and the fake GPS map doesn’t even work). Do the newer iPhone or Android phones have this feature built in?

Links

  1. Dupe on new site: How to auto redial busy line with iPhone?
  2. How to auto redial busy line with Android?

Ralph Towner: Drifting Petals

Available at Amazon


Follow

Get every new post delivered to your Inbox.