Sed: invalid reference \1 on `s' command's RHS

Submitted by Druss on Mon, 2015-07-06 13:46

If you see something like the following error message when you run a sed command:

invalid reference \1 on `s' command's RHS

then it (probably) means that your regex capture group has not been escaped properly.

So, if you are using a command like:

sed "s/foo(bar)[123]/baz\1/"

then it needs to be escaped like so:

sed "s/foo\(bar\)[123]/baz\1/"

In other words, round parentheses/brackets need to be escaped while the square brackets do not :|

Unity3D: InputField caret position bug workaround

Submitted by Druss on Sat, 2015-07-04 02:06

If you, like me, have the (off and on) pleasure of working with Unity3D (5.1.1f1), you are probably familiar with implementing cute li'l workarounds to get around the pesky li'l niggles that seem to plague the otherwise fun package. Today, I ran into an issue with the Inputfield nGUI component. From the looks of things, it doesn't like you playing around with its font size.

Microsoft Virtual CD-ROM: vcdrom.sys "Driver has been blocked from loading"

Submitted by Druss on Tue, 2015-06-23 16:12

I had the misfortune of trying to install Microsoft's "Virtual CD-ROM Control Panel" which creates, well, a virtual CD/DVD-ROM drive that allows you to mount ISO images. There are a number of other programs that do this, but seeing as to how this was a M$ product, free, Window-7 compatible, and light of weight, I decided to give it a whirl. The README.txt that accompanies the installation file provides instructions for the manual addition of the vcdrom.sys driver to the Windows directory.

XML and Unity3D

Submitted by Druss on Fri, 2015-05-29 01:45

N.B. This is a mirror of a page that no longer exists at its original location.

I needed to be able to save game state, and I wanted to communicate back and forth with websites, and I needed the files to be human readable, and I needed it to be easy [I have been told I am very needy]. The best thing for me to do was to figure out how to read, and write, XML inside Unity3D. It’s a web plugin right? it should support XML processing, and the DOM model right? Well, yes, yes it does.

C# error: InvalidOperationException: Collection was modified; enumeration operation may not execute.

Submitted by Druss on Sat, 2015-05-16 23:54

I was fiddling around with Unity3D (and C#) and I ran into the following error messages:

InvalidOperationException: Collection was modified; enumeration operation may not execute.
System.Collections.Generic.List`1+Enumerator[UnityEngine.UI.Toggle].VerifyState () (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.Collections.Generic/List.cs:778)

and

Non-destructive healing in GIMP

Submitted by Druss on Sat, 2015-05-02 23:42

Non-destructive healing allows you to "heal" the pixels of an image using a separate, dedicated layer so that you can undo or modify your changes at a later point in time. In (Photoshop and) GIMP, this essentially works by performing the heal on an empty layer using the Sample Merged option which allows you to perform the heal as if all the layers were merged together. While this works fine with the clone function, it is broken for healing in GIMP (2.8) due to this bug :(

MySQL: #1071 - Specified key was too long; max key length is 767 bytes

Submitted by Druss on Fri, 2015-04-03 01:33

Here I was simply creating a MySQL (5.5) table when suddenly up pops the following error:

#1071 - Specified key was too long; max key length is 767 bytes

After a little trial and error, I found that since one of my VARCHAR fields was being used for a UNIQUE index, MySQL was basically telling me that it was using too much space. When I reduced the length of this field from its initial 512 setting to 256 & then 255, it still complained. However, reducing it further to 128 fixed the issue!

Mouse Marks: Weird red marks on screen when pressing the Windows Meta Key and Shift

Submitted by Druss on Fri, 2015-03-20 18:36

For the last few weeks, I've noticed weird red dots/lines or similar marks on my Kubuntu screen. I'd attributed them to a graphics issue that I'd recently sorted out, particularly because I was mainly noticing these marks when resuming the system from sleep mode. Turns out I was wrong. Very wrong.

Resuming after sleep mode, terminating/hanging up a frozen SSH session in Linux

Submitted by Druss on Fri, 2015-03-20 11:55

So, I am often SSH'd into a remote server from my Kubuntu desktop. I also rarely switch off my desktop and prefer to just hit sleep instead. One of the things that can be annoying when I resume the desktop is that the previous SSH session is now unresponsive/frozen as SSH believes that it is still connected to the remote server while the server has given up on the old session long ago. No amount of CTRL + C or CTRL + Z banging is going to terminate the session which can take an inordinately long wait to time out.

Kubuntu: Audio plays in the wrong tty/terminal

Submitted by Druss on Thu, 2015-03-05 01:18

This has happened to me on a number of occasions where I've found that my system audio only plays when I switch to a different tty. I don't know exactly how to duplicate the issue . But essentially, if I switch from my Kubuntu 14.10 KDE desktop to a different tty (using something like CtrlAltF5) and then switch back to the KDE tty, I find that I can hear no audio. However, if I switch again to the command-line tty, I can hear that audio that ought to have been playing in KDE. Rather weird, huh?

Pages

Subscribe to languor.us RSS