Inkscape Extensions Need Fantastic LXML

February 10, 2014

Ever got that message when trying to open or save a DXF? Or use any other extension for that matter? Did this just start when you upgraded to Mavericks? Well, read on…

Quote:

When saving .dxf file (as well as some other tasks) in OS X, the user gets a message that lxml is required or that numby is required. The problem is that those are shipped with OS X. It is easily solved by adding the line

export VERSIONER_PYTHON_VERSION=2.6
above the line
export VERSIONER_PYTHON_PREFER_32_BIT=yes

in the inkscape startup script /Applications/Inkscape.app/Contents/Resources/bin/inkscape

You may have run across the above quote in an official Inkscape bug, but let me explain a little more to help you get the fix in…

First, to get to the file they are talking about, you right-click on the Inkscape.app and select “Show Package Contents”. Then navigate the the file above.

Second, open the file in a text program that doesn’t add additional formatting, like Text Wrangler. Then, around line 32, you will see some text that will need to be changed to look something like this:

# On Snow Leopard, use the 32-bit version of python from Universal build.
# This is because our bundled i386 python libraries are 32-bit only.
export VERSIONER_PYTHON_VERSION=2.6
export VERSIONER_PYTHON_PREFER_32_BIT=yes

Lastly, you may need to get version 2.6 of Python, and set it as your default. I’m not covering those instructions, but they are much easier to find than this part.

Save and close your file and your done.

Advertisements

RAR Archiving

May 16, 2012

RAR Archiver :

RAR is a proprietary file format for data compression and archiving, developed by Eugene Roshal.

Under Linux and UNIX, use command called unrar. By default unrar is not being installed on Linux, FreeBSD or UNIX oses. You can install unrar command with the help of apt-get or yum command.

-Create an archive rar called ‘file1.rar’

rar a file1.rar test_file

-Compress ‘file1′, ‘file2′ and ‘dir1′ simultaneously

rar a file1.rar file1 file2 dir1

-Decompress rar archive

rar x file1.rar

OR

unrar x file1.rar

Zip Without Compression From Terminal

April 22, 2012

You may Zip without compression, control how much compression, or compress some files and not others. True since the old DOS days.

Create zip without compression on OS X from Terminal:

zip -r0 zipfilename.zip files-to-zip

If you want to add files with max compression:

zip -r9 zipfilename.zip files-to-zip

Use zip -h to see what all the switches do.

Tip: Force a Virtual Machine to Power Off

December 1, 2011

If you’ve ever used a computer and had it freeze or otherwise lock up, you may have had to pull the power cord, either literally or by holding the power button. But how do you do this for a virtual machine?

In the Virtual Machine menu, there are of course power commands: Shut Down Guest, Suspend Guest, and Restart Guest. However, these are what are known assoft power commands – they’re requests to the guest OS, which it can ignore (or in the case of a deadlocked guest, might not be able to handle). In contrast, hard power options are not ignorable by the guest – it’s the virtual equivalent of yanking the power cord. To get these hard power options, hold down the option key on the Virtual Machine menu to change the power commands to Power Off, Suspend, and Reset.

Obligatory note of caution: Just like with a physical computer, you risk corrupting the contents of the (virtual) disk if the guest OS isn’t in a quiesced state.

Side note: Some virtual machines have the default options switched (i.e. hard power options by default, and pressing the option key changes to soft power options).

Bonus tip: Holding down the option key to get alternate menu items is used in other Mac applications – for example, try it in Finder.

Mac OS X Startup Options

July 27, 2010

If your having trouble booting up your Macbook Pro, here are some boot options to try:

Keystroke Description
Press C during startup Start up from a bootable CD or DVD, such as the Mac OS X Install disc that came with the computer.
Press D during startup Start up in Apple Hardware Test (AHT), if the Install DVD 1 is in the computer.
Press Option-Command-P-R until you hear two beeps. Reset NVRAM
Press Option during startup Starts into Startup Manager, where you can select a Mac OS X volume to start from. Note: Press N to make the the first bootable Network volume appear as well.
Press Eject, F12, or hold the mouse (/trackpad) button Ejects any removable media, such as an optical disc.
Press N during startup Attempt to start up from a compatible network server (NetBoot).
Press T during startup Start up in FireWire Target Disk mode.
Press Shift during startup Start up in Safe Boot mode and temporarily disable login items.
Press Command-V during startup Start up in Verbose mode.
Press Command-S during startup Start up in Single-User mode.
Press Option-N during startup Start from a NetBoot server using the default boot image.

The Option-Command-P-R is a good one. If you have a Macbook Air, using Option will allow you to boot over the network if there’s another computer setup for remote install.

Capturing Keyboard “Arrow” Input in OpenCV…

June 11, 2010

Some people have asked how to capture keyboard arrow direction input for use with OpenCV. It is straight forward, you just have to know the ASCII code for certain “non-printable” characters you want to use, including the arrow keys. Here’s a short example:

c = cvWaitKey(100);

switch (c)

{

case 30: // up arrow

case ‘U’: // UP

case ‘u’: // up

avgOutput = (InputUnitTwo + InputUnitOne) / 2;

printf(“Avg=%f\n”, avgOutput);

break;

}

