Archive

Archive for the ‘Technical Blogging’ Category

Hackers vs audiophiles: which headphone do they prefer?

August 12, 2012 Leave a comment

Hackers vs audiophiles: which headphone do they prefer?.

Headphones for Hackers

- Anonymous Hacker

Headphones are ingrained in startup culture. If you visit a startup office, more often than not, it seems like everyone is wearing headphones. The same workplace norm doesn’t appear to exist at law firms, medical practices or anywhere else really.

A hacker needs to concentrate without interruption for long periods of time and yet has almost no quiet personal space at work. A pair of headphones is a great solution to the contradiction inherent in this situation.

Beyond the practicalities, hackers seem to be personally invested in their choice of headphones. Headphones are a tool of the trade, and like many craftsmen, programmers like to talk about their tools (what other professions could have lively debates about Text Editors?). Ask a programmer about his headphones and you’re likely receive a more detailed response than you care to hear.

At Priceonomics we became curious about what types of headphones programmers actually … (Read more here)

WordPress Blog not posting to Facebook « WordPress.com Forums

August 11, 2012 Leave a comment

Blog not posting to Facebook « WordPress.com Forums.

Blog not posting to Facebook

  1. Blog not posting to facebook. I’ve gone through the process of disconnecting, removing the Facebook app, and reconnecting, but it’s still not auto-posting to my fanpage. Is there anything else you would recommend to get this to work?
    Blog url: http://robertreviewsstuff.wordpress.com/

  2. I’m having the same problem. Worked a couple of times when I first set it up, hasn’t worked since.

  3. Aside from reconnecting I have no solutions to offer you.
    http://en.support.wordpress.com/publicize/#reconnecting-facebook

    I can suggest two alternatives. You can use Networked Blogshttp://www.networkedblogs.com/ or RSS Grafitti http://www.facebook.com/RSS.Graffitifor posting to Facebook walls if you prefer. RSS Graffiti periodically checks the RSS/Atom feeds that you specify and posts any new entries it finds to the Facebook Walls that you specify. You can get any feed written on any wall (Facebook Profiles, Fan Pages, Groups, Events and Application Profile Pages). In fact, multiple feeds to multiple walls. You choose the combination.

Facebook Obsoletes Less Than Year-Old Facebook Application Development For Dummies Book!

Facebook Obsoletes Less Than Year-Old Facebook Application Development For Dummies Book!

2012.04.17

Just a quick rant here.  In what must be some kind of record, Facebook has pretty much made obsolete the book Facebook Application Development For Dummies (Wiley, by Jesse Stay), which I purchased about 7 months ago (August 2011 — only 3 months after it was released!).

Most of my other programming books (mostly O’Reilly, Head First, Head Rush, etc.) are good for at least 5 years before they are useless.  But in this case, Facebook has redesigned their developer portal so much that where once there was a canvas page and canvas url, now only the canvas url is present.  Not only that, when you hover over secure canvas url it says that a secure canvas url is required by October 2011 (Oops! — That deadline has passed).

Such is the developer’s roadmap of progress.  I want to look at this with an open mind, and as such I’ll take this as an opportunity to look for more recent online Facebook Application Development tutorials.  I found one on Facebook’s developer site here.  I’ll try to follow that but right now my ass hurts from hemorrhoids and sitting in an uncomfortable chair too long (an upcoming article will aggregate reviews of several task chairs, ergo and otherwise — WATCH FOR IT!) so I’m retiring for the moment.

Until next time …

- CodeSlayer2010

Zemanta Puts Unwanted HTML Comments In Pre-Formatted PHP Code (Sourcecode) In WordPress Posts

April 9, 2012 4 comments

PROBLEM:

I  have recently determined through trial and error and process of elimination that Zemanta is responsible for adding extraneous HTML comments to my pre-formatted (with “pre” tags) PHP code that I have placed between “sourcecode” tags to activate WordPress.com’s built in programming code syntax highlighting.

Here is a screenshot (fig 1.) that demonstrates the problem:

codeslayer2010 blog with zemanta extraneous html comment errors

fig. 1

See, all that green is what commented my code out and made it so it doesn’t display correctly.

