<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Where Did My Brain Go? &#187; Aardvark</title>
	<atom:link href="http://wheredidmybraingo.com/tag/aardvark/feed/" rel="self" type="application/rss+xml" />
	<link>http://wheredidmybraingo.com</link>
	<description>Mitch Miller’s Web</description>
	<lastBuildDate>Sun, 22 Jan 2012 03:14:06 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>How To Ask Software Question on Aardvark</title>
		<link>http://wheredidmybraingo.com/how-to-ask-software-question-on-aardvark/</link>
		<comments>http://wheredidmybraingo.com/how-to-ask-software-question-on-aardvark/#comments</comments>
		<pubDate>Sat, 26 Sep 2009 09:56:21 +0000</pubDate>
		<dc:creator>Mitch</dc:creator>
				<category><![CDATA[Learning]]></category>
		<category><![CDATA[Aardvark]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Technology/Internet]]></category>

		<guid isPermaLink="false">http://wheredidmybraingo.com/?p=255</guid>
		<description><![CDATA[How to remove image tags from an HTML document with one line of code using sed, and suggestions to users who want to ask questions about programming or software on Aardvark]]></description>
			<content:encoded><![CDATA[<p><a href="http://vark.com/" title="Aardvark Homepage" rel="external"><img src="http://wheredidmybraingo.com/g2/Aardvark.png" height="28" width="128" alt="Aardvark logo for vark.com"/></a> <a href="http://vark.com/" title="Aardvark Homepage" rel="external">Aardvark</a> is a network of users who answer each others questions. <a href="http://wheredidmybraingo.com/i-am-answering-questions-on-aardvark/" title="I Am Answering Questions On Aardvark">I joined Aardvark</a> on May&nbsp;8,&nbsp;2009, and <strong>finally</strong> received my first question yesterday.</p>
<p>I am <a href="http://wheredidmybraingo.com/tag/blogging/" title="Articles on Blogging at Where Did My Brain Go?">blogging</a> about it because:</p>
<ol>
<li>question was ambiguous</li>
<li>it is common problem</li>
<li>I solved it with one line of code!</li>
</ol>
<p>In topic of &#8220;Regular Expressions,&#8220; Stephan, a fellow on the other side of the world, asked:</p>
<blockquote>
Looking for a regular expression which will remove all the <strong>&lt;img&gt;</strong> tags from a string. The string is a HTML document.
</blockquote>
<p>Stephan provided an example like this:</p>
<table summary="input to convert">
<tr><td>&lt;td&gt;&lt;img alt=&quot;&quot; src=&quot;w&quot; style=&quot;width: 20px; height: 1px;&quot;/&gt;&lt;/td&gt;</td></tr>
<tr><td>&lt;td&gt;&lt;img alt=&quot;&quot; src=&quot;x&quot; style=&quot;width: 1px; height: 1px;&quot;/&gt;&lt;/td&gt;</td></tr>
<tr><td>&lt;td&gt;&lt;img alt=&quot;&quot; src=&quot;y&quot; style=&quot;width: 20px; height: 1px;&quot;/&gt;&lt;/td&gt;</td></tr>
<tr><td>&lt;td&gt;&lt;img alt=&quot;&quot; src=&quot;z&quot; style=&quot;width: 1px; height: 1px;&quot;/&gt;&lt;/td&gt;</td></tr>
</table>
<p>Let me explain why this question is hard to answer.</p>
<h3>Regular Expressions</h3>
<p>A <a href="http://en.wikipedia.org/wiki/Regular_expression" title="Wikipedia article" rel="external">regular expression</a> is a pattern of characters,  used to search for a set of objects. A simple example is:</p>
<code>
[hds]ad
</code>
<p>This would match &#8220;had,&#8221; &#8220;dad,&#8221; &#8220;sad.&#8221; Regular expressions, are common, but they are implemented differently everywhere. For example, my favorite text editor, <a href="http://vim.org/" title="Vim is my favorite text editor" rel="external">Vim</a>, which I have been using for over a dozen years, provides additional features, using a special syntax. I would have used Vim if I was doing this for myself. This simple example should work on all implementations of regular expressions. However, advanced features are implemented differently by other products, and programming languages.</p>
<p>For example, I never learned <a href="http://en.wikipedia.org/wiki/Perl" rel="external" title="Wikipedia article">Perl</a> programming language, which includes <a href="http://en.wikipedia.org/wiki/Perl_Compatible_Regular_Expressions" rel="external" title="Wikipedia article">Perl Compatible Regular Expressions</a>. So remember to be specific if you ask someone a question about regular expressions, or <strong>anything</strong> related to programming.</p>
<h3>Operating Systems</h3>
<p>Operating systems which are derived from Unix, such as <a href="http://novell.com/linux/desktop/" title="I use Novell Linux Desktop" rel="external">Linux</a>, or <a href="http://www.apple.com/macosx/" title="Apple Computer Operating System since 1992" rel="external">Mac OS/X</a> include advanced text utilities, which are not packaged with <a href="http://wheredidmybraingo.com/wiping-out-windows/" title="Wiping Out Windows">Microsoft Windows</a>. Although <a href="http://en.wikipedia.org/wiki/Windows_Vista" rel="external" title="Wikipedia article">Vista</a> was installed on my <a href="http://shop.lenovo.com/SEUILibrary/controller/e/webca/LenovoPortal/en_CA/catalog.workflow:category.details?current-catalog-id=12F0696583E04D86B9B79B0FEC01C087&amp;current-category-id=EA9FF8465DFE45ED847C7CAF8F79F973" title="description of Thinkpad T400 models" rel="external">latest Thinkpad</a>, I only tried it for ten minutes, before <a href="http://en.wikipedia.org/wiki/Criticism_of_Windows_Vista" title="Criticism of Windows Vista" rel="external">giving up</a>, and installing Linux.</p>
<h3>What Is Wrong With Aardvark?</h3>
<p>I would not have responded if I was asked &#8220;how to remove images from html file on Windows&#8221; &#8211; &#8220;how to remove images from html file with Perl&#8221; &#8211; or many other possibilities. Aardvark needs better instructions, so users can ask, and respond, to questions more efficiently.</p>
<p>Assumptions are often wrong, but I really wanted to answer my first question, so I assumed that Stephan was not using <a href="http://wheredidmybraingo.com/1995/windows/" title="Nessa Explains Windows">Microsoft Windows</a>, and provided a response which should work on any Unix-type system.</p>
<h3>How To Remove Images From HTML on Linux, or Mac OS/X</h3>
<p>Unix based systems include <a href="http://sed.sourceforge.net/grabbag/tutorials/" title="sed tutorials" rel="external">sed</a> or &#8220;stream editor.&#8221; This is description from sed manual page on my favorite computer:</p>
<blockquote>
Sed is a stream editor. A stream editor is used to perform basic text transformations on an input stream (a file or input from a pipeline). While in some ways similar to an editor which permits scripted edits (such as ed), sed works by making only one pass over the input(s), and is consequently more efficient. But it is sed&#8217;s ability to filter text in a pipeline which particularly distinguishes it from other types of editors.
</blockquote> 
<p>In other words, sed is <strong>perfect</strong> tool to remove images from HTML files! After saving sample as &#8220;input.html&#8221; &#8211; I was able to remove images from the sample, and save it as &#8220;output.html&#8221; with this command:</p>
<code>
sed 's/&lt;img .*\/\{1\}&gt;1\}//g' input.html &gt; output.html
</code>
<p>output.html contained:</p>
<table summary="converted output">
<tr><td>&lt;td&gt;&lt;/td&gt;</td></tr>
<tr><td>&lt;td&gt;&lt;/td&gt;</td></tr>
<tr><td>&lt;td&gt;&lt;/td&gt;</td></tr>
<tr><td>&lt;td&gt;&lt;/td&gt;</td></tr>
</table>
<p><strong>Perfect!</strong> I hope I helped Stephan, but I will never know, since neither Aardvark, nor Stephan, informed me if my answer was helpful.</p>
<h3>Another One Line Program</h3>
<p>Those familiar with <a href="http://w3.org/html/" title="definitive source of HTML information" rel="external">HTML</a>, know that certain characters, like <strong>&lt;</strong> and <strong>&gt;</strong> must be encoded as &#8220;entities&#8221; &#8211; e.g., <strong>&amp;lt;</strong> and <strong>&amp;gt;</strong>. So I wrote another one liner, in <a href="http://php.net" title="Personal Hypertext Processor is popular programming language" rel="external">PHP</a>, for this article:</p>
<code>
&lt;?php echo htmlspecialchars(file_get_contents($argv[1])); ?&gt;
</code>
<p>I saved that line as &#8220;html2text.php&#8221; and entered:</p>
<code>
php -f html2text input.html
</code>
<p>Then I copied and pasted results into this article.</p>
<p>Now you know <strong>how to remove images from HTML</strong>, and also <strong>how to convert HTML to include in your Web pages</strong>, with just two lines of code!</p>
<p><strong>NOTE:</strong> I like my one liner, but you can make it easier to use, by adding a second line, and converting it to a &#8220;shell script.&#8221; See <strong>Example #1</strong> on <a href="http://www.php.net/manual/en/features.commandline.php" title="comprehensive info on using PHP from command line" rel="external">Using PHP from the command line</a> for more information.</p>
<h3>Calling Aardvark!</h3>
<p>Aardvark, which is running a computer-based business, should understand the differences between applications, and operating systems. I sent them a link to this article, and I hope they use my suggestions, to improve their innovative service.</p>
]]></content:encoded>
			<wfw:commentRss>http://wheredidmybraingo.com/how-to-ask-software-question-on-aardvark/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>I Am Answering Questions On Aardvark</title>
		<link>http://wheredidmybraingo.com/i-am-answering-questions-on-aardvark/</link>
		<comments>http://wheredidmybraingo.com/i-am-answering-questions-on-aardvark/#comments</comments>
		<pubDate>Sat, 09 May 2009 03:59:18 +0000</pubDate>
		<dc:creator>Mitch</dc:creator>
				<category><![CDATA[Learning]]></category>
		<category><![CDATA[Aardvark]]></category>
		<category><![CDATA[Human Interest]]></category>
		<category><![CDATA[Paul Stewart]]></category>
		<category><![CDATA[Twitter]]></category>

		<guid isPermaLink="false">http://wheredidmybraingo.com/?p=201</guid>
		<description><![CDATA[Ask me questions about HTML, Java, and Web programming on Aardvark, an innovative service.]]></description>
			<content:encoded><![CDATA[<p><a href="http://vark.com/" title="Aardvark Homepage"><img src="http://wheredidmybraingo.com/g2/Aardvark.png" height="28" width="128" alt="Aardvark logo for vark.com"/></a> I have joined <a href="http://vark.com/" title="homepage">Aardvark</a>, thanks to an invitation from <a href="https://twitter.com/arckinteractive" title="follow Paul Stewart on Twitter">Paul Stewart</a> of <a href="http://arckinteractive.com/" title="Chicago Web Development">arck interactive</a>, which I received on <a href="http://twitter.com/Mitchell_Miller" title="follow me on Twitter">Twitter</a>. Aardvark is cool!</p>
<h3>What Is Aardvark?</h3>
<p>Aardvark is a network of users who answer each others questions. It opened to the public in <a href="http://en.wikipedia.org/wiki/Aardvark_(search_engine)" title="Wikipedia article">March 2009</a>, but new users must be invited to join by existing users.</p>
<p>Users register as &ldquo;experts&rdquo; on at least three subjects. For example, I selected:</p>
<ol>
<li><a href="http://www.w3.org/html/" title="HTML is the publishing language of the World Wide Web">HTML</a></li>
<li><a href="http://java.sun.com/javase/" title="Java: standard edition">Java SE</a></li>
<li><a href="http://verybestpages.com/" title="Hire me to work on your Web site">Web Programming</a></li>
</ol>
<p>Basically, someone sends a question about HTML to Aardvark, which eventually gets routed to me. Then Aardvark emails me the question, asking if I want to answer it.</p>
<p>Of course, there are <strong>many</strong> more options. I can limit questions to &ldquo;friends&rdquo; or members of groups. I can also receive questions by IM and chat services. iPhones will be supported soon.</p>
<h3>Does It Work?</h3>
<p>I don&#39;t know yet, because I have not sent or received any questions! I think I need to register for more subjects. I am also used to asking questions on <a href="http://wordpress.org/support/topic/267358" title="how to display text from functions.php">Web forums</a>, however I will try to ask my next question on Aardvark.</p>
<p>Aardvark is a brilliant idea. I will report back on it, when I have more experience using this innovative service.</p>]]></content:encoded>
			<wfw:commentRss>http://wheredidmybraingo.com/i-am-answering-questions-on-aardvark/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

