06
Dec 13

Running just to stand still

I’ve been working on and off on Programmer’s Notepad for over 15 years, version 1 written in Delphi and version 2 a complete rewrite to teach myself C++. While I was a student it was developed whenever I had free time (which I had lots of). Days, evenings, nights, weekends, there was plenty of work put in. Once I started working this reduced to evenings and weekends, but still a lot of them – particularly when I was travelling with work. I was lucky to have a job with almost no commute, and an understanding girlfriend (now wife). Now I work at the end of a 1 hour commute, and I also have two children, and I find almost no time left for hobby coding. I was slightly scared to note that on the two year anniversary of my new job, I’d released nothing and written barely anything for the last two years.

However, maintaining Programmer’s Notepad still managed to consume a number of evenings/spare days during those two years – just usually not on adding features or fixing bugs. For years I’ve insisted on running my own server, maintaining a Linux VPS in order to serve whatever hosting needs I have at the time. My Debian (some time gentoo) VPS has been mail host, web server for numerous WordPress/Wiki/bbPress/… sites, useful ssh endpoint and more, but hosting pnotepad.org has increasingly become a burden. I no longer have the time to spend hours dealing with:

  • Debian security updates
  • Difficult distro upgrades
  • Security patching four or five different web apps
  • Working out which app is responsible for swallowing all the memory on the server every other day due to a horrible authentication implementation (I won’t bore you with the details here)
  • Dealing with difficult version upgrades requiring template changes or complete site overhauls

I realised that something had to change, in order that when I had spare time I could use it to improve my software rather than just running to stand still. I decided I wanted to move as much of my site infrastructure as possible away from self-hosted php apps, possibly away from my VPS entirely (which could also save me money).

Enter Jekyll and GitHub. I’m gradually migrating all my site content to static HTML, authored in markdown, presented using Jekyll, stored and version controlled on GitHub. The first thing I moved was Programmer’s Notepad’s documentation. Previously stored using Dokuwiki, I had already had to completely lock down contributions due to constant spam attacks, and recently keeping Dokuwiki working well had been taking time. Now moved to Jekyll, the mostly-static content serves quickly and pain-free. Even better, the content is all on github so users can still easily contribute documentation. It’s perhaps not as simple as using a wiki, but the end result is sustainable.

Next up is the main Programmer’s Notepad site, also largely static but served via WordPress for ease of editing. This is under way now using the same recipe, and the slight extra cost of editing via GitHub will be more than offset by drastically simpler serving.

The remaining troublesome app is the forums, and I still haven’t quite decided what to do there. They contain lots of useful content, but keeping bbPress happy is my biggest ongoing headache – it is nowhere near as simple to use/upgrade as WordPress. I have a half-finished simple forum hosting app (written on an idle weekend) that I’m tempted to finish off, or perhaps I’ll just switch back to Google Groups and cut my losses. Eventually it would be nice to use Github pages to host the whole domain, leaving WordPress and VPS maintenance woes behind.


21
Nov 13

Test Programmer’s Notepad 2.4

I have a candidate release of Programmer’s Notepad 2.4 ready, including the following changes:

What’s new in 2.4?

  1. Fuzzy matching in “Jump to” dialog, e.g. MTM for MyTestMethod
  2. New style presets
  3. New translations
  4. Delay Windows shutdown for file save
  5. Improved find dialog resizing
  6. Python Scripting Extension (PyPN) included as optional component in installer

Bug Fixes:

  1. Fixes to XML/HTML tag completion
  2. UTF-8 Replace All and UTF-8 character code improvements for Regex search
  3. Fix for script recording due to Scintilla bug

Please help to test it, let me know if it’s ready for primetime!

Download Installer

Download Portable

Update: Users with unstable updates enabled should now see this update available.


21
Nov 13

Programmer’s Notepad is now on GitHub!

With Google Code turning down downloads, and my own source control use tending towards git recently, I decided it was time to move the Programmer’s Notepad code and releases.

Now available on GitHub: http://github.org/simonsteele/pn/

I took the opportunity to merge the translations from pnotepad-trans back into the main tree, keeping them separate added un-necessary overhead and most contributors did not use Google Code to submit changes. Now savvy users can fork and issue pull requests, or edit directly using GitHub. A win for simplicity!

