The Designspace http://thedesignspace.net/ My daily explorations, troubleshooting, solutions and discoveries. en-us ellen@thedesignspace.net Sat, 08 Jun 2013 19:03:30 -0500 How to make a diff file on Mac http://thedesignspace.net/MT2archives/001036.html I had occasion to make a patch file the other day, and since I do this so rarely, it took some time to look up how to do it. So here, in a nutshell is how to use diff on a Mac. Open terminal. At the prompt, type diff -up newfile oldfile But really the easiest way to get the... Drupal 7: CTools module error: Failed: PDOException: SQLSTATE[23000]: Integrity constraint violation: http://thedesignspace.net/MT2archives/001034.html When I re-installed CTools (Chaos Tools Suite) during a Drupal 7 upgrade, it resulted in this error: Failed: PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '29' According to this post, it may have something to do withinsufficient memory allocation to PHP preventing hook_install from running when the module tries to load. Since I had just increased the memory in... Easy, trackable Wordpress elearning with Gravity Forms quizzes and the TinCanAPI http://thedesignspace.net/MT2archives/001028.html I work in a small learning management department in a large Health System. One of the "forever" problems we'd like to solve, is how to get out of the way of our many clinical subject matter experts and make it EASY for them to put trackable learning content online by themselves. Why is this still a problem in this age... Regular expression to match any line that contains a string http://thedesignspace.net/MT2archives/001017.html I use BBEdit to clean up text files generated by various highlighting and note-taking apps. One application that I particularly like, Skim, exports a list of all the highlights you've made in a PDF, each prefaced with a line like: * Highlight, page 74 I wanted to get rid of those line indicators, so I could incorporate those highlights into... Firefox not displaying XML file as a tree http://thedesignspace.net/MT2archives/001013.html I usually troubleshoot XML files by simply dragging them into a Firefox browser window. Unlike other text files, Firefox displays XML in a handy tree format, as show below.... Javascript: use setTimeout() for detecting whether an object or element exists yet http://thedesignspace.net/MT2archives/000990.html This is an example of the use of setTimeout() to detect if an element or object exists yet. In Javascript, timing is crucial. If an element hasn't been loaded or rendered on the page yet, you can't do something with it, so it is necessary to test for the existence of items that take a while to load. This script... Friction http://thedesignspace.net/MT2archives/000989.html Something I've been thinking a lot about lately, since we have been looking at learning systems, is the idea of friction. My definition of friction is anything that either lowers our expectations of the results we can get from a particular tool or process to the point that we either change our expectations of the results or abandon them altogether.... Use BBEdit to replace the entire contents of multiple files http://thedesignspace.net/MT2archives/000971.html A few months ago, I needed to revise an HTML file that is used many times across a large website. Most of the key code associated with this file is contained in centrally-located includes, but as luck would have it, this time the entire file needed to be revised - even the user-customized bits. That meant that almost a thousand... Drupal error message: "call_user_func_array() expects parameter 1 to be a valid callback" http://thedesignspace.net/MT2archives/000965.html After doing a series of updates to a Drupal installation, the following error appeared on all admin pages and edit pages: "call_user_func_array() expects parameter 1 to be a valid callback, function 'clients_access_callback " Other symptoms included that the database could not be updated to complete some of the following updates, and search no longer worked.... Thread: Changing maxAllowedContentLength http://thedesignspace.net/MT2archives/000949.html In a .NET application used to deliver quizzes, attempting to import a large quiz from another server resulted in this error: "The request filtering module is configured to deny a request that exceeds the request content length." A second message stated: "Request filtering is configured on the Web server to deny the request because the content length exceeds the configured... Javascript testing for NaN: why doesn't !="NaN" work? http://thedesignspace.net/MT2archives/000918.html A couple of weeks ago, I was working on a custom HTML wrapper for Captivate quizzes that would behave one way if a score were already stored for that quiz, and another if the score were non-existent or zero. So, how best to test for the existence of a score? Usually I test for the existence of a value with... Clicking a link results in blank page with "true" in IE7 http://thedesignspace.net/MT2archives/000889.html Prettify XML text in BBEdit http://thedesignspace.net/MT2archives/000883.html When XML data is sent back from a web service, it is in the form of a stream: there are no line breaks or indents to make it easier for humans to read. The example below is typical: the entire XML result is one continuous line. This makes it very hard to troubleshoot your application: you need a utility to... A handy tool for testing X-path expressions http://thedesignspace.net/MT2archives/000863.html When working on an application that consumes data from a webservices XML response, you may find it useful to test your X-path expressions.... .htaccess tricks Allow public access to a subdirectory http://thedesignspace.net/MT2archives/000855.html I run a little site that is mostly access-protected. If it is viewed from a location within the company IP, no password is needed. If viewed from outside the company firewall, it will ask for a user-id and password. However we wanted to make one subdirectory public....