CNID_CONFIG=”-l log_info -f /var/log/cnid.log”
Source: Random Notes » Blog Archive » Netatalk debugging and logging tips and tricks
CNID_CONFIG=”-l log_info -f /var/log/cnid.log”
Source: Random Notes » Blog Archive » Netatalk debugging and logging tips and tricks
Life
Misc
I remember once watching a documentary on Arnold Schwarzenegger’s bodybuilding career (or was it this one?) in the ’70s and early ’80s.
All of the bodybuilders in that golden era had their own training programme managers and promoters. I recall that one manager/promoter, working for another bodybuilder, loved his own quotes.
These quotes would range from the urbane, “the pen is mightier than the muscle”, to somewhat more characteristically humorous: “remember the golden rule: he who has the gold, makes the rules“.
Well, in the completely unrelated world of PHP programming, this perl of wisdom (sic joke) is worth hanging on to. Why? Well, if you have ever used PHP’s variable variables, knowledge of the correct syntax is worth its weight in gold. It’ll save hours, if not days, of debugging.
So, anyway, I’ve been coding a calendar system for a valued client for the past ten days or so. My first attempt I pretty much scrapped as it got too complex and almost impossible to debug. The second version is much better, except for one issue which has been giving me grief until now.
Variable variables in PHP are extremely useful, but I throw in a word of caution immediately: use them sparingly. It can be easy to quickly lose track of what’s called what and why it’s there. Especially if any single script is 400+ lines long.
To set a variable variable, it’s easier to start off giving a value to an ordinary variable:
$myVar = "myVarVar";Now, I want to create a variable variable with the name $myVarVar, so this is how it’s done:
$$myVar = "this is my variable variable";To see the contents of the variable variable, you can do either of the following:
echo $$myVar; // or
echo $myVarVar; Both will output “this is my variable variable” to the screen/page.
Snooker Loopy
Things start getting interesting when you introduce arrays and loops. Take the following example:
for($i=0; $i<4; $i++) {
$myVar = "myVarVar".$i;
$$myVar = " Variable variable £".$i;
}
echo $myVarVar0; // "Variable variable #0"
echo $myVarVar1; // "Variable variable #1"
echo $myVarVar2; // "Variable variable #2"
echo $myVarVar3; // "Variable variable #3"
Life
Misc
This week
Life
Misc
Boy, I am always amazed at the breadth of stuff that goes on weekly, surrounding people’s preferred operating systems, new hardware press releases and so on. For me, it’s one of the best things about the internet: constant information from all corners of the globe, seeking an audience and advocate elsewhere.
Intel, AMD and the new kid in town
So, this week there has been loads of stuff which caught my attention, only a short list of which I have time to share. First things first, Ars Technica : a constantly vibrant source of interesting news out there in the technosphere. Featured in its hallowed pages was the title “ARM’s Eagle has landed: meet the A15“. Indeedy, ARM is developing more processor chips which are beginning to compete with the likes of Intel’s Atom and AMD’s lesser-known Geode.
The exciting thing here is that a third player is entering the midst of a traditionally two-horse race: GPU/CPU design and manufacture (AKA AMD vs Intel). Similarly to the console race of 2007-ish, a third player getting involved (in the console war, this being Microsoft‘s XBox 360) does great things for the market and the larger picture. Who would have thought, against the mighty 360 or PS3, that the Wii would have competed so well?
We’ll see how this plays out in a different way with chip manufacturers though but, as with most of these things, the early adopters of SmartBooks (Netbooks with phone capabilities, typically powered by ARM processors) will likely be Business types and Linux users who aren’t just taken in by the big names.
The Apple is finally ripening
Finally. Sense at Apple. Well, some at least. Developers are creative, resourceful individuals. So throwing down the gauntlet by restricting their development languages was kind of a draconian, hard-line gesture by a company pimping itself as cool and trendy. Sorry Fanbois, but it was a bit Microsofty, actually. Which is actually unfair to Microsoft, as they are generally far less restrictive about this (as this list of programming languages illustrates..). Then again, 99.4% of malware is aimed at Windows users.
But back to Apple, this Ars story describes the change in stance at Cappuccino.
How nice of them to open up their policy as well as opening up their iOS 4.1 BootROM in the same week! In case anyone thinks I have a grudge against Apple, far from it. This vulnerability intended feature clearly demonstrates that Apple are committed to opening up their systems and allowing users to fully use what they have purchased. Brilliant!
Oh, but then there are still situations which make you wonder. Like the stealthy Apple OS-X update that kept “fanbois strangely silent“… I’m not sure I would have described Apple’d products as a “mutant virus“, but their loyal customers’ thinking probably is. But then, Apple build fashion statements, not computers.
Open systems continue to gather pace
There’s an interesting article at O’Reilly on debunking the 1% myth. The 1% myth is the idea, forever purported by some in the industry, that Linux only has 1% of desktop market share. Succinctly put, as there is no way of actually measuring this accurately, it’s a false claim (as the article details).
Talking of open software, media player Amarok is looking more and more beautiful. What’s not to like about this, especially when it’s free?
I think it may be a good idea to start calling this “Fortnightly [p]review”…
Last week
This week
Work
Life
Misc
In the fast lane for the past fortnight, hence no preview/review last week.
Last week
Work
Life
Misc
This week
Work
Life
Misc
An absolutely fantastic weekend really gives you renewed strength for the week ahead. This is a busy week outside of work, though, so a refined set of objectives is the order of the day.
Work
Life
Misc
My “Get real! :-)” week was pretty good. Lots achieved.
Work
Unplanned extras
Life
Misc
My life doesn’t revolve around the television. I don’t watch any terrestrial broadcasts. I am especially uninterested in “prime”-time offerings (e.g. soaps). Ugh. Instead…
This week
It’s a sea-change. Day off planned, plus lots of stuff happening outside of work mean I’m taking a break from planning anything at all. A number of loose ends to tie up and various new ideas to ponder mean I’ll still be busy thinking all week. 🙂
“Hindsight is a beautiful thing”, I was recently reminded. With hindsight, last week wasn’t the super-catch-up exercise I’d hoped. But, instead, it was a good week for new ideas (all captured, naturally).
Last week:
Get back on track!
Work
Life
Misc
Would like to see more:
This week:
Get real! 🙂
Work
Life
Misc
My life doesn’t revolve around the television. I don’t watch any terrestrial broadcasts. I am especially uninterested in “prime”-time offerings (e.g. soaps). Ugh. Instead…