I am not totally sure Zemanta is to blame, but it seems the most likely culprit.  Here’s why:

  1. Identified 3 possible suspects: Zemanta, WordPress.com proofreading, and pasting pre-formatted code in Visual view instead of HTML view.
  2. Disabled Zemanta and retested -  problem remained.
  3. With Zemanta disabled, disabled proofreading as well.  No change.
  4. With Zemanta and proofreading disabled, went Edit>HTML View.  In each instance where I had posted code, deleted all the code from in between “sourcecode” tags.
  5. Re-copied and pasted code from each original PHP file.  Re-tested: Worked!  Syntax highlighting works properly now.  Made multiple edits to both code and text, updated and viewed the post — Good to go every time.
  6. Re-enabled Zemanta, made a test edit, saved and previewed the new post.  Everything is messed up again!  This is why I think Zemanta is the issue.

SOLUTION:

The solution I have come up with is this.

  1. If you want to use Zemanta, do so before adding any preformatted code or sourcecode tags.  Always turn Zemanta off when you are done using it.
  2. DO NOT, (under any circumstances) have Zemanta enabled if you have preformatted PHP code in your blog.  Chances are, Zemanta will mess your code up and you will have to re-paste your code again.  During my tests, I have had to paste all my sourcecode from scratch 3 times and let me tell you — it gets very tedious and wastes valueable time.
  3. Always paste sourcecode in HTML view only.

These are my recommendations based on my personal experience with this issue.  I’d love to hear from anyone else who is having similar issues.  Please let me know if this solution worked for you!

- CodeSlayer2010

Why you Should Tweet your Post Multiple Times?

Powershell – Executing commands which require quotes and variables is practically impossible!

March 30, 2012 4 comments


Executing commands which require quotes and variables is practically impossible: Microsoft Connect

This is an interesting forum thread about what I’ve spent the last 2 hours researching:  How to properly quote commands with parameters and interpolated paths so that they will execute as a command.  Doesn’t seem like it should be so hard.  Here is an example of the code I’m working with:

The command I’m trying to run:

C:\Program Files\Mozilla Firefox\firefox.exe -createprofile myTest

# Here is what works in MS-Dos / Windows XP command prompt:

"C:\Program Files\Mozilla Firefox\firefox.exe" -CreateProfile myTest

However, run the same thing in powershell and this is what you get:


PS C:\Documents and Settings\nunya> “C:\Program Files\Mozilla Firefox\firefox.exe” -CreatProfile myTest
You must provide a value expression on the right-hand side of the ‘-’ operator.
At line:1 char:48Unexpected token ‘CreatProfile’ in expression or statement.
At line:1 char:49Unexpected token ‘myTest’ in expression or statement.
At line:1 char:62

Building a new computer | V TECHblogs

UPDATE:

Only a few months since I last posted this and the hosting domain seems to be gone.  It would be a shame to remove this post, so I’m updating it with some related photos of neon home-build PC mods.  I hope you enjoy these excellent works of art & function.

(The original article was posted here: Building a new computer | V TECHblogs. I’m leaving this link in case it ever comes back on line)

Build Your Own Computer (2012) - Sick Neon Cutaway Home System

Build Your Own Computer (2012) – Sick Neon Cutaway Home System

head1 head2 head3
pics pics
pics pics
pics pics

Lynda.com PHP MySQL WAMP Project: Widget Corp – Progress Update – 2012.02.07

February 8, 2012 2 comments

Widget Corp tutorial progress (2012.02.07 - 1)

Hello folks.  I’ve been doing a Lynda.com tutorial called PHP With MySQL Essential Training.  I’ve actually been doing aboutg 2-8 hours per week of the multiple, sequential lessons that are involved in this excellent hands-on tutorial for about a month now.

At this point, I have completed all the basic PHP and MySQL material, and now in Chapter 13, I am creating a content management system from scratch.  I enjoy doing this video tutorial very much, though at times I have to pause to screen for 10 minutes or so to type in code manually from what’s on the screen.  When you subscribe to Lynda.com (around $30/mo) they have subscription options that provide you the example files to save you all the typing.  But, I firmly believe that, at least for me, as a relative newbie who is trying to understand all the mechanics of web application development with PHP & MySQL, the absolute best way to learn is to type everything manually.  In this way you basically link the code concepts together in your mind so that you can now type in various code modules by heart if need be.Image representing lynda.com as depicted in Cr...

