Friday, December 25, 2009

What if the universe looks like discarded origami

That is, folded up many times with some sharp creases, but in the end just crumpled up in a ball.

Would we be able to jump between folds? What are the properties of such a universe? If the universe in the dimensions that we know is just a crumpled ball in higher dimensions does this mean that we might travel between places that are far away in our conventional frame of reference but would be short distances in the crumpled dimension?  Would we have a choice of where to travel?  How would we map such a universe from the inside in our 3 dimensional viewpoint?

What happens at the center of such a universe? Does such a universe imply that although we have a 3 dimensional center, that there also exist centers that are in higher dimensions?  The center of a crumpled piece of paper is probably not in the same location as the center of the sheet of paper laid flat.  Does any type of energy or subatomic particle travel between folds?   Gravity?  Does this explain the spurious gravitational measurements postulated to be caused by dark matter?   What are the implications for space travel? Teleportation?  Unless you can convert yourself to an energy form that traverses folds...

Could we store energy in this other dimension? Heat? Computing?  Can we change the shape of this origami universe?  Affect its shape?  Is the shape, the very structure of our origami universe changing?  If the topology changes, then it is unfolding, folding, crumpling, ...?  In what way would the origami universe evolve?  How do non-local gravitational forces affect local galactic structures?  Can portions of the membrane pass through other portions, very unlike our familiar origami?   How many sheets are there?  Do the sheets have the same physics?

How do we determine whether a folded, membrane universe is a good model?  Or not?

Thoughts and musings on membrane universes from the net:

Friday, September 18, 2009

Disabling spindump diagnostic and crash reporter on Mac OS


The spindump process detects and collects information about crashing processes.  While this is great and all, it doesn't always work and spindump itself hangs indefinitely, taking with it an entire processor pegged at 97% usage.  Uhg. Sometimes an application is unresponsive because it is very busy doing some type of IO.  I get spindump hogging cycles when I am copying movie data from one disk to another in iMovie.  With spindump running, my system basically becomes unusable.  You can read the spindump manpage for more info on this process. 



To disable it permanently: 


sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.spindump.plist


Re-enabling it is just as easy:


sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.spindump.plist


Thanks to James Knowles for this tip: 
http://jamesreubenknowles.com/disable-spindump-71

Friday, August 21, 2009

Applescripting with OmniGraffle: exporting all groups, draw some points

I haven't really spent a lot of time writing or using Applescript before. I dabbled only when I needed to tweak one that I'd found on the web. This is sensible since a web search is always a practical problem solver's first step in finding a solution. This is also due to my love of the Unix command line. If I need something quick and dirty then I write it in pipe and filter semantics with some command line voodoo using the likes of awk, sed, grep, tr, cut, paste, and sometimes add some Perl for good measure. After using Applescript for a few days and ruminating over its syntax, I think that it is crafty, compact, and extensible. Unlike most languages, it doesn't really 'do' anything. It is the laziest language I've come across and I like that. The way it works is to just literally 'tell' other applications what it wants done. It has data structures, and types (of sorts). And like many extensible languages, it suffers from a dearth of cohesive intelligible resources for understanding its use. Sure, there are books on Applescript, and lots of resources on the web, but a lot of basic things that should be covered (because of the downright weirdness of the language) are nowhere to be found. The dictionaries that are provided with each 'AppleScriptable' application provide the minimum information required with no examples of the use of particular objects or messages.

Nonetheless, this week I wrote three simple Applescripts for the OmniGraffle vector drawing application out of necessity. The first two export either all of groups or graphics of a OmniGraffle document as a particular format. This is useful if you create a large number of graphics that you want to export, or as I often do, create a large number of groups of graphics that each comprise an icon. There is no 'batch' export in OmniGraffle because they almost certainly figured that someone would just use Applescript to do it.

The third is even simpler; it just imports a comma-delimited list of value pairs as the endpoints of line segments. That is, it draws x-y coordinates as a single connected graphic.  The syntax for doing this can be learned by drawing something and then ->Edit->Copy As->Applescript....a very neat feature.

Just cut and paste the scripts below into the Script Editor and save them under ~/Library/Scripts/Applications/OmniGraffle (or OmniGraffle Pro)

OminGraffle export all groups
------------------------------------------------------------