There are two main branches to look at on GitHub, the main tree which contains just PN for Windows, and the “peanut” branch which contains the work I began a year or so ago on a cross-platform port. You can run a simple single-window edit view on OS/X with the correct scheme applied, but that’s as far as it goes so far. The branch contains a significant code reorganisation for the bits of code used, and it will take time to merge with the main branch – if it happens.


26
Nov 11

Giving Thanks

We don’t celebrate Thanksgiving in the UK, but this seems like a good time to pass on my thanks to people who have sent gifts who I have been unable to thank personally. So without further ado, Thank You very much to the following:

Alex Bolton
Glenn Castleman
Stuart Denyer
Matthew Farey
Steve Klett
Steven McGahey
Oliver Schneider
Vladimir Udilov

Unfortunately Amazon do not usually provide contact details for gifts any more, so my apologies to all of you for not thanking you sooner. To all those who I’ve been able to contact, my thanks once again!


01
Sep 11

Programmer’s Notepad 2.3 Released

I’m happy to finally announce a new stable release, Programmer’s Notepad 2.3, has been released to our Google Code page. This release has focused on cleaning up many areas of 2.2 that were buggy or incomplete, and so doesn’t many large new features. Instead look for small improvements all over the place.

Headline Changes in 2.3:

  1. Jump dialog now filters results as you type.
  2. Custom scheme is now implemented as a PN extension, and adds extra identifier block comment types
  3. Double-click on tab bar (not on tab) starts a new doc.
  4. Miscellaneous updates to schemes to improve highlighting (including HTML5 elements and attributes).
  5. RTF export reworked, background colours now working better.
  6. Properties scheme folding.
  7. Select a URL and right-click to go to it.
  8. New German and Russian translations.
  9. Scheme Presets: Solarized (Light), improved Obsidian, thanks to contributors.

More than 25 bugs both small and large were fixed in this release, and it has had a good series of test builds to try and shake big problems loose.

Downloads:
Download 2.3 Installer
Download 2.3 Portable

You may also like to add the PyPN extension to your 2.3 install to get support for scripting/macros with Python: PyPN 1.1

Finally I wanted to say thank you to all those who make these releases what they are. Firstly to everyone who has contributed code, designs or ideas, and to all those who download every test build and provide feedback or bug reports. Next to the translators who have updated existing translations and added new languages for this release, thanks for your patience as we make more and more of the UI translatable. Last but not least thanks to those who have sent donations or gifts, I try to thank you personally where I can, but Amazon often doesn’t send me contact details – please know they’re all appreciated!


21
Aug 11

Last Call for 2.3 Translations

I intend to release Programmer’s Notepad 2.3 as the new stable release towards the end of this week. One late bug fix has added a new string, so all translations need at least this one minor update. Some haven’t been updated in a while, so need a larger update.

Currently 2.3 will ship with the following languages in the installer/portable package:

  • Simplified-Chinese
  • British English
  • Hungarian
  • Romanian
  • German
  • Russian
  • Spanish

All translation files are stored in the Programmer’s Notepad Translations project, using a Mercurial repository.

My thanks to those who have already contributed to the translations in the 2.3 release!

Help Wanted
Want to help with updating any of these, or perhaps adding a new language? Follow the steps in the Translating Programmer’s Notepad guide on the docs wiki.

I’m also looking for someone who’d like to contribute to PN by looking after the translations, doing something like the following:

  • Keep a mailing list going for translators to ask questions/be notified of updates
  • Publish the status of translations (i.e. identify those that need work)
  • Update the translation kit and instructions as required
  • Help with the translation issues on the tracker
  • Help to keep the translations project up to date (not everyone can use Mercurial)

If you’re interested, send me a mail (s.steele at this domain) or get in touch via the forums/issue tracker.


19
Jul 11

Thanks to Glyssec

Just wanted to say a quick word of thanks to Tara from Glyssec who reported a SQL Injection vulnerability in some scripts on pnotepad.org earlier this year. My thanks for making a responsible disclosure on discovering the problem, it’s appreciated!


18
May 11

Regular Expressions and Scripts – Worked Example

Programmer’s Notepad has great support for Regular Expressions baked in, supporting much more than the restricted syntax that many Scintilla-based editors provide. For example, did you know that you can use negative lookarounds to find text that doesn’t contain a pattern? This regular expression matches any line that doesn’t contain “not here”:

^((?!not here).)*$

