Was just checking a 301 redirect I've set up, and while looking at the the server output from the wget -S command I noticed that etsy.com has an X-Recruiting header. Etsy I hope your innovation brings all the coders to the yard.
James McDonald
C Struct Loses it’s Settings
A while ago I blogged about a Control system that commits a C Struct to a file on a disk and then reads the file and enters the C Struct data back into the control system. The operators started noticing inconsistent behaviours. And so I have had to investigate. After...
Struct is 652 Bytes Fwrite writes 656 Bytes
I am not a programmer but I had the need to write a C struct to disk When I then tried to write another of the same files to try and work-a-round a problem with the system they are used on I got a slightly large (by 4 bytes) file I was compiling the C program with my...
array_merge – And the winning key is!
Just a note to self about PHP array_merge The later array passed into array_merge overwrites the former, also if it's indexed with numerical keys then the values will just be appended. <?php $option_array = [ 'element' => 'ooa1', 'optionb' => 'ob1',...
OpenRPT Context Queries, Format Strings and URLs in PDFs
OpenRPT is a Report Write that is Bundled with xTuple in all it's flavours. It's simple and takes some getting used to in order to use it's power When creating a custom report there is a thing called a Context Query. These are the values that are available...
Netbeans Removes Indent from // Comments
Been using netbeans for PHP development and discovered that it will remove the leading whitespace from comments and then the comments inside a block of code are hard up against the left margin which looks weird. Not sure if there is a setting to stop this behaviour...
Making Weird Grunting Noises with CakePHP 3 & Twitter Bootstrap
This is how I got grunt running with the twbs/bootstrap plugin to automatically copy the CSS, JS and Fonts into my CakePHP 3 development environment. I did this on MacBookPro OSX 10.11.5. But this applies to Linux too. If anyone has better suggestions as to how this...
TCPDF KeyWords Doubled in Document Properties Description Tab – Acrobat Reader
This causes the keywords to double when viewed in File ==> Properties ==> Description Tab. $pdf->SetKeywords('CLAM, CLM, Schedule, Program, Meeting, Service Meeting'); This shows the keywords once only: $pdf->SetKeywords('CLAM CLM Schedule Program Meeting...
CakePHP 3 Changes To Date/Time Formatting
The new date objects have different formatting strings http://www.icu-project.org/apiref/icu4c/classSimpleDateFormat.html#details $this->Time->format($assigned_part->start_time, 'h:mm') $this->Time->format($mtg->date, 'eeee MMMM d') The old ones here...
I have no idea what the problem is PHP CLI
Trying to do some PHP tutorials using vim and running php from the command line and I get.... nothing back. If it's a syntax error (e.g. a missing line ending ; ) then no reply at all. If the syntax is correct and it's something else then the error isn't displayed...
CakePHP POST Failing
I was just trying to submit about 10 x 15 records... and found that cakephp was failing with a validation error. Found out it was due to the following in the php error log. [09-Jun-2016 19:16:22 Australia/Melbourne] PHP Warning: Unknown: Input variables exceeded...
Adding new fonts to TCPDF
Less agony way of doing it. Download your fonts and then run the following cd /Users/jmcd/Sites/clam/vendor/tecnickcom/tcpdf tools/tcpdf_addfont.php -i /Users/jmcd/Downloads/liberation-sans/LiberationSans-BoldItalic.ttf cd fonts/ Bulk Load Multiple TTF's for i in ls...
CakePHP – Call to a member function format() on array!
// failing validator rule $validator ->date('date') ->add('date', 'unique', [ 'rule' => 'validateUnique', 'provider' => 'table', 'message' => "One of the dates you submitted already exists!" ]); // working buildRules public function buildRules(...){...
CakePHP “public $paginate =” overwritten by action “$this->paginate =” Gotcha
If you have a the following code class PartsController extends AppController { /** * Index method * * @return \Cake\Network\Response|null */ public function index() { $this->paginate = [ 'contain' => ['Sections'] ]; $parts = $this->paginate($this->Parts);...
CakePHP 3 – TCPDF Install and Usage
In your CakePHP top level folder (the one that has composer.json, src/, vendors/, config/, webroot/) run: composer require tecnickcom/tcpdf You should now have vendor/tecnickcom/tcpdf Now in a controller src/Controller/<ControllerName>Controller.php create an...
CakePHP 3 – Escape to the Global Namespace
This code in CakePHP 3: <?php $date = '31/01/1973'; $ymd = DateTime::createFromFormat('!d/m/Y', $date)->format('Y-m-d'); Causes this error Error: Class 'App\Controller\DateTime' not found This code fixes it: <?php $date = '31/01/1973'; $ymd =...
Checking for port errors on Cisco Switches
Recently had a macbook pro which had a network dongle that was very hot and the network connection stopped working. Found that the dongle was sending garbled signal down the wire and the Cisco switch shutdown the port. # all status show interfaces status # port...
Symantec Endpoint Protection Cloud – NIS.exe High CPU on Windows XP SP3 VMWare VMs
Just discovered that one of the patches I installed today on my VMWare hosts fixed an issue I had after installing Symantec Endpoint Protection for Small Business Cloud Hosted Edition The old ESXi build was 106549 the new one is 3872664 ( vSphere 5.1 3b ) I don't know...