Skip to main content

Posts

Consolidate query executions

UPDATED:  There is an issue whereby this code does not work as expected with MySQL.  As a result, the concept has been reworked and listed under the entry " Consolidated query executions version 2 ." In an effort to adhere to the DRY principle, or don't repeat yourself , the routine defined in this piece can be added to programs that employ a series of queries.  The idea is that it moves a few lines of code that would otherwise need to be in each method or function that calls a query to a database server. This snippet is coded with PHP and represents a method from a larger class.  There are more details about the code itself in the comments of the code. private function run($sql) { // Assumes $this->Conn has been set up in advance as a PDO connection. $Query = $this->Conn->prepare($sql); if((func_num_args() == 2) && is_array(func_get_arg(1))) { $Query->execute(func_get_arg(1)); } else { $Query->execute(array()); } // ...

SpeedTest Easter egg

There is an Easter egg in Speedtest .  From the results view, pull down the "speedometer-looking" dial.  Behind the dial will be a picture of a disgruntled cat.  Pull the gauge down again and there will be a new pose of the cat.  Repeated pulls keep changing the pose of the cat until the final picture is that of the rage comic, " Y U no…guy ." Speedtest is the popular network speed testing utility from Ookla .  The company offers the speed tester on desktop browsers via Flash as well as iOS and Android devices.  The Y U no guy is a goofy looking cartoon often seen with the caption, "y u no leave me alone."  It's thought to have been derived from the Japanese comic strip Gantz. The Easter egg is only in the iOS version since the interface of the webpage version doesn't allow for this sort of input, and it doesn't work at all on the Android version.  The Y U no guy cartoon is captioned "Y U no leave now" and is the last image.  To d...

Scanning to USB with the Xerox WorkCentre 3210 and 3220 (part 2)

The WorkCentre 3210 and WorkCentre 3220 are two variants of an entry level Xerox business level multifunction printer.  The couple bring a lot to the table in terms of features and longevity, but it's not always clear as to how to operate the machines.  While the printers do come with a manual, like most documentation for consumer devices, it's awful.  Well, awful in that it's brief. It's a catch 22 situation really.  Literature for consumer devices is seldom referred to, but there's, for some reason, a demand for it.  As a consequence, it's typically brief and offers no assistance when problems arise.  This is the second of a two-part piece on extending the documentation that comes with the 3210/3220. Scanning to USB:  The document files The WorkCentre's scan to USB feature works out of the root level of the disk.  It will create a new folder for each day and scan the documents to files with names representing the time the ...

Scanning to USB with the Xerox WorkCentre 3210 and 3220 (part 1)

The WorkCentre 3210 and WorkCentre 3220 are two variants of an entry level Xerox business level multifunction printer.  The couple bring a lot to the table in terms of features and longevity, but it's not always clear as to how to operate the machines.  While the printers do come with a manual, like most documentation for consumer devices, it's awful.  Well, awful in that it's brief. It's a catch 22 situation really.  Literature for consumer devices is seldom referred to, but there's, for some reason, a demand for it.  As a consequence, it's typically brief and offers no assistance when problems arise.  This is the first of a two-part piece on extending the documentation that comes with the 3210/3220. Scanning to USB:  The media This first piece is actually a log of the troubleshooting steps used to resolve a problem with the scan to USB feature. The WorkCentre has a feature whereby it can scan documents directly to a drive thro...

PHP KB: No records found when using SQL variables and PDO parameters

Issue The PDO class for PHP throws an error when running queries against SQL Server and returning multiple results sets. Cause Without the benefit of the details around the implementation of SQL Server or the SQLSRV PDO driver, there's no way to know what's causing this issue.  However, the anecdotal evidence points to the the lack of support in the SQLSRV driver for SQL Server's ability to return multiple datasets. One of the errors that has been encountered reported a question mark (?) placeholder in each place where an SQL variable was in the script that was passed to the PDO::prepare() method call.  This was taken to mean that the method was perceiving each SQL variable as a parameter that it should be looking for in the parameters array passed in the PDOStatement::execute() method.  In other words, it was interpreting SQL parameters (variables) as PDO parameters (?). Ultimately, this issue is likely to come down to the use of the table data type or tempo...

Mura KB: Pages continue to re-direct after removing 'Go To First Child' content object

Issue Removing a " Go To First Child " content object from a page does not take effect right away. Cause Mura uses a re-direct to "route" users to the first child element of the site.  When the re-direct is removed, the information remains cached in the user's browser. Solution Clear the cache from the browser and reload the offending page. Environment Version Mura Version 5.6 OS Any Browser Any Details Mura has a handy feature that allows a page to re-direct out to a child item.  Clearing the "Go To First Child" content object however, may be problematic since the browser caches the re-direct.  This means for example, that if a top-level page loads another top-level page, but the feature is ever removed via the Mura administration, the page will continue to load the second page. Assume a scenario like this.  A site has a Home section and a News section.  Ignoring the reasons why a site might be implemente...

Unanimous U.S. Congressional vote against global Internet regulations

With a vote of nearly 400 to nil, the United States Congress , with the support of both houses, has voted not to support any new global regulations on the Internet.  The resolution states that it is the intent of The Government to implement the position that the Internet can operate free from governmental intervention. Furthermore, the close of the resolution articulates the state of being that the Internet is currently operated as a "multistakeholder" environment and is deemed to be successful as it is. Sources Engadget House passes unanimous resolution to ban UN regulation of the internet http://www.engadget.com/2012/12/05/house-passes-unanimous-resolution-ban-UN-internet-regulation/ The Verge US House votes against government control of internet as ITU conference gets underway http://www.theverge.com/2012/12/5/3732478/house-votes-against-government-control-internet Documents 112TH CONGRESS, 2D SESSION, S. CON. RES. 50 http://thehill.com/images/stories/bl...