Sometimes I find myself repeating the same set of Search/Replace operations in order to format text. If I’m going to do this more than a couple of times, I record a script using PyPN to make things easier for myself. Today I was turning text like this:

    LogStep("Do something");
    MyClass.DoReallyCleverStuff();
    MyClass.VerifySomethingAwesome();
    
    LogStep("Do another thing");
    MyClass.DoSomethingLessClever();
    MyClass.VerifySomethingBad();

Into text like this:


Do something
Do another thing

There are many ways to do something like this, and I could have written a PyPN script by hand to do it. However, combining Regular Expressions and Script Recording means I can do this without a lot of manual code effort. Here’s what I did:

  1. Tools > Record Script
  2. Replace All: ^((?!LogStep).)*$ with (nothing)
  3. Replace All: (\r\n){2,} with \r\n
  4. Replace All: \s*LogStep\("([^"]+)"\); with \1
  5. Tools > Stop Recording

At the end of this Programmer’s Notepad added a script to the Scripts window (Recorded\New Script) and placed the code for that script in a new editor window. Because I wanted to keep the script for future use, I changed it’s name and saved it to C:\Program Files\Programmer’s Notepad\Scripts. Here’s the script (which I reduced slightly for posting here):

import pn, scintilla

@script("Clean Up Log Steps", "Testing")
def CleanUpLogSteps():
	doc = pn.CurrentDoc()
	sci = scintilla.Scintilla(doc)
	opt = pn.GetUserSearchOptions()
	opt.FindText = u'^((?!LogStep).)*$'
	opt.MatchWholeWord = False
	opt.MatchCase = False
	opt.UseRegExp = True
	opt.SearchBackwards = False
	opt.LoopOK = True
	opt.UseSlashes = False
	opt.ReplaceText = u''
	opt.ReplaceInSelection = False
	doc.ReplaceAll(opt)
	# When recording, the result of this operation was: pn.FindNextResult(37)

	opt.FindText = u'(\\r\\n\\r\\n){2,}'
	opt.ReplaceText = u'\\r\\n'
	doc.ReplaceAll(opt)
	# When recording, the result of this operation was: pn.FindNextResult(16)

	opt.FindText = u'\\s*LogStep\\("([^"]+)"\\);'
	opt.ReplaceText = u'\\1'
	doc.ReplaceAll(opt)
	# When recording, the result of this operation was: pn.FindNextResult(10)

If I was going to use this script a lot, I could bind it to a shortcut key in Tools > Options > Keyboard.


25
Apr 11

Programmer’s Notepad 2.3 RC Released

I’m happy to announce a new testing release, Programmer’s Notepad 2.3 RC, has been released to the Google Code page. This version includes a bunch of bug fixes, some minor changes and various changes under the hood.

Changes of interest in 2.3:

  1. Jump dialog now filters results as you type.
  2. Custom scheme is now implemented as a PN extension.
  3. Double-click on tab bar (not on tab) starts a new doc.
  4. 3 types of block comment supported in custom schemes (schemedef).
  5. Tags only auto-closed in the correct state in HTML/XML, hr br and img not auto-closed.
  6. Miscellaneous updates to schemes to improve highlighting (including HTML5 elements and attributes).
  7. RTF export reworked, background colours now working better.
  8. Properties scheme folding.
  9. Crash issues with split views fixed.
  10. Chinese Windows XP menu issues fixed.
  11. Portable edition translations issues fixed.
  12. Some autocomplete fixes

Downloads:
Download 2.3 RC Installer
Download 2.3 RC Portable
Download 2.3 RC Multi-Language

You may also like to add the following updated extensions to your 2.3 RC install:

PyPN to get support for scripting/macros with Python: PyPN 1.0 RC
TextUtil for miscellaneous extra text helpers: TextUtil 0.2

Thanks to all contributors, translators and testers for their help with this release.

p.s. this release has been available for a while, I just haven’t had time to write it up. A new family member has been keeping me very busy!


10
Jan 11

Updated Pascal Scheme for 2.2

Some large changes in the Pascal lexer that comes with Scintilla caused the Pascal support in version 2.2 to be, well, pretty broken. I’ve just fixed up a Scheme that works with the new lexer, and you can download it here:

Download Updated Pascal Scheme

Instructions:

  1. Download Pascal.scheme file
  2. Copy Pascal.scheme to PN\Schemes directory, overwriting existing file
  3. Restart Programmer’s Notepad