Notice that in the case switch, the keyboard ASCII “letters” use a single quote ( ‘U’ ), where as the ASCII “code” is just a decimal (30 for up-arrow).

Here are the other decimal ASCII codes for the non-printable arrow keyboard inputs:

case 28: // right arrow

case 29: // left arrow

case 30: // up arrow

case 31: // down arrow

Rotate your screen in Snow Leopard…

May 22, 2010

For whatever reason, you may find the need to have your screen rotated 90 deg (portrait mode). For me, it was because I’m using MAME and it’s rotate feature was insufficient.

Here’s how to do it:

1) If System Preferences is open, quit it.
2) Open System Preferences.
3) Hold down Command and Option at the same time and click on “Displays”
(NOTE! This must done on the *first* time you open the displays preference pane after opening system preferences or it wont work. If you’ve already opened Display prefrences without holding cmd and option, quit and try again)
4) That’s it! You should now see a buggy looking “Rotation” option off to the edge of the window. Clicking brings up your options for rotation and actually works!

Startup Automatic Login on Mac OSX…

May 9, 2010

Mac OS X version 10.3 and higher

  1. Login to your machine.
  2. Navigate to the Apple menu and select System Preferences.
  3. This action will launch a System Preferences window.
  4. In the System Preferences window, locate the section entitled System.
  5. In the System section, locate and click to select the Accounts icon. (It should be the first icon from the left.)
  6. This will launch an Accounts window.
  7. In the left pane of the Accounts window, locate the Login Options.
    1. If grayed out or dimmed, this task requires authentication.
      1. To Authenticate: click the golden padlock icon at the bottom-left of the Accounts window. This will launch a screen entitled Authenticate.
      2. Enter your Administrator Password and click OK. If the correct password is entered, this will authenticate you and close the window. Once the window closes, Login Options will no longer be dimmed.
  8. Select Login Options. This will display your login options in the right pane of the Accounts window.
  9. Deselect/Uncheck the first option – Automatically log in as username.
  10. Close the Accounts window.
  11. Navigate to the Apple menu and select System Preferences. This will re-launch the System Preferences window.
  12. Relocate and click to select Accounts icon.
  13. Locate and select Login Options (re-authenticate if necessary).
  14. Select/Check the first option – Automatically log in as username.
  15. From the pull-down menu select your username.
  16. A window will appear and prompt you for the password assigned to selected username. Enter the correct password. Please note, if you are completing this step following an admin password reset, please enter your new admin password.
  17. Click the OK button to commit the password information and close the window.
  18. Close the Accounts window and reboot to verify the automatic login capability.

Rename An Xcode Executable Or Project

April 7, 2010

I copied this from Tom’s Cocoa Blog:

“If you have used Xcode before you know that when you create a new project the name you give the project is used as the name for the target executable.  But what do you do if you come up with a new name for your application or want to create a similar project with some minor changes.  Well you have two choices.

1.  Rename the entire project.

2.  Rename only the executable.

Renaming a project in Xcode 3.x

This seems like it ought to be a simple process provided by Xcode but it is not.  Here is how to do it.

1.  Copy and rename the project folder

2.  Inside the new project folder rename the files ending in .pch and .xcodeproj

3.  Right click on .xcodeproj file (it is actually a folder) and select show contents. In the contents folder there should be a file ending in .pbxproj. Open This file in you favorite editor and replace all instances of the old project name with the new project name.

4.  Delete the build folder

5.  Open the Renamed Xcode project and right click (Control click) on the Target from the groups and files list. Select Info to open the properties panel.

6.  Click on the build tab the select packaging from the collection pop up menu

7.  Change the value in the product name build setting to the new name.

8.  Do Build Clean all Targets.

Changing the executable name

1. Open the Xcode project and right click (Control click) on the Target from the groups and files list. Select Info to open the properties panel.

2.  Click on the build tab the select packaging from the collection pop up menu

3.  Change the value in the product name build setting to the new name.

4.  Do Build Clean all Targets.”

Using OpenCV Libraries in Xcode

April 7, 2010

These instructions were written for Xcode 3.1.x

  • Create a new XCode project using the Command Line Utility/Standard Tool template
  • Select Project -> Edit Project Settings
  • Set Configuration to All Configurations
  • In the Architectures section, double-click Valid Architectures and remove all the PPC architectures
  • In the Search Paths section set Header Search Paths to /usr/local/include/opencv ( important note: if you installed via MacPorts, /usr/ becomes /opt/ ).
  • Close the Project Info window
  • Select Project -> New Group and create a group called OpenCV Frameworks
  • With the new group selected, select Project -> Add to Project…
  • Press the “/” key to get the Go to the folder prompt
  • Enter /usr/local/lib (important note: if you installed OpenCV via MacPorts, then this becomes /opt/local/lib )
  • Select libcxcore.dyliblibcvaux.dyliblibcv.dyliblibhighgui.dylib, and libml.dylib.
  • Click Add
  • Uncheck Copy Items… and click Add

Now you should be able to include the OpenCV libraries, compile, and run your project:

To use the libraries, include the required files with standard includes. For example:

#include <cv.h>
#include <highgui.h>

(important note: if you installed OpenCV via MacPorts, then /usr/local/ becomes /opt/local/ )