At work we are using a Zend MVC-based framework, so I have practical experience in maintenance coding and creating small new features — mostly break-fixes though.  But I’m like a trained monkey — I don’t really know the mechanics and the logic of why to do things, only that somebody told me “if this, then that”.

I’m sure that sufficient for some coders, but sufficient isn’t good enough for me.  My goal is EXCELLENCE!  Therefore, I ask as many questions as I think I need to (after having already done as much research as I could on my own).  There’s no shame in my game.  After I get an answer I write it down in my journal and then I have my own “reference manual” that I can consult if I forget a step or need to recall that information down the road.  I have found that having new information written down actually results in a lesser likelihood of needing to refer to it in writing, and a greater incidence of ingraining in your brain by habit. I’m really happy with my progress on this project which I will refer to from now on as “Widget Corp”.  Basically, when it is all done I will have a highly refactored, efficient, and effective code template/framework for building customized CMS‘s.  I’m pretty psyched about having an actual “web application” that I can display to the world via my website. That image above is a screenshot showing what my app looks like in Firefox 3, locally on my Win XP machine.  Future improvements I intend to look into are:

  1. Figure out why it is bulleting blank lines.  (NOTE: I tried doing echo/exit in the code but no avail so far)
  2. Refactor to be Object Oriented.
  3. Refactor to use MVC.

Anyway. that’s all stuff down the road.  My goal for completion is March31, 2012.  Wish me luck!

Until next time, HAPPY CODING! :)

CodeSlayer2010

Testing WordPress’s Code Syntax Highlighting

December 4, 2011 1 comment

(12/04/11)

TEST 1:

This example introduces a bit of test code we are calling ‘CODE SNIPPET A’. It uses the ‘sourcecode’ tag and has no language attributes or parameters.

Code Snippet A

		<form id="form1">
			<div>
				<input id="btnShowMessage" type="button" value="show message" />
				<div id="divMessage" style="background-color: yellow;">THIS IS THE MESSAGE</div>
			</div>
		</form>
	

NOTE: When you are in your dashboard editing your post you will not be able to see the syntax highlighting. Don’t freak out. Do a save and ‘preview’ and everything should be just fine.

TEST 2:

This is snippet A except now we have added the language=’html’ attribute.

	<form id="form1">
		<div>
			<input id="btnShowMessage" type="button" value="show message" />
			<div id="divMessage" style="background-color: yellow;">THIS IS THE MESSAGE</div>
		</div>
	</form>

TEST 3:

Well that’s all good for plain old html. But, what if our code is from a scripting language, such as PHP, that alternates back and forth between html and the script code? In that case, you could use something like

	1

Code Snippet B

	<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script>
		<script type="text/javascript">
		  $(document).ready(function(){
			 nameOutput = jQuery('#nameOutput');
			 nameOutput.css({'background':'yellowgreen'});
			 jQuery('body').css({
				'background':'#A66900',
				'font-family':'comic sans ms',
			 });
			 nameOutput.wrap('<span style="color:purple;">');
			 jQuery('#wrap').addClass('centered');
			 jQuery('#wrap').css({
				'background':'#F2B449',
			 })
		  });
		</script>
		<style type="text/css">
		  /****** COLORS *******
			 #A66900 // brown
		   */
		  .centered {
			margin: 0 auto;
			width: 66%;
		  }
		</style>
	<div id="wrap">
		<?php echo "Welcome to " . 'hell'; ?>
		<br />
		<?php

		  echo "<pre>";
		  print_r($_SERVER);
		  echo "</pre>";

		  $model = new stdClass();
		  $model->smurf = 'Papa';
		  echo "my smurf = " . $model->smurf;

		  $model->_name = isset($_POST['userName']) ? $_POST['userName'] : '[not defined!]';
		  echo "<pre>";
		  print_r($model);
		  echo "</pre>";
		?>
		<H1>THIS PAGE IS CURRENTLY UNDER CONSTRUCTION AND TESTING</H1>

		<form id="main" action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
		<input type="text" name="userName" value="Enter Your Name" />
		<input type="submit" name="submit" />

		<div id="nameOutput" name="nameOutput">
		  <?php if(isset($_POST['userName'])) echo stripslashes($_POST['userName']); ?>

		</div>
	<div id="content"></div>
	</div>
	
Follow

Get every new post delivered to your Inbox.

Join 476 other followers