--Copyright 2009, Sunny Fugate
--Creative Commons Attribution-Share Alike 3.0
--http://creativecommons.org/licenses/by-sa/3.0/us/
--
tell application "OmniGraffle Professional 5"
--Setup export options
set current export settings's area type to selected graphics
set current export settings's draws background to false
set current export settings's export scale to 1
set current export settings's include border to false
set current export settings's resolution to 2.0
--Retrieve the desired output export path
set myFolder to POSIX path of (choose folder)
--Get the desired output format
set outputTypeList to {"PDF", "TIFF", "PNG", "GIF", "JPEG", "EPS", "SVG", "PICT", "BMP"}
choose from list outputTypeList with prompt "Choose export format"
set exportformat to result as text
--Get the desired file prefix
set prefixDialog to display dialog "Enter a desired output file prefix or leave blank" default answer ""
set filePrefix to the text returned of prefixDialog
--Get the current document for later use
set currentDocument to document of front window
--Get a list of the canvases
set theCanvases to every canvas of currentDocument
--Use a counter for unique naming
set counter to 0
--Loop over each canvas
repeat with aCanvas in theCanvases
--Make sure that the current canvas is displayed 
--(export of currently selected only works in the displayed window
set canvas of front window to aCanvas
--get a list of groups for this canvas
set theGroups to every group of aCanvas
get theGroups
--loop over each group
repeat with aGroup in theGroups
get aGroup
--Set the selection of the window and save / export
set selection of front window to {aGroup}
save currentDocument as exportformat in POSIX file (myFolder & filePrefix & (counter))
set counter to counter + 1
end repeat
end repeat
end tell


OmniGraffle export all graphics
--------------------------------------------

--Copyright 2009, Sunny Fugate
--Creative Commons Attribution-Share Alike 3.0
--http://creativecommons.org/licenses/by-sa/3.0/us/
--
tell application "OmniGraffle Professional 5"
--Setup export options
set current export settings's area type to selected graphics
set current export settings's draws background to false
set current export settings's export scale to 1
set current export settings's include border to false
set current export settings's resolution to 2.0
--Retrieve the desired output export path
set myFolder to POSIX path of (choose folder)
--Get the desired output format
set outputTypeList to {"PDF", "TIFF", "PNG", "GIF", "JPEG", "EPS", "SVG", "PICT", "BMP"}
choose from list outputTypeList with prompt "Choose export format"
set exportformat to result as text
--Get the desired file prefix
set prefixDialog to display dialog "Enter a desired output file prefix or leave blank" default answer ""
set filePrefix to the text returned of prefixDialog
--Get the current document for later use
set currentDocument to document of front window
--Get a list of the canvases
set theCanvases to every canvas of currentDocument
--Use a counter for unique naming
set counter to 0
--Loop over each canvas
repeat with aCanvas in theCanvases
--Make sure that the current canvas is displayed 
--(export of currently selected only works in the displayed window
set canvas of front window to aCanvas
--get a list of groups for this canvas
set theGroups to every graphic of aCanvas
get theGroups
--loop over each group/graphic
repeat with aGroup in theGroups
get aGroup
--Set the selection of the window and save / export
set selection of front window to {aGroup}
save currentDocument as exportformat in POSIX file (myFolder & filePrefix & (counter))
set counter to counter + 1
end repeat
end repeat
end tell


OmniGraffle draw line from clipboard


--------------------------------------------
--Copyright 2009, Sunny Fugate
--Creative Commons Attribution-Share Alike 3.0
--http://creativecommons.org/licenses/by-sa/3.0/us/
--
--Expect values to be comma delimited x,y with linebreak between each value
set theData to the clipboard
set AppleScript's text item delimiters to (ASCII character 13)
set valueList to every text item of theData
--set numberString to "{"
set numberList to {}
set AppleScript's text item delimiters to {","}
repeat with value in text items of valueList
--stupid extra repeat which never repeats to emulate a repeat 'next/continue'
repeat while true
try
set x to item 1 of text items of value as number
set y to item 2 of text items of value as number
on error theError number errorNum
exit repeat
end try
set numberList to numberList & {{x, y}}
exit repeat
end repeat
end repeat
tell application "OmniGraffle Professional 5"
tell canvas of front window
make new line at end of graphics with properties {point list:numberList}
end tell
end tell