<?xml version="1.0" encoding="ISO-8859-1"?>

<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/">
	<channel>
		<title>LinuxQuestions.org - Blogs</title>
		<link>http://www.linuxquestions.org/questions/blog.php</link>
		<description>LinuxQuestions.org offers a free Linux forum where Linux newbies can ask questions and Linux experts can offer advice. Topics include security, installation, networking and much more.</description>
		<language>en</language>
		<lastBuildDate>Sun, 27 May 2012 18:16:47 GMT</lastBuildDate>
		<generator>vBulletin</generator>
		<ttl>60</ttl>
		<image>
			<url>http://lqcdn.thequestionsnetwork.net/questions/images/misc/rss.jpg</url>
			<title>LinuxQuestions.org - Blogs</title>
			<link>http://www.linuxquestions.org/questions/blog.php</link>
		</image>
		<item>
			<title>Wheezy Memory Leaks</title>
			<link>http://www.linuxquestions.org/questions/blog.php?b=34782</link>
			<pubDate>Sun, 27 May 2012 12:35:30 GMT</pubDate>
			<description><![CDATA[I had excess memory usage. seems to be I'm hit by some memory leak caused by tracker, see http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=612242 
...]]></description>
			<content:encoded><![CDATA[<div>I had excess memory usage. seems to be I'm hit by some memory leak caused by tracker, see <a href="http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=612242" target="_blank">http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=612242</a><br />
<br />
This solved it for now:<br />
[REMOVE] tracker-extract:amd64<br />
[REMOVE] tracker-gui:amd64<br />
[REMOVE] tracker-miner-fs:amd64<br />
[REMOVE] tracker-utils:amd64</div>

]]></content:encoded>
			<dc:creator>jere21</dc:creator>
			<guid isPermaLink="true">http://www.linuxquestions.org/questions/blog.php?b=34782</guid>
		</item>
		<item>
			<title>Running a Genetic Algorithm on an Amazon EC2 Cluster</title>
			<link>http://www.linuxquestions.org/questions/blog.php?b=34781</link>
			<pubDate>Sat, 26 May 2012 21:22:16 GMT</pubDate>
			<description><![CDATA[Running a Genetic Algorithm on an Amazon EC2 Cluster 
 
I've started working on a simple tool to run genetic algorithms on a Linux cluster. I'm using...]]></description>
			<content:encoded><![CDATA[<div>Running a Genetic Algorithm on an Amazon EC2 Cluster<br />
<br />
I've started working on a simple tool to run genetic algorithms on a Linux cluster. I'm using MIT's StarCluster utility to create an on-demand Linux cluster on Amazon's EC2 cloud computing service. Using this as a starting point it should be pretty easy to deploy as much computing power as I want (budget permitting).<br />
<br />
Step one was Amazon Web Services (<a href="http://aws.amazon.com/" target="_blank">http://aws.amazon.com/</a>) sign up. I already had a normal Amazon account, so I used the same email and password during the signup. This requires a credit card, email account verification and a confirmation code sent to you by phone. It's a pay-as-you go service, with some basics available free for the first year, so I felt comfortable to sign up - no big commitment is required. (Naturally, if you deploy a massive cluster for days at a time, your credit card will be charged accordingly).<br />
<br />
Next I installed StarCluster (<a href="http://web.mit.edu/star/cluster/" target="_blank">http://web.mit.edu/star/cluster/</a>) on my Linux laptop, using the recommended Python Package Index method (since python was already installed, this was literally just: &quot;sudo easy_install StarCluster&quot; from the terminal). I found the quick start guide to be pretty good, and the how-to video also very useful.<br />
<br />
StarCluster needs to have your Amazon login credentials written into its config file in order to log into EC2 and run commands for you. After you've signed up to AWS Amazon creates most of the log in credentials for you, which you can find under My Account -&gt; Security Credentials. You'll need the Access Key Id and Secret Access Key (in the Access Credentials section) and your Canonical User ID (under the Account Identifiers section).<br />
<br />
You'll also need to create an Amazon EC2 Key Pair (not to be confused with an Amazon CloudFront Key Pair, in the same section), which can be done in the Access Credentials section. I ran a StarCluster command which tried to create a key pair for me and upload the public key to AWS, but after running the command AWS did not have the public key in its system. I therefore created a key pair on the AWS web interface, and downloaded the private key to my computer. For security purposes it's probably a good idea to store the private key and the starcluster config file with all your login details with the file access permissions set to allow only your user to read them (eg &quot;chmod go-wx private-key-filename config-filename&quot;). And do keep all of the login info safe, otherwise someone could log in and use a lot of expensive cloud services on your account.<br />
<br />
Having worked through the StarCluster quick start guide I was able to create a small, two node cluster. Next I'll explain how I'm going to use a genetic algorithm on the cluster.<br />
<br />
A genetic algorithm (GA) is an optimisation algorithm inspired by Darwinian evolution. My aim is to produce neural networks able to perform certain tasks. To do this using a GA we imagine a kind of artificial DNA, called a genotype, which is simply a list of numbers defining all the properties of a neural network. The details are not important for understanding how the cluster will function, so I will skip over most of it here. The GA begins with a population of multiple genotypes containing random numbers. For each genotype a neural network is created and simulated to see how well it solves the task, and a score, called the fitness, is assigned to the genotype. Once all genotypes have been given a fitness the GA produces new genotypes, by copying the genotypes with the highest fitness and in addition applying some small random changes to the numbers. To make room in the population for the new genotypes the worst genotypes are deleted. Therefore, over time, by trial and error, the GA discovers better and better solutions to the task.<br />
<br />
A key feature of GAs is that each genotype can have its fitness evaluated independently, and therefore one way to parallelise a GA is to send fitness evaluation jobs out to each node in a cluster, and have the GA running on the master node managing the population as a whole. However, if it only takes a few seconds to evaluate each genotype and the time taken to assign each job to a node is also on the order of a few seconds, the cluster will waste a lot of time assigning and migrating jobs.<br />
<br />
There is an alternative approach. Instead of having one population using the whole cluster, we can have a separate population running on each node, and occasionally migrate genotypes between nodes somehow, creating a meta-population. Then we can have all the nodes running evaluations virtually all of the time, with a small migration overhead.<br />
<br />
To test the program on a small scale I'll start with one population running on my laptop. To deploy on the cluster I'll write a second, master program to launch populations on each of the nodes. To implement migration I'll simply have the populations quit after, say, ten minutes, and save the best few genotypes to a file. Whenever the master program detects that the queue of pending jobs is low it launches a new population, and seeds it with several genotypes from the most recently created files. As long as more than one file is given to each new population genotypes will be able to spread through the meta-population.<br />
<br />
The aim is to have the basic evolver program not care whether it is running by itself, or on the cluster. It just runs until I hit Ctrl-C or until the time limit is reached, and then it saves the best genotypes to a file. StarCluster takes care of making this output available on the master node. The master program only has to know about passing the correct file names to the new jobs it creates - it doesn't know anything about GAs or neural networks etc, nor does it care what language the basic evolver program is written in. Hopefully it will be useful for a wide range of GA applications, and reasonably scalable. The StarCluster grid comes preconfigured with Sun Grid Engine, therefore it is simple to hand out jobs to the cluster nodes.<br />
<br />
I will aim to post about my initial testing soon... Feel free to comment below if you have any interest or advice about this project.</div>

]]></content:encoded>
			<dc:creator>robertvi</dc:creator>
			<guid isPermaLink="true">http://www.linuxquestions.org/questions/blog.php?b=34781</guid>
		</item>
		<item>
			<title>New mc2 and new-make versions.</title>
			<link>http://www.linuxquestions.org/questions/blog.php?b=34780</link>
			<pubDate>Sat, 26 May 2012 09:27:05 GMT</pubDate>
			<description><![CDATA[This could clobber any modifications you may have made to the templates, so back up what you have if you 'mc2 save'ed to any of the same filenames. 
...]]></description>
			<content:encoded><![CDATA[<div>This could clobber any modifications you may have made to the templates, so back up what you have if you 'mc2 save'ed to any of the same filenames.<br />
<br />
mc2 2.0.11<ul><li>Corrected CFLAGS for -fPIC in dyn-32 template</li>
<li>Removed redundant 'update' target in same.</li>
</ul><a href="http://www.linuxquestions.org/questions/blog/rainbowsally-615861/liblq-and-mc2-makefile-creator2-the-next-generation-34648/">http://www.linuxquestions.org/questi...eration-34648/</a><br />
<br />
There are a few more tweeks to be done in the mc2 templates but they are very low priority at this time.<br />
<br />
new-make<br />
1.0.12 <ul><li>Corrected code to force (no error message) for rmdir command in the makefile's uninstall target</li>
<li>Corrected stderr redirect for error messages in mktools set-perms</li>
<li>Removed set-perms calls from sandbox installer fileset -- (such as the Makefile for the installer itself).</li>
<li>Added missing quote in make-installer target and changed /tmp to ~/tmp to assure read/write/exec perms for the current user in case it's a sandboxed installation.</li>
</ul><br />
<a href="http://www.linuxquestions.org/questions/blog/rainbowsally-615861/tying-up-loose-ends-the-make-based-package-installer-uninstaller-34641/">http://www.linuxquestions.org/questi...staller-34641/</a><br />
<br />
I had a bit of version confusion going on in my system for a while, which does a pretty good job of scrambling good and bad code, but that affects mostly fairly advanced features you probably never used.<br />
<br />
There's still a bit of stuff to iron out (more sensible error messages as context changes, a better single-pass uninstaller creator, etc., but new-make is now quite usable, and depending on your PREFIX, quite safe as well.)</div>

]]></content:encoded>
			<dc:creator>rainbowsally</dc:creator>
			<guid isPermaLink="true">http://www.linuxquestions.org/questions/blog.php?b=34780</guid>
		</item>
		<item>
			<title>Precompiled cint dlls for linux (ix86) here</title>
			<link>http://www.linuxquestions.org/questions/blog.php?b=34779</link>
			<pubDate>Sat, 26 May 2012 08:49:10 GMT</pubDate>
			<description><![CDATA[These go into  
 
Code: 
--------- 
/usr/local/share/cint/cint/include 
--------- 
by default. 
 
If you have relocated your cint installation, I'm...]]></description>
			<content:encoded><![CDATA[<div>These go into <br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<pre class="bbcodeblock" dir="ltr" style="
		margin: 0px;
		margin-right: -99999px;
		padding: 3px;
		border: 1px inset;
		width: 98%;
		height: 34px;
		text-align: left;
		overflow: auto">/usr/local/share/cint/cint/include</pre>
</div>by default.<br />
<br />
If you have relocated your cint installation, I'm not sure they'll work.<br />
<br />
Also I haven't gotten the gl stuff working yet, but if you've had trouble getting these to compile, here's what we have.<br />
<br />
They are named '*.dll' but they are linux ELF binaries, and they go into the include folder with the header files so that cint can find them.<br />
<br />
<a href="http://rainbowsally.net/pub/lq/CINTSYSDIR-cint-include-dlls.tar.gz" target="_blank">http://rainbowsally.net/pub/lq/CINTS...de-dlls.tar.gz</a><br />
<br />
For this installation location, <br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<pre class="bbcodeblock" dir="ltr" style="
		margin: 0px;
		margin-right: -99999px;
		padding: 3px;
		border: 1px inset;
		width: 98%;
		height: 34px;
		text-align: left;
		overflow: auto">export CINTSYSDIR=/usr/local/share/cint</pre>
</div>in ~/.bashrc or whatever you have for your shell's startup script.</div>

]]></content:encoded>
			<dc:creator>rainbowsally</dc:creator>
			<guid isPermaLink="true">http://www.linuxquestions.org/questions/blog.php?b=34779</guid>
		</item>
		<item>
			<title>Why does my answering machine want to know what year it is?</title>
			<link>http://www.linuxquestions.org/questions/blog.php?b=34778</link>
			<pubDate>Fri, 25 May 2012 19:52:43 GMT</pubDate>
			<description><![CDATA[This is completely off topic, but I've been wondering about it for a while. The last few times I have bought an answering machine, it wants me to set...]]></description>
			<content:encoded><![CDATA[<div>This is completely off topic, but I've been wondering about it for a while. The last few times I have bought an answering machine, it wants me to set the date so it can announce the day and time when the call was received, a very helpful feature. Then it wants to know the year. So it knows the day of the week, hour, minute, and year. Why does it want to know the year? I mean, if it knew the date and month, then it could do useful things like adjusting for daylight savings time. But as it is, it has no idea when daylight savings time starts or ends or when the year ends or anything. Is it there so if I forget whether I received that message on Friday 2009 or Friday 2010 I'll have a helpful reminder? Since the machine only keeps 16 messages, that seems pointless.<br />
<br />
So I'm serious, if anyone knows the logic behind this, I'd love to know. If it were only one answering machine, I would just assume it was poor programming, or some chip had room to store one more int16 so why not or something, but I have noticed this at least 3 times in the last 6-7 years.</div>

]]></content:encoded>
			<dc:creator>drask</dc:creator>
			<guid isPermaLink="true">http://www.linuxquestions.org/questions/blog.php?b=34778</guid>
		</item>
		<item>
			<title>automated network settings for a laptop</title>
			<link>http://www.linuxquestions.org/questions/blog.php?b=34777</link>
			<pubDate>Thu, 24 May 2012 11:09:33 GMT</pubDate>
			<description>Sometimes when a laptop is used on multiple networks (such as work and home), there are different network settings to be configured (particularly if...</description>
			<content:encoded><![CDATA[<div>Sometimes when a laptop is used on multiple networks (such as work and home), there are different network settings to be configured (particularly if static settings are required).<br />
<br />
The <a href="http://guessnet.alioth.debian.org/" target="_blank">guessnet</a> package can be used to augment <i>ifupdown</i> for this purpose; <i>guessnet</i> allows automated tests to be run when the network interface is initializing (such as testing the router mac address) as a way of choosing a configuration.<br />
<br />
An example would be mapping <i>eth0</i> to a static network setting if a particular router is seen, otherwise defaulting to dhcp. This would be set up in <i>/etc/network/interfaces</i>:<br />
<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<pre class="bbcodeblock" dir="ltr" style="
		margin: 0px;
		margin-right: -99999px;
		padding: 3px;
		border: 1px inset;
		width: 98%;
		height: 194px;
		text-align: left;
		overflow: auto">mapping eth0
   script guessnet-ifupdown
   map default: default
   map timeout: 10
   map verbose: true
   map autofilter: true
iface eth0-home inet static
   test peer address <i>router-IP</i> mac <i>router-MAC</i> source <i>own-IP</i>
   <i>static network settings</i>
   ...
iface default inet dhcp</pre>
</div>The <i>default</i> mapping indicates the fallback configuration should the other configuration tests fail. The <i>autofilter</i> selects test stanzas that begin with the name of the interface being configured; there can be multiple tested configurations, which are tested concurrently.</div>

]]></content:encoded>
			<dc:creator>neonsignal</dc:creator>
			<guid isPermaLink="true">http://www.linuxquestions.org/questions/blog.php?b=34777</guid>
		</item>
		<item>
			<title>Mageia 2 is now available</title>
			<link>http://www.linuxquestions.org/questions/blog.php?b=34776</link>
			<pubDate>Wed, 23 May 2012 06:48:22 GMT</pubDate>
			<description>Mageia 2 is now available 
the most glorious of all Linux distributions is now at version 2 
 
version 1 users will find the new upgrade at...</description>
			<content:encoded><![CDATA[<div>Mageia 2 is now available<br />
the most glorious of all Linux distributions is now at version 2<br />
<br />
version 1 users will find the new upgrade at<br />
<a href="http://www.mageia.org/en/" target="_blank">http://www.mageia.org/en/</a><br />
<br />
People who are destined for greatness will love Mageia<br />
People who want vitality and fullness of life<br />
People who want computing at the leading edge<br />
will all love Mageia<br />
<br />
like the smoothest of whiskey<br />
the finest of wines<br />
the fastest sleekest coolest of sports cars <br />
is our beloved, most glorious Mageia<br />
<br />
all you other peons and losers can use ubuntu or windows</div>

]]></content:encoded>
			<dc:creator>floppywhopper</dc:creator>
			<guid isPermaLink="true">http://www.linuxquestions.org/questions/blog.php?b=34776</guid>
		</item>
		<item>
			<title>Why and how to use `pthread_join()`? - PThreads</title>
			<link>http://www.linuxquestions.org/questions/blog.php?b=34775</link>
			<pubDate>Wed, 23 May 2012 06:00:34 GMT</pubDate>
			<description><![CDATA[*_Join_:* 
Join is a functionality of Pthread library which allows the originating thread to wait for the completion of all its spawned thread's...]]></description>
			<content:encoded><![CDATA[<div><b><font size="3"><u>Join</u>:</font></b><br />
Join is a functionality of Pthread library which allows the originating thread to wait for the completion of all its spawned thread's tasks.<br />
<br />
Without join the originating thread would exit as soon as it completes its chores, completely ignoring the states of its spawned threads. Due to this, even if any of the spawned threads is in middle of its chore, it'll simply get aborted.<br />
<br />
<font size="3"><b><u>Problem</u>:</b></font><br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<pre class="bbcodeblock" dir="ltr" style="
		margin: 0px;
		margin-right: -99999px;
		padding: 3px;
		border: 1px inset;
		width: 98%;
		height: 498px;
		text-align: left;
		overflow: auto"><font size="2"><font face="Verdana">#include &lt;pthread.h&gt;
#include &lt;iostream&gt;

<font color="YellowGreen"><b>/* Declaration of the function which will serve as an argument function for all the threads.*/</b></font>
<b>void*</b> functionA (<b>void*</b>);

<b><font color="YellowGreen">/* Declaration of the global variable which will get incremented by each of the threads in the common function `functionA`.*/</font></b>
int counter = 0;

<b><font color="YellowGreen">/* Declaration and initialization of the mutex variable which will protect the shared global variable `counter`.*/</font></b>
<b><i>pthread_mutex_t</i></b> mutexA = <b><i>PTHREAD_MUTEX_INITIALIZER</i></b>;

int main ()
{
	<b><font color="YellowGreen">/* Declaring an array for 10 threads.*/</font></b>
	<b><i>pthread_t</i></b> thread_id [10];

	<font color="YellowGreen"><b>/* Creating 10 threads with default attributes and the common function namely `functionA` for execution.*/</b></font>
	<b>for</b> (int i = 0; i &lt; 10; i++)
	{
		<b><i>pthread_create</i></b> (&amp;thread_id [i], NULL, functionA, NULL);
	}

	std :: cout &lt;&lt; &quot;Final counter value: &quot; &lt;&lt; counter &lt;&lt; &quot;\n&quot;;
	return 0;
}

<b>void* </b>functionA (<b>void</b><b>*</b> arg)
{
	<b><font color="YellowGreen">/* `pthread_self ()` prints the thread ID of the currently calling thread.*/</font></b>
	std :: cout &lt;&lt; &quot;Thread number: &quot; &lt;&lt; <b><i>pthread_self</i></b> () &lt;&lt; &quot;\n&quot;;
		
	<b><i>pthread_mutex_lock</i></b> (&amp;mutexA);
	<b><font color="YellowGreen">/* Each time this function gets called, the counter is incremented by the calling thread.*/</font></b>
	counter++;
	<b><i>pthread_mutex_unlock</i></b> (&amp;mutexA);

	return 0;
} </font></font></pre>
</div><b><font size="3"><u>Output</u>:</font></b><br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<pre class="bbcodeblock" dir="ltr" style="
		margin: 0px;
		margin-right: -99999px;
		padding: 3px;
		border: 1px inset;
		width: 98%;
		height: 114px;
		text-align: left;
		overflow: auto"><font face="Verdana">anisha@linux-y3pi:~/&gt; <b>g++</b> joinA.cpp <b>-lpthread -Wall</b>
anisha@linux-y3pi:~/&gt; <b>./a.out </b>

Final counter value: 0

anisha@linux-y3pi:~/&gt;</font></pre>
</div><font size="3"><b><u>Observation</u>:</b></font><br />
The job of the thread executing the function `main ()` was to create 10 threads, print the value of the variable `counter`, and return 0. That's exactly what it did. We didn't tell it to &quot;wait&quot; for its 10 spawned threads to finish their chores! Did we? <br />
	<br />
When there are multiple threads involved, the kernel schedules all the threads giving each one of them certain time to execute based on some scheduling algorithm. If and when, the thread executing the function `main ()` gets scheduled by the kernel before the other threads, it will try to complete its chore and return in the given time! If it returns before its spawned threads, the spawned threads will get aborted. That's what has  happened here!<br />
<br />
<font size="3"><b><u>Solution</u>:</b></font><br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<pre class="bbcodeblock" dir="ltr" style="
		margin: 0px;
		margin-right: -99999px;
		padding: 3px;
		border: 1px inset;
		width: 98%;
		height: 50px;
		text-align: left;
		overflow: auto"><font face="Verdana">int <b><i>pthread_join</i></b> (pthread_t threadID,
	  	        void*     *retval);</font></pre>
</div>The argument `threadID` holds the ID of the thread to be joined.<br />
The exit status of the thread is copied in the argument `retval`. If the target thread was canceled, then `PTHREAD_CANCELED` is placed in `retval`.<br />
<br />
If multiple threads simultaneously try to join with the same thread, then the results are undefined. <br />
On success, `pthread_join()` returns 0; on error, it returns an error number.<br />
<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<pre class="bbcodeblock" dir="ltr" style="
		margin: 0px;
		margin-right: -99999px;
		padding: 3px;
		border: 1px inset;
		width: 98%;
		height: 498px;
		text-align: left;
		overflow: auto"><font face="Verdana">#include &lt;pthread.h&gt;
#include &lt;iostream&gt;

<b><font color="YellowGreen">/* Declaration of the function which will serve as an argument function for all the threads.*/</font></b>
<b>void</b><b>*</b> functionA (void*);

<font color="YellowGreen"><b>/* Declaration of the global variable which will get incremented by each of the threads in the common function `functionA`.*/</b></font>
int counter = 0;

<b><font color="YellowGreen">/* Declaration and initialization of the mutex variable which will protect the shared global variable `counter`.*/</font></b>
<b><i>pthread_mutex_t</i></b> mutexA = <b><i>PTHREAD_MUTEX_INITIALIZER</i></b>;

int main ()
{
	<b><font color="YellowGreen">/* Declaring an array for 10 threads.*/</font></b>
	<b><i>pthread_t</i></b> thread_id [10];

	<font color="YellowGreen"><b>/* Creating 10 threads with default attributes and the common function namely `functionA` for execution.*/</b></font>
	for (int i = 0; i &lt; 10; i++)
	{
		<b><i>pthread_create</i></b> (&amp;thread_id [i], NULL, functionA, NULL);
	}

	<b><font color="YellowGreen">/* Telling the main thread to wait for the task completion of all its spawned threads.*/</font></b>
	<font color="yellow"><b>for (int j = 0; j &lt; 10; j++)
	 {
		<i>pthread_join</i> (thread_id [j], NULL);
	 }</b></font>

	std :: cout &lt;&lt; &quot;\n\nFinal counter value: &quot; &lt;&lt; counter &lt;&lt; &quot;\n&quot;;
	return 0;
}

<b>void</b>* functionA (<b>void</b>* arg)
{
	<b><font color="YellowGreen">/* `pthread_self ()` prints the thread ID of the currently calling thread.*/</font></b>
	std :: cout &lt;&lt; &quot;Thread number: &quot; &lt;&lt; <i>pthread_self</i> () &lt;&lt; &quot;\n&quot;;
		
	<b><i>pthread_mutex_lock</i></b> (&amp;mutexA);
	<b><font color="YellowGreen">/* Each time this function gets called, the counter is incremented by the calling thread.*/</font></b>
	counter++;
	<b><i>pthread_mutex_unlock</i></b> (&amp;mutexA);

	return 0;
}</font></pre>
</div><b><u><font size="3">Output</font></u>:</b><br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<pre class="bbcodeblock" dir="ltr" style="
		margin: 0px;
		margin-right: -99999px;
		padding: 3px;
		border: 1px inset;
		width: 98%;
		height: 274px;
		text-align: left;
		overflow: auto"><font face="Verdana">anisha@linux-y3pi:~/&gt; <b>g++ </b>joinB.cpp <b>-lpthread -Wall</b>
anisha@linux-y3pi:~/&gt; ./a.out 
Thread number: 140546115806992
Thread number: 140546107414288
Thread number: 140546099021584
Thread number: 140546090628880
Thread number: 140546082236176
Thread number: 140546073843472
Thread number: 140546065450768
Thread number: 140546124199696
Thread number: 140546132592400
Thread number: 140546140985104
	
Final counter value: 10
	
anisha@linux-y3pi:~/&gt;</font></pre>
</div></div>

]]></content:encoded>
			<dc:creator>Anisha Kaul</dc:creator>
			<guid isPermaLink="true">http://www.linuxquestions.org/questions/blog.php?b=34775</guid>
		</item>
		<item>
			<title>sharing files with a qemu guest: the easier way</title>
			<link>http://www.linuxquestions.org/questions/blog.php?b=34774</link>
			<pubDate>Tue, 22 May 2012 20:32:10 GMT</pubDate>
			<description>This will not be news to any true qemu guru. But for the rest of us: if you search online for information about how to share files with a qemu guest,...</description>
			<content:encoded><![CDATA[<div>This will not be news to any true qemu guru. But for the rest of us: if you search online for information about how to share files with a qemu guest, you are likely to get pointed to some deep tutorial about setting up a TUN/TAP interface involving multiple configuration files and changes to your system permissions. A simpler approach is the <b>-redir</b> option:<br />
<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<pre class="bbcodeblock" dir="ltr" style="
		margin: 0px;
		margin-right: -99999px;
		padding: 3px;
		border: 1px inset;
		width: 98%;
		height: 34px;
		text-align: left;
		overflow: auto">qemu-kvm -hda debian.img -m 512 -redir tcp:5555:22</pre>
</div>(The -m option refers to the amount of memory to allocate to the guest.)<br />
<br />
The above invocation of the redir option will cause host traffic directed to port 5555 to be redirected to port 22 on the guest VM. So, after you boot up the guest, start up an SSH daemon from within the guest, and then you can connect to the guest from the host using scp or sftp over port 5555 on localhost. In my case I use sshfs:<br />
<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<pre class="bbcodeblock" dir="ltr" style="
		margin: 0px;
		margin-right: -99999px;
		padding: 3px;
		border: 1px inset;
		width: 98%;
		height: 34px;
		text-align: left;
		overflow: auto">sshfs me@localhost:/home/me /remote/cmhoward/guests/vdebian-i386 -p 5555</pre>
</div>Where /home/me is a directory on the guest VM, and /remote/cmhoward/guests/vdebian-i386 is the place on the host where I want to mount the files.</div>

]]></content:encoded>
			<dc:creator>hydraMax</dc:creator>
			<guid isPermaLink="true">http://www.linuxquestions.org/questions/blog.php?b=34774</guid>
		</item>
		<item>
			<title>Have fun when play friv games on 5ire system</title>
			<link>http://www.linuxquestions.org/questions/blog.php?b=34773</link>
			<pubDate>Tue, 22 May 2012 08:49:25 GMT</pubDate>
			<description>Welcome online *friv (http://friv.5ire.com/)* games lovers! Now you can play all cool and funny friv games online for free, without download them in...</description>
			<content:encoded><![CDATA[<div>Welcome online <b><a href="http://friv.5ire.com/" target="_blank">friv</a></b> games lovers! Now you can play all cool and funny friv games online for free, without download them in your computer and without long registration forms. These are great news, isn't it? You can play for free your favorite game, like lash, puzzle, adventure, action, <a href="http://friv.5ire.com/friv-4-school/" target="_blank">Friv 4 School<br />
</a> and even special games for girls.Maybe you are wondering what can you play.<br />
<br />
Try these cool and funny friv games for few minutes and laugh out loud. Danger Alliance is a basic strategy online game which pits you against an equal enemy on the opposite side of the map.The single player element will keep you going for quite a while, but I also had fun in the pass-and-play style multiplayer mode, where you take it in turns to make a move. Danger Alliance: Battles is a fun strategy game which makes its own mark thanks to the stand-out cartoon graphics style and great AI. Puzzle friv games are great for kids,because they learn new stuff while they have fun with their friends. Sprinkle is a safe game for children and subject is pretty cool: The little creatures that inhabit the planet are having a problem with meteors that set their villages on fire due to pesky Earth tourists.<br />
<br />
The player is tasked with helping the miniature fire brigade in their quest to bring peace and harmony back to their planet and stop the fires ruining all their fun. To do this, you control the wooden fire hose, which can be moved around to aim at the fire. The nozzle angle is adjustable and the whole contraption can be wheeled left and right or cranked up and down to get the water flowing right where it's needed.Ultimately, Sprinkle succeeds in bringing something new to the table with the excellent water physics and the cute characters. An old friv games for all ages is iSpace Retro.The concept is still to control a gun at the bottom of the screen which can move left and right as well as fire. The task is to make your way through waves of descending aliens that will fire back.<br />
<br />
What about graphically? Well as mentioned before, the game has a slightly improved feel, with cleaner cut aliens, and funky space backgrounds. Graphically, that's all you will find different. Trucks and Skulls is the perfect game for cars and races fans.The premise of the game won't surprise you; using trucks, launched from an adjustable ramp, you try to hit a set of skulls balanced on platforms.The game starts by introducing you to the various trucks on offer, each of which have different attributes. Some trucks are simply there to smash in to scenery, while others will turn into a fast-flying bomb the moment you touch them.While there are a few things the game could do better, Trucks and Skulls does offer an interesting alternative to firing birds at pigs. You can find thousands of friv games like these. All you need is an internet connection, one click and you can be the next winner! Enjoy and new bored!<br />
Source: <b><a href="http://friv.5ire.com/" target="_blank">friv games</a></b></div>

]]></content:encoded>
			<dc:creator>cutegirl36</dc:creator>
			<guid isPermaLink="true">http://www.linuxquestions.org/questions/blog.php?b=34773</guid>
		</item>
		<item>
			<title>aaargh - Windows</title>
			<link>http://www.linuxquestions.org/questions/blog.php?b=34771</link>
			<pubDate>Sat, 19 May 2012 14:32:36 GMT</pubDate>
			<description><![CDATA[Have to get this off my head. 
 
Today I've spent 4 1/2 hours on installing Windows and 35 minutes on Linux. Plus 4 hours in vain on a couple Zyxel...]]></description>
			<content:encoded><![CDATA[<div>Have to get this off my head.<br />
<br />
Today I've spent 4 1/2 hours on installing Windows and 35 minutes on Linux. Plus 4 hours in vain on a couple Zyxel USG 50 Routers setting up a VPN connection. Result = no worky!<br />
<br />
As I had this nice ACER AspireONE netbook I wanted it to run my usual flavor of Linux the Debian 6 Squeeze. So today I had some time to spend over lunch. It was a bit of fumbling until I had a bootable USB stick. Three attempts and 2 hours the other day until I tried to first format the stick using Windows and then put the unpacked content of the 1 CD-ROM .iso into the root of the stick. :doh:<br />
Also added the .iso file which turned out to be the smart move. :D<br />
Then it booted properly from the stick. Therefore today Linux installation.<br />
<br />
Worked like a charm on the ACER. No external drivers needed. Easy as it comes. 30 minutes and I was done. Then reboot and re-install Windows with the ACER recovery and setup tool into the shrunk original partition. (Wanted to have it dual-boot).<br />
10 minutes and 3 reboots later I found that I had forgotten to update the grub-bootloader to reflect the newly present OS. :doh:<br />
<br />
That was the reason for the first 30 minutes on Windows setup. Then it started with the usual Win localization etc. Another 15 minutes later Win is up and running for the first time. Took 55 minutes to install all the useless crap which comes with the ACER distro such as McAfee security and such. Another 25 minutes to remove all the software I do not want in my Windows and subsequent reboots. Another 20 minutes to have .NET 4.0 installed (I need that to run software from my employer.)<br />
<br />
And now since 30 minutes running Win-update with about 480 updates still to go.<br />
:(<br />
<br />
Please console me a bit and post a bit about your wastes of time with computers.</div>

]]></content:encoded>
			<dc:creator>error_401</dc:creator>
			<guid isPermaLink="true">http://www.linuxquestions.org/questions/blog.php?b=34771</guid>
		</item>
		<item>
			<title>OOo/LibreOffice Calc BASIC: cell display orientation/rotation</title>
			<link>http://www.linuxquestions.org/questions/blog.php?b=34770</link>
			<pubDate>Fri, 18 May 2012 06:45:55 GMT</pubDate>
			<description>There are incorrect examples on the internet of using OOo/LibreOffice BASIC to set  Calc cell contents to display vertically, the same as can be done...</description>
			<content:encoded><![CDATA[<div>There are incorrect examples on the internet of using OOo/LibreOffice BASIC to set  Calc cell contents to display vertically, the same as can be done interactively via Format Cell -&gt; Alignment -&gt; Text Orientation and setting the angle to 90 degrees.<br />
<br />
The problem is that they show 90 but the units are 1/100ths of a degree so vertical requires 9000.<br />
<br />
This works<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<pre class="bbcodeblock" dir="ltr" style="
		margin: 0px;
		margin-right: -99999px;
		padding: 3px;
		border: 1px inset;
		width: 98%;
		height: 34px;
		text-align: left;
		overflow: auto">oCell.setPropertyValue( &quot;RotateAngle&quot;, 9000 )</pre>
</div>This does not work (it is here to help people searching for this string when they use it and it does not have the intended effect)<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<pre class="bbcodeblock" dir="ltr" style="
		margin: 0px;
		margin-right: -99999px;
		padding: 3px;
		border: 1px inset;
		width: 98%;
		height: 34px;
		text-align: left;
		overflow: auto">oCell.setPropertyValue( &quot;RotateAngle&quot;, 90 )</pre>
</div></div>

]]></content:encoded>
			<dc:creator>catkin</dc:creator>
			<guid isPermaLink="true">http://www.linuxquestions.org/questions/blog.php?b=34770</guid>
		</item>
		<item>
			<title>New project: csvfs</title>
			<link>http://www.linuxquestions.org/questions/blog.php?b=34769</link>
			<pubDate>Thu, 17 May 2012 20:27:32 GMT</pubDate>
			<description>I started a new project recently called csvfs. It is FUSE-based file system which can represent the data from a CSV file in a hierarchy of...</description>
			<content:encoded><![CDATA[<div>I started a new project recently called csvfs. It is FUSE-based file system which can represent the data from a CSV file in a hierarchy of directories and files. This allows you to use standard unix text and file processing tools without going to the trouble of processing the CSV format yourself. It uses libcsv for parsing, so it should be very liberal about the exacting formatting of the CSV file.<br />
<br />
Functionality is rudimentary, and the file system is currently read only. But alpha source code is available here:<br />
<br />
<a href="https://frigidcode.com/code/csvfs/" target="_blank">https://frigidcode.com/code/csvfs/</a><br />
<br />
I've only built it on my amd64 Gnu/Linux box, so hopefully it builds for you 32-bit folks! :)</div>

]]></content:encoded>
			<dc:creator>hydraMax</dc:creator>
			<guid isPermaLink="true">http://www.linuxquestions.org/questions/blog.php?b=34769</guid>
		</item>
		<item>
			<title>Puppy Log</title>
			<link>http://www.linuxquestions.org/questions/blog.php?b=34767</link>
			<pubDate>Thu, 17 May 2012 08:25:05 GMT</pubDate>
			<description>Been a big fan of Puppy Linux for many years, having a bootable USB stick in your pocket in the IT game is a very handy thing. When I got a new work...</description>
			<content:encoded><![CDATA[<div>Been a big fan of Puppy Linux for many years, having a bootable USB stick in your pocket in the IT game is a very handy thing. When I got a new work laptop (ooooooh!) my Puppy stick broke due to drivers and time for an upgrade. Oh work laptop is a Dell E5420, nothing special but not bad either.<br />
<br />
After a bit of a search in the forums someone suggested I try Precise Puppy 5.3 and I was mighty impressed, both the LAN and WI-FI worked, yey! I am not sure how mainstream Precise is as a Puppy distro and the word in Puppy land is &quot;Slacko is the future&quot; so hey ho I took Slako 5.3.3 for a walk ..... mmmmmm nope WI-FI totally not recognised, using the corporate Windows build I checked out the hardware its a DW1530 Wireless-N.<br />
<br />
Will re-post in Puppy land and come back if I have the answers.</div>

]]></content:encoded>
			<dc:creator>markyd</dc:creator>
			<guid isPermaLink="true">http://www.linuxquestions.org/questions/blog.php?b=34767</guid>
		</item>
		<item>
			<title><![CDATA[Fedora Linux Kernel &#3473;&#3482; &#3514;&#3535;&#3520;&#3501;&#3535;&#3482;&#3530;&#3482;&#3517;&#3530; &#3482;&#3515; &#3484;&#3536;&#3505;&#3539;&#3512;....]]></title>
			<link>http://www.linuxquestions.org/questions/blog.php?b=34765</link>
			<pubDate>Wed, 16 May 2012 11:29:55 GMT</pubDate>
			<description><![CDATA[&#3465;&#3523;&#3530;&#3523;&#3515;&#3517;&#3535;&#3512; Terminal &#3473;&#3482;&#3495; &#3484;&#3538;&#3524;&#3538;&#3517;&#3530;&#3517;&#3535; &#3476;&#3514; &#3508;&#3524;&#3501;&#3538;&#3505;&#3530; &#3503;&#3539;&#3517;&#3535; &#3501;&#3538;&#3514;&#3545;&#3505; Commands &#3495;&#3538;&#3482; &#3508;&#3538;&#3517;&#3538;&#3520;&#3545;&#3517;&#3538;&#3505;&#3530; &#3473;&#3482;&#3538;&#3505;&#3530; &#3473;&#3482; &#3505;&#3538;&#3520;&#3515;&#3536;&#3503;&#3538;&#3520; &#3482;&#3515;&#3517;&#3535; Enter &#3482;&#3515;&#3505;&#3530;&#3505;... 
 
su - 
 
yum -y update 
 
yum -y...]]></description>
			<content:encoded><![CDATA[<div>&#3465;&#3523;&#3530;&#3523;&#3515;&#3517;&#3535;&#3512; Terminal &#3473;&#3482;&#3495; &#3484;&#3538;&#3524;&#3538;&#3517;&#3530;&#3517;&#3535; &#3476;&#3514; &#3508;&#3524;&#3501;&#3538;&#3505;&#3530; &#3503;&#3539;&#3517;&#3535; &#3501;&#3538;&#3514;&#3545;&#3505; Commands &#3495;&#3538;&#3482; &#3508;&#3538;&#3517;&#3538;&#3520;&#3545;&#3517;&#3538;&#3505;&#3530; &#3473;&#3482;&#3538;&#3505;&#3530; &#3473;&#3482; &#3505;&#3538;&#3520;&#3515;&#3536;&#3503;&#3538;&#3520; &#3482;&#3515;&#3517;&#3535; Enter &#3482;&#3515;&#3505;&#3530;&#3505;...<br />
<br />
su -<br />
<br />
yum -y update<br />
<br />
yum -y install gcc make kernel-headers kernel-devel<br />
<br />
<font color="Red">shutdown -r now</font><br />
<br />
&#3503;&#3536;&#3505;&#3530; &#3465;&#3501;&#3538;&#3505;&#3530; &#3508;&#3540;&#3503;&#3508;&#3540; &#3484;&#3512;&#3505;&#3530; &#3482;&#3535;&#3508;&#3538; &#3514;&#3482;&#3535; &#3520;&#3484;&#3546; &#3476;&#3514; &#3515;&#3501;&#3540;&#3508;&#3535;&#3495;&#3538;&#3505;&#3530; &#3503;&#3539;&#3517;&#3535; &#3501;&#3538;&#3514;&#3545;&#3505; &#3473;&#3482; &#3473;&#3524;&#3545;&#3512; Type &#3482;&#3515;&#3517;&#3535; Enter &#3482;&#3515;&#3505;&#3520;&#3535; &#3473;&#3524;&#3545;&#3512; &#3505;&#3545;&#3512;&#3530;&#3495;&#3538;..&#3512;&#3545;&#3482;&#3503; &#3477;&#3482; &#3484;&#3524;&#3508;&#3540; &#3484;&#3512;&#3505;&#3530; PC &#3473;&#3482; SHUTDOWN &#3520;&#3545;&#3505;&#3520;&#3535;..OPEN &#3482;&#3515;&#3517;&#3535; &#3501;&#3538;&#3514;&#3545;&#3505; Programs &#3495;&#3538;&#3482; Close &#3482;&#3515;&#3517;&#3535; &#3473;&#3482; &#3495;&#3514;&#3538;&#3508;&#3530; &#3482;&#3515;&#3517;&#3535; Enter &#3482;&#3515;&#3505;&#3530;&#3505;...<br />
<br />
&#3476;&#3505;&#3530;&#3505; &#3461;&#3508;&#3538; &#3484;&#3538;&#3514;&#3535;........&#3510;&#3535;&#3514;&#3538; &#3510;&#3535;&#3514;&#3538;...</div>

]]></content:encoded>
			<dc:creator>sunjayasri</dc:creator>
			<guid isPermaLink="true">http://www.linuxquestions.org/questions/blog.php?b=34765</guid>
		</item>
		<item>
			<title><![CDATA[&#3510;&#3517;&#3530;&#3517;&#3548; &#3510;&#3538;&#3515;&#3540;&#3520;&#3535;&#3495; &#3482;&#3503;&#3540; &#3508;&#3535;&#3501;&#3530;&#3520;&#3545;&#3505;&#3530;&#3505;&#3546; &#3505;&#3536;&#3501;...]]></title>
			<link>http://www.linuxquestions.org/questions/blog.php?b=34764</link>
			<pubDate>Wed, 16 May 2012 11:18:45 GMT</pubDate>
			<description><![CDATA[&#3512;&#3546; &#3473;&#3482;&#3546; &#3465;&#3505;&#3530;&#3505;&#3546; &#3512;&#3524; &#3466;&#3515;&#3538;&#3523;&#3538;&#3514;&#3535;&#3482;&#3535;&#3515; &#3484;&#3523;&#3530;&#3501;&#3515; &#3524;&#3536;&#3501;&#3530;&#3501;&#3482;&#3530; &#3511;&#3520; &#3512;&#3535; &#3461;&#3503; &#3503;&#3538;&#3505; &#3461;&#3520;&#3510;&#3549;&#3503; &#3482;&#3515; &#3484;&#3501;&#3538;&#3512;&#3538;..&#3512;&#3505;&#3530;&#3503; &#3512;&#3540;&#3505;&#3530; &#3461;&#3508;&#3538; &#3503;&#3535;&#3505; &#3495;&#3538;&#3508;&#3530; &#3520;&#3517;&#3501;&#3530; &#3474;&#3520; &#3520;&#3536;&#3515;&#3503;&#3538; &#3482;&#3538;&#3514;&#3505;&#3530;&#3505; &#3510;&#3536;&#3515;&#3538; &#3505;&#3538;&#3523;&#3535; &#3474;&#3520; &#3482;&#3508;&#3535;&#3524;&#3515;&#3538;&#3505;&#3530;&#3505; &#3482;&#3548;&#3512;&#3545;&#3505;&#3530;&#3495;&#3540; &#3503;&#3535;&#3505;...]]></description>
			<content:encoded><![CDATA[<div><font size="2">&#3512;&#3546; &#3473;&#3482;&#3546; &#3465;&#3505;&#3530;&#3505;&#3546; &#3512;&#3524; &#3466;&#3515;&#3538;&#3523;&#3538;&#3514;&#3535;&#3482;&#3535;&#3515; &#3484;&#3523;&#3530;&#3501;&#3515; &#3524;&#3536;&#3501;&#3530;&#3501;&#3482;&#3530; &#3511;&#3520; &#3512;&#3535; &#3461;&#3503; &#3503;&#3538;&#3505; &#3461;&#3520;&#3510;&#3549;&#3503; &#3482;&#3515; &#3484;&#3501;&#3538;&#3512;&#3538;..&#3512;&#3505;&#3530;&#3503; &#3512;&#3540;&#3505;&#3530; &#3461;&#3508;&#3538; &#3503;&#3535;&#3505; &#3495;&#3538;&#3508;&#3530; &#3520;&#3517;&#3501;&#3530; &#3474;&#3520; &#3520;&#3536;&#3515;&#3503;&#3538; &#3482;&#3538;&#3514;&#3505;&#3530;&#3505; &#3510;&#3536;&#3515;&#3538; &#3505;&#3538;&#3523;&#3535; &#3474;&#3520; &#3482;&#3508;&#3535;&#3524;&#3515;&#3538;&#3505;&#3530;&#3505; &#3482;&#3548;&#3512;&#3545;&#3505;&#3530;&#3495;&#3540; &#3503;&#3535;&#3505; &#3505;&#3538;&#3523;&#3535; &#3520;&#3546;... </font><br />
<br />
<font color="Magenta"><font size="3">&#3510;&#3517;&#3530;&#3517;&#3548; &#3510;&#3538;&#3515;&#3540;&#3520;&#3535;&#3495; &#3482;&#3503;&#3540; &#3508;&#3535;&#3501;&#3530;&#3520;&#3545;&#3505;&#3530;&#3505;&#3546; &#3505;&#3536;&#3501;...</font></font></div>

]]></content:encoded>
			<dc:creator>sunjayasri</dc:creator>
			<guid isPermaLink="true">http://www.linuxquestions.org/questions/blog.php?b=34764</guid>
		</item>
		<item>
			<title>Weather forecast script</title>
			<link>http://www.linuxquestions.org/questions/blog.php?b=34762</link>
			<pubDate>Tue, 15 May 2012 17:17:16 GMT</pubDate>
			<description>A bash script to fetch the 5-day weather forecast for your area: enjoy. I believe it will work for any country, but you may have to play around. For...</description>
			<content:encoded><![CDATA[<div>A bash script to fetch the 5-day weather forecast for your area: enjoy. I believe it will work for any country, but you may have to play around. For the UK, I just gave it my postcode, and it worked from that. And no apologies are made for the quality of the awk script, it was my first. Comments are welcome :D<br />
<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<pre class="bbcodeblock" dir="ltr" style="
		margin: 0px;
		margin-right: -99999px;
		padding: 3px;
		border: 1px inset;
		width: 98%;
		height: 402px;
		text-align: left;
		overflow: auto">#!/bin/bash
#
# weather.bash
#
# 2012 - Snark1994 (J. Hunt) - snark1994@gmail.com
#
# Free to use, distribute and alter, with the exception of the API key - you
# need to register your own one with worldweatheronline.com
#
key=ABCDEFGHIJLMNOP #obtain your own API key from worldweatheronline.com
postcode=&quot;$@&quot;
postcode=$(echo $postcode | sed 's/ /+/g')
url=&quot;http://free.worldweatheronline.com/feed/weather.ashx?q=CF38+1GD&amp;format=csv&amp;num_of_days=5&amp;key=$key&quot;

if [ $(/usr/bin/stat -c %Y &quot;/tmp/weather&quot;) -lt $(( $(date +%s) - 3600 )) ]; then
    echo &quot;/tmp/weather out of date!&quot;
    echo &quot;Fetching $url&quot;
    wget -q -O &quot;/tmp/weather&quot; $url
fi

awk 'BEGIN { FS=&quot;,&quot;; ORS=&quot;&quot;; print &quot;5-day forecast:\n&quot;; &quot;date +%u&quot; | getline day; days[1]=&quot;Mon  &quot;; days[2]=&quot;Tue  &quot;; days[3]=&quot;Wed  &quot;; days[4]=    &quot;Thur &quot;; days[5]=&quot;Fri  &quot;; days[6]=&quot;Sat  &quot;; days[7]=&quot;Sun  &quot;; days[day]=&quot;Today&quot; }
     NR &gt;= 10 { gsub(/\r/, &quot;&quot;); print days[(day+NR-11)%7+1] &quot;\tTemp (°C): &quot; $4 &quot;=&gt;&quot; $2 &quot; \tWind (kmph) &quot; $7 &quot;  \tRain (mm) &quot; $13 &quot;\t\t&quot; $12 &quot;    \n&quot; }' /tmp/weather

exit 0</pre>
</div></div>

]]></content:encoded>
			<dc:creator>Snark1994</dc:creator>
			<guid isPermaLink="true">http://www.linuxquestions.org/questions/blog.php?b=34762</guid>
		</item>
		<item>
			<title>new mc2 (makefile creator) version plus a bit of explanation</title>
			<link>http://www.linuxquestions.org/questions/blog.php?b=34760</link>
			<pubDate>Mon, 14 May 2012 16:22:41 GMT</pubDate>
			<description><![CDATA[[Correction EXT_OBJ will not allow adding targets that can't be deleted in 'make clean'.  There are other ways to add targets, but I'm not ready to...]]></description>
			<content:encoded><![CDATA[<div>[Correction EXT_OBJ will not allow adding targets that can't be deleted in 'make clean'.  There are other ways to add targets, but I'm not ready to go into it here at this time.  May 15, 2012]<br />
<br />
mc2 2.0.10 (link at the bottom)<br />
<ul><li>added EXT_OBJ to OBJ list for adding additional object files, libs [but not generic targets] before LINK executes.  TODO: document usage, i.e., add 'EXT_OBJ = &lt;target_list&gt;' in makeinclude and define the target(s) in mc2.def.</li>
<li>corrected static-32 template to really null LDFLAGS and LIB vars</li>
</ul><a href="http://rainbowsally.net/pub/lq/mc2-sandbox-2.0.10.tar.gz" target="_blank">http://rainbowsally.net/pub/lq/mc2-s...-2.0.10.tar.gz</a><br />
<br />
If you haven't tried mc2 yet, it is a makefile creator that generates self-updating makefiles from a simple micro-template called mc2.def.<br />
<br />
Regular mc2.def's and the resulting Makefile's can be 'update'-ed to add any new sources and objects that appear in the SRCDIR to the build.<br />
<br />
Type NONE can be created to add Makefiles created with other utilities to the PROJECT build.  (See PROJECT below.)<br />
<br />
Type MULTI can be created to make one executable per source file found in SRCDIR.<br />
<br />
Type PROJECT mc2.def files are exceptionally simple and serve to recurse directories in which other mc2.def files are found and build them all in each subdir in alphanumeric order.  <br />
<br />
Thus if you add a numeric prefix you can control the order of the parts are compiled in, and thus your directory structure IS the project configuration.<br />
<br />
The command 'make update&quot; when the makefile is a PROJECT type also recurses all the directories and updates all the Makefiles sources and object files.<br />
<br />
Now... this latest feature (EXT_OBJ) allows a normal mc2.def generated Makefile to have some of the features of a PROJECT type makefile.  <br />
<br />
This may be a bit confusing, but that's because giving these operations the proper names would be even more confusing.  The various operations are more of a matter of WHEN they run than what they do -- which we can redefine as we wish.<br />
<br />
For example, <br />
<br />
* The SRC definitions are targets that are assumed to exist.  <br />
<br />
We could call this 'STAGE1' to be more proper about it, but that is such a non-descriptive term that first-time users would be more confused than they would be by the name SRC, which is almost always a list of C/C++ or assembler files.<br />
  <br />
* The HDR definitions are targets that, if changed' force a full recompile of all the object files.  Why?  Because if the headers change, everything becomes unreliable until everything is brought back into sink.<br />
  <br />
Is STAGE2 a less confusing name for this kind of target?  Probably not.<br />
  <br />
* The OBJ definitions will generally only recompile if the object file is missing or the SRC file changed.  This allows editing source files in large projects very quickly because sources only affect the object files they create.  Once created, <br />
  <br />
That's STAGE3.<br />
  <br />
* LINK will again run to rebuild the lib, executable, or whatever else it's set up to do with all the object files if any object files change.<br />
  <br />
That's STAGE4.<br />
  <br />
So we have STAGE 1, 2, 3, and 4 which we can play games with to monkey with how the makefile functions.<br />
<br />
And there's also a POST function that may be defined and run after the build, for example if files need to be copied or moved to some other location or if the executable needs special treatment such as given a symlink (as occurs with some shared libs).<br />
<br />
And that's an optional STAGE 5 but it's name is probably self-descriptive enough to not be misleading.  :-)<br />
<br />
Back to the EXT_OBJ definition, which can be added to a makeinclude or added directly to the mc2.def file.<br />
<br />
If you look at the &quot;OBJ = ...&quot; list from a typical mc2 generated makefile you'll see the names of object files such as, maybe &quot;o/this.o&quot; and &quot;o/that.o&quot;; those are indeed object files but we can play tricks with this type of object because those are ALSO the names of targets.<br />
<br />
If you look at the rules section of a typical mc2 generated makefile you'll see that each object in the OBJ list is just a file.  So to add a new target, <br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<pre class="bbcodeblock" dir="ltr" style="
		margin: 0px;
		margin-right: -99999px;
		padding: 3px;
		border: 1px inset;
		width: 98%;
		height: 82px;
		text-align: left;
		overflow: auto">EXT_OBJ = \
  new-target \
  ... 
  ########### end of list</pre>
</div>Targets like 'new-target' are not automatically generated in the Makefile because they don't have sources in the SRCDIR, therefore you won't get multiple definitions of these targets and you are free to add the target's execution procedure to create those files even if the file is just a time stamp. (echo &gt; timestamp).<br />
<br />
So we pick the EXT_OBJ 'time to run' to execute additional targets.<br />
<br />
Mc2 might get a gui front-end someday, but as it is, the terminal app is very flexible and gives the users especially C newbees an almost fool-proof way to generate simple makefiles for testing C or C++ code quickly and cleanly making it easier to 'learn the ropes' of makefile flags at their own speed, yet mc2 can handle very large projects fairly easily too.<br />
<br />
It's not important that *I* created this utility, by the way.  In fact the main purpose of it is to raise the question... are these cmakes, qmakes, imakes and so forth worth the drive space?  Sure, they prevent you from making mistakes but at the same time they prevent you from correcting any.<br />
<br />
For example, why do kubuntu/debian users think libpthreads is missing from their distros when they compile a cmake-ed applications that are allegedly compatible (or required) for their their systems?<br />
<br />
[Cmake can't use Dash.  Try to fix that without reassigning the /bin/sh symlink to point to 'Bash'.  Fix it on the cmake side.  Ready?  On you marks, get set... ]<br />
<br />
And automake?  That thing is such a mess that it's why I made my first makefile generator, called AutoBake.  It's now obsoleted by mc2, but you might enjoy the logo.<br />
<br />
<a href="http://rainbowsally.net/tkf/ftl/index.html" target="_blank">http://rainbowsally.net/tkf/ftl/index.html</a><br />
<br />
How many times do I have to configure MY system?  (Or any other opensuse 11.4 system, for that matter, since even binaries will plug right in.)<br />
<br />
Well, yes, the other makefile generators are probably worth the drive space, but they are far larger and more difficult to use, especially for small test apps.<br />
<br />
So if you get a chance, take mc2 for a spin.  Play with it as-is, modify it to your own liking, create a spin off (the installer can import your version(s)), do whatever you want. <br />
<br />
Learn by experimentation what make and Makefiles do.<br />
<br />
Or just consider it a question: Is it possible that an 80K app that compiles in seconds could be more fun, more useful, or easier to use than 10 megs of over-bloated magic that you can't understand, can't see working, and can't customize to meet your own needs?<br />
<br />
[I once compiled &quot;hello world&quot; and got .75 megs* of files for that.  It was a C app created by kdevelop.  That being so offensive to me, one of my top priorities once I learned a bit of C was to write AutoBake.  Like the logo?]<br />
<br />
Whatever.  At least Marsha N. likes this stuff, and that's the acid test for me.  ;-)<br />
<br />
Here's the link to the latest mc2 at our blog.<br />
<a href="http://www.linuxquestions.org/questions/blog/rainbowsally-615861/liblq-and-mc2-makefile-creator2-the-next-generation-34648/">http://www.linuxquestions.org/questi...eration-34648/</a><br />
<br />
(C) 2012, Rainbowsally. GPL<br />
  <br />
The Computer Mad Science Team.<br />
<br />
:-)<br />
<br />
-----------<br />
* that was point .75 megs for kdev3 -- 50 megs for kdev 4 counting hidden sessoin files in my home folder.</div>

]]></content:encoded>
			<dc:creator>rainbowsally</dc:creator>
			<guid isPermaLink="true">http://www.linuxquestions.org/questions/blog.php?b=34760</guid>
		</item>
		<item>
			<title>corrections (mc2, and signal-handler)</title>
			<link>http://www.linuxquestions.org/questions/blog.php?b=34759</link>
			<pubDate>Mon, 14 May 2012 12:43:51 GMT</pubDate>
			<description>I have posted an update not for the signal-handler code.  For one, the -O2 switch may cause your C version to hang...  More here. 
...</description>
			<content:encoded><![CDATA[<div>I have posted an update not for the signal-handler code.  For one, the -O2 switch may cause your C version to hang...  More here.<br />
<br />
<a href="http://www.linuxquestions.org/questions/blog/rainbowsally-615861/example-sig-handler-funcs-for-c-and-c-throw-catch-part-2-34758/">http://www.linuxquestions.org/questi...-part-2-34758/</a><br />
<br />
Also the mc2 static-32 template in the latest d/load won't work.<br />
<br />
was:<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<pre class="bbcodeblock" dir="ltr" style="
		margin: 0px;
		margin-right: -99999px;
		padding: 3px;
		border: 1px inset;
		width: 98%;
		height: 50px;
		text-align: left;
		overflow: auto">LDFLAGS =  &quot;&quot; # must be cleared explicitly for ar
LIB =      &quot;&quot; # must be cleared explicitly for ar</pre>
</div>should be:<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<pre class="bbcodeblock" dir="ltr" style="
		margin: 0px;
		margin-right: -99999px;
		padding: 3px;
		border: 1px inset;
		width: 98%;
		height: 50px;
		text-align: left;
		overflow: auto">LDFLAGS =     # must be cleared explicitly for ar
LIB =         # must be cleared explicitly for ar</pre>
</div>Will be fixed in next release but to correct this in the meantime,<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<pre class="bbcodeblock" dir="ltr" style="
		margin: 0px;
		margin-right: -99999px;
		padding: 3px;
		border: 1px inset;
		width: 98%;
		height: 66px;
		text-align: left;
		overflow: auto">mc2 -fetch static-32
&lt;edit&gt; mc2.def # and make changes shown above
mc2 -save static-32 # and press [y]es</pre>
</div></div>

]]></content:encoded>
			<dc:creator>rainbowsally</dc:creator>
			<guid isPermaLink="true">http://www.linuxquestions.org/questions/blog.php?b=34759</guid>
		</item>
		<item>
			<title>Example: sig-handler funcs for C and C++ (throw-catch) PART 2</title>
			<link>http://www.linuxquestions.org/questions/blog.php?b=34758</link>
			<pubDate>Mon, 14 May 2012 04:37:23 GMT</pubDate>
			<description><![CDATA[UPDATE: 
Note: The signal-handler files can't be compiled with the -O2 switch and it's probably best if you only trap the signals you really intend...]]></description>
			<content:encoded><![CDATA[<div>UPDATE:<br />
Note: The signal-handler files can't be compiled with the -O2 switch and it's probably best if you only trap the signals you really intend to redirect, such as SIGSEGV (11).  If you compile what we have here with the -O2 switch your cpu may hang if you try to exit using Ctrl-C for example.  See implementation notes added to signal-handler.c below.<br />
<br />
See part 1 for main functions to test this in C and C++.<br />
<br />
<b>To throw and catch stuff like segfaults in C++ it's easiest to translate the signal and throw a user defined code if the segfault has not been handled. And by &quot;handled&quot; we mean it's not so screwed up that we'd have to return to the shell.  This functionality is imperative if you intend to run your own interpreter loop where you don't want to lose all the data in memory unless it's absolutely necessary.</b><br />
<br />
The translation (in C++) is done by pushing and popping handlers which start the 'throw' chain (unwinding the stack) when appropriate.  See part 1 for examples in C and in C++.<br />
<br />
In C we don't translate because we can't 'throw(code)' the same way we can in C++. This difference may be confusing, but if you think of the handler_code (variable) as being a flag indicating whether a code has been 'HANDLER_THROW'-ed things might start making a bit of sense.  Generally, HANDLER_THROW() only needs to be done in C because C++ has its own throw-catch built-ins.<br />
<br />
Here's the code and header for sig-handler funcs.  The 64-bit code is untested and may need some touch-ups, probably mostly syntactical, the asm and constants should be ok.  BITS is set in the header, which you may want to define in the Makefile... but this might get you started in your own implementations of this concept either way.<br />
<br />
file: src/signal-handler.h<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<pre class="bbcodeblock" dir="ltr" style="
		margin: 0px;
		margin-right: -99999px;
		padding: 3px;
		border: 1px inset;
		width: 98%;
		height: 498px;
		text-align: left;
		overflow: auto">// signal-handler.h

#ifndef signal_handler_h
#define signal_handler_h

// signal-handler.h

///////////////////////////////////////////////////////////
// catch segfaults and continue
#include &lt;signal.h&gt;  // segfault handling
#include &lt;setjmp.h&gt;  // reset eflags 0x100 (trap) flag
#include &lt;sys/ucontext.h&gt; // register names

#define BITS 32
// #define BITS 64

#ifdef __cplusplus
// intercept throw-catch errors too.
#include &lt;exception&gt;
extern std::terminate_handler old_term_handler;

// used only once in main()
#define BEGIN_MAIN_HANDLER() \
    pvt_init_sighandler(pvt_exception_mediator); \
    std::set_terminate(pvt_handler_throw)

// done once at the end of main() before returning.
#define END_MAIN_HANDLER() \
  std::set_terminate(old_term_handler)
#else

#define BEGIN_MAIN_HANDLER() \
    pvt_init_sighandler(pvt_exception_mediator)

#define END_MAIN_HANDLER()

#endif // __cplusplus

// begins a handled block and may include a {handler function} 
// that may reset the throw_code variable if the problem is handled.
#define PUSH_HANDLER() \
  { \
    throw_code = handler_code = 0; \
    handler_link_ptr  cont_next; \
    pvt_push_handler(&amp;cont_next); \
    if(!setjmp(handler_link-&gt;jb) &amp;&amp; ! handler_code) \
    {

// followed by { what to try } which may include try-catch 
// expressions. if cont is false, will pop_handler prior to 
// a 'return' or (more typically) a 'throw(int code) function
// to balance push/pops.
#define HANDLE(cont) }else{ if(!cont) pvt_pop_handler();

// ends a handler block
#define POP_HANDLER() \
    } \
  } \
  pvt_pop_handler()

typedef struct
{
  void* prev;
  jmp_buf jb;
}handler_link_ptr;

#ifdef __cplusplus
extern &quot;C&quot; {
#endif // __cplusplus

// Used in C++ for the signal number to translate trapped signals to 
// throw and catch.  Signal number 11 is segfault.  These can often be 
// non-fatal errors though the linux os prefers to unload the binary and 
// return to the shell when these happen.
extern int throw_code;

// used in to simulate throw-catch through handlers in C using HANDLER_THROW(code)
// See HANDLER_THROW() below.
extern int handler_code;

// Used mainly in C, similar to try-catch throw function.  This will call
// the HANDLER currently pushed, so some care is required to avoid recursion 
// or other problems.  It's generally best to throw to the caller after 
// setting a flag in the HANDLER section.
void HANDLER_THROW(int code);

// global handler linked list (points to current)
extern handler_link_ptr *handler_link;

// used internally by PUSH/POP macros
void pvt_push_handler(handler_link_ptr* o);
void pvt_pop_handler();

// used to call c/c++ exception handlers from trapped signals
void pvt_exception_mediator(int);

// used in BEGIN_MAIN_HANDLER() to trap all signals in the 
// range 1-15 for handling and/or conversion to throw-catch
void pvt_init_sighandler(void (*fn)(int));

// used internally to call handler(s) with current throw_code
void pvt_handler_throw();

#ifdef __cplusplus
} // extern &quot;C&quot;
#endif // __cplusplus

#endif // signal_handler_h</pre>
</div>file: src/signal-handler.c<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<pre class="bbcodeblock" dir="ltr" style="
		margin: 0px;
		margin-right: -99999px;
		padding: 3px;
		border: 1px inset;
		width: 98%;
		height: 498px;
		text-align: left;
		overflow: auto">// signal-handler.c

#include &lt;signal-handler.h&gt;
#include &lt;stdio.h&gt; // fprintf()
#include &lt;stdlib.h&gt; // exit()

// used to untrap and begin throw-catch
int throw_code;

#ifdef __cplusplus
std::terminate_handler old_term_handler;
extern &quot;C&quot; {
#endif // __cplusplus
  
int handler_code;

// used mainly in C, similar to try-catch throw function
void HANDLER_THROW(int code)
{
  if(!code) 
  {
    fprintf(stderr, &quot;Can't HANDLER_THROW( zero ), aborting...\n&quot;);
    exit(1);
  }
  handler_code = code;
  pvt_handler_throw();
}

  
static handler_link_ptr _handler_link;
handler_link_ptr *handler_link = &amp;_handler_link;

void pvt_push_handler(handler_link_ptr* o) 
{
  handler_link_ptr* save = handler_link;
  handler_link = o;
  handler_link-&gt;prev = save;
}

void pvt_pop_handler() 
{ 
  handler_link = (handler_link_ptr*)handler_link-&gt;prev; 
}


void pvt_handler_throw()
{
  longjmp(handler_link-&gt;jb, throw_code);
}

void handle(int err)
{
  throw_code = err;
  pvt_handler_throw();
}


#if BITS == 32

  // returns ebp from cpu
  static void** get_ebp()
  {
    asm(
        &quot;mov %ebp, %esp;\n&quot;
        &quot;popl %ebp;\n&quot;
        &quot;mov %ebp, %eax;\n&quot;
        &quot;ret;\n&quot;
       );
    return 0; // not used
  }
#else 
#if BITS == 64
  // returns rdx from cpu
  static void** get_rdx()
  {
    asm(
        &quot;mov %rbp, %rsp;\n&quot;
        &quot;popl %rbp;\n&quot;
        &quot;mov %rdx, %rax;\n&quot;
        &quot;ret;\n&quot;
       );
    return 0; // not used
  }
#else
#warning BITS must be defined (either 32 or 64)
#endif // 64
#endif // 32
  
  static struct sigaction new_action;
  
  void pvt_init_sighandler(void (*fn)(int))
  { 
    new_action.sa_handler = fn;
    sigemptyset (&amp;new_action.sa_mask);
    new_action.sa_flags = SA_SIGINFO;
/// *****************************************
/// THIS COULD POTENTIALLY HANG YOUR CPU
// If all you want to trap is segfaults,
// replace this with 
// sigaction(11, &amp;new_action, 0);
// and repeat for other signals you want to 
// catch.  This may not be a problem in C++
// but it is in C, so be aware of this potential
// problem.

    for(int i = 0; i &lt; 16; i++)
      sigaction( i, &amp;new_action, 0);
  }

  // a pointer we can get at in asm
  void** psig_context; 

  typedef struct
  {
    const char c;
  }ERRSTRING;
    

  void pvt_exception_mediator(int signum)
  {
    throw_code = signum;
    
#if BITS == 32
// see /usr/include/sys/ucontext.h
    
#define CTX_TRAPNO 12
#define CTX_EIP 14
    void** p = get_ebp();
    p += 2; // &amp;signum
    p = (void**)p[2];                     // pointers
    p += 5;                               // psig_context
    psig_context = (void**)p;
  
  // get context
    void*** context = (void***)psig_context;

    // turn off trap flag
    context[CTX_TRAPNO] = (void**)0;
    // set new eip as though it were a call
    context[CTX_EIP] = (void**)&amp;pvt_handler_throw;

#else
#if BITS == 64
// see /usr/include/sys/ucontext.h
#define CTX_TRAPNO 20
#define CTX_RIP 16

    void**p;
    
    p = (void**)get_rdx();
    p+=5;
    psig_context = p;
    void***context = (void***)psig_context;
    context[REG_RIP] = (void**)&amp;handler_throw;

#else
#warning BITS must be defined (either 32 or 64)
#endif // 64
#endif // 32
  }

#ifdef __cplusplus
} // extern &quot;C&quot;
#endif // __cplusplus</pre>
</div>The Computer Mad Science Team<br />
<br />
:-)</div>

]]></content:encoded>
			<dc:creator>rainbowsally</dc:creator>
			<guid isPermaLink="true">http://www.linuxquestions.org/questions/blog.php?b=34758</guid>
		</item>
		<item>
			<title>Example: sig-handler funcs for C and C++ (throw-catch) PART 1</title>
			<link>http://www.linuxquestions.org/questions/blog.php?b=34757</link>
			<pubDate>Mon, 14 May 2012 04:22:35 GMT</pubDate>
			<description><![CDATA[Today's Features 
* THROW-CATCH in C 
* Translating signals to C++ throw-catch parameters. 
 
 
To compile the C++ example these vars are set in...]]></description>
			<content:encoded><![CDATA[<div>Today's Features<ul><li>THROW-CATCH in C</li>
<li>Translating signals to C++ throw-catch parameters.</li>
</ul><br />
To compile the C++ example these vars are set in mc2.def and should be similar for other methods of building it.<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<pre class="bbcodeblock" dir="ltr" style="
		margin: 0px;
		margin-right: -99999px;
		padding: 3px;
		border: 1px inset;
		width: 98%;
		height: 146px;
		text-align: left;
		overflow: auto">COMPILE = g++ -m32 -c -o # COMPILE &lt;output_file&gt; ...
CFLAGS = -Wall -g3 --save-temps
# or CFLAGS = -Wall -O2 # optimized
INCLUDE = -I $(SRCDIR) -I$(PREFIX)/include 

LINK = g++ -m32 -o # LINK &lt;output_file&gt; ...
LDFLAGS = # $(GCCDIR)/libgcc_eh.a
LIB = -L/usr/lib -L/opt/gcc-dbg/lib</pre>
</div>To compile the C example<br />
<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<pre class="bbcodeblock" dir="ltr" style="
		margin: 0px;
		margin-right: -99999px;
		padding: 3px;
		border: 1px inset;
		width: 98%;
		height: 146px;
		text-align: left;
		overflow: auto">COMPILE = gcc -m32 -c -o # COMPILE &lt;output_file&gt; ...
CFLAGS = -Wall -g3 -std=gnu99 # --save-temps
# or CFLAGS = -Wall -O2 -std=gnu99 # optimized
INCLUDE = -I $(SRCDIR)

LINK = gcc -m32 -o # LINK &lt;output_file&gt; ...
LDFLAGS = # $(GCCDIR)/libgcc_eh.a
LIB = -L/usr/lib # -L$(PREFIX)/lib -L/opt/gcc-dbg/lib/</pre>
</div>So let's first take a peek at the two versions of main for the C and C++ tests.  These two versions are mutually exclusive and the makefiles are not the same either.  Use whatever tricks you like to symlink or move files as required for the different builds if you want to see them both.<br />
<br />
Note: This C++ code is the result of several attempts to get at the low level throw and catch functions (tracing into a debug version of the entire gcc installation) which ended up being much more complicated than this and couldn't be used in C at all.<br />
<br />
file: src/main.cpp<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<pre class="bbcodeblock" dir="ltr" style="
		margin: 0px;
		margin-right: -99999px;
		padding: 3px;
		border: 1px inset;
		width: 98%;
		height: 498px;
		text-align: left;
		overflow: auto">// generic C++ source template created by new.main

#include &lt;stdio.h&gt;  // printf(), FILE*, etc.
#include &lt;malloc.h&gt; // malloc(), free()
#include &lt;string.h&gt; // strcpy(), memcpy(), etc.
#include &lt;stdlib.h&gt; // exit()

#include &quot;signal-handler.h&quot;

void dbg(){}

// seg fault corrected
void test_handled()
{
  printf(&quot;Test 1 (handled segfault):\n&quot;);
  try
  {
    PUSH_HANDLER()      // set up HANDLE(flg) as the signal hander
    {
      char* s = 0;
      s += 9;
      int c = *s;
      c = c; // use it
    }
    HANDLE(true);       // handle signals and flag = continue normally
    POP_HANDLER();      // end HANDLER block to continue execution
    
    if(throw_code == 11)
    {
      // do segfault cleanup if any
      printf(&quot;%s: handling segfault\n&quot;, __func__);
    }
    else // abort
    {
      printf(&quot;%s: can't handle signal (%d)\n&quot;, __func__, throw_code);
      exit(throw_code);
    }
  }
  catch(int err)
  {
    if(err)
      throw(err);
  }
}

// seg fault uncorrected (fatal)
void test_unhandled()
{
  printf(&quot;Test 2 (unhandled segfault):\n&quot;);
  try
  {
    PUSH_HANDLER()      // set up HANDLE(flg) as the signal hander
    {
      char* s = 0;
      int c = *s;
      c = c; // use it
    }
    HANDLE(false)        // handle signals and flag = not continuing
    {
      printf(&quot;%s: not handling segfault\n&quot;, __func__);
      printf(&quot;%s: throwing code (1)\n&quot;, __func__);
      throw(1);
    }
    POP_HANDLER();      // end HANDLER block to continue execution
  }
  catch(int err)
  {
    if(err)
      throw(err);
  }
}

void tester()
{
  printf(&quot;%s: testing translating handled and unhandled signals to throw-catch\n&quot;, __func__);
  int caught = 0;
  try
  {
    PUSH_HANDLER()      // set up HANDLE(flg) as the signal hander
    {
      test_handled();
    }
    HANDLE(false)        // handle signals and flag = not continuing
    {
      printf(&quot;test_handled screwed up, supposed handle errors\n&quot;);
      printf(&quot;%s: HANDLE throwing code (4)\n&quot;, __func__);
      throw(4);
    }
    POP_HANDLER();      // end HANDLER block to continue execution
  }
  catch(int err)
  {
    caught = err;
  }
  // caught...
  try
  {
    PUSH_HANDLER()      // set up HANDLE(flg) as the signal hander
    {
      test_unhandled();
    }
    
    // this time we want to know if the signal was handled or not
    HANDLE(false)        // handle signals and flag = not continuing
    {
      printf(&quot;%s: can't handle throw_code = %d\n&quot;, __func__, throw_code);
      printf(&quot;%s: HANDLE throwing code (2)\n&quot;, __func__);
      throw(2);
    }
    POP_HANDLER();      // end HANDLER block to continue execution
  }
  catch(int err)
  {
    caught += 2;
  }
  if(caught)
  {
    printf(&quot;%s: caught cumulative error code(s) (%d)\n&quot;, __func__, caught);
    printf(&quot;%s: rethrowing throw_code (%d) from handler funcs\n&quot;, __func__, throw_code);
    if(caught)
      throw(throw_code);
  }
}

int main(int argc, char** argv)
{
  dbg();
  // done only once in main();
  BEGIN_MAIN_HANDLER(); // init system
  try
  {
    PUSH_HANDLER()      // set up HANDLE(flg) as the signal hander
    {
      tester();
    }
    HANDLE(false)        // handle signals and flag = not continuing
    {
      throw(1);
    }    
    POP_HANDLER();      // end HANDLER block to continue execution
  }
  catch(int err)
  {
    if(err)
    {
      printf(&quot;main: caught code (%d)\n&quot;, err);
    }
  }
  // done only once in main();
  END_MAIN_HANDLER(); // reset terminate function for throw-catch
    
  printf(&quot;Exiting main() normally after testing\n&quot;);
  return 0;
}</pre>
</div>See the makefile tips in the next post if you want to build the C++ tests above.<br />
<br />
Here's the straight C version.  It does have the -std-gnu99 flag set but I don't remember if that's still needed or not as the code has evolved.<br />
<br />
file: src/main.c<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<pre class="bbcodeblock" dir="ltr" style="
		margin: 0px;
		margin-right: -99999px;
		padding: 3px;
		border: 1px inset;
		width: 98%;
		height: 498px;
		text-align: left;
		overflow: auto">// main.c sig-handler test

/* 
  In the C version to avoid adding an additional PUSH_HANDLER/POP_HANDLER
  pair around the individual tests, we don't HANDLER_THROW() anything until 
  we leave the block, reading the handler_code to determine whether to throw 
  or not.
  
  As a result the HANDLE() functions set the continuing flag to true and 
  'catch' is simulated by reading the handler_code flag.  
  
*/

#include &lt;stdio.h&gt;  // printf(), FILE*, etc.
#include &lt;malloc.h&gt; // malloc(), free()
#include &lt;string.h&gt; // strcpy(), memcpy(), etc.

#include &quot;signal-handler.h&quot;

// these macros help show what the param in HANDLE(param)
// is doing.  It's only a flag for whether to unnest the 
// handlers or not within a HANDLE block.  True = continue
// i.e., NOT to unnest the HANDLER
#ifndef true
#define true 1
#endif
#ifndef false
#define false 0
#endif


void dbg(){}

void noop() {}

// seg fault corrected
void test_handled()
{
  printf(&quot;Test 1 (handled segfault):\n&quot;);
    PUSH_HANDLER()      // set up HANDLE(flg) as the signal hander
    {
      char* s = 0;
      s += 9;
      int c = *s;
      c = c; // use it
    }
    HANDLE(true);       // handle signals and flag = continue normally
    POP_HANDLER();      // end HANDLER block to continue execution
    
    if(throw_code == 11)
    {
      // do segfault cleanup if any
      printf(&quot;%s: handling segfault\n&quot;, __func__);
    }
    else // abort
    {
      printf(&quot;%s: can't handle signal (%d)\n&quot;, __func__, throw_code);
      exit(throw_code);
    }
    if(handler_code)
      HANDLER_THROW(handler_code);
    else
      noop();
}

// seg fault uncorrected (fatal)
void test_unhandled()
{
  printf(&quot;Test 2 (unhandled segfault):\n&quot;);
    PUSH_HANDLER()      // set up HANDLE(flg) as the signal hander
    {
      char* s = 0;
      int c = *s;
      c = c; // use it
    }
    HANDLE(true)        // handle signals and flag = continuing
    {
      printf(&quot;%s: not handling segfault\n&quot;, __func__);
      printf(&quot;%s: throwing code (1)\n&quot;, __func__);
      handler_code = 1;
    }
    POP_HANDLER();      // end HANDLER block to continue execution
    if(handler_code)
      HANDLER_THROW(handler_code);
}

void tester()
{
  printf(&quot;%s: testing translating handled and unhandled signals to throw-catch\n&quot;, __func__);
  int caught = 0;
  PUSH_HANDLER()      // set up HANDLE(flg) as the signal hander
  {
    test_handled();
  }
  HANDLE(true)        // handle signals and flag = continuing
  {
    printf(&quot;test_handled screwed up, supposed handle errors\n&quot;);
    printf(&quot;%s: HANDLE throwing code (4)\n&quot;, __func__);
    handler_code = 4;
  }
  POP_HANDLER();      // end HANDLER block to continue execution
  if(handler_code)
    caught = handler_code;
    
  PUSH_HANDLER()      // set up HANDLE(flg) as the signal hander
  {
    test_unhandled();
  }
    
    // this time we want to know if the signal was handled or not
  HANDLE(true)        // handle signals and flag = continuing
  {
    printf(&quot;%s: can't handle throw_code = %d\n&quot;, __func__, throw_code);
    printf(&quot;%s: HANDLE throwing code (2)\n&quot;, __func__);
    handler_code = 2;
  }
  POP_HANDLER();      // end HANDLER block to continue execution
  
  if(handler_code)
    caught += handler_code;
  
  if(caught)
  {
    printf(&quot;%s: caught cumulative error code(s) (%d)\n&quot;, __func__, caught);
    printf(&quot;%s: rethrowing throw_code (%d) from handler funcs\n&quot;, __func__, throw_code);
    HANDLER_THROW(throw_code);
  }
}

int main(int argc, char** argv)
{
  dbg();
  // done only once in main();
  BEGIN_MAIN_HANDLER(); // init system
  PUSH_HANDLER()      // set up HANDLE(flg) as the signal hander
  {
    tester();
  }
  HANDLE(true)        // handle signals and flag = continuing
    handler_code = 1;
  POP_HANDLER();      // end HANDLER block to continue execution
  
  // done only once in main();
  END_MAIN_HANDLER(); // reset terminate function for throw-catch
    
  printf(&quot;Exiting main() normally after testing\n&quot;);
  return 0;
}</pre>
</div>Cont'd in part 2</div>

]]></content:encoded>
			<dc:creator>rainbowsally</dc:creator>
			<guid isPermaLink="true">http://www.linuxquestions.org/questions/blog.php?b=34757</guid>
		</item>
		<item>
			<title>How to tar files through scripting?</title>
			<link>http://www.linuxquestions.org/questions/blog.php?b=34756</link>
			<pubDate>Sat, 12 May 2012 15:02:36 GMT</pubDate>
			<description>I am newbie in scripting. Made a script but not executing properly. I want to take tar backup of files of first 15 days of the month that is 1st to...</description>
			<content:encoded><![CDATA[<div>I am newbie in scripting. Made a script but not executing properly. I want to take tar backup of files of first 15 days of the month that is 1st to 15th May. Files are in this format --&gt;&gt; 01May2012 to 15May2012<br />
<br />
The script is given below.. Please help me to make this correct<br />
<br />
today=`date '+%d%B%Y' -d '-11days'`<br />
cd /opt/Server.Log_11Ocg01<br />
tar -cvf backups1to11.tar /opt/Server.Log_11Ocg01/$today<br />
<br />
Thanks <br />
Ankit</div>

]]></content:encoded>
			<dc:creator>anky.parmar1786</dc:creator>
			<guid isPermaLink="true">http://www.linuxquestions.org/questions/blog.php?b=34756</guid>
		</item>
		<item>
			<title>Old SUSE Linux in VBox</title>
			<link>http://www.linuxquestions.org/questions/blog.php?b=34755</link>
			<pubDate>Sat, 12 May 2012 01:25:12 GMT</pubDate>
			<description><![CDATA[I've ran and test SUSE 7.1 and 7.3 and later in VirtualBox. Here's some notes about each 
-2001- 
7.1 - Offers KDE 1.1 and 2.0 and Kernel 2.2/2.4....]]></description>
			<content:encoded><![CDATA[<div>I've ran and test SUSE 7.1 and 7.3 and later in VirtualBox. Here's some notes about each<br />
-2001-<br />
7.1 - Offers KDE 1.1 and 2.0 and Kernel 2.2/2.4. GNOME 1.2. Only 640x480 with 16 colors with XFree86 4. Includes as both Sax1 and SaX2 and Yast1 and YaST2. You may have to fight the sound server, but it works well once you have it fired up. This is the only one older than 9.2 I installed from an Install CD instead of an FTP server.<br />
7.3 - KDE 2.2 and GNOME 1.4. Same video resolution and sound stuff as 7.1. Still has SaX 1/2 and YaST 1/2. I think it is safe to assume that 7.2 s very similar. In 7.3 the theme in KDE was changed up a bit to look like what it did in 8.0. Kernel 2.2 is still an option but by now 2.4 is the default. Now has ext3 support.<br />
-2002-<br />
8.0 - KDE 3.0 and still GNOME 1.4. It is weird to me because it uses KDE 3 with the KDE 2 hicolor theme and has GNOME 1 still. SaX 1 and YaST 1 were removed. The graphics now fully wor - all the normal color stuff and screen resolutions you can get in the modern versions of openSUSE except the Cursor lock - that's gonna be a stickler for a while.<br />
8.1 - KDE 3.0 and GNOME 2.0. Even though Keramik took over upstream-wise in KDE 3.1, it is the default theme in 8.1 and makes KDE look like it belongs to this millennium.  GNOME 2.0 now has 2 panels rather than 1. OpenOffice is now included. GRUB is now the default bootloader.<br />
-2003-<br />
8.2 - KDE 3.1 and GNOME 2.2. GNOME now has only 1 panel (kinda goes backward). Not very special to me...<br />
9.0 - Still KDE 3.1 and GNOME 2.2. GNOME is still one panel but has a new theme. Not too exciting to me either.<br />
-2004-<br />
9.1 - GNOME 2.4 and KDE 3.2. GNOME now has the 2 panel appearance and theme that it had up to 10.0 except it is missing a menu to be added in 9.2. The KDE fonts are tidier. Now has Kernel 2.6 and Firefox.<br />
9.2 - GNOME 2.6 and KDE 3.3. This version is the first with a full Professional ISO freely downloadable. GNOME has a new menu, and KDE has the kool Keramik lite theme imitating XP. It is also the first to be branded as Novell and SUSE.<br />
-2005-<br />
9.3 - GNOME 2.6 and KDE 3.4. KDE now uses the same specialized SUSE theme that was like Plastik. Last non-openly deloped SUSE<br />
10.0 - GNOME 2.10 and KDE 3.4. The kickoff to the openSUSE project. This release was very similar to 9.3.<br />
10.0.<br />
-2006-<br />
10.1 - GNOME 2.10 and KDE 3.5. GNOME is scutted down to one panel and looks like 10.2-11.1 without slab.<br />
10.2 - GNOME 2.14 (or 2.16) and KDE 3.5. KDE now has the kickoff menu (the menu that upstream KDE adopted in KDE4) and GNOME now has slab (which I miss a lot). This is the first to include some Qt 4 libraries and to default to ext3 rather than reiserfs. The distro name changed from SUSE Linux to openSUSE.<br />
-2007-<br />
10.3 - GNOME 2.20 and still KDE 3.5. One of my favorites. Similar to 10.2. A feature noteworthy is the GTK version of YaST and the inclusion of XFCE on the DVD.<br />
-2008-<br />
11.0 - GNOME 2.22 and KDE 3.5/4.0. This is the first I used before going insane on the old ones. KDE 4 is introduced, though with a lot of openSUSE customizations.<br />
11.1 - KDE 4.1 and GNOME 2.24. This was the last version to include KDE3 (Nooooooo!). KDE 4 has the default desktop background set up (11.0 by default used the KDE3 Desktop folder setup)<br />
-2009-<br />
11.2 - KDE 4.3 and GNOME 2.28. I loved this release - KDE4 here ran soooooo much better than in 11.1. The GNOME theme had an overhaul with the Sonar theme and now had a GNOME shell preview. ext4 support was added. The mouse integration I mentioned earlier starts acting normal in this release.<br />
-2010-<br />
11.3 - KDE 4.4 and GNOME 2.30. This was the first release to include btrfs and LXDE. It overall isn't that different from 11.2.<br />
-2011-<br />
11.4 - KDE 4.6 and GNOME 2.32. This is the oldest supported version of SUSE and the last to have the beautiful slab. The GNOME icon set was redone here.<br />
12.1 - KDE 4.7 and GNOME 3.2. I'm glad they didn't jump straight to GNOME 3. I've learned to tolerate GNOME 3, but still like KDE better. GNOME 3 either has 2 panels in fallback or 1 top panel in the shell. The GNOME theme and shell closely follows the upstream theme with a few small differences. A lot of KDE apps now have a menu button rather than a menu bar. The kernel version is 3.1 (it was bumped to 3 to honor 20 years of awesome Linux) and now boots with systemd.<br />
-2012-<br />
12.2 - KDE 4.8 and GNOME 3.4. A great release on its way. Have that up in  VBox too. Dolphin was redone and GNOME 3.4 inches GNOME 3 is the right direction of usability. GRUB2 will become the new default bootloader, making SUSE a lot easier to dual boot with Fedora and Ubuntu. It might be the last KDE 4 release, since KDE 5 is on its way.<br />
Coming Soon- Once I get my hands on 6.4, 7.0 and 7.2 I will chain of fools right through all of the SUSEs with VirtualBox GUI support and post it up here.<br />
I might this summer do a Chain-of-Fools through all of the GNOME 2 releases to honor the awesomeness of GNOME 2 in SUSE that will die when 11.4 slams into EOL in September.</div>

]]></content:encoded>
			<dc:creator>wagscat123</dc:creator>
			<guid isPermaLink="true">http://www.linuxquestions.org/questions/blog.php?b=34755</guid>
		</item>
		<item>
			<title>Misadventures In Computer Mad Science</title>
			<link>http://www.linuxquestions.org/questions/blog.php?b=34754</link>
			<pubDate>Fri, 11 May 2012 11:25:57 GMT</pubDate>
			<description><![CDATA[Misadventures In Computer Mad Science 
 
A friend of mine once told me that I'm the worst programmer he knew.  And that's probably right.  What do...]]></description>
			<content:encoded><![CDATA[<div>Misadventures In Computer Mad Science<br />
<br />
A friend of mine once told me that I'm the worst programmer he knew.  And that's probably right.  What do you expect from someone who's first programming love was Forth (ZX-81 and Co-Co).  <br />
<br />
So I always encourage folks to see what is going on and perhaps rework or clean up my messes if they can see a better way to do things.<br />
<br />
Features:<ul><li>Half a paragraph from the GPL v.3</li>
</ul><br />
See highlights near the bottom if you're not interested in my disconnected mood swings today.  :-)  <br />
<br />
This is going to be about 'configure' being (shock!) 'dangerous' and also about open source and GPL violations by major linux distros.<br />
<br />
No code toys to play with this time.<br />
<br />
---------------<br />
<br />
Misadventure 1 was trying to download gcc sources from opensuse.  Looks like now that the d/load page is back up, it's still as messed up as ever.<br />
<br />
But this next misadventure...  Well....  it was at least kinda exciting for me, if not for you.  ;-)<br />
<br />
I made a debug version of libstdc++ and libsupc++ to try to find a better way to catch segfaults in try-catch blocks.  (Currently using a jmp_buf to reset the registers ... it's a long story.)<br />
<br />
But though I could trace the stdc++ calls (req's patience due to the numerous 'throws()' in stuff like malloc() and many other subfunctions that trigger a trap signal that I also handled with a simple 'return') the problem was that the good stuff was not in libstdc++ itself, but was still invisible to me.<br />
<br />
Here's where the real misadventure starts.<br />
<br />
Got the sources for gcc from somewhere I fergit now but though it was missing stdc++ the versions were compatible and...<br />
<br />
So I also created a debug version of gcc.  <br />
<br />
Unbeknownst to myself at the time, I set up the prefix wrong in the configuration.  I intended to go into /opt/gcc-dbg but the configurator script I created hadn't correctly defined DBGPREFIX so in the configuration...<br />
<br />
confurator script excerpt:<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<pre class="bbcodeblock" dir="ltr" style="
		margin: 0px;
		margin-right: -99999px;
		padding: 3px;
		border: 1px inset;
		width: 98%;
		height: 82px;
		text-align: left;
		overflow: auto">./configure \
  --prefix=$DBGPREFIX \
  &lt;other config stuff&gt; \
  ##########</pre>
</div>The config thought I wanted it all to to into / due to DBGPREFIX not having been defined in the script.<br />
<br />
Woopsie.  :-)<br />
<br />
[I use scripts to run 'configure' because these things take so long to compile, I need to leave a trail of beans to see what doesn't work -- because sometimes they choke at the last step, sometimes hours later if it's a large build.]<br />
<br />
Fortunately, gcc takes a LONG time to compile.  The way I discovered this problem was by using 'find -cmin &lt;time-offset&gt;'.<br />
<br />
So I was able to find the dirs and files that were misplaced so that I could 'uninstall' them (at least) using a new.make makefile.  And since opensuse is rpm-based, I I attempted to launched yast before the libs disappeared.  <br />
<br />
Worked. whew!  Much easier than typing in unknown rpm filenames.  And here's one of the main reasons I use opensuse despite it's TERRIBLE maintenance of its source repositories -- a tradition that continues into their 12.x development, unfortunately.  (SEE GPL V. 3 PARAG AT THE BOTTOM.)<br />
<br />
In Yast, before uninstalling the misplaced files (see below), I set yast to update unconditionally from sources on my DVD (one reason I like open suse) and do this to 'all in this list' (another reason I like it), where the list was the list of RPMS that contined the name 'gcc'.<br />
<br />
And I left yast open one desktop as I went to collect the lists of files to uninstall using 'find'.<br />
<br />
But not being a high functioning day for me already, after manually moving the obvious errors like /include and /share (and /info ???) directories into the /opt/gcc-dbg folder in preparation for 'importing' the files using new-make, I copied my 'find -cmin' output into a files.dat file.  (Should have been links.dat for an virgin import so that all file attributes are preserved and symlinks in the list don't get copied as the binaries).<br />
<br />
Once all the newer files were in a dat file, however, I could 'make uninstall' though the TREE ended up being useless.<br />
<br />
And then I hit the &quot;accept&quot; button in yast on the other desktop to reinstall anything I might clobbered in this process.<br />
<br />
Then to see if I needed to restore my entire system from backups, since this is very low level stuff that would require 4 gigs of backups to get running again, I held my breath and rebooted.<br />
<br />
Lucky me.  Booted fine.<br />
<br />
Now here's what I want to say.<br />
<br />
The problem was the 'configure' not the new-make.  In fact new-make (and possibly yast) saved me from another &quot;lesson&quot; in exercising caution.<br />
<br />
Yes 'new-make' is dangerous when used on root system files.  But so is 'configure'.  And as it turns out gcc doesn't even have an 'uninstall' target in the makefile, though it's preset to a default installation into /usr/local.  (?)<br />
<br />
Let me say this again, though, because if I had had to restore from backups, it would have taken 12 minutes to get back to a basic running kde system and and I'd only have lost a few files I could easily restore from new-make packages an rpms listed in a package list exported in yast, which are ALL from the installation DVD (and this is yet another reason I like opensuse 11.4).<br />
<br />
So... KEEP BACKUPS YOU CAN LIVE WITH.  This includes lists of packages you may have installed.  And DON'T LOSE YOUR HOME FOLDER, which is not a problem if you just rename it and move it back after restoring from a tarball (which is how I do it, so I don't have to rely on anyone else's sometimes cray-zee assumptions).<br />
<br />
And don't freak out right away when you have problems.  This is linux, not Windows. Most problems are solvable, even nasty problems like installing a test versions of system files into the wrong folders, including /lib and /bin, which I did in this misadventure.  Twice actually!<br />
<br />
It does help if you have the tools though.  And although the file list was really all that was necessary for uninstalling the bogus installation (just rm -f $(&lt;files.dat) you can avoid sudden heart attacks if you make sure you know how to use your distro's rescue system (not as easy as you might think) or get a good rescue CD or (if you can still boot into anything at all) keep an older linux in a partition you can get into quickly to make corrections easily by simply selecting an alternate linux at the boot menu.<br />
<br />
And on that last point...<br />
<br />
That is IF your distro supports the older linux.  Kubuntu doesn't. OpenSUSE does.  So this is yet another reason I use opensuse 11.4 but I don't dare try 12.x, however, because they seem to be following the Gnome/KDE herd over a cliff -- treating our systems like their own personal remote-controlled property and creating a breed of &quot;most normal users&quot; that will NEVER find their own way around.<br />
<br />
Let's cap off this tirade with a word from the free software foundation.<br />
<br />
This is from the GPL v. 3, starting at line 50 and my heart sang when I saw it:<br />
<br />
<b><br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<pre class="bbcodeblock" dir="ltr" style="
		margin: 0px;
		margin-right: -99999px;
		padding: 3px;
		border: 1px inset;
		width: 98%;
		height: 114px;
		text-align: left;
		overflow: auto">  Some devices are designed to deny users access to install or run
  modified versions of the software inside them, although the manufacturer
  can do so.  This is fundamentally incompatible with the aim of
  protecting users' freedom to change the software.  The systematic
  pattern of such abuse occurs in the area of products for individuals to
  use, which is precisely where it is most unacceptable.</pre>
</div></b><br />
<br />
&quot;Precisely where it is most unacceptable?&quot;  Did I read that right?  <br />
<br />
But &quot;Systematic&quot;?  <br />
<br />
And &quot;Devices&quot;?<br />
<br />
Doesn't that sound a bit... um... paranoid?<br />
<br />
Download gcc at opensuse.  10K.  That's some pretty tight compression, eh?  About 40 thousand to one.  But how do they get 400 megs into a 10K archive?  And gcc is also GPL v. 3.  Some time ago, when I tried to download libffi from opensuse which was touted as 'standard' sources for opensuse 11.4 it was 60 Megs and was (of all things)GCC.  Not libffi.  Other files I've attempted to download from them were missing content, had bad headers, or unexpected end of files, and of those that did contain data, many or even most of them appeared to install in the wrong folders.  I'd estimate (from my experience) that approximately 2/3rds of the ALLEGED sources are NOT even what's in our systems.<br />
<br />
So then what is?<br />
<br />
Do you know the developers' names?  Their social security numbers, their bank account numbers?<br />
<br />
Do they know yours?<br />
<br />
Got kde?  Hit ctrl-esc and set ksysguard to sort by pids.  What is PackageKit doing?  Playing dodgball with hackers?  Is that now the high standard of safety they have adopted?  Or is it worse.  What is package kit doing behind your back. See /etc/PackageKit.  (You can just rename the config in that folder to shut that infernal pid-sucker off.)<br />
<br />
Thanks for the blog, LQ. :-) And thanks to QT for putting their code under version 3, so even kde, kubuntu, and opensuse are <b>legally obligated</b> to get their acts together.  But so far, it appears that opensuse is systematically repeating errors of the 11.x development and aappear to be deliberately indifferent to my requests I sent in their &quot;contact us&quot; link at their forums, which I am forced to use since I have been banned for posts like these at their forums.  <br />
<br />
[Truce would have been easy and still could be.  All opensuse needs to do is honor their legal obligations.  And a big thank you to the free software foundation for GPL version 3.]</div>

]]></content:encoded>
			<dc:creator>rainbowsally</dc:creator>
			<guid isPermaLink="true">http://www.linuxquestions.org/questions/blog.php?b=34754</guid>
		</item>
		<item>
			<title>Not able to understand error</title>
			<link>http://www.linuxquestions.org/questions/blog.php?b=34753</link>
			<pubDate>Fri, 11 May 2012 05:59:52 GMT</pubDate>
			<description><![CDATA[when i am running scripts it is giving error  
./dist_auar_pb.sh: line 156: [: /psoft/batch/fsdev/outbound/auar/atl/archive/AUARCPPSF05.120504:...]]></description>
			<content:encoded><![CDATA[<div>when i am running scripts it is giving error <br />
./dist_auar_pb.sh: line 156: [: /psoft/batch/fsdev/outbound/auar/atl/archive/AUARCPPSF05.120504: binary operator expected<br />
<br />
for code <br />
if [ -f $ARC_DIR/${EXTRACT}* ]<br />
  then<br />
   find $ARC_DIR/${EXTRACT}* -mtime +45 -exec rm {} \;<br />
  fi<br />
<br />
but clone copy of this script working fine for same coding <br />
y this??<br />
plz tell me solution what should i do with this script why only this script giving error and not clone scripts</div>

]]></content:encoded>
			<dc:creator>priyankabade</dc:creator>
			<guid isPermaLink="true">http://www.linuxquestions.org/questions/blog.php?b=34753</guid>
		</item>
		<item>
			<title>Yellow Split Pigeon Peas lentil with a twist AKA Sambhar (in Hindi)</title>
			<link>http://www.linuxquestions.org/questions/blog.php?b=34752</link>
			<pubDate>Thu, 10 May 2012 04:15:27 GMT</pubDate>
			<description>*Ingredients:* 
* 1/2 cup Yellow Split Pigeon Peas lentil (AKA Toor dal in Hindi) 
* 3/4 table spoon small yellow Mustard seeds (AKA Sarson in...</description>
			<content:encoded><![CDATA[<div><b>Ingredients:</b><ul><li>1/2 cup Yellow Split Pigeon Peas lentil (<i>AKA Toor dal in Hindi</i>)</li>
<li>3/4 table spoon small yellow Mustard seeds <i>(AKA Sarson in Hindi)</i>.</li>
<li>1 and a half medium Green chillies <i>(AKA Hari mirch in Hindi)</i>.</li>
<li>1 table spoon <i>thick</i> Tamarind syrup. <i>(AKA Imli ka pani in Hindi)</i>. <b><i>(No, this ingredient can NOT be skipped.)</i></b></li>
<li>1 tablespoon <a href="http://www.amazon.com/Eastern-Sambar-Masala-200g/dp/B004XTCZEI" target="_blank">Sambhar masala</a>. <b><i>(No, this ingredient can NOT be skipped.)</i></b></li>
<li>1/4 tea spoon Turmeric powder <i>(AKA Haldi in Hindi)</i>.</li>
<li>1 medium Onion.</li>
<li>1 small Tomato.</li>
<li>1/2 table spoon Salt.</li>
<li>Oil for frying onions and tomatoes.</li>
</ul><br />
<b>Directions:</b><ul><li>Yellow Split Pigeon Peas lentil need to be soaked in water for half an hour. After half an hour, put it in the pressure cooker on the gas, and let it get tender.</li>
<li>Chop the Onion, tomato, and Green Chilies finely.</li>
<li>Put the Mustard seeds in the preheated oil and let them fully crackle.</li>
<li>Add Green chilies, and fry them till they turn florescent green.</li>
<li>Add Onions and salt, and fry til Onions get golden brown.</li>
<li>Add Tomatoes, and fry til they get mushy.</li>
<li>Add cooked Split Pigeon Peas only. Do NOT put in all its water at a time. Decide the consistency you want and add the remaining water accordingly. This recipe if made too watery won't taste too good, IMO.</li>
<li>Add Sambhar Masala, and the Tamarind syrup. Let it boil for few minutes.</li>
<li>Serve hot with boiled rice.</li>
</ul><b>Serves 2</b>.<br />
<br />
P.S. <br />
No, I haven't forgotten Garlic, Ginger, Pepper and all. This South Indian recipe doesn't need them. In fact putting them in it may spoil its authentic South Indian taste.<br />
<br />
Besides, I have also seen many people putting vegetables in this lentil. That's their taste. I don't prefer it that way.</div>

]]></content:encoded>
			<dc:creator>Anisha Kaul</dc:creator>
			<guid isPermaLink="true">http://www.linuxquestions.org/questions/blog.php?b=34752</guid>
		</item>
		<item>
			<title>Linksys WMP600N wireless N ethernet card in Linux...it does work</title>
			<link>http://www.linuxquestions.org/questions/blog.php?b=34750</link>
			<pubDate>Wed, 09 May 2012 08:48:58 GMT</pubDate>
			<description><![CDATA[Hi, after struggling to get this card working I've had success.  This is for Gentoo but other distros should be similar.  Originally I tried the...]]></description>
			<content:encoded><![CDATA[<div>Hi, after struggling to get this card working I've had success.  This is for Gentoo but other distros should be similar.  Originally I tried the rt2800pci driver in the kernel with no luck...running ifconfig wlan0 up caused an error (and I made sure the firmware was loaded too).  So here's my ugly guide on getting things working on a WPA2 N wireless network (using a passphrase):<ul><li>We're going to use the RaLink driver from www.ralinktech.com-&gt;support-&gt;linux.  Download the source for rt2860pci and extract...I had to use p7zip because bzip2 didn't recognize the archive.  7z e 2010...bz2.</li>
</ul><ul><li>Kernel configuration.  Remove the RaLink drivers from the kernel under Device Drivers-&gt;Network Device Support-&gt;Wireless LAN-&gt;Ralink Driver Support or blacklist the rt2800pci module.  Also, the source won't build unless you compile in Intel Pro/Wireless 2200BG and 2915ABG under Device Drivers-&gt;Network Device Support-&gt;Wireless LAN.  This is insane but it's documented here: <a href="http://forums.gentoo.org/viewtopic-t-854151-start-0.html" target="_blank">http://forums.gentoo.org/viewtopic-t...1-start-0.html</a>.</li>
</ul><ul><li>view the README_STA.  check that the Makefile has MODE=STA, TARGET=LINUX</li>
</ul><ul><li>cd os/linux and edit the config.mk.  HAS_WPA_SUPPLICANT=y, HAS_NATIVE_WPA_SUPPLICANT_SUPPORT=y</li>
</ul><ul><li>cd ../..; make; make install.  make install will insert the new modules so you'll have to do this every time you rebuild the kernel.</li>
</ul><ul><li>modprobe rt2860sta and check dmesg for errors.  there should be an interface ra0 if you run ifconfig -a.</li>
</ul><ul><li>emerge wpa_supplicant.  my use flags were dbus, eap-sim, fasteap, madwifi, wps, -ssl</li>
</ul><ul><li>(optional) emerge wireless-tools.  this will give you iwconfig, which helps you see the interface state and what network it's connected to, etc.</li>
</ul><ul><li>wpa_passphrase ssid 'password' &gt;&gt; /etc/wpa_supplicant/wpa_supplicant.conf.  Edit the file and make it look like this:<br />
ctrl_interface=/var/run/wpa_supplicant<br />
ctrl_interface_group=0<br />
ap_scan=2<br />
fast_reauth=1<br />
eapol_version=1 # this is what fixed my connection problems<br />
network={<br />
scan_ssid=1 # for networks hiding their ssid<br />
ssid=&quot;your_ssid&quot;<br />
proto=WPA RSN<br />
key_mgmt=WPA-PSK<br />
pairwise=CCMP TKIP<br />
group=CCMP TKIP<br />
psk=your_hashed_password_from_wpa_passphrase<br />
}</li>
</ul><ul><li>in your /etc/conf.d/net, add this for your wireless:<br />
modules_ra0=&quot;wpa_supplicant&quot;<br />
wpa_supplicant_ra0=&quot;-Dwext&quot;</li>
</ul><br />
This helped a lot: <a href="http://wiki.debian.org/rt2860sta" target="_blank">http://wiki.debian.org/rt2860sta</a></div>

]]></content:encoded>
			<dc:creator>vik</dc:creator>
			<guid isPermaLink="true">http://www.linuxquestions.org/questions/blog.php?b=34750</guid>
		</item>
		<item>
			<title>Lirc .9 with Media Center Edition (MCE) Transceiver in kernel 3.3.4</title>
			<link>http://www.linuxquestions.org/questions/blog.php?b=34749</link>
			<pubDate>Wed, 09 May 2012 08:15:29 GMT</pubDate>
			<description><![CDATA[Hello, I'm writing this to help out anyone who has wasted days trying to get their MCE remote or Media Center Edition Transceiver working with a...]]></description>
			<content:encoded><![CDATA[<div>Hello, I'm writing this to help out anyone who has wasted days trying to get their MCE remote or Media Center Edition Transceiver working with a newer kernel (3.3.4) and new Lirc (.9).  As you may know, mceusb was once built into lirc but now it is in the mainline kernel and there's very little documentation-wise to help us figure it out.  Here are the steps to get it working in the new environment (this is for Gentoo but other distros should be similar):<ul><li>Kernel configuration.  Under Device Drivers-&gt;Multimedia Support-&gt;Remote Controller adapters, select Enable IR Raw decoder for the RC6 protocol (not positive if you need this), Enable IR to LIRC bridge, and Windows Media Center Ed. eHome Infrared Transceiver.  The IR to LIRC bridge is what creates our /dev/lirc0 device.  NOTE: compiling in Compile Remote Controller Keymap caused the buttons to repeat as mentioned here: <a href="http://www.mythtv.org/wiki/MCE_Remote" target="_blank">http://www.mythtv.org/wiki/MCE_Remote</a>, under troubleshooting.  If you don't have an lircrc file defined, you open a terminal, and pressing the up arrow on the remote shows you the last command you typed: you have this module enabled.</li>
</ul><ul><li>Install lirc.  I grabbed the latest, 0.9.  USE flags: transmitter (might not be needed).  In etc/make.conf, add this line LIRC_DEVICES=&quot;userspace&quot;.  Make sure lirc_devices_userspace use flag is set.</li>
</ul><ul><li>The ebuild for lirc is broken for my 64 bit system.  the fix is this: export LDFLAGS_amd64=&quot;&quot;; emerge lirc.</li>
</ul><ul><li>grab the proper lircd.conf file from lirc.sourceforge.net/remotes/mceusb/lircd.conf.mceusb and copy it to /etc/lirc/lircd.conf.</li>
</ul><ul><li>/etc/init.d/lircd start.  hopefully this works; if not take a look at /etc/conf.d/lircd and make sure you have a /dev/lirc0.  If not, add a line LIRCD_OPTS=&quot;-d /dev/path_to_your_device&quot; to the file.</li>
</ul><ul><li>test receive.  run irw and press buttons on the remote.  you should see &quot;hex code&quot; &quot;command&quot; &quot;remote&quot;.  For example, if I press 2 I'll see 000000037ff07bfd 00 Two mceusb.</li>
</ul><ul><li>test send.  irsend LIST mceusb &quot;&quot; to see commands.  Then irsend SEND_ONCE mceusb One and you should see the led light up on the transmitter.</li>
</ul><ul><li>now create your lircrc file and get your media center going!</li>
</ul><br />
NOTES<ul><li>I originally tried the devinput driver but wasn't able to run irsend; I would get an error &quot;send unsupported on hardware&quot; or something like that.</li>
</ul><ul><li>Having a Hauppauge HVR 1600 capture card with an IR transceiver, I tried using that interface but had no luck.  Also, the Zilog driver (in staging) caused Kernel panics so I scrapped that idea.</li>
</ul><br />
Helpful links: <a href="http://www.mythtv.org/pipermail/mythtv-users/2011-June/316879.html" target="_blank">http://www.mythtv.org/pipermail/myth...ne/316879.html</a>, <a href="http://forums.gentoo.org/viewtopic-t-882181-start-0.html" target="_blank">http://forums.gentoo.org/viewtopic-t...1-start-0.html</a>, and <a href="http://forums.gentoo.org/viewtopic-p-6928138.html" target="_blank">forums.gentoo.org/viewtopic-p-6928138.html</a>.</div>

]]></content:encoded>
			<dc:creator>vik</dc:creator>
			<guid isPermaLink="true">http://www.linuxquestions.org/questions/blog.php?b=34749</guid>
		</item>
		<item>
			<title>Unofficial RPMs for libcsv</title>
			<link>http://www.linuxquestions.org/questions/blog.php?b=34747</link>
			<pubDate>Tue, 08 May 2012 02:32:42 GMT</pubDate>
			<description>I completed my libcsv (http://sourceforge.net/projects/libcsv/) RPMs, with 32 bit and 64 bit packages available. 
...</description>
			<content:encoded><![CDATA[<div>I completed my <a href="http://sourceforge.net/projects/libcsv/" target="_blank">libcsv</a> RPMs, with 32 bit and 64 bit packages available.<br />
<br />
<a href="https://frigidcode.com/code/libcsv-packages/" target="_blank">https://frigidcode.com/code/libcsv-packages/</a></div>

]]></content:encoded>
			<dc:creator>hydraMax</dc:creator>
			<guid isPermaLink="true">http://www.linuxquestions.org/questions/blog.php?b=34747</guid>
		</item>
		<item>
			<title>distribute a program in a quad machine.</title>
			<link>http://www.linuxquestions.org/questions/blog.php?b=34746</link>
			<pubDate>Mon, 07 May 2012 18:16:26 GMT</pubDate>
			<description>Hi guys, 
Im a newbie and need your support. 
While I was running a huge fortran program, i found that my quad machine uses only one processor (the...</description>
			<content:encoded><![CDATA[<div>Hi guys,<br />
Im a newbie and need your support.<br />
While I was running a huge fortran program, i found that my quad machine uses only one processor (the other three are more or less idle). Is there any way to distribute load to these idle processors ?<br />
Thanks</div>

]]></content:encoded>
			<dc:creator>saheervc</dc:creator>
			<guid isPermaLink="true">http://www.linuxquestions.org/questions/blog.php?b=34746</guid>
		</item>
		<item>
			<title>Quick method to integrate AD with Linux Clients?</title>
			<link>http://www.linuxquestions.org/questions/blog.php?b=34745</link>
			<pubDate>Mon, 07 May 2012 15:28:22 GMT</pubDate>
			<description>Hi, Can anybody tell me the quick method to integrate AD with Linux clients without using samba authentication. I want my Linux login should be...</description>
			<content:encoded><![CDATA[<div>Hi, Can anybody tell me the quick method to integrate AD with Linux clients without using samba authentication. I want my Linux login should be happen with AD users.<br />
<br />
Vitthal</div>

]]></content:encoded>
			<dc:creator>vitthal_jamdade</dc:creator>
			<guid isPermaLink="true">http://www.linuxquestions.org/questions/blog.php?b=34745</guid>
		</item>
		<item>
			<title>dual boot</title>
			<link>http://www.linuxquestions.org/questions/blog.php?b=34744</link>
			<pubDate>Mon, 07 May 2012 11:10:18 GMT</pubDate>
			<description>sir as you told press shift key but no one key is working when i reboot.no option for win7 and ubuntu.a blank screen comes with a msg  ( ANALOG    ...</description>
			<content:encoded><![CDATA[<div>sir as you told press shift key but no one key is working when i reboot.no option for win7 and ubuntu.a blank screen comes with a msg  ( ANALOG    <br />
AUS.SPEZIFIKATIONE<br />
92.6KHZ/58HZ)<br />
THIS MSG  COMES ON THE SCREEN AND AFTER SOME SECONDS UBUNTU STARTS.SIR PLZ HELP ME.<br />
<br />
<br />
THANKS SIR</div>

]]></content:encoded>
			<dc:creator>mkbawalia</dc:creator>
			<guid isPermaLink="true">http://www.linuxquestions.org/questions/blog.php?b=34744</guid>
		</item>
		<item>
			<title><![CDATA[JFS error "dbAlloc: the hint is outside the map"]]></title>
			<link>http://www.linuxquestions.org/questions/blog.php?b=34743</link>
			<pubDate>Sun, 06 May 2012 10:10:21 GMT</pubDate>
			<description><![CDATA[This error seems to be rare.  Netsearching for "the hint is outside the map" found only source code repositories and a message database with no...]]></description>
			<content:encoded><![CDATA[<div>This error seems to be rare.  Netsearching for &quot;the hint is outside the map&quot; found only source code repositories and a message database with no information beyond the message itself.  No pages were found reporting the message occurring in the wild.<br />
<br />
The original patch which introduced the message (<a href="http://permalink.gmane.org/gmane.comp.file-systems.jfs.patches/49" target="_blank">http://permalink.gmane.org/gmane.com...jfs.patches/49</a>) has this comment:<br />
<div style="margin:20px; margin-top:5px; ">
	<div class="smallfont" style="margin-bottom:2px">Quote:</div>
	<table cellpadding="3" cellspacing="0" border="0" width="100%">
	<tr>
		<td class="bbcodeblock" style="border:1px inset">
			
				# 03/10/14	shaggy &lt;at&gt; shaggy.austin.ibm.com	1.1155<br />
# JFS: Improved error handing<br />
#                                                                                 <br />
# This patch replaces many assert statements, which caused a BUG(), with<br />
# improved code to mark the superblock dirty and then proceed as specified by<br />
# the errors= mount flag (as ext2 and ext3 do).  JFS's default for the errors<br />
# option is &quot;remount-ro&quot; in order to prevent addition data corruption when a<br />
# problem is found.<br />
#                                                                                 <br />
# These asserts are usually triggered by on-disk data corruption.  By marking<br />
# the superblock dirty, fsck will perform a complete check on the file system<br />
# and correct the problems, rather than simply replaying the journal, inviting<br />
# later trouble.
			
		</td>
	</tr>
	</table>
</div>The message appeared in /var/log/syslog on a Debian Squeeze system which was showing no other signs of on-disk data corruption and no unusual smartmon messages.<br />
<br />
It may have been triggered by resizing the file system which is on an LVM LV.  The resize was done at ~16:30.  The error message was at 00:14 the next day.<br />
<br />
The system has had problems re-sizing another JFS (also on an LVM LV on the same HDD) twice before, as reported at <a href="https://bugzilla.kernel.org/show_bug.cgi?id=14979" target="_blank">https://bugzilla.kernel.org/show_bug.cgi?id=14979</a></div>

]]></content:encoded>
			<dc:creator>catkin</dc:creator>
			<guid isPermaLink="true">http://www.linuxquestions.org/questions/blog.php?b=34743</guid>
		</item>
		<item>
			<title>Errata in segfault try-catch code</title>
			<link>http://www.linuxquestions.org/questions/blog.php?b=34742</link>
			<pubDate>Sun, 06 May 2012 09:02:48 GMT</pubDate>
			<description>Update: 
 
I have corrected the 32 and ALSO the 64 bit code here....</description>
			<content:encoded><![CDATA[<div>Update:<br />
<br />
I have corrected the 32 and ALSO the 64 bit code here.<br />
<a href="http://www.linuxquestions.org/questions/blog/rainbowsally-615861/handle-segmentation-faults-in-try-catch-block-34741/">http://www.linuxquestions.org/questi...h-block-34741/</a><br />
<br />
And removed as much asm code as possible, working instead with C/C++ vars to traverse the stack.<br />
<br />
The Computer Mad Science Team.<br />
<br />
:-)</div>

]]></content:encoded>
			<dc:creator>rainbowsally</dc:creator>
			<guid isPermaLink="true">http://www.linuxquestions.org/questions/blog.php?b=34742</guid>
		</item>
		<item>
			<title>Handle segmentation faults in try-catch block</title>
			<link>http://www.linuxquestions.org/questions/blog.php?b=34741</link>
			<pubDate>Sun, 06 May 2012 05:52:24 GMT</pubDate>
			<description><![CDATA[[CHANGELOG:  
May 6, 2012 (second edit) 
Latest: 
Tested 64 bit code (and also 32), corrected close brace in function that got lost in the...]]></description>
			<content:encoded><![CDATA[<div>[CHANGELOG: <br />
May 6, 2012 (second edit)<br />
Latest:<br />
Tested 64 bit code (and also 32), corrected close brace in function that got lost in the #if-#else-#endif mixup (with extern &quot;C&quot; close brace)... nevermind.  It works now.<br />
<br />
Features:<ul><li>catch segmentation faults and continue normally</li>
</ul><br />
Don't underestimate this concept.  We'll be using it in the GUI-Interactive interpreter.<br />
<br />
This is a highly simplified version of the SEH for linux experiment posted earlier on.  In that one ALL the registers are available through the sigcontext struct.  In this one we only need eip/rip and so we can deal with the struct as an array of pointers (or longs, but pointers are more useful).<br />
<br />
It is assumed that the fault is understood and has been fully handled.  In this test we are in essence verifying that address 0 is not available for reading. ;-)<br />
<br />
[The other experiment told what kind of read/write access caused the fault.]<br />
<br />
There is nothing to &quot;fix&quot; in this case except the return address, so here we go.<br />
<br />
file: src/main.cpp<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<pre class="bbcodeblock" dir="ltr" style="
		margin: 0px;
		margin-right: -99999px;
		padding: 3px;
		border: 1px inset;
		width: 98%;
		height: 498px;
		text-align: left;
		overflow: auto">// main.cpp for segv catch test

#include &lt;stdio.h&gt;  // printf() 
#include &lt;signal.h&gt; // signal()

#define BITS 32

void dbg(){}


extern &quot;C&quot;
{

#if BITS == 32
void** get_ebp()
{
  asm(
      &quot;mov %ebp, %esp;\n&quot;
      &quot;popl %ebp;\n&quot;
      &quot;mov %ebp, %eax;\n&quot;
      &quot;ret;\n&quot;
     );
  return 0; // not used
}
#else 
#if BITS == 64
void** get_edx()
{
  asm(
      &quot;mov %rbp, %rsp;\n&quot;
      &quot;popl %rbp;\n&quot;
      &quot;mov %rdx, %rax;\n&quot;
      &quot;ret;\n&quot;
     );
  return 0; // not used
}
#else
#warning BITS must be defined (either 32 or 64)
#endif // 64
#endif // 32

static void exception_mediator(int signum);

int mem_test_var;

static struct sigaction new_action;

static void init_sighandler(void (*fn)(int))
{
  new_action.sa_handler = fn;
  sigemptyset (&amp;new_action.sa_mask);
  new_action.sa_flags = SA_SIGINFO;
  sigaction(11, &amp;new_action, 0); // sigsegv only
}

void** psig_context; // a pointer we can get at in asm
int test_flag;

void throw_test()
{
  test_flag++;
  throw(&quot;Segment violation\nContinuing...\n\n&quot;);
}
    

static void exception_mediator(int signum)
{
  
#if BITS == 32
#define CTX_EIP 14
  void** p = get_ebp();
  p += 2; // &amp;signum
  p = (void**)p[2];                     // pointers
  p += 5;                               // psig_context
  psig_context = (void**)p;
  
  // get context
  void*** context = (void***)psig_context;
  
  // set new eip as though it were a call
  context[CTX_EIP] = (void**)&amp;throw_test;
// } not close brace here -rs

#else
#if BITS == 64
#define CTX_RIP 16

    void**p;
    
    p = (void**)get_rdx();
    p+=5;
    psig_context = p;
    void***context = (void***)psig_context;
    context[CTX_RIP] = (void**)&amp;throw_test;
    
#else
#warning BITS must be defined (either 32 or 64)
#endif // 64
#endif // 32
} // add close brace here -rs

} // extern &quot;C&quot;

int main(int argc, char** argv)
{
  dbg();  
  init_sighandler(exception_mediator);
  printf(&quot;Press ENTER 4 times to test and exit normally\n&quot;);  
  for(int i = 0; i &lt; 4; i++)
  {
    getchar();
    try
    {
      char* s = 0;
      printf(&quot;%s\n&quot;, s);
    }
    catch(const char* s)
    {
      if(test_flag)
        printf(&quot;%s&quot;, s);
      test_flag = 0;
    }
  }
  printf(&quot;\nExiting normally\n&quot;);  
  return 0;
}</pre>
</div>This is preset for ix86 architecture.  You can also try x86_64 if your machine can handle it.  Other architectures haven't been tested but it's very likely that once you find the sigcontext struct, the registers the struct will be identical.<br />
<br />
The Computer Mad Science Team<br />
<br />
:-)</div>

]]></content:encoded>
			<dc:creator>rainbowsally</dc:creator>
			<guid isPermaLink="true">http://www.linuxquestions.org/questions/blog.php?b=34741</guid>
		</item>
		<item>
			<title><![CDATA[Bridge Linux – Arch with "a human face”]]></title>
			<link>http://www.linuxquestions.org/questions/blog.php?b=34740</link>
			<pubDate>Sun, 06 May 2012 02:58:01 GMT</pubDate>
			<description>*As a preliminary.* 
 
Maybe a bit on the recently growing wave of popularity of Arch Linux (I get the impression that many people just reach for...</description>
			<content:encoded><![CDATA[<div><font size="1"><b>As a preliminary.</b></font><br />
<br />
Maybe a bit on the recently growing wave of popularity of Arch Linux (I get the impression that many people just reach for this distribution), I made an attempt to install a 64-bit version of this system with KDE.<br />
<br />
Because, I'm rather an individual, who loves comfort, I started from Chakra Linux. However, the &quot;specific&quot; approach of its creators to GTK applications (I use a few, and not everything is in the bundles), determined that I said “good bye” to this distro. So, in such a case, remained only “vanilla” Arch...but there was also something I did not like: fit, though, perhaps that was due to errors committed by me during the installation or my ignorance of Arch.<br />
<br />
So, anyway, I went back to Sabayon, but - as it turned out later - not for long...<br />
<br />
Looking through the list of distros waiting to be added to the main “collection” on distrowatch.com, I came across a real gem: <a href="http://millertechnologies.net/" target="_blank">BRIDGE LINUX</a><br />
<br />
<font size="1"><b>Who and what?</b></font><br />
<br />
Bridge Linux is an Arch-based distro, issued as a LiveCD with easy installation on a hard disk (either from CD or a USB stick). It can be said that it is fully configured Arch Linux live edition, equipped additionally with a number of programs and scripts, that it is a kind of a “door-to-Arch”, or – as you can read on the project website: &quot;Simplified Arch Linux&quot; (&quot;Arch made easy&quot;).<br />
<br />
Distribution is available in several varieties: with Xfce, GNOME, KDE and &quot;light&quot; (LXDE environment by default and OpenBox as an option), and each of them released as 32-bit (i686) and 64-bit (x86_64).<br />
<br />
The creator of Bridge Linux and its sole developer, not counting the share, gathered around the project - and as yet small - community, is an American, Dalton Miller - a lover of Arch and Xfce. He is, moreover, confirmed, when asked whether the distribution of all kinds are treated equally:<br />
<br />
<div style="margin:20px; margin-top:5px; ">
	<div class="smallfont" style="margin-bottom:2px">Quote:</div>
	<table cellpadding="3" cellspacing="0" border="0" width="100%">
	<tr>
		<td class="bbcodeblock" style="border:1px inset">
			
				Honestly, I'd like to treat them all the same, but Xfce is definitely the best/most polished version. It's what I use, it's what the first version was, so it's the best.
			
		</td>
	</tr>
	</table>
</div>Such an approach of the Author does not mean that he neglects different environments, as I can prove, for example, the issue with KDE. When I started Bridge Linux first time, I was sure that I would have to deal with yet underdeveloped distribution, acting unstable and full of errors, but in fact it was completely different and after a short live version test, I decided to install Bridge Linux as my primary (and only) operating system. Simply, it is exactly what I was looking for: easy to install, fully configured, fast, stable and – what is most important – a rolling distro (not requiring either cyclic reinstallation, nor upgrades) with tailor-made KDE, which contains very few programs by default (and thus it is not necessary long removal of unwanted components). Thanks to very quickly updated and rich repositories of Arch Linux (including AUR) at the same time there is easy access to the latest software releases.<br />
<br />
Depending on the selected version of the desktop environment, there are different minimum requirements for hardware. Based on information from the project website:<br />
<ul><li>Bridge Light might run on a P2 or P3 with 64 - 128 MB of RAM.</li>
<li>Xfce maybe 128 MB RAM and a P3.</li>
<li>GNOME I've heard runs ok on Netbooks with Atoms and 1 GB of RAM.</li>
<li>KDE will probably be best with at least 1 GB of RAM and a 1 GHz CPU.</li>
</ul><br />
“Boss” of the distro says that the above data isn't based on his own tests, so they could not be a determinant of minimum hardware requirements. In his opinion, Bridge Linux will work properly on your computer with a minimum of 1 GB of RAM and 1 GHz processor clock speed.<br />
<br />
<font size="1"><b>Installation</b></font><br />
<br />
Bridge Linux - as I mentioned earlier - gives the possibility to install it on a hard disk. It could be done through a simple installation program (somewhat resembling that the one from Arch Linux). It is not a peak of professionalism – which also the author confirms (and ensures that a fully functional installer with a grafical interface is one of his priorities) – however, the installation process is not either too long, nor overly complex and goes almost atomatically – except for the few obvious for the installation configuration issues that require user action (detailed description of the installation of Bridge Linux will be the subject of one of my next entries on the blog).<br />
<br />
<font size="1"><b>What after install?</b></font><br />
<br />
<i><b>Note! The rest of the entry applies only to Bridge Linux with KDE!</b></i><br />
<br />
It should be noted that the selection of applications, Dalton Miller guided by the principle of no duplication, and left it, mostly, to the user. Hence, as already mentioned, Bridge Linux is characterized by minimalism in terms of quantity of software installed by default. To me, this is one of the advantages of this system, I have, in fact, some favorite applications that I use, but, usually, they do not coincide with the so-called &quot;general trends&quot;, with what most distributions offer by default. Using other distros, I usually spent a lot of time on uninstallation of unnecessary, in my opnion, packages (software) from the freshly-installed system – in case of Bridge Linux, I removed just around twenty-some of them (most of the kdeartwork group).<br />
<br />
<font size="1"><b>Which software does Bridge Linux offer in the default kit?</b></font><br />
<br />
Contrary to what may be suggested, a reduced number of default applications in the distribution created by Dalton Miller gives user quite a lot of possibilities: there is a web browser (Chromium), an email client (KMail), an IM (Kopete), a program to use torrents (Transmission-qt), there is also an office suite (LibreOffice), a pdf viewer (Okular), a graphics program (GIMP) and Image Viewer (GwenView), there is an audio player (Amarok) and video player (DragonPlayer) there are, finally, tools for programmers (Qt-Assistant, Qt -Designer and Qt-Linguist). In addition, a script which starts with the first run of the system, allows to install, among others, Java environment (Oracle's jre - personally, I did not use this option and installed OpenJDK by my own).<br />
<br />
It should also be noted that a program installed by default called “packer”, allows a user of Bridge Linux to use AUR repository &quot;out of the box&quot;, without any additional configuration. Packer is, in general, a useful tool, because except AUR, it supports also standard repositories, replacing, thus, partially pacman.<br />
<br />
<font size="1"><b>Is there anything that you need to install on your own?</b></font><br />
<br />
Yes, first of all, your language package for KDE, kde-l10n-<i>&lt;your language code&gt;</i> and for LibreOffice - libreoffice-<i>&lt;your language code&gt;</i> (unless the system is to remain in English). Besides, the Java Runtime Environment (or jdk), if it is required and was not installed with the script, I described above. Also, Icedtea must be installed for OpenJDK. Other applications users install according to their needs and preferences.</div>

]]></content:encoded>
			<dc:creator>ludvick</dc:creator>
			<guid isPermaLink="true">http://www.linuxquestions.org/questions/blog.php?b=34740</guid>
		</item>
		<item>
			<title>Slackware Rox</title>
			<link>http://www.linuxquestions.org/questions/blog.php?b=34739</link>
			<pubDate>Sun, 06 May 2012 00:34:25 GMT</pubDate>
			<description>So i come here every once in awhile to see if i can be of some help but all  of the issues with Slackware are few and far between or solved already....</description>
			<content:encoded><![CDATA[<div>So i come here every once in awhile to see if i can be of some help but all  of the issues with Slackware are few and far between or solved already.<br />
<br />
Thanks guys</div>

]]></content:encoded>
			<dc:creator>o2cool</dc:creator>
			<guid isPermaLink="true">http://www.linuxquestions.org/questions/blog.php?b=34739</guid>
		</item>
		<item>
			<title>GUI-Interactive: Display a list of QT4 classes</title>
			<link>http://www.linuxquestions.org/questions/blog.php?b=34738</link>
			<pubDate>Sat, 05 May 2012 09:51:04 GMT</pubDate>
			<description><![CDATA[Today's features: 
* A stand alone executable to list all of QT4's classes. 
* A first function for an interactive interpreter for QT funcs and...]]></description>
			<content:encoded><![CDATA[<div>Today's features:<ul><li>A stand alone executable to list all of QT4's classes.</li>
<li>A first function for an interactive interpreter for QT funcs and classes</li>
<li>Another simple but interesting parse job.</li>
</ul><br />
Requres:<ul><li>the libLQ download (or your own work-alike hack)</li>
</ul><br />
<a href="http://www.linuxquestions.org/questions/blog/rainbowsally-615861/liblq-and-mc2-makefile-creator2-the-next-generation-34648/">http://www.linuxquestions.org/questi...eration-34648/</a><br />
<br />
We are delving into QT's system for reasons explained in earlier blog entries.  When I tried early versions of QT4 it was at the bottom of the list of potential GUI's I was looking at.  But the newer QT4 seems to be pretty good.  Might even stick with it.  :-)<br />
<br />
For the interactive layer (communicating with the GUI system) one thing we may need is a list of all available classes and a 'word' we can use to get this information.  <br />
<br />
[From this list we'll be able search for classes, write includes and create objects to view their properties and methods, etc.]<br />
<br />
We may need contexts like namespaces in the future and since C structs already incorporate this kind of encapsulation by way of '-&gt;' or '.' accessors (such as they are), let's borrow the '.' notation scheme, initially sans namespace context.<br />
<br />
Here's the task.<br />
<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<pre class="bbcodeblock" dir="ltr" style="
		margin: 0px;
		margin-right: -99999px;
		padding: 3px;
		border: 1px inset;
		width: 98%;
		height: 82px;
		text-align: left;
		overflow: auto">list all classes:
  find all headers in /usr/include/Qt that contain &quot;Q_&lt;*&gt;_EXPORT&quot; and 
  extract the class name.
  display the list.</pre>
</div><div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<pre class="bbcodeblock" dir="ltr" style="
		margin: 0px;
		margin-right: -99999px;
		padding: 3px;
		border: 1px inset;
		width: 98%;
		height: 82px;
		text-align: left;
		overflow: auto">void classes_x_listAll(int argc, char** argv)
{
  // implementation details
}</pre>
</div>The reason for the _x_ is to allow namespace prefixes like dots arrows or even &quot;::&quot;.<br />
<br />
The reason for the argc, argv parameters is to reuse existing traditions, import and export functions to and from stand-alone xecutables, and also allow for the eventual development of a bytecode interpreter which will be able to compile this function like this.<br />
<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<pre class="bbcodeblock" dir="ltr" style="
		margin: 0px;
		margin-right: -99999px;
		padding: 3px;
		border: 1px inset;
		width: 98%;
		height: 34px;
		text-align: left;
		overflow: auto"> : argc | function_address [ | param1 | param2 ... ] ;</pre>
</div>If argc = 1, function address is param[0].  We can therefore also think of the argc value as a 'commandlength' in the bytecode compiler.  Our first function definition will be this kind of function.<br />
<br />
The execution loop therefor will set the function_address as argv (pointer to self) and the argc for this call is 1 (no additional parameters).<br />
<br />
We also need a function to exit the interpeter loop, which we'll name &quot;quit&quot;.<br />
<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<pre class="bbcodeblock" dir="ltr" style="
		margin: 0px;
		margin-right: -99999px;
		padding: 3px;
		border: 1px inset;
		width: 98%;
		height: 82px;
		text-align: left;
		overflow: auto">void quit(int argc, char** argv)
{
  // implementation details
}</pre>
</div>It's in the 'root' context so it has no prefix.<br />
<br />
We need to look through all the files in /usr/include/Qt for file's that contain lines that look like this:<br />
[code] class Q_&lt;...&gt;_EXPORT %{ClassName}% ... // i.e., : public ParentName[code]<br />
<br />
<br />
file: src/error_codes.dat<br />
purpose: sync enum and string data for sequential tokens<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<pre class="bbcodeblock" dir="ltr" style="
		margin: 0px;
		margin-right: -99999px;
		padding: 3px;
		border: 1px inset;
		width: 98%;
		height: 162px;
		text-align: left;
		overflow: auto">////////////////////////////////////////////////////////////////////////
// This is a list of name/value pairs for loading constant error tokens
////////////////////////////////////////////////////////////////////////
// User defines LOAD_NV to either set the first or the second parameter
// in the enum or the string array.

LOAD_NV(ERROR_VERSION, &quot;NO VERSION, JUST FOR TEST&quot;),
LOAD_NV(ERROR_ARGC, &quot;Wrong number of args&quot;),
LOAD_NV(ERROR_ENDLIST, 0)</pre>
</div><br />
file: src/main.cpp<br />
[code]<br />
// generic C++ source template<br />
<br />
#include &lt;stdio.h&gt;  // printf(), FILE*, etc.<br />
#include &lt;malloc.h&gt; // malloc(), free()<br />
#include &lt;string.h&gt; // strcpy(), memcpy(), etc.<br />
#include &lt;stdlib.h&gt; // exit()<br />
<br />
// enable as needed<br />
#include &lt;LQ/LQ.h&gt;  // loads all libLQ headers <br />
<br />
#define TESTING_LISTALL 1 /* includes main() function in compilation */<br />
<br />
void dbg(){}<br />
<br />
#define LOAD_NV(tokname, str) \<br />
  tokname<br />
<br />
typedef enum<br />
{<br />
#include &quot;error_codes.dat&quot;<br />
//  ERROR_VERSION,<br />
//  ERROR_ARGC,<br />
//  ERROR_ENDIST<br />
}ERROR_CODE;<br />
<br />
#undef LOAD_NV<br />
<br />
#define LOAD_NV(tokname, str) \<br />
  str<br />
<br />
const char* error_string[] =<br />
{<br />
#include &quot;error_codes.dat&quot;<br />
//  &quot;1.0&quot;,<br />
//  &quot;Wrong number of args&quot;,<br />
//  0 // ENDLIST<br />
};<br />
    <br />
#undef LOAD_NV<br />
<br />
<br />
void syntax_error(char** argv, ERROR_CODE code, const char* helpstr)<br />
{<br />
#ifndef HAVE_FUNC_LOOKUPS<br />
  // simulate a lookup table for function names<br />
  char* _func_name = (char*)&quot;Unknown&quot;;<br />
  char* func_name_tbl[] = {_func_name, 0};<br />
  int func_index = 0;<br />
#else<br />
  // TODO<br />
#endif<br />
  if(code &gt;= ERROR_ENDLIST)<br />
  {<br />
    fprintf(stderr,<br />
        &quot;Uh... something's really screwy here.\n&quot;<br />
        &quot; Not even the error code is right in '%s'\n&quot;<br />
        &quot; Is this even the right version? (%s) -rs&quot;, __func__, error_string[0]);<br />
    // XBell();<br />
    exit(1);<br />
  }<br />
  fprintf(stderr, &quot;In [%s]: %s\n&quot;, func_name_tbl[func_index], error_string<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<pre class="bbcodeblock" dir="ltr" style="
		margin: 0px;
		margin-right: -99999px;
		padding: 3px;
		border: 1px inset;
		width: 98%;
		height: 498px;
		text-align: left;
		overflow: auto">);
  if(helpstr)
    fprintf(stderr, &quot;%s\n&quot;, helpstr);
  exit(code);
}

void parse_classnames(char*** pclassnames, char**filelist);

// subroutines are private and may have non-std parameter lists and 
// return values.  The pvt_ prefix isn't necessary, but don't use 
// _x_ anywhere in the name.  We may need that to generate jump addresses
// and name linkage later.

void pvt_listAll(char*** plist)
{
  slist_pipeRead(plist, &quot;ls /usr/include/Qt/*.h 2&gt;/dev/null&quot;);
}

void pvt_parse_classnames(char*** pclassnames, char** filelist);
    
void classes_x_listAll(int argc, char** argv)
{
  // implementation details
  if(argc != 1)
    syntax_error(argv, ERROR_ARGC, &quot;Needs 0 args&quot;);
  // get list of headers in /usr/include/Qt and create list of 
  // find class strings
  char** filelist = slist_new();
  char** classnames = slist_new();
  pvt_listAll(&amp;filelist);
  // for(char** ps = filelist; *ps; ps++) printf(&quot;%s\n&quot;, *ps);
  if(slist_count(filelist)) 
  {
    pvt_parse_classnames(&amp;classnames, filelist);
    for(int i = 0; i &lt; slist_count(classnames); i++)
      printf(&quot;%s\n&quot;, classnames[i]);
  }
  slist_delete(&amp;filelist);
  slist_delete(&amp;classnames);
}

static void pvt_parse_one_classname(char*** pclassnames, const char* filename)
{
  FILE* fp = fopen(filename, &quot;r&quot;);
  char ibuf[256];
  char obuf[256];
  // simple parse for text 
  // class Q_GUI_EXPORT %{ClassName}% ... 

  const char* ip;
  char* op;
  if(!fp) return;
  while(!feof(fp))
  {
    *ibuf = 0;
    fgets(ibuf, 256, fp);
    if(*ibuf)
    {
      // simple parse job, let's do it inline
      do
      {
        ip = ibuf;
        op = obuf;
        
        // skip [whitespaces]
        while(*ip == ' ') ip++;
        
        // skip &quot;class&quot;
        if(strncmp(ip, &quot;class&quot;, 5)) break;
        ip += 5;
        
        // skip [whitespaces]
        while(*ip == ' ') ip++;
        
        // skip &quot;Q_&quot;&lt;*&gt;_EXPORT&quot;
        {
          bool state = false;
          do
          {
            if(strncmp(ip, &quot;Q_&quot;, 2)) break;
            ip += 2;
            for(; *ip &gt; ' '; ip++)
            {
              if(strncmp(ip, &quot;_EXPORT&quot;, 7) == 0) 
              {
                ip += 7;
                state = true; 
                break;
              }
            }
          }while(0);
          if(!state)
            break;
        } // end &quot;Q_&quot;&lt;*&gt;_EXPORT&quot;

        // skip [whitespaces]
        while(*ip == ' ') ip++;
        
        // copy classname
        while((*ip &gt; ' ') &amp;&amp; (*ip != ':'))
          *op++ = *ip++;
      }while(0);
      *op = 0;
      if(*obuf)
        slist_append(pclassnames, obuf);
    }
  }
  fclose(fp);
}

void pvt_parse_classnames(char*** pclassnames, char** filelist)
{
  int nfiles = slist_count(filelist);
  const char* filename;
  for(int i = 0; i &lt; nfiles; i++)
  {
    filename = filelist[i];
    pvt_parse_one_classname(pclassnames, filename);
  }
}

#if TESTING_LISTALL
int main(int argc, char** argv)
{
  dbg();  
  classes_x_listAll(argc, argv);
  return 0;
}
#endif // TESTING_LISTALL</pre>
</div><br />
For the makefile, try 'mc2 -fetch LQ++'.<br />
<br />
I used the C++ template but I then had to add an INCLUDE and a LIB and an LDFLAG.<br />
<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<pre class="bbcodeblock" dir="ltr" style="
		margin: 0px;
		margin-right: -99999px;
		padding: 3px;
		border: 1px inset;
		width: 98%;
		height: 98px;
		text-align: left;
		overflow: auto">PREFIX = $(HOME)/usr32
INCLUDE = -I $(SRCDIR) -I$(PREFIX)/include -I /usr/include 
LINK = g++ -m32 -o # LINK &lt;output_file&gt; ...
LDFLAGS = -lLQ
LIB = -L/usr/lib -L$(PREFIX)/lib</pre>
</div>The above might get you rolling even if you don't use mc2.  Good luck. :-)<br />
<br />
The executable lists just under a thousand classes on my system.<br />
<br />
Here's just the start and the end of the dump.<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<pre class="bbcodeblock" dir="ltr" style="
		margin: 0px;
		margin-right: -99999px;
		padding: 3px;
		border: 1px inset;
		width: 98%;
		height: 130px;
		text-align: left;
		overflow: auto">Q3Accel
Q3Action
Q3ActionGroup
  &lt;snipping 905 class names&gt;
QXmlSchema
QXmlSchemaValidator
QXmlSerializer</pre>
</div>It looks pretty much like we might be able to write code to include the right header ala &quot;#include &lt;ClassName&gt;&quot; and create an object and then call it's metaObject() to get properties and methods either as an external temp app even if we can't get our interpreter to generate the object in a class factory of some kind.  So one way or another, we'll be able to get this info for most if not all of these classes.<br />
<br />
And this interpreter will carry around everything it needs to do its jobs because the exectuable and the lib are one and the same.<br />
<br />
Next let's start playing with a byte code* compatible interpreter and see if we can actually execute this hair-brained plan.<br />
<br />
----------------<br />
* re. byte-code.<br />
It may not end up being exactly byte-code because we can use hard coded direct addresses, which may be a easier to port back and forth to/from stand alone executables since we won't have that extra level of indirection to unravel.<br />
<br />
The Computer Mad Science Team.<br />
<br />
:-)</div>

]]></content:encoded>
			<dc:creator>rainbowsally</dc:creator>
			<guid isPermaLink="true">http://www.linuxquestions.org/questions/blog.php?b=34738</guid>
		</item>
		<item>
			<title>GUI Interacitve</title>
			<link>http://www.linuxquestions.org/questions/blog.php?b=34737</link>
			<pubDate>Fri, 04 May 2012 16:06:13 GMT</pubDate>
			<description><![CDATA[This will be a new subtheme under the GUI Programming topic. 
 
No examples or experiments yet, let's just talk about the how's and why's of doing...]]></description>
			<content:encoded><![CDATA[<div>This will be a new subtheme under the GUI Programming topic.<br />
<br />
No examples or experiments yet, let's just talk about the how's and why's of doing this.<br />
<br />
It's time to start thinking about an interactive layer to communicate with the GUI system.  This implies an interpreter, which runs in a loop grabbing commands and executing them (if the syntax is correct) and is really not much different from a bytecode compiler which runs an execution loop to do the same, so we can do this with the notion of expanding this to a bytecode compiler in mind.<br />
<br />
The goal is to get more info about the system by executing commands, such as a command to list all the methods for a given class or all the properties and where they come from.  This is available in 'assistant' for QT but it's easier to find all the methods (for example) by creating a dummy ui file and editing the connections to see what's available.  And even then, we can't copy/paste any results.<br />
<br />
And properties are no easier to figure out.<br />
<br />
Fair enough?  A worthy goal?<br />
<br />
And this 'interactive' layer should be generic enough that the interface can be adapted to other GUI systems.<br />
<ul><li>The interactive layer will be an interpreter. Interpreters need 'names' of functions to find their execution procedures.</li>
<li>Names are strings.</li>
</ul>And so as in previous experiments, we'll want efficient lookup tables, and this time we may want to split them into threads, and perhaps even 'contexts' which will act like 'namespaces' or class inheritance links.  But this gets fairly labor intensive, so let's start with just getting some basic info from the GUI for now.<br />
<br />
Stay tuned.  The Interactive layer will be all mixed up with other experiments and demos due to the way evolution works in the domain of 'knowledge' which is probably pretty much related to how evolution works in nature.<br />
<br />
The Computer Mad Science Team<br />
<br />
PS. The properties used in the previous preemptive event handler experiment were looked up using other previous experiments that listed methods and properties for a hard-coded widget.<br />
<br />
This interactive layer for the GUI is not only a valid goal, it's proven useful already.  The 'interpreter'?  It was bash with it's own set of syntax rules that disallow params in parens, among other things that make it unacceptable for our GUI-interactive interpreter.<br />
<br />
:-)</div>

]]></content:encoded>
			<dc:creator>rainbowsally</dc:creator>
			<guid isPermaLink="true">http://www.linuxquestions.org/questions/blog.php?b=34737</guid>
		</item>
		<item>
			<title>Smarter popups in desktop apps</title>
			<link>http://www.linuxquestions.org/questions/blog.php?b=34736</link>
			<pubDate>Thu, 03 May 2012 17:42:13 GMT</pubDate>
			<description>Sometimes when you make some mistake in an app, like forgetting to enter a subject for email, you get these popups warning of the problem.  Then you...</description>
			<content:encoded><![CDATA[<div>Sometimes when you make some mistake in an app, like forgetting to enter a subject for email, you get these popups warning of the problem.  Then you have to click OK to dismiss the popup and correct the error.<br />
<br />
What I would like to see is for the app to also be checking the error condition that caused the problem, and if it gets corrected, take the popup down automatically.  Of course this also means the app developer would have to learn about multithreading and how to put the popup in a different thread, and communicate between the thread handling the main user experience, and the thread interrupting that user experience (usually, you can't do anything when one of these popups happen).<br />
<br />
Web developers should learn to do this, too.  I've seen at least one site that did this (where I got the idea), so it is clearly possible to do, even on my antique year old browser.</div>

]]></content:encoded>
			<dc:creator>Skaperen</dc:creator>
			<guid isPermaLink="true">http://www.linuxquestions.org/questions/blog.php?b=34736</guid>
		</item>
		<item>
			<title>QT4 Event preemption: mouse click to get object name</title>
			<link>http://www.linuxquestions.org/questions/blog.php?b=34735</link>
			<pubDate>Thu, 03 May 2012 16:30:20 GMT</pubDate>
			<description>See also the experiment to dump properties....</description>
			<content:encoded><![CDATA[<div>See also the experiment to dump properties.<br />
<a href="http://www.linuxquestions.org/questions/blog/rainbowsally-615861/qt4-property-dump-example-simple-terminal-app-34716/">http://www.linuxquestions.org/questi...nal-app-34716/</a><br />
<br />
Now that we have event preemption ability, let's get simple again and create ui application that can tell the name of a widget by clicking on it.<br />
<br />
[It's simpler than you think but I have uploaded the sources and makefile in case my description of this process is too complicated or confusing.]<br />
<br />
Preemption for this is necessary because NORMAL mouse events need to be disabled (or consumed) during the call to identify the widgets.<br />
<br />
So let's start here if we're using mc2.  <br />
<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<pre class="bbcodeblock" dir="ltr" style="
		margin: 0px;
		margin-right: -99999px;
		padding: 3px;
		border: 1px inset;
		width: 98%;
		height: 114px;
		text-align: left;
		overflow: auto">mc2 -fetch qt4                         # makefile template for qt4
mc2 -create qt4-files src/click_id.ui  # generate initial fileset

# edit click_id.ui and change class from QWidget to QDialog
mc2 -run qt4-ui src                    # get ui: target and paste into mc2.def
mc2 -init                              # generate a self-updating makefile</pre>
</div>Here's the ui file after editing and adding a few widgets for the test.  <br />
<br />
[The 'hints' tags have been stripped for size reduction... should still work even though the connection editor won't show them in the right places.]<br />
<br />
file: src/click_id.ui<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<pre class="bbcodeblock" dir="ltr" style="
		margin: 0px;
		margin-right: -99999px;
		padding: 3px;
		border: 1px inset;
		width: 98%;
		height: 498px;
		text-align: left;
		overflow: auto">&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;ui version=&quot;4.0&quot;&gt;
 &lt;class&gt;click_id&lt;/class&gt;
 &lt;widget class=&quot;QDialog&quot; name=&quot;click_id&quot;&gt;
  &lt;property name=&quot;geometry&quot;&gt;
   &lt;rect&gt;
    &lt;x&gt;0&lt;/x&gt;
    &lt;y&gt;0&lt;/y&gt;
    &lt;width&gt;400&lt;/width&gt;
    &lt;height&gt;300&lt;/height&gt;
   &lt;/rect&gt;
  &lt;/property&gt;
  &lt;property name=&quot;windowTitle&quot;&gt;
   &lt;string&gt;Form&lt;/string&gt;
  &lt;/property&gt;
  &lt;widget class=&quot;QPushButton&quot; name=&quot;btnGetName&quot;&gt;
   &lt;property name=&quot;geometry&quot;&gt;
    &lt;rect&gt;
     &lt;x&gt;280&lt;/x&gt;
     &lt;y&gt;10&lt;/y&gt;
     &lt;width&gt;102&lt;/width&gt;
     &lt;height&gt;27&lt;/height&gt;
    &lt;/rect&gt;
   &lt;/property&gt;
   &lt;property name=&quot;text&quot;&gt;
    &lt;string&gt;Get &amp;amp;Name&lt;/string&gt;
   &lt;/property&gt;
  &lt;/widget&gt;
  &lt;widget class=&quot;QPushButton&quot; name=&quot;btnQuit_1&quot;&gt;
   &lt;property name=&quot;geometry&quot;&gt;
    &lt;rect&gt;
     &lt;x&gt;30&lt;/x&gt;
     &lt;y&gt;220&lt;/y&gt;
     &lt;width&gt;102&lt;/width&gt;
     &lt;height&gt;27&lt;/height&gt;
    &lt;/rect&gt;
   &lt;/property&gt;
   &lt;property name=&quot;text&quot;&gt;
    &lt;string&gt;Quit &amp;amp;1&lt;/string&gt;
   &lt;/property&gt;
  &lt;/widget&gt;
  &lt;widget class=&quot;QPushButton&quot; name=&quot;btnQuit_2&quot;&gt;
   &lt;property name=&quot;geometry&quot;&gt;
    &lt;rect&gt;
     &lt;x&gt;150&lt;/x&gt;
     &lt;y&gt;220&lt;/y&gt;
     &lt;width&gt;102&lt;/width&gt;
     &lt;height&gt;27&lt;/height&gt;
    &lt;/rect&gt;
   &lt;/property&gt;
   &lt;property name=&quot;text&quot;&gt;
    &lt;string&gt;Quit &amp;amp;2&lt;/string&gt;
   &lt;/property&gt;
  &lt;/widget&gt;
  &lt;widget class=&quot;QPushButton&quot; name=&quot;btnQuit_3&quot;&gt;
   &lt;property name=&quot;geometry&quot;&gt;
    &lt;rect&gt;
     &lt;x&gt;270&lt;/x&gt;
     &lt;y&gt;220&lt;/y&gt;
     &lt;width&gt;102&lt;/width&gt;
     &lt;height&gt;27&lt;/height&gt;
    &lt;/rect&gt;
   &lt;/property&gt;
   &lt;property name=&quot;text&quot;&gt;
    &lt;string&gt;Quit &amp;amp;3&lt;/string&gt;
   &lt;/property&gt;
  &lt;/widget&gt;
 &lt;/widget&gt;
 &lt;resources/&gt;
 &lt;connections&gt;
  &lt;connection&gt;
   &lt;sender&gt;btnQuit_1&lt;/sender&gt;
   &lt;signal&gt;clicked()&lt;/signal&gt;
   &lt;receiver&gt;click_id&lt;/receiver&gt;
   &lt;slot&gt;close()&lt;/slot&gt;
  &lt;/connection&gt;
  &lt;connection&gt;
   &lt;sender&gt;btnQuit_2&lt;/sender&gt;
   &lt;signal&gt;clicked()&lt;/signal&gt;
   &lt;receiver&gt;click_id&lt;/receiver&gt;
   &lt;slot&gt;close()&lt;/slot&gt;
  &lt;/connection&gt;
  &lt;connection&gt;
   &lt;sender&gt;btnQuit_3&lt;/sender&gt;
   &lt;signal&gt;clicked()&lt;/signal&gt;
   &lt;receiver&gt;click_id&lt;/receiver&gt;
   &lt;slot&gt;close()&lt;/slot&gt;
  &lt;/connection&gt;
  &lt;connection&gt;
   &lt;sender&gt;btnGetName&lt;/sender&gt;
   &lt;signal&gt;clicked()&lt;/signal&gt;
   &lt;receiver&gt;click_id&lt;/receiver&gt;
   &lt;slot&gt;onGetID()&lt;/slot&gt;
  &lt;/connection&gt;
 &lt;/connections&gt;
 &lt;slots&gt;
  &lt;slot&gt;onGetID()&lt;/slot&gt;
 &lt;/slots&gt;
&lt;/ui&gt;</pre>
</div>edit src/app-main.cpp so it looks like this.<br />
<br />
file: src/app-main.cpp<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<pre class="bbcodeblock" dir="ltr" style="
		margin: 0px;
		margin-right: -99999px;
		padding: 3px;
		border: 1px inset;
		width: 98%;
		height: 498px;
		text-align: left;
		overflow: auto">#include &lt;stdio.h&gt;
#include &lt;QtGui/QApplication&gt;
#include &quot;click_id.h&quot;
#include &quot;lqapp.h&quot;

int main(int argc, char *argv[])
{
    LQApp a(argc, argv);
    click_id w;
    w.show();
    LQApp::watch = &amp;w;
    return a.exec();
}

//////////////////////////////////////////////////////////////
// filling out LQApp

extern bool getting_id;

// user defined virtual function
bool LQApp::eventHandler(QObject* receiver, QEvent* event)
{
  if(event-&gt;type() == QEvent::MouseButtonPress)
  {
    if(getting_id)
    {
      // 1. find widget under mouse... well, that will be the intended 
      // receiver of the current event if getting_id is true.
      //
      // 2. get property of widget on mouse click and do NOT process 
      // this event.
      
      int indx;
      QVariant anytype;
      indx = receiver-&gt;metaObject()-&gt;indexOfProperty(&quot;objectName&quot;);
      if(indx &lt; 0)
        printf(&quot;This baby has no 'objectName' property\n&quot;);
      else
      {
        const char* s;
        anytype = receiver-&gt;property(&quot;objectName&quot;);
        printf(&quot;objectName: %s\n&quot;, s = anytype.toByteArray());
      }
      indx = receiver-&gt;metaObject()-&gt;indexOfProperty(&quot;text&quot;);
      if(indx &lt; 0)
        printf(&quot;This baby has no 'text' property\n&quot;);
      else
      {
        const char* s;
        anytype = receiver-&gt;property(&quot;text&quot;);
        printf(&quot;text: %s\n&quot;, s = anytype.toByteArray());
      }
      printf(&quot;\n&quot;);
      getting_id = false;
      return true; // consumed
    }
  }
  return QApplication::notify(receiver, event);
}</pre>
</div><br />
Edit click_id.h and add<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<pre class="bbcodeblock" dir="ltr" style="
		margin: 0px;
		margin-right: -99999px;
		padding: 3px;
		border: 1px inset;
		width: 98%;
		height: 50px;
		text-align: left;
		overflow: auto">public slots:
  void onGetID();</pre>
</div>Edit click_id.cpp and add<br />
<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<pre class="bbcodeblock" dir="ltr" style="
		margin: 0px;
		margin-right: -99999px;
		padding: 3px;
		border: 1px inset;
		width: 98%;
		height: 114px;
		text-align: left;
		overflow: auto">bool getting_id;

void click_id::onGetID()
{
  getting_id = true;
}</pre>
</div><br />
We also need the subclassed QApplication that allows us to do this.<br />
<br />
file: src/lqapp.cpp<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<pre class="bbcodeblock" dir="ltr" style="
		margin: 0px;
		margin-right: -99999px;
		padding: 3px;
		border: 1px inset;
		width: 98%;
		height: 434px;
		text-align: left;
		overflow: auto">// lqapp.cpp - preemptive event handling in subclass of QApplication

#include &quot;lqapp.h&quot;


// today the world, tomorrow the stars...
bool LQApp::notify(QObject *receiver, QEvent *event)
{ 
  // printf(&quot;receiver: %s0x%lX: eventType: %d\n&quot;, 
  //         receiver == watch ? &quot;TARGET -&gt; &quot; : &quot;&quot;, 
  //         (long)receiver, e-&gt;type());
  return eventHandler(receiver, event); // user defined virtual
}

LQApp::LQApp(int &amp;argc, char **argv)
: QApplication(argc, argv)
{
  // additional setup
}

LQApp::~LQApp()
{
  // delete additional setup as req'd
}

QObject* LQApp::watch; // static, globally accessible</pre>
</div>file: src/lqapp.h<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<pre class="bbcodeblock" dir="ltr" style="
		margin: 0px;
		margin-right: -99999px;
		padding: 3px;
		border: 1px inset;
		width: 98%;
		height: 322px;
		text-align: left;
		overflow: auto">// lqapp.h

#ifndef lqapp_h
#define lqapp_h

#include &lt;QApplication&gt;     // parent class
#include &lt;qevent.h&gt;           // always used

class LQApp : public QApplication
{
public:
  LQApp(int &amp;argc, char **argv);
  ~LQApp();
  bool notify(QObject *receiver, QEvent *e);                // preemptive event handler
  virtual bool eventHandler(QObject *receiver, QEvent *e);  // let's try this approach
  static QObject* watch;                                    // ...
};

#endif // lqapp_h</pre>
</div>Now we have<br />
1. click_id.ui <br />
2. main.cpp <br />
3, 4. click_id.h and cpp (class declaration and slot definitions)<br />
5, 6. lqapp.h and cpp (the event loop handler)<br />
<br />
But we need two more files.  If you're using qmake and a pro file, use uic and moc and qmake for this, or with mc2, here's how we can do it.<br />
<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<pre class="bbcodeblock" dir="ltr" style="
		margin: 0px;
		margin-right: -99999px;
		padding: 3px;
		border: 1px inset;
		width: 98%;
		height: 50px;
		text-align: left;
		overflow: auto">make ui
make</pre>
</div>Here's the dump for my clicking on the middle button at the bottom, the form, and the &quot;Get Name&quot; button (that triggers the event preemption and printout) itself.<br />
<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<pre class="bbcodeblock" dir="ltr" style="
		margin: 0px;
		margin-right: -99999px;
		padding: 3px;
		border: 1px inset;
		width: 98%;
		height: 162px;
		text-align: left;
		overflow: auto">$&gt; main
objectName: btnQuit_2
text: Quit &amp;2

objectName: click_id
This baby has no 'text' property

objectName: btnGetName
text: Get &amp;Name</pre>
</div>And all of the buttons function normally if 'Get Name' is not clicked first.  All three Quit buttons will indeed quit when we are not preempting the these events.<br />
<br />
I'll upload a working copy of this experiment in case my description of the steps was too complicated.<br />
<br />
The d/load is only about 6K.  <br />
<a href="http://rainbowsally.net/pub/lq/rs-click-id.tar.gz" target="_blank">http://rainbowsally.net/pub/lq/rs-click-id.tar.gz</a><br />
Type 'make'.  Run 'main' from the terminal so you can see the dump.<br />
<br />
Includes debug info in case you want to see how it works.  (I use kdbg &gt;= 5.0)<br />
<br />
The Computer Mad Science Team<br />
<br />
:-)</div>

]]></content:encoded>
			<dc:creator>rainbowsally</dc:creator>
			<guid isPermaLink="true">http://www.linuxquestions.org/questions/blog.php?b=34735</guid>
		</item>
		<item>
			<title>Integrated KVM connector</title>
			<link>http://www.linuxquestions.org/questions/blog.php?b=34733</link>
			<pubDate>Thu, 03 May 2012 02:09:31 GMT</pubDate>
			<description>We need a standardized integrated connector that supports ALL of the following in one connector: 
 
1.  Dual DVI data links for video up to 2560x1600...</description>
			<content:encoded><![CDATA[<div>We need a standardized integrated connector that supports ALL of the following in one connector:<br />
<br />
1.  Dual DVI data links for video up to 2560x1600<br />
2.  Single VGA compatible analog signal likes (as in DVI-A)<br />
3.  PS/2 keyboard connection<br />
4.  PS/2 mouse connection<br />
5.  USB<br />
<br />
Then maybe the KVM switch market can get their act together.</div>

]]></content:encoded>
			<dc:creator>Skaperen</dc:creator>
			<guid isPermaLink="true">http://www.linuxquestions.org/questions/blog.php?b=34733</guid>
		</item>
		<item>
			<title>GUI Programming: QT4 Event Preeption Part 2-B (temp)</title>
			<link>http://www.linuxquestions.org/questions/blog.php?b=34732</link>
			<pubDate>Thu, 03 May 2012 01:38:59 GMT</pubDate>
			<description><![CDATA[Here's the code to run the examples and create a subclass of QApplication customized for our event preeption test. (See part 2-A) 
 
file:...]]></description>
			<content:encoded><![CDATA[<div>Here's the code to run the examples and create a subclass of QApplication customized for our event preeption test. (See part 2-A)<br />
<br />
file: src/utils.h<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<pre class="bbcodeblock" dir="ltr" style="
		margin: 0px;
		margin-right: -99999px;
		padding: 3px;
		border: 1px inset;
		width: 98%;
		height: 450px;
		text-align: left;
		overflow: auto">// utils.h

#ifndef utils_h
#define utils_h

#include &lt;QObject&gt;

// See explanation in utils.cpp
int lq_hash32(const char* name);

// See explanation in utils.cpp
typedef struct 
{
  int hashid; // computed once
  const char* name;
  uint value;
}HASH_ENTRY;

extern HASH_ENTRY lq_key_name_tbl[];

const char* qkey2name(uint value);
char* qmodkeys2name(uint value);  // returns a temp static string
uint qname2key(const char* name); // key value for name or 0x01ffffff (&quot;Key_unknown&quot;)

bool handle_return_key(QObject* p);

#endif // utils_h</pre>
</div><br />
Here's the somewhat unfriendly (still) subclass of QApplication with an event handler that can preempt other handlers.<br />
<br />
file: src/main.cpp<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<pre class="bbcodeblock" dir="ltr" style="
		margin: 0px;
		margin-right: -99999px;
		padding: 3px;
		border: 1px inset;
		width: 98%;
		height: 498px;
		text-align: left;
		overflow: auto">
#include &lt;QApplication&gt;   // app
#include &lt;QTextEdit&gt;      // editor
#include &lt;QKeyEvent&gt;      // QKeyEvent
#include &quot;utils.h&quot;        // qkey2name(), handle_return_key(QTextEditor*), etc.
#include &quot;lib/utils.cpp&quot;  // for type MULTI mc2 compilation, include, not link
#include &lt;stdio.h&gt;        // printf()

#define OLD_SCHOOL 1 /* change this to 0 to compare old to new */

void dbg(){}

////////////////////////////////////////////////////////
// LQApp class declaration

// type used to set the event handler aka 'notify'
typedef bool (*handler_func_t)(QObject* target, QObject* object, QEvent* ev);


class LQApp : public QApplication
{
  public:
    LQApp(int &amp;argc, char **argv);
    ~LQApp();
    bool notify(QObject *receiver, QEvent *ev);
    void setHandler(QObject* target, handler_func_t handler);
    void getTargetHandler(QObject** pobj, handler_func_t* pfunc);

    // globally accessible funcs and vars
    static bool (*handler)(QObject* target, QObject* object, QEvent* ev);
    static bool defaultHandler(QObject* target, QObject* object, QEvent* ev);
    QObject* target;
    static LQApp* self;
    
};

////////////////////////////////////////////////////////
// LQApp class implementation

// these are globally accessible for now so our handler
// functions can get at them through LQApp::self (aka 
// a static 'this') -&gt;

// a 'this' pointer
LQApp* LQApp::self;

// the currently effective event handler
bool (*LQApp::handler)(QObject* target, QObject* object, QEvent* ev);

// the default handler, usually not called by user
bool LQApp::defaultHandler(QObject* notused, QObject* receiver, QEvent* ev)
{
  notused = 0; // not used, just something to 'reference' the variable  
  return self-&gt;QApplication::notify(receiver, ev);
}

// these need the object in order to call them -&gt;
bool LQApp::notify(QObject *receiver, QEvent *ev) 
{
  handler(target, receiver, ev);
  return true;
}

// sets new target object and handler func.
void LQApp::setHandler(QObject* new_target, handler_func_t new_handler)
{
  target = new_target;
  handler = new_handler;
}

// Saves previous target and handler in user supplied var ptrs.
// Used to generate a chain of handlers, call with the address of 
// an object and a function that can be used by the new handler 
// to call prev_handler(prev_target, object, event);
void LQApp::getTargetHandler(QObject** prev_targ, handler_func_t* prev_func)
{
  LQApp* This = LQApp::self;
  *prev_targ = This-&gt;target;
  *prev_func = This-&gt;handler;
}

// App contructor
LQApp::LQApp(int &amp;argc, char **argv)
  : QApplication(argc, argv) 
{
  // additional setup
  self = this;
  handler = defaultHandler;
}

// App destructor
LQApp::~LQApp()
{
  // delete additional setup as req'd
}


//////////////////////////////////////////////////////
// Usage example

static QObject* prev_target;
static handler_func_t prev_handler;

bool editor_handler(QObject* target, QObject* receiver, QEvent* event)
{
  // return true; // preempt everything - testing
  // screen for our receiver
  if(receiver == target)
  {
    // screen by event types
    switch(event-&gt;type())
    {
      // screen by event types
      case QEvent::KeyRelease:
      case QEvent::KeyPress:
      {
        // this is funky...
        // This 'firsttime' flag just blocks recursion.
        // QT or some error in my program runs this loop twice
        // and I don't yet know why it does this. -rs -&gt;
        
//        static int firsttime;
//        firsttime = !firsttime;
//        if(!firsttime)
//          return true; // consumed
        // &lt;- rs Try commenting this out and see what happens.
        // We might want to explore the blocking or using timestamps for 
        // the event, or even the &quot;accept()&quot; flag in the event.  At least
        // at this level.
        
        // cast the QEvent to the right type
        QKeyEvent *keyEvent = static_cast&lt;QKeyEvent *&gt;(event);
        uint keyval = keyEvent-&gt;key();
        // screen by key value
        switch(keyval)
        {
          case Qt::Key_Return:
#if OLD_SCHOOL
            // explain in great detail what was received
            printf(&quot;\n&lt;ching-smash-grind-BAM&gt;\n&quot;); 
            fflush(stdout);
#else
            // less less old school, but perhaps still somewhat informative. ;-)
            printf(&quot;Key: %-20s  Flags: %s\n&quot;, qkey2name(keyval), qmodkeys2name(keyval));
#endif             
            ((QTextEdit*)receiver)-&gt;append(&quot;&quot;); // newline
            return true; // consumed
          default:

#if OLD_SCHOOL
            // explain in great detail what was received
            printf(&quot;&lt;tappity&gt;&quot;); 
            fflush(stdout);
#else
            // less less old school, but perhaps still somewhat informative. ;-)
            printf(&quot;Key: %-20s  Flags: %s\n&quot;, qkey2name(keyval), qmodkeys2name(keyval));
#endif             
                goto CONTINUE;
            ; // or just fall through
        } // end switch key
      } // end case keypress
          default:
            goto CONTINUE;   // or just fall through
    } // end switch event type 
    // fall through, do not preempt
  }
CONTINUE:
  return prev_handler(prev_target, receiver, event);
}

////////////////////////////////////////////////////
// standard-ish main except that it adds a TextEdit 
// set to all the defaults.
int main(int argc, char *argv[])
{
  dbg();
  LQApp app(argc, argv);
  QTextEdit editor;
  
  // save the previous pointers if we need to use or restore them.
  app.getTargetHandler(&amp;prev_target, &amp;prev_handler);
  
  app.setHandler(&amp;editor, editor_handler);
  editor.show();
  return app.exec();
}</pre>
</div>And here's a second executable.  If you get an error that 'main' is redifined in the link cycle, set OUTNAME = MULTI in your mc2.def file or if you use another makefile system, do what you must.<br />
<br />
file: src/lookup-test.cpp<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<pre class="bbcodeblock" dir="ltr" style="
		margin: 0px;
		margin-right: -99999px;
		padding: 3px;
		border: 1px inset;
		width: 98%;
		height: 434px;
		text-align: left;
		overflow: auto">// lookup-test.cpp
#include &lt;stdio.h&gt;


#include &quot;utils.h&quot;

#define LOOKUP_TEST 1
#include &quot;lib/utils.cpp&quot; // for type MULTI mc2 build
#undef LOOKUP_TEST

int main()
{
  for(HASH_ENTRY* p = lq_key_name_tbl; p-&gt;name != 0; p++)
  {
    const char* keyname = p-&gt;name;
    uint keyval = qname2key(keyname);
    printf(&quot;keyval: Ox%-10X keyname: %s\n&quot;, keyval, keyname);
  }
  // defined in lib/utils.cpp
  // int hash_false_hits = 0;
  // int hash_lookups = 0;
  printf(&quot;Total lookups = %d\n&quot;, hash_lookups);
  printf(&quot;Total string comparisons = %d\n&quot;, string_comparisons);
  printf(&quot;Total false hits = %d\n&quot;, hash_false_hits);
  return 0;
}</pre>
</div>Notes:<br />
<br />
Re. the hash lookup.<br />
The lookup in <br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<pre class="bbcodeblock" dir="ltr" style="
		margin: 0px;
		margin-right: -99999px;
		padding: 3px;
		border: 1px inset;
		width: 98%;
		height: 34px;
		text-align: left;
		overflow: auto">uint qname2key(const char* name)</pre>
</div>the call to do a strcmp is usually only done once because the hash algorithm is mixed up enough to only generate about one false hit per several thousand text entries.  (See dump fragment from lookup-test in part 2-A)<br />
<br />
Considering the fact that it's called once per lookup, check out the loop as it appears in 'objdump -d' slightly edited for clarity.<br />
<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<pre class="bbcodeblock" dir="ltr" style="
		margin: 0px;
		margin-right: -99999px;
		padding: 3px;
		border: 1px inset;
		width: 98%;
		height: 434px;
		text-align: left;
		overflow: auto">// precomputing the hash value takes a little time, so this is for longish lists
// where the hash32 call and return and the iteration over the entire string to 
// generate the id vanish due to the simplicity of the hash matching below.

jmp loop_start:

// increment i and exit if *i == 0
next_i:
80495e8: add    $0xc,%ebx         
80495eb: mov    0x4(%ebx),%edx
80495ee: test   %edx,%edx
80495f0: je     not_found;

loop_start:
80495f2: cmp    %esi,(%ebx)
80495f4: jne    80495e8 next_i;
// this is the bottom of the loop except when doing strcmp

80495f6: mov    %edi,0x4(%esp)
80495fa: mov    %edx,(%esp)
80495fd: call   8048f2c &lt;strcmp@plt&gt;
8049602: test   %eax,%eax
8049604: jne    next_i;
// this only loops back if the string comparison fails which is almost never

// usually falls through from successful strcmp to return i</pre>
</div>As we can see, there are two conditional branches and four other instructions per loop.<br />
<br />
The length of the strings compared doesn't matter.  It will still perform at this level of efficiency.<br />
<br />
The Computer Mad Science Team<br />
<br />
:-)</div>

]]></content:encoded>
			<dc:creator>rainbowsally</dc:creator>
			<guid isPermaLink="true">http://www.linuxquestions.org/questions/blog.php?b=34732</guid>
		</item>
		<item>
			<title>GUI Programming: QT4 Event Preeption Part 2-A (temp)</title>
			<link>http://www.linuxquestions.org/questions/blog.php?b=34731</link>
			<pubDate>Thu, 03 May 2012 01:32:23 GMT</pubDate>
			<description><![CDATA[[Corrected hash algorithm to return -1 for null string (aka "") input. May 4, 2012] 
 
Today's features 
* conditional compilation (OLD_SCHOOL vs. ?)...]]></description>
			<content:encoded><![CDATA[<div>[Corrected hash algorithm to return -1 for null string (aka &quot;&quot;) input. May 4, 2012]<br />
<br />
Today's features<ul><li>conditional compilation (OLD_SCHOOL vs. ?)</li>
<li>discovery of a potential recursion problem in preemptive event handling (QTextEdit)</li>
</ul><br />
This example is complicated enough to be but actually is not quite ready for prime time, but I do want to point out the advantage of creating hash values for speeding up text searches in tables of data.  See the utils.cpp implementation below.<br />
<br />
Also, we have a slightly more user friendly (?) implementation of a QApplication subclass (named LQApp) that adds some features for chaining event handlers at the application level.<br />
<br />
Consider this to be just an example.  We'll eventually figure out how to deal with the recursion problem in a less creative way. ;-)<br />
<br />
Let's start with the utils.cpp file which goes into a subdir named src/lib and will be included in other sources to avoid the necessity of using a more complicate linkage scheme.  If using mc2, type 'mc2 -fetch qt4' and set 'OUTNAME = MULTI' because there are two executable generated.<br />
<br />
Here's the end of a dump from link-test which uses the lib/utils.cpp functions.<br />
<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<pre class="bbcodeblock" dir="ltr" style="
		margin: 0px;
		margin-right: -99999px;
		padding: 3px;
		border: 1px inset;
		width: 98%;
		height: 130px;
		text-align: left;
		overflow: auto">... (and then at the end of the dump) ...
keyval: Ox1100020    keyname: Key_Camera
keyval: Ox1100021    keyname: Key_CameraFocus
keyval: Ox1FFFFFF    keyname: Key_unknown
Total lookups = 365
Total string comparisons = 66795
Total false hits = 0</pre>
</div>Here we go.<br />
<br />
file: src/lib/utils.cpp<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<pre class="bbcodeblock" dir="ltr" style="
		margin: 0px;
		margin-right: -99999px;
		padding: 3px;
		border: 1px inset;
		width: 98%;
		height: 498px;
		text-align: left;
		overflow: auto">// utils.cpp

#include &lt;QTextEdit&gt;
#include &lt;stdio.h&gt;
#include &quot;utils.h&quot; 

/*
  lq_hash32() is very similar to the ghash algorithm used to look up 
  names in shared objects except that it always sets the high 
  bit so no '0' value can be computed.
  
  While it could be argued that hashing is an extra step and it doesn't 
  result in unique ids in all cases, the fact that we can compare ids
  in a for() loop without calling strcmp() except to do a double check 
  saves quite a bit of time for large lists.
  
  If the lists to look through are super-long more time can be saved 
  by creating 'buckets' or 'threads' (where I come from) computed from 
  the hash id.
  
  In the following example there's just one 'thread' and it's a fixed size.
  Obviously, if you need them to 'grow' you need to allocate and reallocate 
  memory for these or use linked lists;
  
*/

int lq_hash32(const char* name)
{
  const char *p = name;
  if(!p) return 0;  // returns 0 if null pointer
  int h = *p;
  if (h) {
    for (p += 1; *p != 0; p++)
      h = ((h &lt;&lt; 5) - h) + *p;
  }
  // return h &lt; 0 ? h : -h;
  // corrected per ntubski's observations -rs
  return h &lt; 0 ? h : ~h;
}

// a temp definition to help convert from header data to a struct definition
#define COMPILE_HASH_ENTRY(name, value) \
  {0, #name, value}

HASH_ENTRY lq_key_name_tbl[] =
{
  // misc keys
  COMPILE_HASH_ENTRY(Key_Escape, 0x01000000),
  COMPILE_HASH_ENTRY(Key_Tab, 0x01000001),
  COMPILE_HASH_ENTRY(Key_Backtab, 0x01000002),
  COMPILE_HASH_ENTRY(Key_Backspace, 0x01000003),
  COMPILE_HASH_ENTRY(Key_Return, 0x01000004),
  COMPILE_HASH_ENTRY(Key_Enter, 0x01000005),
  COMPILE_HASH_ENTRY(Key_Insert, 0x01000006),
  COMPILE_HASH_ENTRY(Key_Delete, 0x01000007),
  COMPILE_HASH_ENTRY(Key_Pause, 0x01000008),
  COMPILE_HASH_ENTRY(Key_Print, 0x01000009),
  COMPILE_HASH_ENTRY(Key_SysReq, 0x0100000a),
  COMPILE_HASH_ENTRY(Key_Clear, 0x0100000b),
          
  // cursor movement
  COMPILE_HASH_ENTRY(Key_Home, 0x01000010),
  COMPILE_HASH_ENTRY(Key_End, 0x01000011),
  COMPILE_HASH_ENTRY(Key_Left, 0x01000012),
  COMPILE_HASH_ENTRY(Key_Up, 0x01000013),
  COMPILE_HASH_ENTRY(Key_Right, 0x01000014),
  COMPILE_HASH_ENTRY(Key_Down, 0x01000015),
  COMPILE_HASH_ENTRY(Key_PageUp, 0x01000016),
  COMPILE_HASH_ENTRY(Key_PageDown, 0x01000017),
          
  // modifiers
  COMPILE_HASH_ENTRY(Key_Shift, 0x01000020),
  COMPILE_HASH_ENTRY(Key_Control, 0x01000021),
  COMPILE_HASH_ENTRY(Key_Meta, 0x01000022),
  COMPILE_HASH_ENTRY(Key_Alt, 0x01000023),
  COMPILE_HASH_ENTRY(Key_CapsLock, 0x01000024),
  COMPILE_HASH_ENTRY(Key_NumLock, 0x01000025),
  COMPILE_HASH_ENTRY(Key_ScrollLock, 0x01000026),
          
  // function keys
  COMPILE_HASH_ENTRY(Key_F1, 0x01000030),
  COMPILE_HASH_ENTRY(Key_F2, 0x01000031),
  COMPILE_HASH_ENTRY(Key_F3, 0x01000032),
  COMPILE_HASH_ENTRY(Key_F4, 0x01000033),
  COMPILE_HASH_ENTRY(Key_F5, 0x01000034),
  COMPILE_HASH_ENTRY(Key_F6, 0x01000035),
  COMPILE_HASH_ENTRY(Key_F7, 0x01000036),
  COMPILE_HASH_ENTRY(Key_F8, 0x01000037),
  COMPILE_HASH_ENTRY(Key_F9, 0x01000038),
  COMPILE_HASH_ENTRY(Key_F10, 0x01000039),
  COMPILE_HASH_ENTRY(Key_F11, 0x0100003a),
  COMPILE_HASH_ENTRY(Key_F12, 0x0100003b),
  COMPILE_HASH_ENTRY(Key_F13, 0x0100003c),
  COMPILE_HASH_ENTRY(Key_F14, 0x0100003d),
  COMPILE_HASH_ENTRY(Key_F15, 0x0100003e),
  COMPILE_HASH_ENTRY(Key_F16, 0x0100003f),
  COMPILE_HASH_ENTRY(Key_F17, 0x01000040),
  COMPILE_HASH_ENTRY(Key_F18, 0x01000041),
  COMPILE_HASH_ENTRY(Key_F19, 0x01000042),
  COMPILE_HASH_ENTRY(Key_F20, 0x01000043),
  COMPILE_HASH_ENTRY(Key_F21, 0x01000044),
  COMPILE_HASH_ENTRY(Key_F22, 0x01000045),
  COMPILE_HASH_ENTRY(Key_F23, 0x01000046),
  COMPILE_HASH_ENTRY(Key_F24, 0x01000047),
  // F25 .. F35 only on X11
  COMPILE_HASH_ENTRY(Key_F25, 0x01000048),
  COMPILE_HASH_ENTRY(Key_F26, 0x01000049),
  COMPILE_HASH_ENTRY(Key_F27, 0x0100004a),
  COMPILE_HASH_ENTRY(Key_F28, 0x0100004b),
  COMPILE_HASH_ENTRY(Key_F29, 0x0100004c),
  COMPILE_HASH_ENTRY(Key_F30, 0x0100004d),
  COMPILE_HASH_ENTRY(Key_F31, 0x0100004e),
  COMPILE_HASH_ENTRY(Key_F32, 0x0100004f),
  COMPILE_HASH_ENTRY(Key_F33, 0x01000050),
  COMPILE_HASH_ENTRY(Key_F34, 0x01000051),
  COMPILE_HASH_ENTRY(Key_F35, 0x01000052),
  // extra keys
  COMPILE_HASH_ENTRY(Key_Super_L, 0x01000053),
  COMPILE_HASH_ENTRY(Key_Super_R, 0x01000054),
  COMPILE_HASH_ENTRY(Key_Menu, 0x01000055),
  COMPILE_HASH_ENTRY(Key_Hyper_L, 0x01000056),
  COMPILE_HASH_ENTRY(Key_Hyper_R, 0x01000057),
  COMPILE_HASH_ENTRY(Key_Help, 0x01000058),
  COMPILE_HASH_ENTRY(Key_Direction_L, 0x01000059),
  COMPILE_HASH_ENTRY(Key_Direction_R, 0x01000060),          
  // 7 bit printable ASCII
  COMPILE_HASH_ENTRY(Key_Space, 0x20),
  COMPILE_HASH_ENTRY(Key_Any, Qt::Key_Space),
  COMPILE_HASH_ENTRY(Key_Exclam, 0x21),
  COMPILE_HASH_ENTRY(Key_QuoteDbl, 0x22),
  COMPILE_HASH_ENTRY(Key_NumberSign, 0x23),
  COMPILE_HASH_ENTRY(Key_Dollar, 0x24),
  COMPILE_HASH_ENTRY(Key_Percent, 0x25),
  COMPILE_HASH_ENTRY(Key_Ampersand, 0x26),
  COMPILE_HASH_ENTRY(Key_Apostrophe, 0x27),
  COMPILE_HASH_ENTRY(Key_ParenLeft, 0x28),
  COMPILE_HASH_ENTRY(Key_ParenRight, 0x29),
  COMPILE_HASH_ENTRY(Key_Asterisk, 0x2a),
  COMPILE_HASH_ENTRY(Key_Plus, 0x2b),
  COMPILE_HASH_ENTRY(Key_Comma, 0x2c),
  COMPILE_HASH_ENTRY(Key_Minus, 0x2d),
  COMPILE_HASH_ENTRY(Key_Period, 0x2e),
  COMPILE_HASH_ENTRY(Key_Slash, 0x2f),
  COMPILE_HASH_ENTRY(Key_0, 0x30),
  COMPILE_HASH_ENTRY(Key_1, 0x31),
  COMPILE_HASH_ENTRY(Key_2, 0x32),
  COMPILE_HASH_ENTRY(Key_3, 0x33),
  COMPILE_HASH_ENTRY(Key_4, 0x34),
  COMPILE_HASH_ENTRY(Key_5, 0x35),
  COMPILE_HASH_ENTRY(Key_6, 0x36),
  COMPILE_HASH_ENTRY(Key_7, 0x37),
  COMPILE_HASH_ENTRY(Key_8, 0x38),
  COMPILE_HASH_ENTRY(Key_9, 0x39),
  COMPILE_HASH_ENTRY(Key_Colon, 0x3a),
  COMPILE_HASH_ENTRY(Key_Semicolon, 0x3b),
  COMPILE_HASH_ENTRY(Key_Less, 0x3c),
  COMPILE_HASH_ENTRY(Key_Equal, 0x3d),
  COMPILE_HASH_ENTRY(Key_Greater, 0x3e),
  COMPILE_HASH_ENTRY(Key_Question, 0x3f),
  COMPILE_HASH_ENTRY(Key_At, 0x40),
  COMPILE_HASH_ENTRY(Key_A, 0x41),
  COMPILE_HASH_ENTRY(Key_B, 0x42),
  COMPILE_HASH_ENTRY(Key_C, 0x43),
  COMPILE_HASH_ENTRY(Key_D, 0x44),
  COMPILE_HASH_ENTRY(Key_E, 0x45),
  COMPILE_HASH_ENTRY(Key_F, 0x46),
  COMPILE_HASH_ENTRY(Key_G, 0x47),
  COMPILE_HASH_ENTRY(Key_H, 0x48),
  COMPILE_HASH_ENTRY(Key_I, 0x49),
  COMPILE_HASH_ENTRY(Key_J, 0x4a),
  COMPILE_HASH_ENTRY(Key_K, 0x4b),
  COMPILE_HASH_ENTRY(Key_L, 0x4c),
  COMPILE_HASH_ENTRY(Key_M, 0x4d),
  COMPILE_HASH_ENTRY(Key_N, 0x4e),
  COMPILE_HASH_ENTRY(Key_O, 0x4f),
  COMPILE_HASH_ENTRY(Key_P, 0x50),
  COMPILE_HASH_ENTRY(Key_Q, 0x51),
  COMPILE_HASH_ENTRY(Key_R, 0x52),
  COMPILE_HASH_ENTRY(Key_S, 0x53),
  COMPILE_HASH_ENTRY(Key_T, 0x54),
  COMPILE_HASH_ENTRY(Key_U, 0x55),
  COMPILE_HASH_ENTRY(Key_V, 0x56),
  COMPILE_HASH_ENTRY(Key_W, 0x57),
  COMPILE_HASH_ENTRY(Key_X, 0x58),
  COMPILE_HASH_ENTRY(Key_Y, 0x59),
  COMPILE_HASH_ENTRY(Key_Z, 0x5a),
  COMPILE_HASH_ENTRY(Key_BracketLeft, 0x5b),
  COMPILE_HASH_ENTRY(Key_Backslash, 0x5c),
  COMPILE_HASH_ENTRY(Key_BracketRight, 0x5d),
  COMPILE_HASH_ENTRY(Key_AsciiCircum, 0x5e),
  COMPILE_HASH_ENTRY(Key_Underscore, 0x5f),
  COMPILE_HASH_ENTRY(Key_QuoteLeft, 0x60),
  COMPILE_HASH_ENTRY(Key_BraceLeft, 0x7b),
  COMPILE_HASH_ENTRY(Key_Bar, 0x7c),
  COMPILE_HASH_ENTRY(Key_BraceRight, 0x7d),
  COMPILE_HASH_ENTRY(Key_AsciiTilde, 0x7e),
  COMPILE_HASH_ENTRY(Key_nobreakspace, 0x0a0),
  COMPILE_HASH_ENTRY(Key_exclamdown, 0x0a1),
  COMPILE_HASH_ENTRY(Key_cent, 0x0a2),
  COMPILE_HASH_ENTRY(Key_sterling, 0x0a3),
  COMPILE_HASH_ENTRY(Key_currency, 0x0a4),
  COMPILE_HASH_ENTRY(Key_yen, 0x0a5),
  COMPILE_HASH_ENTRY(Key_brokenbar, 0x0a6),
  COMPILE_HASH_ENTRY(Key_section, 0x0a7),
  COMPILE_HASH_ENTRY(Key_diaeresis, 0x0a8),
  COMPILE_HASH_ENTRY(Key_copyright, 0x0a9),
  COMPILE_HASH_ENTRY(Key_ordfeminine, 0x0aa),
  COMPILE_HASH_ENTRY(Key_guillemotleft, 0x0ab),
  COMPILE_HASH_ENTRY(Key_notsign, 0x0ac),
  COMPILE_HASH_ENTRY(Key_hyphen, 0x0ad),
  COMPILE_HASH_ENTRY(Key_registered, 0x0ae),
  COMPILE_HASH_ENTRY(Key_macron, 0x0af),
  COMPILE_HASH_ENTRY(Key_degree, 0x0b0),
  COMPILE_HASH_ENTRY(Key_plusminus, 0x0b1),
  COMPILE_HASH_ENTRY(Key_twosuperior, 0x0b2),
  COMPILE_HASH_ENTRY(Key_threesuperior, 0x0b3),
  COMPILE_HASH_ENTRY(Key_acute, 0x0b4),
  COMPILE_HASH_ENTRY(Key_mu, 0x0b5),
  COMPILE_HASH_ENTRY(Key_paragraph, 0x0b6),
  COMPILE_HASH_ENTRY(Key_periodcentered, 0x0b7),
  COMPILE_HASH_ENTRY(Key_cedilla, 0x0b8),
  COMPILE_HASH_ENTRY(Key_onesuperior, 0x0b9),
  COMPILE_HASH_ENTRY(Key_masculine, 0x0ba),
  COMPILE_HASH_ENTRY(Key_guillemotright, 0x0bb),
  COMPILE_HASH_ENTRY(Key_onequarter, 0x0bc),
  COMPILE_HASH_ENTRY(Key_onehalf, 0x0bd),
  COMPILE_HASH_ENTRY(Key_threequarters, 0x0be),
  COMPILE_HASH_ENTRY(Key_questiondown, 0x0bf),
  COMPILE_HASH_ENTRY(Key_Agrave, 0x0c0),
  COMPILE_HASH_ENTRY(Key_Aacute, 0x0c1),
  COMPILE_HASH_ENTRY(Key_Acircumflex, 0x0c2),
  COMPILE_HASH_ENTRY(Key_Atilde, 0x0c3),
  COMPILE_HASH_ENTRY(Key_Adiaeresis, 0x0c4),
  COMPILE_HASH_ENTRY(Key_Aring, 0x0c5),
  COMPILE_HASH_ENTRY(Key_AE, 0x0c6),
  COMPILE_HASH_ENTRY(Key_Ccedilla, 0x0c7),
  COMPILE_HASH_ENTRY(Key_Egrave, 0x0c8),
  COMPILE_HASH_ENTRY(Key_Eacute, 0x0c9),
  COMPILE_HASH_ENTRY(Key_Ecircumflex, 0x0ca),
  COMPILE_HASH_ENTRY(Key_Ediaeresis, 0x0cb),
  COMPILE_HASH_ENTRY(Key_Igrave, 0x0cc),
  COMPILE_HASH_ENTRY(Key_Iacute, 0x0cd),
  COMPILE_HASH_ENTRY(Key_Icircumflex, 0x0ce),
  COMPILE_HASH_ENTRY(Key_Idiaeresis, 0x0cf),
  COMPILE_HASH_ENTRY(Key_ETH, 0x0d0),
  COMPILE_HASH_ENTRY(Key_Ntilde, 0x0d1),
  COMPILE_HASH_ENTRY(Key_Ograve, 0x0d2),
  COMPILE_HASH_ENTRY(Key_Oacute, 0x0d3),
  COMPILE_HASH_ENTRY(Key_Ocircumflex, 0x0d4),
  COMPILE_HASH_ENTRY(Key_Otilde, 0x0d5),
  COMPILE_HASH_ENTRY(Key_Odiaeresis, 0x0d6),
  COMPILE_HASH_ENTRY(Key_multiply, 0x0d7),
  COMPILE_HASH_ENTRY(Key_Ooblique, 0x0d8),
  COMPILE_HASH_ENTRY(Key_Ugrave, 0x0d9),
  COMPILE_HASH_ENTRY(Key_Uacute, 0x0da),
  COMPILE_HASH_ENTRY(Key_Ucircumflex, 0x0db),
  COMPILE_HASH_ENTRY(Key_Udiaeresis, 0x0dc),
  COMPILE_HASH_ENTRY(Key_Yacute, 0x0dd),
  COMPILE_HASH_ENTRY(Key_THORN, 0x0de),
  COMPILE_HASH_ENTRY(Key_ssharp, 0x0df),
  COMPILE_HASH_ENTRY(Key_division, 0x0f7),
  COMPILE_HASH_ENTRY(Key_ydiaeresis, 0x0ff),  
  // see the headers if you need international and multi-key char composition.
  // multimedia/internet keys - ignored by default.
  COMPILE_HASH_ENTRY(Key_Back , 0x01000061),
  COMPILE_HASH_ENTRY(Key_Forward , 0x01000062),
  COMPILE_HASH_ENTRY(Key_Stop , 0x01000063),
  COMPILE_HASH_ENTRY(Key_Refresh , 0x01000064),
  COMPILE_HASH_ENTRY(Key_VolumeDown, 0x01000070),
  COMPILE_HASH_ENTRY(Key_VolumeMute , 0x01000071),
  COMPILE_HASH_ENTRY(Key_VolumeUp, 0x01000072),
  COMPILE_HASH_ENTRY(Key_BassBoost, 0x01000073),
  COMPILE_HASH_ENTRY(Key_BassUp, 0x01000074),
  COMPILE_HASH_ENTRY(Key_BassDown, 0x01000075),
  COMPILE_HASH_ENTRY(Key_TrebleUp, 0x01000076),
  COMPILE_HASH_ENTRY(Key_TrebleDown, 0x01000077),
  COMPILE_HASH_ENTRY(Key_MediaPlay , 0x01000080),
  COMPILE_HASH_ENTRY(Key_MediaStop , 0x01000081),
  COMPILE_HASH_ENTRY(Key_MediaPrevious , 0x01000082),
  COMPILE_HASH_ENTRY(Key_MediaNext , 0x01000083),
  COMPILE_HASH_ENTRY(Key_MediaRecord, 0x01000084),
  COMPILE_HASH_ENTRY(Key_MediaPause, 0x1000085),
  COMPILE_HASH_ENTRY(Key_MediaTogglePlayPause, 0x1000086),
  COMPILE_HASH_ENTRY(Key_HomePage , 0x01000090),
  COMPILE_HASH_ENTRY(Key_Favorites , 0x01000091),
  COMPILE_HASH_ENTRY(Key_Search , 0x01000092),
  COMPILE_HASH_ENTRY(Key_Standby, 0x01000093),
  COMPILE_HASH_ENTRY(Key_OpenUrl, 0x01000094),
  COMPILE_HASH_ENTRY(Key_LaunchMail , 0x010000a0),
  COMPILE_HASH_ENTRY(Key_LaunchMedia, 0x010000a1),
  COMPILE_HASH_ENTRY(Key_Launch0 , 0x010000a2),
  COMPILE_HASH_ENTRY(Key_Launch1 , 0x010000a3),
  COMPILE_HASH_ENTRY(Key_Launch2 , 0x010000a4),
  COMPILE_HASH_ENTRY(Key_Launch3 , 0x010000a5),
  COMPILE_HASH_ENTRY(Key_Launch4 , 0x010000a6),
  COMPILE_HASH_ENTRY(Key_Launch5 , 0x010000a7),
  COMPILE_HASH_ENTRY(Key_Launch6 , 0x010000a8),
  COMPILE_HASH_ENTRY(Key_Launch7 , 0x010000a9),
  COMPILE_HASH_ENTRY(Key_Launch8 , 0x010000aa),
  COMPILE_HASH_ENTRY(Key_Launch9 , 0x010000ab),
  COMPILE_HASH_ENTRY(Key_LaunchA , 0x010000ac),
  COMPILE_HASH_ENTRY(Key_LaunchB , 0x010000ad),
  COMPILE_HASH_ENTRY(Key_LaunchC , 0x010000ae),
  COMPILE_HASH_ENTRY(Key_LaunchD , 0x010000af),
  COMPILE_HASH_ENTRY(Key_LaunchE , 0x010000b0),
  COMPILE_HASH_ENTRY(Key_LaunchF , 0x010000b1),
  COMPILE_HASH_ENTRY(Key_MonBrightnessUp, 0x010000b2),
  COMPILE_HASH_ENTRY(Key_MonBrightnessDown, 0x010000b3),
  COMPILE_HASH_ENTRY(Key_KeyboardLightOnOff, 0x010000b4),
  COMPILE_HASH_ENTRY(Key_KeyboardBrightnessUp, 0x010000b5),
  COMPILE_HASH_ENTRY(Key_KeyboardBrightnessDown, 0x010000b6),
  COMPILE_HASH_ENTRY(Key_PowerOff, 0x010000b7),
  COMPILE_HASH_ENTRY(Key_WakeUp, 0x010000b8),
  COMPILE_HASH_ENTRY(Key_Eject, 0x010000b9),
  COMPILE_HASH_ENTRY(Key_ScreenSaver, 0x010000ba),
  COMPILE_HASH_ENTRY(Key_WWW, 0x010000bb),
  COMPILE_HASH_ENTRY(Key_Memo, 0x010000bc),
  COMPILE_HASH_ENTRY(Key_LightBulb, 0x010000bd),
  COMPILE_HASH_ENTRY(Key_Shop, 0x010000be),
  COMPILE_HASH_ENTRY(Key_History, 0x010000bf),
  COMPILE_HASH_ENTRY(Key_AddFavorite, 0x010000c0),
  COMPILE_HASH_ENTRY(Key_HotLinks, 0x010000c1),
  COMPILE_HASH_ENTRY(Key_BrightnessAdjust, 0x010000c2),
  COMPILE_HASH_ENTRY(Key_Finance, 0x010000c3),
  COMPILE_HASH_ENTRY(Key_Community, 0x010000c4),
  COMPILE_HASH_ENTRY(Key_AudioRewind, 0x010000c5),
  COMPILE_HASH_ENTRY(Key_BackForward, 0x010000c6),
  COMPILE_HASH_ENTRY(Key_ApplicationLeft, 0x010000c7),
  COMPILE_HASH_ENTRY(Key_ApplicationRight, 0x010000c8),
  COMPILE_HASH_ENTRY(Key_Book, 0x010000c9),
  COMPILE_HASH_ENTRY(Key_CD, 0x010000ca),
  COMPILE_HASH_ENTRY(Key_Calculator, 0x010000cb),
  COMPILE_HASH_ENTRY(Key_ToDoList, 0x010000cc),
  COMPILE_HASH_ENTRY(Key_ClearGrab, 0x010000cd),
  COMPILE_HASH_ENTRY(Key_Close, 0x010000ce),
  COMPILE_HASH_ENTRY(Key_Copy, 0x010000cf),
  COMPILE_HASH_ENTRY(Key_Cut, 0x010000d0),
  COMPILE_HASH_ENTRY(Key_Display, 0x010000d1),
  COMPILE_HASH_ENTRY(Key_DOS, 0x010000d2),
  COMPILE_HASH_ENTRY(Key_Documents, 0x010000d3),
  COMPILE_HASH_ENTRY(Key_Excel, 0x010000d4),
  COMPILE_HASH_ENTRY(Key_Explorer, 0x010000d5),
  COMPILE_HASH_ENTRY(Key_Game, 0x010000d6),
  COMPILE_HASH_ENTRY(Key_Go, 0x010000d7),
  COMPILE_HASH_ENTRY(Key_iTouch, 0x010000d8),
  COMPILE_HASH_ENTRY(Key_LogOff, 0x010000d9),
  COMPILE_HASH_ENTRY(Key_Market, 0x010000da),
  COMPILE_HASH_ENTRY(Key_Meeting, 0x010000db),
  COMPILE_HASH_ENTRY(Key_MenuKB, 0x010000dc),
  COMPILE_HASH_ENTRY(Key_MenuPB, 0x010000dd),
  COMPILE_HASH_ENTRY(Key_MySites, 0x010000de),
  COMPILE_HASH_ENTRY(Key_News, 0x010000df),
  COMPILE_HASH_ENTRY(Key_OfficeHome, 0x010000e0),
  COMPILE_HASH_ENTRY(Key_Option, 0x010000e1),
  COMPILE_HASH_ENTRY(Key_Paste, 0x010000e2),
  COMPILE_HASH_ENTRY(Key_Phone, 0x010000e3),
  COMPILE_HASH_ENTRY(Key_Calendar, 0x010000e4),
  COMPILE_HASH_ENTRY(Key_Reply, 0x010000e5),
  COMPILE_HASH_ENTRY(Key_Reload, 0x010000e6),
  COMPILE_HASH_ENTRY(Key_RotateWindows, 0x010000e7),
  COMPILE_HASH_ENTRY(Key_RotationPB, 0x010000e8),
  COMPILE_HASH_ENTRY(Key_RotationKB, 0x010000e9),
  COMPILE_HASH_ENTRY(Key_Save, 0x010000ea),
  COMPILE_HASH_ENTRY(Key_Send, 0x010000eb),
  COMPILE_HASH_ENTRY(Key_Spell, 0x010000ec),
  COMPILE_HASH_ENTRY(Key_SplitScreen, 0x010000ed),
  COMPILE_HASH_ENTRY(Key_Support, 0x010000ee),
  COMPILE_HASH_ENTRY(Key_TaskPane, 0x010000ef),
  COMPILE_HASH_ENTRY(Key_Terminal, 0x010000f0),
  COMPILE_HASH_ENTRY(Key_Tools, 0x010000f1),
  COMPILE_HASH_ENTRY(Key_Travel, 0x010000f2),
  COMPILE_HASH_ENTRY(Key_Video, 0x010000f3),
  COMPILE_HASH_ENTRY(Key_Word, 0x010000f4),
  COMPILE_HASH_ENTRY(Key_Xfer, 0x010000f5),
  COMPILE_HASH_ENTRY(Key_ZoomIn, 0x010000f6),
  COMPILE_HASH_ENTRY(Key_ZoomOut, 0x010000f7),
  COMPILE_HASH_ENTRY(Key_Away, 0x010000f8),
  COMPILE_HASH_ENTRY(Key_Messenger, 0x010000f9),
  COMPILE_HASH_ENTRY(Key_WebCam, 0x010000fa),
  COMPILE_HASH_ENTRY(Key_MailForward, 0x010000fb),
  COMPILE_HASH_ENTRY(Key_Pictures, 0x010000fc),
  COMPILE_HASH_ENTRY(Key_Music, 0x010000fd),
  COMPILE_HASH_ENTRY(Key_Battery, 0x010000fe),
  COMPILE_HASH_ENTRY(Key_Bluetooth, 0x010000ff),
  COMPILE_HASH_ENTRY(Key_WLAN, 0x01000100),
  COMPILE_HASH_ENTRY(Key_UWB, 0x01000101),
  COMPILE_HASH_ENTRY(Key_AudioForward, 0x01000102),
  COMPILE_HASH_ENTRY(Key_AudioRepeat, 0x01000103),
  COMPILE_HASH_ENTRY(Key_AudioRandomPlay, 0x01000104),
  COMPILE_HASH_ENTRY(Key_Subtitle, 0x01000105),
  COMPILE_HASH_ENTRY(Key_AudioCycleTrack, 0x01000106),
  COMPILE_HASH_ENTRY(Key_Time, 0x01000107),
  COMPILE_HASH_ENTRY(Key_Hibernate, 0x01000108),
  COMPILE_HASH_ENTRY(Key_View, 0x01000109),
  COMPILE_HASH_ENTRY(Key_TopMenu, 0x0100010a),
  COMPILE_HASH_ENTRY(Key_PowerDown, 0x0100010b),
  COMPILE_HASH_ENTRY(Key_Suspend, 0x0100010c),
  COMPILE_HASH_ENTRY(Key_ContrastAdjust, 0x0100010d),
  COMPILE_HASH_ENTRY(Key_LaunchG , 0x0100010e),
  COMPILE_HASH_ENTRY(Key_LaunchH , 0x0100010f),
  COMPILE_HASH_ENTRY(Key_MediaLast, 0x0100ffff),
  
  // Keypad navigation keys
  COMPILE_HASH_ENTRY(Key_Select, 0x01010000),
  COMPILE_HASH_ENTRY(Key_Yes, 0x01010001),
  COMPILE_HASH_ENTRY(Key_No, 0x01010002),
  
  // Newer misc keys
  COMPILE_HASH_ENTRY(Key_Cancel , 0x01020001),
  COMPILE_HASH_ENTRY(Key_Printer, 0x01020002),
  COMPILE_HASH_ENTRY(Key_Execute, 0x01020003),
  COMPILE_HASH_ENTRY(Key_Sleep  , 0x01020004),
  COMPILE_HASH_ENTRY(Key_Play   , 0x01020005),
  COMPILE_HASH_ENTRY(Key_Zoom   , 0x01020006),
                     
  // Device keys
  COMPILE_HASH_ENTRY(Key_Context1, 0x01100000),
  COMPILE_HASH_ENTRY(Key_Context2, 0x01100001),
  COMPILE_HASH_ENTRY(Key_Context3, 0x01100002),
  COMPILE_HASH_ENTRY(Key_Context4, 0x01100003),
  COMPILE_HASH_ENTRY(Key_Call, 0x01100004),
  COMPILE_HASH_ENTRY(Key_Hangup, 0x01100005),
  COMPILE_HASH_ENTRY(Key_Flip, 0x01100006),
  COMPILE_HASH_ENTRY(Key_ToggleCallHangup, 0x01100007),
  COMPILE_HASH_ENTRY(Key_VoiceDial, 0x01100008),
  COMPILE_HASH_ENTRY(Key_LastNumberRedial, 0x01100009),
  COMPILE_HASH_ENTRY(Key_Camera, 0x01100020),
  COMPILE_HASH_ENTRY(Key_CameraFocus, 0x01100021),
  COMPILE_HASH_ENTRY(Key_unknown, 0x01ffffff),
        
  {0, 0, 0},
};
#undef COMPILE_HASH_ENTRY

int lq_key_name_tbl_hash_inited = 0;

void init_lq_key_pairs()
{
  for(HASH_ENTRY* p = lq_key_name_tbl;p-&gt;name != 0; p++)
    p-&gt;hashid = lq_hash32(p-&gt;name);
  
  lq_key_name_tbl_hash_inited++;
}

const char* qkey2name(uint value)
{
  for(HASH_ENTRY* p = lq_key_name_tbl;p-&gt;name != 0; p++)
  {
    if(p-&gt;value == value)
      return p-&gt;name;
  }
  return &quot;Key_unknown&quot;;
}


#ifdef LOOKUP_TEST
int hash_false_hits = 0;
int hash_lookups = 0;
int string_comparisons = 0;
#endif

uint qname2key(const char* name)
{
  // only need hashes for names.
  if(!lq_key_name_tbl_hash_inited)
    init_lq_key_pairs();
  int hashid = lq_hash32(name);

// normal
#ifndef LOOKUP_TEST
  for(HASH_ENTRY* p = lq_key_name_tbl;p-&gt;name != 0; p++)
  {
    if((p-&gt;hashid == hashid) &amp;&amp; (strcmp(p-&gt;name, name) == 0))
      return p-&gt;value;
  }

// test
#else
int ctr = 0;
hash_lookups ++;
for(HASH_ENTRY* p = lq_key_name_tbl;p-&gt;name != 0; p++)
{
  string_comparisons++;
  if(p-&gt;hashid == hashid) 
  { 
    ctr++; // id's match
    if (strcmp(p-&gt;name, name) == 0)
    {
      if(ctr &gt; 1)
      {
        hash_false_hits += ctr -1;
      }
      return p-&gt;value;
    } // if
  } // if
}
#endif // LOOKUP_TEST

  return 0x01ffffff; // &quot;Key_unknown&quot;;
}

char* qmodkeys2name(uint value)
{
  static char tmp[256];
  *tmp = 0;
  
  if(value &amp; 0x40000000) strcat(tmp, &quot;Qt::GroupSwitchModifier | &quot;);
  if(value &amp; 0x20000000) strcat(tmp, &quot;Qt::KeypadModifier | &quot;);
  if(value &amp; 0x10000000) strcat(tmp, &quot;Qt::MetaModifier | &quot;);
  if(value &amp; 0x08000000) strcat(tmp, &quot;Qt::AltModifier | &quot;);
  if(value &amp; 0x04000000) strcat(tmp, &quot;Qt::ControlModifier | &quot;);
  if(value &amp; 0x02000000) strcat(tmp, &quot;Qt::ShiftModifier | &quot;);

  if(*tmp)
    strrchr(tmp, '|')[-1] = 0;
  else
    strcpy(tmp, &quot;NONE&quot;);
  return tmp;
}

//////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////
// Here's a method extender for QTextEdit.  These method 
// extenders don't contain any additional data, just 
// methods, so they don't have constructors or destructors
// and everything is public so the original class functions
// can be obtained through them and funcs or vars not 
// available publicly can be made accessible through this 
// interface by reimplimenting them as public.
class LQTextEdit : public QTextEdit
{
public:
  int count();                // slist style, not implemented
  const char* get(int idx);   // slist style, not implemented
  int position() { return QTextEdit::textCursor().position();}
};

bool handle_return_key(QObject* p)
{
  LQTextEdit* te = static_cast&lt;LQTextEdit*&gt;(p);
  QTextCursor tc = te-&gt;textCursor();
  printf(&quot;Position: %d\n&quot;, te-&gt;position());
  te-&gt;append(&quot;\n&quot;);
  return true; // stop processing, this key is preempted
}</pre>
</div>Continued in part 2-B</div>

]]></content:encoded>
			<dc:creator>rainbowsally</dc:creator>
			<guid isPermaLink="true">http://www.linuxquestions.org/questions/blog.php?b=34731</guid>
		</item>
		<item>
			<title>Unofficial Debs for libcsv</title>
			<link>http://www.linuxquestions.org/questions/blog.php?b=34730</link>
			<pubDate>Thu, 03 May 2012 01:31:28 GMT</pubDate>
			<description><![CDATA[I've produced some unofficial debs for libcsv. libcsv (http://sourceforge.net/projects/libcsv/) is an pure ANSI C library for reading and writing CSV...]]></description>
			<content:encoded><![CDATA[<div>I've produced some unofficial debs for libcsv. <a href="http://sourceforge.net/projects/libcsv/" target="_blank">libcsv</a> is an pure ANSI C library for reading and writing CSV data. I've made the packages available because I am thinking about using libcsv in an upcoming project. The packages are available here:<br />
<br />
<a href="https://frigidcode.com/code/libcsv-packages/" target="_blank">https://frigidcode.com/code/libcsv-packages/</a><br />
<br />
I hope to have some RPMs available as well within a few days.</div>

]]></content:encoded>
			<dc:creator>hydraMax</dc:creator>
			<guid isPermaLink="true">http://www.linuxquestions.org/questions/blog.php?b=34730</guid>
		</item>
		<item>
			<title><![CDATA[&#3462;&#3497;&#3512;&#3530;&#3510;&#3515; &#3520;&#3545;&#3514;&#3520;&#3540;....]]></title>
			<link>http://www.linuxquestions.org/questions/blog.php?b=34729</link>
			<pubDate>Wed, 02 May 2012 18:35:09 GMT</pubDate>
			<description><![CDATA[&#3512;&#3535; &#3512;&#3545;&#3523;&#3546; &#3523;&#3538;&#3458;&#3524;&#3517;&#3545;&#3505;&#3530; &#3510;&#3530;&#3517;&#3548;&#3484;&#3530; &#3517;&#3538;&#3520;&#3539;&#3512; &#3523;&#3503;&#3495; &#3484;&#3548;&#3523;&#3530; &#3508;&#3548;&#3517;&#3530; &#3482;&#3536;&#3497;&#3539;&#3512;&#3482;&#3530; &#3520;&#3536;&#3505;&#3538; &#3482;&#3530;*&#3515;&#3538;&#3514;&#3535;&#3520;&#3482;&#3530; &#3511;&#3520;&#3530; &#3512;&#3535; &#3503;&#3505;&#3538;&#3512;&#3538;..&#3473;&#3524;&#3545;&#3501;&#3530; &#3461;&#3508;&#3546; &#3517;&#3458;&#3482;&#3535;&#3520;&#3546; &#3490;&#3505;&#3501;&#3535;&#3520; &#3482;&#3520;&#3503;&#3535; &#3524;&#3549; &#3517;&#3538;&#3505;&#3482;&#3530;&#3523;&#3530; &#3511;&#3535;&#3520;&#3538;&#3501;&#3514;&#3495; &#3524;&#3540;&#3515;&#3540;&#3520;&#3539; &#3512;&#3545;&#3512; &#3523;&#3530;&#3502;&#3535;&#3505;&#3514;&#3495;...]]></description>
			<content:encoded><![CDATA[<div><font size="2"><font color="RoyalBlue">&#3512;&#3535; &#3512;&#3545;&#3523;&#3546; &#3523;&#3538;&#3458;&#3524;&#3517;&#3545;&#3505;&#3530; &#3510;&#3530;&#3517;&#3548;&#3484;&#3530; &#3517;&#3538;&#3520;&#3539;&#3512; &#3523;&#3503;&#3495; &#3484;&#3548;&#3523;&#3530; &#3508;&#3548;&#3517;&#3530; &#3482;&#3536;&#3497;&#3539;&#3512;&#3482;&#3530; &#3520;&#3536;&#3505;&#3538; &#3482;&#3530;*&#3515;&#3538;&#3514;&#3535;&#3520;&#3482;&#3530; &#3511;&#3520;&#3530; &#3512;&#3535; &#3503;&#3505;&#3538;&#3512;&#3538;..&#3473;&#3524;&#3545;&#3501;&#3530; &#3461;&#3508;&#3546; &#3517;&#3458;&#3482;&#3535;&#3520;&#3546; &#3490;&#3505;&#3501;&#3535;&#3520; &#3482;&#3520;&#3503;&#3535; &#3524;&#3549; &#3517;&#3538;&#3505;&#3482;&#3530;&#3523;&#3530; &#3511;&#3535;&#3520;&#3538;&#3501;&#3514;&#3495; &#3524;&#3540;&#3515;&#3540;&#3520;&#3539; &#3512;&#3545;&#3512; &#3523;&#3530;&#3502;&#3535;&#3505;&#3514;&#3495; &#3508;&#3536;&#3512;&#3538;&#3505;&#3545;&#3505;&#3540; &#3463;&#3501;..&#3473;&#3503;&#3538;&#3505;&#3495; &#3462;&#3497;&#3512;&#3530;&#3510;&#3515; &#3520;&#3545;&#3514;&#3520;&#3540;.....<br />
========================================================<br />
&#3461;&#3508;&#3546; &#3515;&#3495;&#3546; &#3508;&#3548;&#3497;&#3538; &#3482;&#3548;&#3517;&#3540;&#3484;&#3536;&#3495;&#3514;&#3545;&#3482;&#3530; &#3512;&#3546;&#3517;&#3545;&#3523; &#3482;&#3495;&#3514;&#3540;&#3501;&#3540; &#3482;&#3525; &#3473;&#3482; &#3484;&#3536;&#3505;...</font></font></div>

]]></content:encoded>
			<dc:creator>sunjayasri</dc:creator>
			<guid isPermaLink="true">http://www.linuxquestions.org/questions/blog.php?b=34729</guid>
		</item>
		<item>
			<title><![CDATA[Terminal &#3484;&#3536;&#3505; &#3520;&#3536;&#3497;&#3538; &#3520;&#3538;&#3523;&#3530;&#3501;&#3515;...]]></title>
			<link>http://www.linuxquestions.org/questions/blog.php?b=34728</link>
			<pubDate>Wed, 02 May 2012 18:25:00 GMT</pubDate>
			<description><![CDATA[Terminal &#3514;&#3505;&#3540; &#3476;&#3510; &#3461;&#3508; &#3520;&#3538;&#3505;&#3530;&#3497;&#3549;&#3523;&#3530; (Windows)OS &#3524;&#3539; &#3508;&#3535;&#3520;&#3538;&#3488;&#3530;&#3488;&#3538; &#3482;&#3515;&#3505;&#3540; &#3517;&#3510;&#3505; &#3482;&#3512;&#3535;&#3505;&#3530;&#3497;&#3530;&#3508;&#3530;*&#3515;&#3548;&#3512;&#3530;&#3495;&#3530; &#3520;&#3536;&#3505;&#3538; &#3482;&#3548;&#3505;&#3530;&#3523;&#3549;&#3517;&#3530; &#3473;&#3482;&#3482;&#3538;. 
 
&#3512;&#3545;&#3512;&#3484;&#3538;&#3505;&#3530; &#3517;&#3538;&#3505;&#3482;&#3530;&#3523;&#3530; &#3501;&#3540;&#3517;&#3503;&#3539; &#3461;&#3501;&#3530;&#3482;&#3515;&#3484;&#3501; &#3524;&#3536;&#3482;&#3538; &#3508;&#3530;*&#3515;&#3514;&#3549;&#3490;&#3505;...]]></description>
			<content:encoded><![CDATA[<div>Terminal &#3514;&#3505;&#3540; &#3476;&#3510; &#3461;&#3508; &#3520;&#3538;&#3505;&#3530;&#3497;&#3549;&#3523;&#3530; (Windows)OS &#3524;&#3539; &#3508;&#3535;&#3520;&#3538;&#3488;&#3530;&#3488;&#3538; &#3482;&#3515;&#3505;&#3540; &#3517;&#3510;&#3505; &#3482;&#3512;&#3535;&#3505;&#3530;&#3497;&#3530;&#3508;&#3530;*&#3515;&#3548;&#3512;&#3530;&#3495;&#3530; &#3520;&#3536;&#3505;&#3538; &#3482;&#3548;&#3505;&#3530;&#3523;&#3549;&#3517;&#3530; &#3473;&#3482;&#3482;&#3538;.<br />
<br />
&#3512;&#3545;&#3512;&#3484;&#3538;&#3505;&#3530; &#3517;&#3538;&#3505;&#3482;&#3530;&#3523;&#3530; &#3501;&#3540;&#3517;&#3503;&#3539; &#3461;&#3501;&#3530;&#3482;&#3515;&#3484;&#3501; &#3524;&#3536;&#3482;&#3538; &#3508;&#3530;*&#3515;&#3514;&#3549;&#3490;&#3505; &#3515;&#3535;&#3521;&#3538;&#3514;&#3482;&#3530; &#3463;&#3501;..<br />
<br />
01.)&#3512;&#3540;&#3503;&#3544;&#3482;&#3535;&#3458;&#3484; &#3463;&#3501;&#3540;&#3517;&#3501;&#3530; (Install) &#3482;&#3515; &#3484;&#3536;&#3505;&#3539;&#3512;<br />
02.)&#3508;&#3503;&#3530;&#3504;&#3501;&#3538;&#3514; &#3512;&#3545;&#3524;&#3545;&#3514;&#3520;&#3539;&#3512; (Manage Operating System)<br />
03.)&#3484;&#3548;&#3505;&#3540; &#3508;&#3535;&#3517;&#3505;&#3514; (File management)<br />
<br />
&#3474; &#3508;&#3530;*&#3515;&#3514;&#3549;&#3490;&#3505; &#3461;&#3501;&#3515;&#3538;&#3505;&#3530; &#3482;&#3538;&#3524;&#3538;&#3508;&#3514;&#3482;&#3538;...<br />
<br />
&#3508;&#3524;&#3501;&#3538;&#3505;&#3530; &#3503;&#3536;&#3482;&#3530;&#3520;&#3545;&#3505;&#3530;&#3505;&#3546; &#3512;&#3545;&#3524;&#3538; &#3514;&#3548;&#3503;&#3535; &#3484;&#3505;&#3530;&#3505;&#3535; &#3517;&#3510;&#3505; &#3520;&#3538;&#3521;&#3546;&#3522;&#3538;&#3501; &#3523;&#3517;&#3482;&#3540;&#3505;&#3540; &#3524;&#3535; &#3474;&#3520;&#3535;&#3514;&#3546; &#3461;&#3515;&#3530;&#3502; &#3503;&#3536;&#3482;&#3530;&#3520;&#3539;&#3512;&#3530; &#3520;&#3546;...<br />
<br />
<br />
\  = Escape character. If you want to reference a special character, you must “escape” it<br />
   with a backslash first.          Example:touch /tmp/filename\*<br />
<br />
/  = Directory separator, used to separate a string of directory names. Example:/usr/src/linux<br />
<br />
.  = Current directory. Can also “hide” files when it is the first character in a filename.<br />
<br />
.. = Parent directory<br />
<br />
~  = User's home directory<br />
<br />
*  = Represents 0 or more characters in a filename, or by itself, all files in a directory.<br />
<br />
?  = Represents a single character in a filename.<br />
<br />
[ ]= Can be used to represent a range of values, e.g. [0-9], [A-Z], etc.<br />
<br />
|  = “Pipe”. Redirect the output of one command into another command.<br />
<br />
&amp;&amp; = Command separator as above, but only runs the second command if the first one<br />
finished without errors.<br />
<br />
&amp;  = Execute a command in the background, and immediately get your shell back.<br />
<br />
==============================================================================================<br />
<br />
&#3508;&#3524;&#3501;&#3538;&#3505;&#3530; &#3503;&#3536;&#3482;&#3530;&#3520;&#3545;&#3505;&#3540; &#3517;&#3510;&#3505;&#3530;&#3505;&#3546; &#3524;&#3539; &#3514;&#3548;&#3503;&#3535;&#3484;&#3501; &#3524;&#3536;&#3482;&#3538; &#3520;&#3538;&#3503;&#3535;&#3505; &#3524;&#3535; &#3473;&#3524;&#3538; &#3508;&#3530;*&#3515;&#3501;&#3538;&#3509;&#3517; &#3520;&#3546;...<br />
<br />
pwd   = Print Working Directory<br />
<br />
cd    = Change Directory<br />
<br />
cd directory = Change into the specified directory Name.<br />
<br />
cd ~  = “~” is an alias for your home directory. It can be used as a shortcut to your “home”, or other directories relative to your home.<br />
<br />
cd .. = Move up one directory. For example, if you are in /home/vic and you type “cd ..”, you will end up in /home.<br />
<br />
cd - = Return to previous directory. An easy way to get back to your previous location!<br />
<br />
ls   = List all files in the current directory, in column format.<br />
<br />
ls directory = List the files in the specified directory.<br />
<br />
ls /usr/bin/d* = List all files whose names begin with the letter “d” in the /usr/bin directory.</div>

]]></content:encoded>
			<dc:creator>sunjayasri</dc:creator>
			<guid isPermaLink="true">http://www.linuxquestions.org/questions/blog.php?b=34728</guid>
		</item>
		<item>
			<title><![CDATA[&#3517;&#3538;&#3505;&#3530;&#3482;&#3530;&#3523;&#3530; &#3524;&#3535; &#3512;&#3535; &#3517;&#3510;&#3535; &#3484;&#3501;&#3530; &#3461;&#3501;&#3530; &#3503;&#3536;&#3482;&#3539;&#3512;&#3530;....]]></title>
			<link>http://www.linuxquestions.org/questions/blog.php?b=34727</link>
			<pubDate>Wed, 02 May 2012 17:47:16 GMT</pubDate>
			<description><![CDATA[&#3508;&#3517;&#3512;&#3540;&#3520; &#3512;&#3535; &#3461;&#3501;&#3530;&#3524;&#3503;&#3535; &#3510;&#3517;&#3505;&#3540; &#3517;&#3536;&#3510;&#3542;&#3520;&#3546; &#3517;&#3538;&#3505;&#3482;&#3530;&#3523;&#3530; &#3467;&#3510;&#3540;&#3505;&#3530;&#3495;&#3540; &#3523;&#3458;&#3523;&#3530;&#3482;&#3515;&#3505;&#3514;&#3514;&#3538;..&#3474; &#3512;&#3535; 16 &#3520;&#3505; &#3520;&#3538;&#3514;&#3546;&#3503;&#3539;&#3514;..&#3512;&#3535; &#3524;&#3495; &#3473;&#3514; &#3461;&#3505;&#3530;&#3503;&#3482;&#3514;&#3538;&#3508;&#3530;&#3508;&#3540; &#3517;&#3549;&#3482;&#3514;&#3505;&#3530; &#3512;&#3545;&#3505;&#3530; &#3503;&#3536;&#3505;&#3538;&#3505;&#3538;...&#3512;&#3505;&#3530;&#3503; &#3512;&#3535; &#3524;&#3495; &#3503;&#3536;&#3505;&#3540;&#3505;&#3546; &#3512;&#3535; &#3520;&#3545;&#3505;&#3512; &#3517;&#3549;&#3482;&#3514;&#3482;...]]></description>
			<content:encoded><![CDATA[<div><font size="2"><font color="Black"><font size="3">&#3508;&#3517;&#3512;&#3540;&#3520; &#3512;&#3535; &#3461;&#3501;&#3530;&#3524;&#3503;&#3535; &#3510;&#3517;&#3505;&#3540; &#3517;&#3536;&#3510;&#3542;&#3520;&#3546; &#3517;&#3538;&#3505;&#3482;&#3530;&#3523;&#3530; &#3467;&#3510;&#3540;&#3505;&#3530;&#3495;&#3540; &#3523;&#3458;&#3523;&#3530;&#3482;&#3515;&#3505;&#3514;&#3514;&#3538;..&#3474; &#3512;&#3535; 16 &#3520;&#3505; &#3520;&#3538;&#3514;&#3546;&#3503;&#3539;&#3514;..&#3512;&#3535; &#3524;&#3495; &#3473;&#3514; &#3461;&#3505;&#3530;&#3503;&#3482;&#3514;&#3538;&#3508;&#3530;&#3508;&#3540; &#3517;&#3549;&#3482;&#3514;&#3505;&#3530; &#3512;&#3545;&#3505;&#3530; &#3503;&#3536;&#3505;&#3538;&#3505;&#3538;...&#3512;&#3505;&#3530;&#3503; &#3512;&#3535; &#3524;&#3495; &#3503;&#3536;&#3505;&#3540;&#3505;&#3546; &#3512;&#3535; &#3520;&#3545;&#3505;&#3512; &#3517;&#3549;&#3482;&#3514;&#3482; &#3484;&#3548;&#3523;&#3530; &#3461;&#3501;&#3515;&#3512;&#3505;&#3530; &#3520;&#3542;&#3520;&#3535; &#3523;&#3546;&#3514;...<br />
<br />
&#3473;&#3524;&#3545;&#3501;&#3530; &#3512;&#3535; &#3512;&#3545;&#3520;&#3505; &#3520;&#3538;&#3495; &#3517;&#3538;&#3505;&#3482;&#3530;&#3523;&#3530; &#3523;&#3512;&#3484; &#3484;&#3536;&#3495;&#3545;&#3512;&#3538;&#3505;&#3530; &#3474; &#3461;&#3501;&#3530;&#3503;&#3536;&#3482;&#3539;&#3512;&#3530; &#3501;&#3540;&#3517;&#3538;&#3505;&#3530; &#3503;&#3539;&#3515;&#3530;&#3485; &#3484;&#3512;&#3505;&#3482;&#3530; &#3508;&#3536;&#3512;&#3538;&#3505; &#3463;&#3501;..&#3474; &#3484;&#3536;&#3505; &#3512;&#3535; &#3505;&#3538;&#3524;&#3501;&#3512;&#3535;&#3505;&#3539; &#3517;&#3545;&#3523; &#3523;&#3501;&#3540;&#3495;&#3540; &#3520;&#3505; &#3461;&#3501;&#3515;&#3512; &#3512;&#3535; &#3517;&#3510;&#3505; &#3461;&#3501;&#3530;&#3503;&#3536;&#3482;&#3539;&#3512;&#3530; &#3476;&#3510; &#3523;&#3512;&#3484; &#3510;&#3545;&#3503;&#3535; &#3484;&#3536;&#3505;&#3539;&#3512;&#3495; &#3512;&#3535; &#3510;&#3517;&#3535; &#3508;&#3548;&#3515;&#3548;&#3501;&#3530;&#3501;&#3540; &#3520;&#3545;&#3512;&#3538;...</font></font></font></div>

]]></content:encoded>
			<dc:creator>sunjayasri</dc:creator>
			<guid isPermaLink="true">http://www.linuxquestions.org/questions/blog.php?b=34727</guid>
		</item>
		<item>
			<title>GUI Programming: Exposing the main event loop (Subclassing QApplication)</title>
			<link>http://www.linuxquestions.org/questions/blog.php?b=34726</link>
			<pubDate>Wed, 02 May 2012 11:23:39 GMT</pubDate>
			<description><![CDATA[GUI Programming: Exposing the main event loop (Subclassing QApplication) 
 
Today's features 
* a QTextEdit in 4 lines of code. 
* subclassing...]]></description>
			<content:encoded><![CDATA[<div>GUI Programming: Exposing the main event loop (Subclassing QApplication)<br />
<br />
Today's features<ul><li>a QTextEdit in 4 lines of code.</li>
<li>subclassing QApplication to view ALL objects and events as they are processed.</li>
<li>how to preempt events in QT</li>
</ul><br />
It looks like this is about the only way to actually preempt messages in QT4.  <br />
<br />
<b>This is NOT the same as installEventFilter() which is simple and useful for many things but runs too late in a series of dispatches to preempt or change anything.<br />
<br />
Also, this is not the same as the X11 event handler (which is pretty cool if you're into that sort of thing).<br />
<br />
And this is NOT just sublcassing the notify handler, which I wonder.. did that EVER work?<br />
</b><br />
<br />
This replaces the root dispatcher (notify()) for the QT system by subclassing QApplication and overwriting that method.<br />
<br />
<font color="Red">If you've discovered the difficulty of subclassing QApplication here yuh go.  Just a dash of Computer Mad Science and voila! :-)<br />
</font><br />
<br />
file: src/main.cpp<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<pre class="bbcodeblock" dir="ltr" style="
		margin: 0px;
		margin-right: -99999px;
		padding: 3px;
		border: 1px inset;
		width: 98%;
		height: 498px;
		text-align: left;
		overflow: auto">
#include &lt;QApplication&gt; // app
#include &lt;QTextEdit&gt;    // editor
#include &lt;QKeyEvent&gt;    // QKeyEvent
// #include &quot;utils.h&quot;      // qkey2name(), handle_return_key(QTextEditor*), etc.
#include &lt;stdio.h&gt;      // printf()

QObject* target;

void dbg(){}
class LQApplication : public QApplication
{
public:
  LQApplication(int &amp;argc, char **argv);
  ~LQApplication();
  bool notify(QObject *receiver, QEvent *e)
  { 
    printf(&quot;receiver: %s0x%lX: eventType: %d\n&quot;, 
           receiver == target ? &quot;TARGET -&gt; &quot; : &quot;&quot;, 
           (long)receiver, e-&gt;type());
    return QApplication::notify(receiver, e);
  }
};

LQApplication::LQApplication(int &amp;argc, char **argv)
: QApplication(argc, argv)
{
  // additional setup
}

LQApplication::~LQApplication()
{
  // delete additional setup as req'd
}

////////////////////////////////////////////////////
// standard-ish main except that it adds a TextEdit 
// set to all the defaults.
int main(int argc, char *argv[])
{
  dbg();
  LQApplication app(argc, argv);
  QTextEdit editor;
  target = &amp;editor;
  editor.show();
  return app.exec();
}</pre>
</div><br />
Here's a snip from what it dumped right as I closed the window.<br />
<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<pre class="bbcodeblock" dir="ltr" style="
		margin: 0px;
		margin-right: -99999px;
		padding: 3px;
		border: 1px inset;
		width: 98%;
		height: 290px;
		text-align: left;
		overflow: auto">receiver: 0x81524C0: eventType: 18
receiver: TARGET -&gt; 0xBFFE30F4: eventType: 27
receiver: 0xBFFE3108: eventType: 20
receiver: TARGET -&gt; 0xBFFE30F4: eventType: 77
receiver: 0x80F6F50: eventType: 71
receiver: 0x80FE278: eventType: 16
receiver: 0x80F6E68: eventType: 71
receiver: 0x80FAC18: eventType: 16
receiver: 0x80F6E68: eventType: 16
receiver: 0x80FDFA8: eventType: 71
receiver: 0x80FB4F0: eventType: 16
receiver: 0x80FDFA8: eventType: 16
receiver: 0x8141E18: eventType: 16
receiver: 0x8145120: eventType: 16
receiver: 0x8147A18: eventType: 16
receiver: 0x81524C0: eventType: 16
receiver: TARGET -&gt; 0xBFFE30F4: eventType: 16</pre>
</div>It's pretty clear what's happening here with event type 16 even without a name printout utility, since TARGET is getting the message last.<br />
<br />
Same with event type 71.<br />
<br />
If you want to use qmake to generate the makefile, go for it.  But you might actually find mc2 makefile creator even easier, especially now that it has the qt4 template (load using 'mc2 -fetch qt4').<br />
<br />
Here's the mc2 link page if you want to check it out.<br />
<a href="http://www.linuxquestions.org/questions/blog/rainbowsally-615861/liblq-and-mc2-makefile-creator2-the-next-generation-34648/">http://www.linuxquestions.org/questi...eration-34648/</a><br />
<br />
The Computer Mad Science Team<br />
<br />
:-)</div>

]]></content:encoded>
			<dc:creator>rainbowsally</dc:creator>
			<guid isPermaLink="true">http://www.linuxquestions.org/questions/blog.php?b=34726</guid>
		</item>
		<item>
			<title>Gloves for my feet</title>
			<link>http://www.linuxquestions.org/questions/blog.php?b=34725</link>
			<pubDate>Wed, 02 May 2012 01:40:10 GMT</pubDate>
			<description><![CDATA[Boy, time does fly, and I didn't blog anything in a long time! 
 
I just felt that I had to mention that I completed my first overnight tramp 
(no,...]]></description>
			<content:encoded><![CDATA[<div>Boy, time does fly, and I didn't blog anything in a long time!<br />
<br />
I just felt that I had to mention that I completed my first overnight tramp<br />
(no, not loose woman, the hike variety) with a heavy back-pack on in my treks.<br />
<br />
No problems, even on rugged terrain, with mud, tree roots, boulders, pebbles, <br />
shingle, you name it ... my feet were happy, as were my knees, ankles, lower<br />
back.  Awesome experience; I guess if it gets colder I'll try the flows for<br />
going bush.  Not sure I'll trust them w/ extreme weather conditions (under <br />
-5 Celsius), or in deep snow ... :)</div>

]]></content:encoded>
			<dc:creator>Tinkster</dc:creator>
			<guid isPermaLink="true">http://www.linuxquestions.org/questions/blog.php?b=34725</guid>
		</item>
		<item>
			<title>Oldie, but goodie.</title>
			<link>http://www.linuxquestions.org/questions/blog.php?b=34724</link>
			<pubDate>Tue, 01 May 2012 19:27:50 GMT</pubDate>
			<description>Hunt the Wumpus. 
There are several types of games, but lately adventure games seem to be coming back. The original adventures just required a...</description>
			<content:encoded><![CDATA[<div>Hunt the Wumpus.<br />
There are several types of games, but lately adventure games seem to be coming back. The original adventures just required a keyboard. No fancy joysticks and or sound cards to deal with.  What is really nice about them is that you can use the same source code more or less on a variety of systems. Sometimes that is known as code portability.  People even want to put it on the Arduino (a micro-controller).  If you do not have an Arduino, you can still play the original game on your desktop system.<br />
<br />
You might even be able to put it on your router and play it remotely.  You could even put it on a server to play while waiting for some event. Definitely for older or lower resource systems.  Wumpus is probably one of the most popular of the original adventure games. Supposedly it was written in BASIC (Beginners all purpose instruction code) and then translated or ported to &quot;C&quot;.   In fact some of the versions of the code,have the original BASIC code embedded in the comments of the &quot;C&quot; code. Good lesson in learning &quot;C&quot; for beginners.<br />
<br />
Here we will go through the set up for a Linux system. Other platforms should at least vaguely resemble this same process.<br />
<br />
Download the archive.<br />
<br />
$ wget <a href="http://www.catb.org/~esr/wumpus/wumpus-1.4.tar.gz" target="_blank">http://www.catb.org/~esr/wumpus/wumpus-1.4.tar.gz</a><br />
<br />
Extract the archive<br />
<br />
$ tar zxvf wumpus-1.4.tar.gz<br />
wumpus-1.4/COPYING<br />
wumpus-1.4/Makefile<br />
wumpus-1.4/README<br />
wumpus-1.4/superhack.c<br />
wumpus-1.4/wumpus.6<br />
wumpus-1.4/wumpus.c<br />
wumpus-1.4/wumpus.spec<br />
wumpus-1.4/wumpus.xml<br />
<br />
Change to the directory.<br />
<br />
$ cd wumpus-1.4<br />
<br />
Get a directory listing to see what is there.<br />
<br />
wumpus-1.4]$ ls<br />
COPYING   README       wumpus.6  wumpus.spec<br />
Makefile  superhack.c  wumpus.c  wumpus.xml<br />
<br />
Compile the program. (Requires the &quot;C&quot; development system&quot;)<br />
wumpus-1.4]$ make<br />
cc  wumpus.c -o wumpus<br />
cc  superhack.c -o superhack<br />
<br />
Get a new listing. See that superhack and wumpus are added. The compiled programs.<br />
<br />
wumpus-1.4]$ ls<br />
COPYING   README     superhack.c  wumpus.6  wumpus.spec<br />
Makefile  superhack  wumpus       wumpus.c  wumpus.xml<br />
<br />
Play wumpus.<br />
<br />
wumpus-1.4]$ ./wumpus<br />
INSTRUCTIONS (Y-N)<br />
?y<br />
WELCOME TO 'HUNT THE WUMPUS'<br />
  THE WUMPUS LIVES IN A CAVE OF 20 ROOMS. EACH ROOM<br />
HAS 3 TUNNELS LEADING TO OTHER ROOMS. (LOOK AT A<br />
DODECAHEDRON TO SEE HOW THIS WORKS-IF YOU DON'T KNOW<br />
WHAT A DODECAHEDRON IS, ASK SOMEONE)<br />
<br />
     HAZARDS:<br />
 BOTTOMLESS PITS - TWO ROOMS HAVE BOTTOMLESS PITS IN THEM<br />
     IF YOU GO THERE, YOU FALL INTO THE PIT (&amp; LOSE!)<br />
 SUPER BATS - TWO OTHER ROOMS HAVE SUPER BATS. IF YOU<br />
     GO THERE, A BAT GRABS YOU AND TAKES YOU TO SOME OTHER<br />
     ROOM AT RANDOM. (WHICH MAY BE TROUBLESOME)<br />
TYPE AN E THEN RETURN<br />
?<br />
<br />
Eric Raymond did not like the wumpus interface so he made an alternate version called superhack.<br />
<br />
wumpus-1.4]$ ./superhack<br />
Hunt the Superhack<br />
You are in room 8.  Exits lead to 1, 7, 9.  You have 5 pies left.<br />
I smell perfume!<br />
Droids nearby!<br />
Droids nearby!<br />
Throw, move or help [t,m,?]? ?<br />
Welcome to `Hunt the Superhack'<br />
<br />
   The superhack lives on the 9th floor of 45 Technology Square in<br />
Cambridge, Massachusetts.  Your mission is to throw a pie in his face.<br />
<br />
   First, you'll have to find him.  A botched experiment by an MIT<br />
physics group has regularized the floor's topology, so that each<br />
room has exits to three other rooms.  (Look at a dodecahedron to<br />
see how this works --- if you don't know what a dodecahedron is,<br />
ask someone.)<br />
<br />
You:<br />
   Each turn you may move to an adjacent room or throw a pie.  If<br />
you run out of pies, you lose.  Each pie can pass through up to<br />
five rooms (connected by a continuous path from where you are).  You<br />
aim by telling the computer which rooms you want to throw through.<br />
If the path is incorrect (presumes a nonexistent connection) the<br />
pie moves at random.<br />
   If a pie hits the superhack, you win. If it hits you, you lose!<br />
<br />
&lt;Press return to continue&gt;<br />
<br />
Hazards:<br />
   Starlets --- two rooms contain lonely, beautiful women.  If you<br />
enter these, you will become fascinated and forget your mission as<br />
you engage in futile efforts to pick one up.  You weenie.<br />
   Droids --- two rooms are guarded by experimental AI security<br />
droids.  If you enter either, the droid will grab you and hustle<br />
you off to somewhere else, at random.<br />
   Lusers --- two rooms contain hungry lusers.  If you blunder into<br />
either, they will eat one of your pies.<br />
   Superhack --- the superhack is not bothered by hazards (the<br />
lusers are in awe of him, he's programmed the droids to ignore him,<br />
and he has no sex life).  Usually he is hacking.  Two things can<br />
interrupt him; you throwing a pie or you entering his room.<br />
<br />
   On an interrupt, the superhack moves (3/4 chance) or stays where<br />
he is (1/4 chance).  After that, if he is where you are, he flames<br />
you and you lose!<br />
<br />
&lt;Press return to continue&gt;<br />
<br />
Warnings:<br />
   When you are one room away from the superhack or a hazard,<br />
the computer says:<br />
   superhack:       &quot;I smell a superhack!&quot;<br />
   security droid:  &quot;Droids nearby!&quot;<br />
   starlet:         &quot;I smell perfume!&quot;<br />
   luser:           &quot;Lusers nearby!&quot;<br />
If you take too long finding the superhack, hazards may move.  You<br />
will get a warning when this happens.<br />
<br />
Commands:<br />
   Available commands are:<br />
<br />
  ?            --- print long instructions.<br />
  m &lt;number&gt;   --- move to room with given number.<br />
  t &lt;numbers&gt;  --- throw through given rooms.<br />
<br />
The list of room numbers after t must be space-separated.  Anything<br />
other than one of these commands displays a short help message.<br />
<br />
You are in room 20.  Exits lead to 13, 16, 19.  You have 5 pies left.<br />
I smell perfume!<br />
Lusers nearby!<br />
Throw, move or help [t,m,?]?<br />
<br />
<br />
Enjoy.</div>

]]></content:encoded>
			<dc:creator>peonuser</dc:creator>
			<guid isPermaLink="true">http://www.linuxquestions.org/questions/blog.php?b=34724</guid>
		</item>
		<item>
			<title>SSL</title>
			<link>http://www.linuxquestions.org/questions/blog.php?b=34723</link>
			<pubDate>Tue, 01 May 2012 18:13:26 GMT</pubDate>
			<description>Where do I go to acquire the widget to place on my site showing the security certificate issuer.</description>
			<content:encoded><![CDATA[<div>Where do I go to acquire the widget to place on my site showing the security certificate issuer.</div>

]]></content:encoded>
			<dc:creator>makbul</dc:creator>
			<guid isPermaLink="true">http://www.linuxquestions.org/questions/blog.php?b=34723</guid>
		</item>
		<item>
			<title>May i know how to post a question</title>
			<link>http://www.linuxquestions.org/questions/blog.php?b=34722</link>
			<pubDate>Tue, 01 May 2012 18:12:38 GMT</pubDate>
			<description>May i know how to post a question.</description>
			<content:encoded><![CDATA[<div>May i know how to post a question.</div>

]]></content:encoded>
			<dc:creator>makbul</dc:creator>
			<guid isPermaLink="true">http://www.linuxquestions.org/questions/blog.php?b=34722</guid>
		</item>
		<item>
			<title>Test post</title>
			<link>http://www.linuxquestions.org/questions/blog.php?b=34721</link>
			<pubDate>Tue, 01 May 2012 16:44:24 GMT</pubDate>
			<description>Test posting :)</description>
			<content:encoded><![CDATA[<div>Test posting :)</div>

]]></content:encoded>
			<dc:creator>Minganus</dc:creator>
			<guid isPermaLink="true">http://www.linuxquestions.org/questions/blog.php?b=34721</guid>
		</item>
		<item>
			<title>Rootkit Hunter reissue of 1.4.0 release (ALLOWDEVFILE)</title>
			<link>http://www.linuxquestions.org/questions/blog.php?b=34720</link>
			<pubDate>Tue, 01 May 2012 16:02:18 GMT</pubDate>
			<description><![CDATA[Please note we've found an error with usage of exclamation points in an ALLOWDEVFILE check. 
We have corrected this and have reissued 1.4.0. 
 
NEW...]]></description>
			<content:encoded><![CDATA[<div>Please note we've found an error with usage of exclamation points in an ALLOWDEVFILE check.<br />
We have corrected this and have reissued 1.4.0.<br />
<br />
NEW RELEASE SHA1: 48798beec504c00af93bf64b6e35dfc7d7aaff07<br />
old release SHA1: 22546370647b79abce783d2a2d29352843d1b617<br />
<br />
<br />
Apologies for the inconvenience,<br />
unSpawn<br />
---</div>

]]></content:encoded>
			<dc:creator>unSpawn</dc:creator>
			<guid isPermaLink="true">http://www.linuxquestions.org/questions/blog.php?b=34720</guid>
		</item>
		<item>
			<title>Rootkit Hunter release 1.4.0</title>
			<link>http://www.linuxquestions.org/questions/blog.php?b=34719</link>
			<pubDate>Tue, 01 May 2012 00:11:39 GMT</pubDate>
			<description>Rootkit Hunter 1.4.0 release is here (http://sourceforge.net/projects/rkhunter/files/latest/download) thanks to John Horne and all contributors who...</description>
			<content:encoded><![CDATA[<div><a href="http://sourceforge.net/projects/rkhunter/files/latest/download" target="_blank">Rootkit Hunter 1.4.0 release is here</a> thanks to John Horne and all contributors who provided code, submitted ideas, bugs, fixes, documentation, helped out on the rkhunter-users mailing list and promoted Rootkit Hunter. <br />
<br />
New:<br />
<br />
- Added the '--list propfiles' command-line option. This will dump out the list of filenames that will be searched for when building the file properties database. By default the list is not shown if just '--list' is used.<br />
- Added Jynx rootkit check.<br />
- Added Turtle/Turtle2 rootkit check.<br />
- Added KBeast rootkit check.<br />
- The installer now supports the Slackware TXZ package layout option.<br />
<br />
Changes:<br />
<br />
- Allow the ALLOWDEVFILE, ALLOWHIDDENFILE and ALLOWHIDDENDIR options to use '%' as the space character. (Note: This is a temporary fix).<br />
- The ALLOWPROCDELFILE option can now use wildcards in the file names.<br />
- The '--list perl' command-line option now shows whether the perl command itself is installed or not.<br />
- The 'shared_libs' test now allows whitelisting of the preloading environment variables.<br />
- The '-r/--rootdir' command-line options, and the ROOTDIR configuration option are now deprecated. If they are used then an error message will be displayed. The options will have no effect, but rkhunter will continue. The options will be completely removed at the next release.<br />
- The 'hidden_ports' test will now show if a found port is TCP or UDP.<br />
- It is now possible to whitelist ports in the 'hidden_ports' test using the PORT_WHITELIST configuration option.<br />
<br />
Bugfixes:<br />
<br />
- Allow the ALLOWPROCDELFILE option to work again.<br />
- Correct the check of the ProFTPD version number.<br />
- Fix the FreeBSD 'sockstat' command check to ensure that the correct fields are used.<br />
- Fix for newer version of the 'file' command when reporting scripts.<br />
- Fix the ALLOWHIDDENFILE option to allow hidden symbolic links.<br />
- The 'filesystem' check now handles files and directories with spaces in their names correctly.<br />
- The 'startup_files' test was displaying file names with spaces in them incorrectly. Also the test was not checking files which were in hidden directories.<br />
- Ensure that the ALLOWDEVFILE, ALLOWHIDDENFILE and ALLOWHIDDENDIR options re-evaluate their whitelisting lists to ensure that any wildcard entries are the most recent. (A time window previously existed which meant that the list was processed, but new files could be created before the test was run. As such they were reported as false-positive warnings, when they should have been whitelisted.)<br />
- Allow the EXISTWHITELIST option to work with symbolic links.<br />
- The test of whether prelinking is being used or not was sometimes causing the file properties hash test to be skipped, without the real reason being stated. Now the hash test will proceed but the user will still get a warning (because it detects that prelinking was used and is not now, or vice-versa).<br />
- Rkhunter will now check to see if the 'head' and 'tail' commands understand the '-n' option. If they do, then it will be used. If they do not, then the older 'head -1' and 'tail -1' commands will be used.<br />
<br />
For more details please see the <a href="http://rkhunter.cvs.sourceforge.net/viewvc/*checkout*/rkhunter/rkhunter/files/CHANGELOG" target="_blank">CHANGELOG</a>.<br />
Rootkit Hunter release 1.4.0 obsoletes all previous releases. Please upgrade real soon now.</div>

]]></content:encoded>
			<dc:creator>unSpawn</dc:creator>
			<guid isPermaLink="true">http://www.linuxquestions.org/questions/blog.php?b=34719</guid>
		</item>
		<item>
			<title>BIOS still not smart enough</title>
			<link>http://www.linuxquestions.org/questions/blog.php?b=34718</link>
			<pubDate>Mon, 30 Apr 2012 18:45:50 GMT</pubDate>
			<description><![CDATA[BIOS is still not smart enough, and has failed to reach the "holy grail" of doing just what system administrators want it to do.  This means you AMI....]]></description>
			<content:encoded><![CDATA[<div>BIOS is still not smart enough, and has failed to reach the &quot;holy grail&quot; of doing just what system administrators want it to do.  This means you AMI.  And the others, too.<br />
<br />
What I (and just about every system administrator I've talk to about this) want is to be able to specify a device boot order that does NOT get modified by the BIOS just because the media or device is absent in a future boot cycle.  I want to have the USB memory stick be the FIRST boot device, conditional on it being present and bootable, and have the primary hard drive be bootable next, and the secondary hard drive be bootable after that (if the primary failed).  This way, if I need to perform maintenance on a system, I can just plug in a bootable USB memory stick, reboot the machine, and that memory stick system will be selected first ... always when it is present.<br />
<br />
Why is that so hard to do?  Some PHB manager tells you not to?</div>

]]></content:encoded>
			<dc:creator>Skaperen</dc:creator>
			<guid isPermaLink="true">http://www.linuxquestions.org/questions/blog.php?b=34718</guid>
		</item>
		<item>
			<title>Problem with booting fedora 12 repairing filesystem?</title>
			<link>http://www.linuxquestions.org/questions/blog.php?b=34717</link>
			<pubDate>Mon, 30 Apr 2012 08:36:05 GMT</pubDate>
			<description>I have installed fedora 12 in my system and now i am getting problem with repairing filesystem. when my system boot up i get this message. 
 
**An...</description>
			<content:encoded><![CDATA[<div>I have installed fedora 12 in my system and now i am getting problem with repairing filesystem. when my system boot up i get this message.<br />
<br />
**An error occurred during the file system check. **Dropping you to a shell; the system will reboot ***when you leave the shell. Give root password for maintenance (or type Control-D to continue):<br />
<br />
When i give root password to repair filesystem.<br />
<br />
bash: cannot set terminal process group (-1): Inappropriate ioctl for device bash: no job control in this shell. (Repair Filesystem) 1#<br />
<br />
and here i am unable to run fsck command to repair filesystem.<br />
<br />
plz help me it's urgent.<br />
<br />
Regards Abdul</div>

]]></content:encoded>
			<dc:creator>abdul kadir</dc:creator>
			<guid isPermaLink="true">http://www.linuxquestions.org/questions/blog.php?b=34717</guid>
		</item>
		<item>
			<title>QT4 Property dump example.  (simple terminal app)</title>
			<link>http://www.linuxquestions.org/questions/blog.php?b=34716</link>
			<pubDate>Mon, 30 Apr 2012 07:24:04 GMT</pubDate>
			<description>This code just prints out the properties (and where they come from) for one widget.  You can see the dump around the middle of this blog entry. 
 
A...</description>
			<content:encoded><![CDATA[<div>This code just prints out the properties (and where they come from) for one widget.  You can see the dump around the middle of this blog entry.<br />
<br />
A full blown version would require a LOT of includes and libs and a way to replace a &quot;ClassName&quot; string in the file with the actual class we want to dump.  (See &quot;%s&quot; in three places below.)<br />
<br />
file: src/qt4-props.cpp<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<pre class="bbcodeblock" dir="ltr" style="
		margin: 0px;
		margin-right: -99999px;
		padding: 3px;
		border: 1px inset;
		width: 98%;
		height: 498px;
		text-align: left;
		overflow: auto">// file: qt4-props.cpp - lists all properties for (in this case)
// a QPushButton class.

#include &lt;QApplication&gt;
#include &lt;QtCore/qmetaobject.h&gt;
#include &lt;QPushButton&gt;
#include &lt;stdio.h&gt;

int main(int argc, char **argv)
{
  QApplication app(argc, argv);
  
  QPushButton *t = new QPushButton();
  
  const QMetaObject* m;
  m = t-&gt;metaObject();
  int cnt = m-&gt;propertyCount();
  // int cnt = m-&gt;methodCount();
  
  while(m)
  {
    QStringList properties;
    QStringList types;
    
    printf(&quot;\nFrom class: %s\n&quot;, m-&gt;d.stringdata);
    printf(&quot;---------------------------\n&quot;);
    
    for(int i = m-&gt;propertyOffset(); i &lt; m-&gt;propertyCount(); i++)
      // for(int i = m-&gt;methodOffset(); i &lt; m-&gt;methodCount(); i++)
    {
      QMetaProperty a = m-&gt;property(i);
      // QMetaMethod a = m-&gt;method(i);
      
      properties &lt;&lt; QString::fromLatin1(m-&gt;property(i).name());
      properties &lt;&lt; QString::fromLatin1(m-&gt;property(i).typeName());
      // properties &lt;&lt; QString::fromLatin1(m-&gt;method(i).signature());
    }
    
    int odd = 0;
    foreach(QString s, properties)
    {
      const char* str = s.toAscii();
      if(!odd)
        printf(&quot;%s : &quot;, str);
      else
        printf(&quot;%s\n&quot;, str);
      odd = !odd;
    }
    cnt = m-&gt;propertyOffset();      
    //    cnt = m-&gt;methodOffset();      
    m = m-&gt;d.superdata;
  }
  return 0;
}

/*
 # file: m*c2.def - type 'mc2 -i' or 'mc2 -u' to init a new makefile
 
 OUTNAME = qt4-props
 BINDIR = .
 SRCDIR = src
 OBJDIR = o
 COMPILE = g++ -c 
 CFLAGS = $(DEFINES) -Wall -W -O2 
 INCLUDE = -I ~/usr32/include -I$(SRCDIR) -I/usr/include -I/usr/include/Qt -I/usr/include/QtGui -I /usr/include/QtCore 
 
 # add these as needed to the includes above.  
 # -I /usr/include/Qt             -I /usr/include/QtHelp         -I /usr/include/QtSvg
 # -I /usr/include/Qt3Support     -I /usr/include/QtMultimedia   -I /usr/include/QtTest
 # -I /usr/include/QtCore         -I /usr/include/QtNetwork      -I /usr/include/QtUiTools
 # -I /usr/include/QtDBus         -I /usr/include/QtOpenGL       -I /usr/include/QtWebKit
 # -I /usr/include/QtDeclarative  -I /usr/include/QtScript       -I /usr/include/QtXml
 # -I /usr/include/QtDesigner     -I /usr/include/QtScriptTools  -I /usr/include/QtXmlPatterns
 # -I /usr/include/QtGui          -I /usr/include/QtSql
 
 LINK = g++ 
 LDFLAGS = -lLQ -lQtGui -lQtCore 
 
 # add as needed. see notes for DEFINES and INCLUDES above if you need to split lines
 # -lQt3Support              -lQtNetwork               -lQtCLucene
 # -lQtOpenGL                -lQtCore                  -lQtScript
 # -lQtDBus                  -lQtScriptTools           -lQtDeclarative
 # -lQtSql                   -lQtDesignerComponents    -lQtSvg
 # -lQtDesigner              -lQtTest                  -lQtGui 
 # -lQtWebKit                -lQtHelp                  -lQtXmlPatterns
 # -lQtMultimedia            -lQtXml
 
 
 # adjust the LIB paths for your system.  Try 'locate libQtGui'
 # to find the right path for your system.
 LIB = -L ~/usr32/lib -L/usr/lib 
 
 ################################################################
 ## User Defined Targets
 
 clean: 
 @rm -f $(MAIN)
 @rm -f $(OBJ)
 @rm -f `find . -name *~ -o -name *.*~`
 
*/</pre>
</div><br />
Here's the property dump for QPushButton using this utility.  <br />
<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<pre class="bbcodeblock" dir="ltr" style="
		margin: 0px;
		margin-right: -99999px;
		padding: 3px;
		border: 1px inset;
		width: 98%;
		height: 498px;
		text-align: left;
		overflow: auto">$&gt; qt4-props

From class: QPushButton
---------------------------
autoDefault : bool
default : bool
flat : bool

From class: QAbstractButton
---------------------------
text : QString
icon : QIcon
iconSize : QSize
shortcut : QKeySequence
checkable : bool
checked : bool
autoRepeat : bool
autoExclusive : bool
autoRepeatDelay : int
autoRepeatInterval : int
down : bool

From class: QWidget
---------------------------
modal : bool
windowModality : Qt::WindowModality
enabled : bool
geometry : QRect
frameGeometry : QRect
normalGeometry : QRect
x : int
y : int
pos : QPoint
frameSize : QSize
size : QSize
width : int
height : int
rect : QRect
childrenRect : QRect
childrenRegion : QRegion
sizePolicy : QSizePolicy
minimumSize : QSize
maximumSize : QSize
minimumWidth : int
minimumHeight : int
maximumWidth : int
maximumHeight : int
sizeIncrement : QSize
baseSize : QSize
palette : QPalette
font : QFont
cursor : QCursor
mouseTracking : bool
isActiveWindow : bool
focusPolicy : Qt::FocusPolicy
focus : bool
contextMenuPolicy : Qt::ContextMenuPolicy
updatesEnabled : bool
visible : bool
minimized : bool
maximized : bool
fullScreen : bool
sizeHint : QSize
minimumSizeHint : QSize
acceptDrops : bool
windowTitle : QString
windowIcon : QIcon
windowIconText : QString
windowOpacity : double
windowModified : bool
toolTip : QString
statusTip : QString
whatsThis : QString
accessibleName : QString
accessibleDescription : QString
layoutDirection : Qt::LayoutDirection
autoFillBackground : bool
styleSheet : QString
locale : QLocale
windowFilePath : QString
inputMethodHints : Qt::InputMethodHints

From class: QObject
---------------------------
objectName : QString</pre>
</div><br />
It's kind of interesting to see how we can parse the property inheritance heirarchy and this is probably similar to how we might get other info about QT classes somewhat interactively.<br />
<br />
And with that in mind...<br />
<br />
What would happen if we change &quot;property&quot; to &quot;method&quot; (matching upper/lower case as req'd) and dumped 'signature()' instead of 'name()' for each method?<br />
<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<pre class="bbcodeblock" dir="ltr" style="
		margin: 0px;
		margin-right: -99999px;
		padding: 3px;
		border: 1px inset;
		width: 98%;
		height: 386px;
		text-align: left;
		overflow: auto">base64 -d &lt;&lt; _eof | gunzip &gt; qt4-methods.cpp
H4sICKssnk8AA3F0NC1wcm9wcy5jcHAApVZbU+M2FH7XrziF3cEJ2GnZPgW6LSRA3XUS2MDQh31Y
YSuJdmXJSDIM0ym/vUe2k9iJw7TTPGSsc/nO7dOxez2YccH68Gh/9lNmFyoxQZxl4IPgxhqgQkAl
h5nS4HEJdsENxNSwDun1gMLNdW4W57m1SkIsqDEBIftcxiJPGJzenGWZ4DG1XMmPdbkdKM16j4hO
1cM3Fttg0dCvUetiYxOunCXh0kJKufTcA9Xz+AjiBdXQ7eLhqUP+IgD14ECzzCvtCoMT1DuTWvZd
C7+AZM91obc0jJU0Fm5GmO+kyLcLqVOl6GP9j+lKXnq4rGLpANNCiS0cqFzaFd7zAjvvpR18dKli
JlOruZxH2HjItMqYtpyZky2dfcmW4uIvQ42deXtf5KVWaTmCPrw3X+TekQueBKZwTqilnZOGi7/7
h96dWhAcftFoXi9oMpsZ5ipC8el2ncAPDzuFd1kglN0bFUZInBqSx6tgVTiodQBOT5f19/szLDHC
ecqfvLpzYPhcUptr5nVWSP8RwvV1TNM1wt/1jFzxKkkw6R9Plh1hNF54FS6Yo1rAZtkldRw7u4Cz
QAwTWHVmYs69VbZ85v2AATrVcT2k9wb6gKNEz5UxE4a1GBYj7xYhME/4FfaeFE/20L/uXJbhgtXr
3CDrerbrHuB1/3eGaWmAzMuxIY54LpKLoxkOSboe4on0umS/2kBpfBwkbIabx80BDvAMPj8AXDrl
c34AVuEYON724pKm9DtzvoRM7m7HZ6MLDOr2mJuCIefheBh+RlFApp8H5aPRMZmc/1EeFBlMRtdh
5Nzmh4fgx0AGl9HZ1RQF77zhxWU4vph2wL93S9C/B39yDCQcD6K7ofPxQ3jt5UZ/OO4tt5MfvvPK
YOgWOmVNVT/2buy25CrnDnRD6rYk4EIFilOzC2YYUIP1s4QlriEogsoa1/WDemIBDmG/BQnqv231
70xkb6inT/NW1A/TPMuUtjvcRrmwPGUJp63qW2ZsK2xR9u5sxsw+K/19l/qO3yolTCvy8Dw3byBP
Miavop3qe/bwibenPGS4ejUulifW2sBY88zuBP4zFTtQ3WpjetdYCtSi2h2o19RapmV7Mxzn3hr6
oyAkCsefqjtCouHyhvgiusG/irZig6grigZgGAOpLCs/IKprBVQmUN2laUlbXIDwovLCzxHb4Jvb
4meIZEXqYoNq66zFBh0amkGUx0yyCqEx3KZdnW8NTdnhCqBBnhazahANTY0XFQq2dRuksi2nPVBp
piST1qzwy/snNhjR8Ha3qR3XDalyLxncZtTYAA3NBo3Exr3etCUlDb7l7msF91MUnkNG7aKkAA5Z
g3kxlqW4qm71CxwIhd9oDIf9UKR6gO7IgBmXxcoDzecLWyBsARCHjWyMVssYQfBYENk9Yir/84cA
cGew30N83Ugk5y1+PzJrCIkFo7LvXnm/6RT8Gb42RmfhuFMX4Pumdv5a1BSAL/FDA7qv4Kvlc9B9
/UpIt/cPquplspQLAAA=
_eof</pre>
</div>;-)<br />
<br />
[See 'mc2 -help all' re.  Multiple Executables: How To.  It's a lot easier than you probably think. Use page down or dump to stdout if you don't like the screwy xmessage scrollbars.  Put both sources in the same source dir and both executables compile at once.  Remember to 'update' your Makefile.]<br />
<br />
.</div>

]]></content:encoded>
			<dc:creator>rainbowsally</dc:creator>
			<guid isPermaLink="true">http://www.linuxquestions.org/questions/blog.php?b=34716</guid>
		</item>
		<item>
			<title>QT4 GUI testing and experiments (including sub-attaq and tooltips)</title>
			<link>http://www.linuxquestions.org/questions/blog.php?b=34715</link>
			<pubDate>Sun, 29 Apr 2012 05:43:16 GMT</pubDate>
			<description><![CDATA[Sorta back on track after some false starts and tweekage on the mc2 makfile creator... 
 
Here's a few things that might be interesting that I cooked...]]></description>
			<content:encoded><![CDATA[<div>Sorta back on track after some false starts and tweekage on the mc2 makfile creator...<br />
<br />
Here's a few things that might be interesting that I cooked up while testing mc2 on QT examples and demos.<br />
<br />
If nothing else you might be interested to see that *.pro files are NOT required to compile these things (there are some download links below).<br />
<br />
------------------<br />
<br />
If you want it, here's a utility to create a new ui file from scratch that will open with designer or creator when you click on it.<br />
<br />
file: ~/bin/src/misc/new.ui (executable)<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<pre class="bbcodeblock" dir="ltr" style="
		margin: 0px;
		margin-right: -99999px;
		padding: 3px;
		border: 1px inset;
		width: 98%;
		height: 482px;
		text-align: left;
		overflow: auto">#!/bin/sh

if [ &quot;$1&quot; == &quot;&quot; ]; then
  name=form1
else
  name=$1
fi

cat &lt;&lt; _EOF &gt; $name.ui
&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;ui version=&quot;4.0&quot;&gt;
 &lt;class&gt;Form&lt;/class&gt;
 &lt;widget class=&quot;QWidget&quot; name=&quot;Form&quot;&gt;
  &lt;property name=&quot;geometry&quot;&gt;
   &lt;rect&gt;
    &lt;x&gt;0&lt;/x&gt;
    &lt;y&gt;0&lt;/y&gt;
    &lt;width&gt;400&lt;/width&gt;
    &lt;height&gt;300&lt;/height&gt;
   &lt;/rect&gt;
  &lt;/property&gt;
  &lt;property name=&quot;windowTitle&quot;&gt;
   &lt;string&gt;Form&lt;/string&gt;
  &lt;/property&gt;
 &lt;/widget&gt;
 &lt;resources/&gt;
 &lt;connections/&gt;
&lt;/ui&gt;
_EOF</pre>
</div>Make a symlink to it in your HOME/bin folder to 'install' it.  (See new.symlink in early blog entries, like around page 3 or 4, if you like these 'new.&lt;name&gt;' utilities and this system of installing in your ~/bin folder.<br />
<br />
Again, this creates the initial ui file, it isn't the file itself.<br />
<br />
---------------------<br />
<br />
Now...<br />
<br />
I created a gui toolkit that worked well with suse 10 but not with suse 11.  I call it FTL and it was based on the once and now again defunct fltk 2.0.<br />
<br />
The main problem is that somehow the improvements between suse 10 and suse 11 clobbered the subpixel rendering of circles that I drew oversize and then scaled down for the final 'draw' operation.  This works for actual images (still) in the newer openSUSE but not for scaled images that are drawn line by line in an offscreen pixmap.<br />
<br />
???<br />
<br />
Here's before and after drawing 2X scaled which worked in suse 10.<br />
<a href="http://rainbowsally.net/pub/lq/images/2x-scaled-drawing.png" target="_blank">http://rainbowsally.net/pub/lq/image...ed-drawing.png</a><br />
<br />
And here's an example in the QT examples that is called tooltips, but which I thought was less interesting for the tooltips than it was for the subpixel rendering which makes the circles so nice.  <br />
<br />
screenshot:<br />
<a href="http://rainbowsally.net/pub/lq/images/rs-tooltips.png" target="_blank">http://rainbowsally.net/pub/lq/images/rs-tooltips.png</a><br />
<br />
download:<br />
<a href="http://rainbowsally.net/pub/lq/rs-tooltips.tar.gz" target="_blank">http://rainbowsally.net/pub/lq/rs-tooltips.tar.gz</a><br />
<br />
The sources are about half a meg and should compile pretty much out of the box unless your libs are in oddball locations.  You may be able to edit the Makefile, or with mc2 you can edit the mc2.def file which isn't so finicky about 'separators' and such.<br />
<br />
You may notice a couple of changes in the sources if you have the original example in your system.  One is that we use a subdirectory for the sources and the other is that we precompile the resources, eliminating the QT_INIT_RESOURCE() macro usually set in 'main.cpp' (More on why we do this below.)<br />
<br />
QT got subpixel rendering nailed.  I'd like to see how.  They call XRenderComposite() which I hadn't done.  I used a more generic X call.  And this is probably part of the solution, but it's not all of it.<br />
<br />
Nevermind.  That's my own gig.  ;-)<br />
<br />
---------------------------<br />
<br />
So... now what?<br />
<br />
Let's mess around a bit.<br />
<br />
Here's sub-attaq from the demos folder that hadn't worked for me before.  If you also had trouble getting it to compile, try this one.  The problem?  I was missing data.xml.  I was able to manually add that file to my make-based installer's TREE and now it works.<br />
<br />
Here's a copy reworked using mc2 that should work for you in case you did have similar problems with this one.<br />
<br />
<a href="http://rainbowsally.net/pub/lq/rs-sub-attaq.tar.gz" target="_blank">http://rainbowsally.net/pub/lq/rs-sub-attaq.tar.gz</a><br />
<br />
This too is about half a meg.  See the README's in the downloads for how to 'make' them. (We need to generate the moc, uic, and qrc files in a separate 'make' target.)<br />
<br />
Note that we are compiling the resources into the applications rather than loading them from the directory at run time.  This is a bit redundant but the executable needs to be in the same directory with the sources if we don't do this.<br />
<br />
QT_INIT_RESOURCES() in both of these apps has been commented out for this reason.<br />
<br />
The makefiles were generated using mc2, but you don't need mc2 to 'make' or run them.<br />
<br />
However, during this exercise I noticed that we need our mc2 -run qt4-ui switch to warn us when stuff like missing xml files happens.<br />
<br />
mc2 v. 2.0.7 adds this ability.<br />
<a href="http://www.linuxquestions.org/questions/blog/rainbowsally-615861/liblq-and-mc2-makefile-creator2-the-next-generation-34648/">http://www.linuxquestions.org/questi...eration-34648/</a><br />
<br />
Well... that's enough Computer Mad Science for one day, I guess.<br />
<br />
;-)<br />
<br />
Seriously, if those demos didn't work, especially sub-attaq, you might never have known it with the *.pro file and qmake system.</div>

]]></content:encoded>
			<dc:creator>rainbowsally</dc:creator>
			<guid isPermaLink="true">http://www.linuxquestions.org/questions/blog.php?b=34715</guid>
		</item>
		<item>
			<title>Running Logwatch in a more portable way</title>
			<link>http://www.linuxquestions.org/questions/blog.php?b=34714</link>
			<pubDate>Sat, 28 Apr 2012 09:16:58 GMT</pubDate>
			<description>In the Linux Security (http://www.linuxquestions.org/questions/linux-security-4/) forum we often ask victims of (perceived) security breaches to...</description>
			<content:encoded><![CDATA[<div>In the <a href="http://www.linuxquestions.org/questions/linux-security-4/">Linux Security</a> forum we often ask victims of (perceived) security breaches to gather log files and parse them for leads using Logwatch. Analysis is best done on a physically separate, known secure machine in a safe network. If left unmodified Logwatch configuration defaults will result in it picking up the machines logs instead of the compromised machines logs. Here is a patch for install_logwatch.sh that will install Logwatch in a temporary directory and prepare it for receiving log files in a separate directory:<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<pre class="bbcodeblock" dir="ltr" style="
		margin: 0px;
		margin-right: -99999px;
		padding: 3px;
		border: 1px inset;
		width: 98%;
		height: 498px;
		text-align: left;
		overflow: auto">--- install_logwatch.sh.orig	2012-03-24 11:35:34.000000000 +0000
+++ install_logwatch.sh	2012-03-24 11:35:35.000000000 +0000
@@ -72,11 +72,11 @@
 
 #All these can be set via user input
 #Defaults
-BASEDIR=&quot;/usr/share/logwatch&quot;
-CONFIGDIR=&quot;/etc/logwatch&quot;
-TEMPDIR=&quot;/var/cache/logwatch&quot;
+BASEDIR=&quot;/tmp/logwatch_portable&quot;
+CONFIGDIR=&quot;${BASEDIR}/etc&quot;
+TEMPDIR=&quot;${BASEDIR}/tmp&quot;
 PERLEXE=&quot;/usr/bin/perl&quot;
-MANDIR=&quot;/usr/share/man&quot;
+MANDIR=&quot;${BASEDIR}/man&quot;
 
 #Command line options section
 #Currently only prefix is supported but now that the door is open other options should follow. -mgt
@@ -237,7 +237,7 @@
 #The install would destory the perms on /tmp
 if [ ! -d $TEMPDIR ]; then
    #Should this be 0700 -d $TEMPDIR ??
-   install -m 0755 -d $TEMPDIR
+   install -m 0750 -d $TEMPDIR
 fi
 
 #This can create duplicates need to grep first -mgt
@@ -271,22 +271,22 @@
    install -m 0644 postfix-logwatch.1 $MANDIR/man1
    install -m 0644 amavis-logwatch.1 $MANDIR/man1
    #OpenBSD no -s
-   if [ $OS = &quot;OpenBSD&quot; ]; then
-      makewhatis -u $MANDIR/man5 $MANDIR/man8 $MANDIR/man1
-   else
-      #FreeBSD and NetBSD no -s no -u
-      if [ $OS = &quot;FreeBSD&quot; ] || [ $OS = &quot;NetBSD&quot; ]; then
-         makewhatis $MANDIR/man5 $MANDIR/man8 $MANDIR/man1
-      else
-         #MacOS X aka Darwin no -u [even thought the manpage says]
-         if [ $OS = &quot;Darwin&quot; ]; then
-            makewhatis -s &quot;1 5 8&quot; $MANDIR
-         else
-         #Linux
-            makewhatis -u -s &quot;1 5 8&quot; $MANDIR
-         fi
-      fi
-   fi
+# DONT:   if [ $OS = &quot;OpenBSD&quot; ]; then
+# DONT:      makewhatis -u $MANDIR/man5 $MANDIR/man8 $MANDIR/man1
+# DONT:   else
+# DONT:      #FreeBSD and NetBSD no -s no -u
+# DONT:      if [ $OS = &quot;FreeBSD&quot; ] || [ $OS = &quot;NetBSD&quot; ]; then
+# DONT:         makewhatis $MANDIR/man5 $MANDIR/man8 $MANDIR/man1
+# DONT:      else
+# DONT:         #MacOS X aka Darwin no -u [even thought the manpage says]
+# DONT:         if [ $OS = &quot;Darwin&quot; ]; then
+# DONT:            makewhatis -s &quot;1 5 8&quot; $MANDIR
+# DONT:         else
+# DONT:         #Linux
+# DONT:            makewhatis -u -s &quot;1 5 8&quot; $MANDIR
+# DONT:         fi
+# DONT:      fi
+# DONT:   fi
 else
    if [ $OS = &quot;SunOS&quot; ]; then
       #Go for the safe install rather then editing man.cf
@@ -317,21 +317,115 @@
 fi
 
 #Symlink
-ln -f -s $BASEDIR/scripts/logwatch.pl /usr/sbin/logwatch
-printf &quot;Created symlink for /usr/sbin/logwatch \n&quot;
+# FIX_STATIC_PATH: ln -f -s $BASEDIR/scripts/logwatch.pl /usr/sbin/logwatch
+# FIX_STATIC_PATH: printf &quot;Created symlink for /usr/sbin/logwatch \n&quot;
 
 #Cron
-if [ -d /etc/cron.daily ]; then
-   rm -f /etc/cron.daily/0logwatch
-   install -m 0755 logwatch.cron /etc/cron.daily/0logwatch
-   printf &quot;Created /etc/cron.daily/0logwatch \n&quot; 
-else
-   install -m 0744 logwatch.cron $CONFIGDIR/logwatch.cron
-   printf &quot;################ README ####################.\n&quot;
-   printf &quot;You need to setup your cron job for logwatch.\n&quot;
-   printf &quot;A sample script is included see $CONFIGDIR/logwatch.cron. \n&quot;
-   printf &quot;2 0 * * * $CONFIGDIR/logwatch.cron &gt;/dev/null 2&gt;&amp;1 \n&quot;
-fi
+# FIX_STATIC_PATH: if [ -d /etc/cron.daily ]; then
+# FIX_STATIC_PATH:    rm -f /etc/cron.daily/0logwatch
+# FIX_STATIC_PATH:    install -m 0755 logwatch.cron /etc/cron.daily/0logwatch
+# FIX_STATIC_PATH:    printf &quot;Created /etc/cron.daily/0logwatch \n&quot; 
+# FIX_STATIC_PATH: else
+# FIX_STATIC_PATH:    install -m 0744 logwatch.cron $CONFIGDIR/logwatch.cron
+# FIX_STATIC_PATH:    printf &quot;################ README ####################.\n&quot;
+# FIX_STATIC_PATH:    printf &quot;You need to setup your cron job for logwatch.\n&quot;
+# FIX_STATIC_PATH:    printf &quot;A sample script is included see $CONFIGDIR/logwatch.cron. \n&quot;
+# FIX_STATIC_PATH:    printf &quot;2 0 * * * $CONFIGDIR/logwatch.cron &gt;/dev/null 2&gt;&amp;1 \n&quot;
+# FIX_STATIC_PATH: fi
+
+# Create dir for log files and report:
+install -m 0700 -d $BASEDIR/logs
+install -m 0700 -d $BASEDIR/report
+# Just let the user recursively copy /var into $BASEDIR/logs
+# mkdir -p ${BASEDIR}/logs/var/{adm,cron,log,log/mysql,spool,spool/MailScanner/incoming,tmp,run,mail,lib/rpm,spool/up2date}
+
+# Fix other static paths:
+find /tmp/logwatch_portable/ -type f -print0 | xargs -0 -iX sed -i &quot;s|/usr/share/logwatch|/tmp/logwatch_portable|g&quot; 'X'
+find /tmp/logwatch_portable/ -type f -print0 | xargs -0 -iX sed -i &quot;s|/etc/logwatch|/tmp/logwatch_portable/etc|g&quot; 'X'
+find /tmp/logwatch_portable/ -type f -print0 | xargs -0 -iX sed -i &quot;s|/usr/local/etc|/tmp/logwatch_portable/etc|g&quot; 'X'
+find /tmp/logwatch_portable/ -type f -print0 | xargs -0 -iX sed -i &quot;s|/var/cache/logwatch|/tmp/logwatch_portable/tmp|g&quot; 'X'
+find /tmp/logwatch_portable/ -type f -not -name http -print0 | xargs -0 -iX sed -i &quot;s|/var|/tmp/logwatch_portable/logs/var|g&quot; 'X'
+
+# Patch scripts/services/http
+cat &gt; http.diff &lt;&lt; EOP
+--- http.orig 2012-03-28 00:00:01.000000000 +0000
++++ http      2012-03-28 00:00:02.000000000 +0000
+@@ -334,6 +334,64 @@
+    'shtml\.exe',
+    'win\.ini',
+    'xxxxxxxxxxxxxxxxxxxxxx',
++   '%20/tmp',
++   '%20/var',
++   '7z%20',
++   'apt-get%20',
++   'cat%20',
++   'cc%20',
++   'cd%20',
++   'crontab%20',
++   'curl%20',
++   'cvs%20',
++   'echo%20',
++   'elinks%20',
++   'emerge%20',
++   'ftp%20',
++   'GET%20',
++   'gcc%20',
++   'gzip%20',
++   'gunzip%20',
++   'HEAD%20',
++   'id%20',
++   'kill%20',
++   'killall%20',
++   'links%20',
++   'ls%20',
++   'lwp-download%20',
++   'lwp-request%20',
++   'lwp-mirror%20',
++   'lwp-rget%20',
++   'lynx%20',
++   'mail%20',
++   'mailx%20',
++   'mkdir%20',
++   'nc%20',
++   'ncftp%20',
++   'netcat%20',
++   'netstat%20',
++   'POST%20',
++   'perl%20',
++   'ps%20',
++   'python%20',
++   'rar%20',
++   'rexec%20',
++   'rm%20',
++   'rpm%20',
++   'ruby%20',
++   'scp%20',
++   'sh%20',
++   'smbclient%20',
++   'ssh%20',
++   'svn%20',
++   'tar%20',
++   'telnet%20',
++   'tftp%20',
++   'wget%20',
++   'uname%20',
++   'wget%20',
++   'whoami%20',
++   'yum%20',
+ );
+ 
+ #
+EOP
+
+cat http.diff | patch -F 3 /tmp/logwatch_portable/scripts/services/http
+
+cat &gt; /tmp/logwatch_portable/scripts/logwatch.sh &lt;&lt; EOP
+#!/bin/bash ---
+/tmp/logwatch_portable/scripts/logwatch.pl --detail High --logdir /tmp/logwatch_portable/logs --output file --format text --archives --filename /tmp/logwatch_portable/report/logwatch.log --range All --numeric --debug Med --hostformat split 2&gt;&amp;1 | tee /tmp/logwatch_portable/report/logwatch.tee
+exit 0 
+EOP
+
+echo &quot;Run /tmp/logwatch_portable/scripts/logwatch.sh now.&quot;
 
 exit
 # vi: shiftwidth=3 tabstop=3 et</pre>
</div>Note I chose /tmp here which will work as long as it has enough space to store the log files, temporary files and report. 'sed -i &quot;s|/tmp|/other path|g&quot; /path/to/patch' if necessary.<br />
<br />
Also note the default settings the logrotate package comes with are generally not sufficient for servers. It is impossible to give any rule of thumb for appropriate log retention settings because the amount of audit trail you need or want to keep should be based on which services you expose, the amount of logging that is generated on average, if disk space is an issue and if aggregated data in log file reporting alone offers enough details (prior to log deletion) for later analysis. Or in short: ask yourself what resources are at your disposal right now to analyze a possible security incident that happened three months ago.</div>

]]></content:encoded>
			<dc:creator>unSpawn</dc:creator>
			<guid isPermaLink="true">http://www.linuxquestions.org/questions/blog.php?b=34714</guid>
		</item>
		<item>
			<title>problem to install xmgrace on fedora 16</title>
			<link>http://www.linuxquestions.org/questions/blog.php?b=34713</link>
			<pubDate>Sat, 28 Apr 2012 06:41:59 GMT</pubDate>
			<description>hi everyone. 
currently i installed fedora 16 on core I3 desktop. after it i was interested to install xmgrace on it. i installed the following files...</description>
			<content:encoded><![CDATA[<div>hi everyone.<br />
currently i installed fedora 16 on core I3 desktop. after it i was interested to install xmgrace on it. i installed the following files<br />
<br />
fftw2-2.1.5-22.fc15.i686<br />
libpng10-1.0.56-1.fc16.i686<br />
libXp-1.0.0-16.fc15.i686<br />
fftw-3.3-3.fc16.i686<br />
pdflib-lite-7.0.5-1.fc16.i686<br />
grace-5.1.22-9.fc16.i686<br />
<br />
then the next step was to replace id.so.comf file having the text<br />
<br />
include ld.so.conf.d/*.conf<br />
/usr/kerberos/lib<br />
/usr/X11R6/lib<br />
/usr/lib/sane<br />
/usr/lib/qt-3.1/lib<br />
/usr/local/lib<br />
<br />
in it. i have replaced this file but still xmgrace is not working. pleas help me to solve the problem. thanks in anticipation</div>

]]></content:encoded>
			<dc:creator>sajjadpu</dc:creator>
			<guid isPermaLink="true">http://www.linuxquestions.org/questions/blog.php?b=34713</guid>
		</item>
		<item>
			<title>problem to install xmgrace on fedora 16</title>
			<link>http://www.linuxquestions.org/questions/blog.php?b=34712</link>
			<pubDate>Sat, 28 Apr 2012 06:31:07 GMT</pubDate>
			<description>hi everyone. 
currently i installed fedora 16 on core I3 desktop. after it i was interested to install xmgrace on it. i installed the following files...</description>
			<content:encoded><![CDATA[<div>hi everyone.<br />
currently i installed fedora 16 on core I3 desktop. after it i was interested to install xmgrace on it. i installed the following files <br />
<br />
fftw2-2.1.5-22.fc15.i686<br />
libpng10-1.0.56-1.fc16.i686<br />
libXp-1.0.0-16.fc15.i686<br />
fftw-3.3-3.fc16.i686<br />
pdflib-lite-7.0.5-1.fc16.i686<br />
grace-5.1.22-9.fc16.i686<br />
<br />
then the next step was to replace id.so.comf file having the text <br />
<br />
include ld.so.conf.d/*.conf<br />
/usr/kerberos/lib<br />
/usr/X11R6/lib<br />
/usr/lib/sane<br />
/usr/lib/qt-3.1/lib<br />
/usr/local/lib<br />
<br />
in it. i have replaced this file but still xmgrace is not working. pleas help me to solve the problem. thanks in anticipation</div>

]]></content:encoded>
			<dc:creator>sajjadpu</dc:creator>
			<guid isPermaLink="true">http://www.linuxquestions.org/questions/blog.php?b=34712</guid>
		</item>
		<item>
			<title>Ubuntu upgrade from 11.10 to 12.04</title>
			<link>http://www.linuxquestions.org/questions/blog.php?b=34710</link>
			<pubDate>Sat, 28 Apr 2012 00:44:33 GMT</pubDate>
			<description>Since I have about a billion 3rd party applications installed, the upgrade process can be somewhat interesting at times.  This time around I...</description>
			<content:encoded><![CDATA[<div>Since I have about a billion 3rd party applications installed, the upgrade process can be somewhat interesting at times.  This time around I uninstalled acroread first, since in previous upgrades, that package has caused the upgrade process to abort.<br />
Now that my internet is on Shaw instead of Telus, the download time was pretty short.  But then the upgrade seemed to be stuck for a long time at the same point, it was not until I expanded the terminal that I found there was an ncurses dialog box waiting for my input (if I didn't see that little arrow by &quot;Terminal&quot;, we could have been waiting for each other for a long time).  <br />
So once it was finally going again, the actual upgrading was going to take awhile, but I can't just leave it with Ubuntu, because it's always asking me about whether I want to keep or replace custom config files.  There's probably a way to automatically answer those if running via the command line, but there was no option that presented itself through the GUI.  I much prefer the way it works on Slackware, where you can let it update everything by itself, and slackpkg will prompt you about each of the new config files only once that is <i>all</i> done.<br />
<br />
Once the upgrade was all said and done, of course I had to investigate the new features.<br />
The first thing, that was terribly annoying, was the way my mouse had to fight to move between my two monitors.  This was easy enough to fix through the unity plugin settings of the CompizConfig, by turning &quot;Launcher Edge Stop Overcome Pressure&quot; down to 5 and &quot;Edge Stop Velocity&quot; to 10.  (I can see how a higher pressure might be useful if I had the launcher on both screens, but rather than a second launcher, I'm running gkrellm there.)<br />
The new privacy settings were nowhere to be found--apparently I had uninstalled the &quot;ubuntu-desktop&quot; meta package at some point in the past, so installing that pulled in the new stuff I was looking for.<br />
Had to open up the Advanced Settings to reset the Window decoration theme back to the way I had it.  <br />
I liked the new icon theme in the panel, but the icons on the launcher were not so hot.  In particular, the default Gnome icon theme was missing the workspace-switcher icon, so it was just an ugly folder sitting in my launcher for the switcher.  Installation of the &quot;gnome-icon-theme-extras&quot; package fixed that though.  (If Unity needs one of those icons, shouldn't that be in the &quot;full&quot; package instead of relegated to &quot;extras&quot;?)<br />
<br />
I kept getting crash reports about virtualbox installation (even though I wasn't trying to run it) until I went back to virtualbox.org, from whence I got the previous version, and downloaded the Precise Pangolin version.<br />
<br />
Mupen64plus was updated to the newer version, which does not have a gui.  In order to reconfigure my controller I grabbed the ~/.config/mupen64plus/blight_input.conf file from my backup and used it as a reference to adjust the settings in ~/.config/mupen64plus/mupen64plus.cfg<br />
<br />
So those have been my adventures so far on this upgrade :)</div>

]]></content:encoded>
			<dc:creator>Sonneteer</dc:creator>
			<guid isPermaLink="true">http://www.linuxquestions.org/questions/blog.php?b=34710</guid>
		</item>
		<item>
			<title><![CDATA[Enabling qt examples in openSUSE & new mc2 version uploaded.]]></title>
			<link>http://www.linuxquestions.org/questions/blog.php?b=34709</link>
			<pubDate>Fri, 27 Apr 2012 22:05:27 GMT</pubDate>
			<description>Enabling qt examples in openSUSE and new mc2 version uploaded. 
 
PART 1. 
 
The issue: The examples in openSUSE 11.4 expect their resources to be in...</description>
			<content:encoded><![CDATA[<div>Enabling qt examples in openSUSE and new mc2 version uploaded.<br />
<br />
PART 1.<br />
<br />
The issue: The examples in openSUSE 11.4 expect their resources to be in<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<pre class="bbcodeblock" dir="ltr" style="
		margin: 0px;
		margin-right: -99999px;
		padding: 3px;
		border: 1px inset;
		width: 98%;
		height: 34px;
		text-align: left;
		overflow: auto">/usr/lib/qt4/examples</pre>
</div>which did not exist on my system.<br />
<br />
I can no longer verify this as an 11.4 issue easily but it appears that in openSUSE we may need a symlink under /usr/lib/qt4 pointing to /usr/share/qt4/examples in order for the qt examples to run.<br />
<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<pre class="bbcodeblock" dir="ltr" style="
		margin: 0px;
		margin-right: -99999px;
		padding: 3px;
		border: 1px inset;
		width: 98%;
		height: 98px;
		text-align: left;
		overflow: auto">ls /usr/lib/qt4/examples      # if there's nothing there
ls /usr/share/qt4/examples    # AND if there is something there
# then...
cd /usr/lib/qt4
sudo ln -s /usr/share/qt4/examples .</pre>
</div>That folder or (preferably) a symlink to it MUST exist for the examples in the /usr/share/qt4/examples folder to run in openSUSE 11.4.<br />
<br />
If that is actually an omission in these distros, tell someone working on openSUSE 12.x about it and tell them The Computer Mad Science Team sent you. ;-)<br />
<br />
I think there was something funny in Kubuntu too, but I can't remember the details.<br />
<br />
<b>Corrections welcome.  As I said, I can no longer easily verify this situation with my modified system.</b><br />
<br />
-------------------------<br />
<br />
PART 2.<br />
<br />
The issue: interactively generating makefiles, including makefiles for qt4<br />
<br />
Since we're getting serious about using QT for a gui, it seems fitting to have some tools specialized for generating QT makefiles.<br />
<br />
We can either generate makefiles directly or we can generate qt *.pro files to generate the makefiles, which isn't much of a gain, so let's go straight for the Makefiles.  You can use qt creator, of course, but that locks you into their system, even for simple C apps.<br />
<br />
We now have a '-create qt4-files' switch that is implemented as a simple addin.  It would work with older mc2 installations.  Same goes for the <br />
'-run qt4-ui &lt;srcdir&gt;' switch.  <br />
<br />
Creating your own specialized functions is absolutely possible, as is combining functionality in your own script programs.<br />
<br />
qmake syntax is also forgiving about separators, but being its own dialect, has zero resemblance to what it produces (i.e., makefiles).  And for mc2, a qt4 makefile is just another makefile.  <br />
<br />
Nothing particularly special about it.<br />
<br />
<b>Here's what our two new plugins do.</b><br />
<br />
mc2 version 2.0.5<br />
<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<pre class="bbcodeblock" dir="ltr" style="
		margin: 0px;
		margin-right: -99999px;
		padding: 3px;
		border: 1px inset;
		width: 98%;
		height: 66px;
		text-align: left;
		overflow: auto">added qt4 mc2.def template to build qt4 apps from any file set.
added 'mc2 -create qt4-files' to generate a basic fileset for new *.ui file.
added 'mc2 -run qt4-ui' function to write ui: tag for moc, uic, and qrc files.</pre>
</div>For these plugins to work, no changes were required to the basic functionality of mc2.<br />
<br />
We also reordered copy and notice operations in the -fetch &lt;templatename&gt; switch so we don't do anything if the template doesn't exist and we added -i[nit] as an alias for -u[pdate] for purely conceptual reasons.<br />
<br />
<a href="http://rainbowsally.net/pub/lq/mc2-sandbox-2.0.5.tar.gz" target="_blank">http://rainbowsally.net/pub/lq/mc2-sandbox-2.0.5.tar.gz</a><br />
<br />
I'll leave the older version up for a bit until I can verify the installer itself.  If the newer one doesn't install right, get the older one and add the plugins for now.  <br />
<br />
Here's the previous version.<br />
<a href="http://rainbowsally.net/pub/lq/mc2-sandbox-2.0.4.tar.gz" target="_blank">http://rainbowsally.net/pub/lq/mc2-sandbox-2.0.4.tar.gz</a><br />
<br />
Notes.<br />
<br />
I noticed the bad paths when qmake-d examples didn't work and I converted some of them to mc2 makefiles.  After getting a couple of them to work, I discovered the pattern.  They all wanted the examples to be in the non-existent folder.<br />
<br />
The kde3 version of kdevelop was invaluable in this endeavor.  The grepper for finding text in files is outstanding.<br />
<br />
I'm not selling anything here.  Just offering a different perspective.  A simpler, approach can sometimes do what the big muscle-bound tools cannot.<br />
<br />
After installation type 'mc2 -fetch qt4' and take a look at the notes in the new mc2.def it writes.<br />
<br />
The Computer Mad Science Team.<br />
<br />
:-)</div>

]]></content:encoded>
			<dc:creator>rainbowsally</dc:creator>
			<guid isPermaLink="true">http://www.linuxquestions.org/questions/blog.php?b=34709</guid>
		</item>
		<item>
			<title>qt designer help without the enableRemoteControl switch</title>
			<link>http://www.linuxquestions.org/questions/blog.php?b=34707</link>
			<pubDate>Thu, 26 Apr 2012 21:02:48 GMT</pubDate>
			<description>In case you missed it (the blog entry), qt designer tries to go online whenever you click on the help button.  This can cause the help to hang for...</description>
			<content:encoded><![CDATA[<div>In case you missed it (the blog entry), qt designer tries to go online whenever you click on the help button.  This can cause the help to hang for quite a long time if your user doesn't have internet access or you might just dislike the decisions made by the developers and prefer to stay in your own neighborhood.<br />
<br />
If you didn't &quot;miss it&quot; but you had trouble with a hex editing the commandline for the assistant client, here's the one that I created.  It should work on openSUSE 11.4, and probably other recent-ish QT4 systems, but keep a backup in case it doesn't work for you.<br />
<br />
The d/load is about 180K.  The basic executable is the stock version that came with the opensuse 11.4 DVD (no updates) with one change in the string &quot;-enableRemoteControl&quot; which has been changed to &quot;-quiet&quot; using ghex2 to edit the binary.<br />
<br />
The change is at file offset: 0x52214, and the string is terminated with a '00' hex byte but the rest of the original string is still visible in the dump as <br />
&quot;RemoteControl&quot;.<br />
<br />
The &quot;RemoteControl&quot; part is ignored though, because the string is now equivalent <br />
to const char*<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<pre class="bbcodeblock" dir="ltr" style="
		margin: 0px;
		margin-right: -99999px;
		padding: 3px;
		border: 1px inset;
		width: 98%;
		height: 66px;
		text-align: left;
		overflow: auto">&quot;-quiet\0RemoteControl&quot;
// instead of
&quot;-enableRemoteControl&quot;</pre>
</div>It could also be filled with null chars replacing &quot;RemoteControl&quot;, which you can do if you prefer.<br />
<br />
I was able to recompile 'designer' from sources and that's what I am using but this one might as well be put to use in case anyone wants it or if you had trouble and want to see what went wrong in your own hex editing attempt.<br />
<br />
<a href="http://rainbowsally.net/pub/lq/rs-designer-no-remote-ctrl.tar.gz" target="_blank">http://rainbowsally.net/pub/lq/rs-de...te-ctrl.tar.gz</a><br />
<br />
:-)<br />
<br />
Addenda:<br />
<br />
<b>How to diff binary files</b><br />
<br />
We need a byte-by-byte binary comparison tool no? <br />
<br />
Yes. <br />
<br />
And we can used 'hexdump -C' to generate two text files we can then diff or kompare the text files.<br />
<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<pre class="bbcodeblock" dir="ltr" style="
		margin: 0px;
		margin-right: -99999px;
		padding: 3px;
		border: 1px inset;
		width: 98%;
		height: 98px;
		text-align: left;
		overflow: auto">$&gt; diff a.txt b.txt
20955c20955
&lt; 00052210  65 6e 74 00 2d 65 6e 61  62 6c 65 52 65 6d 6f 74  |ent.-enableRemot|
---
&gt; 00052210  65 6e 74 00 2d 71 75 69  65 74 00 52 65 6d 6f 74  |ent.-quiet.Remot|</pre>
</div><br />
<b>You might want to skip the rest of this blog entry if you're not in the mood for another of my rants.  Fair warning. ;-)</b><br />
<br />
The reason I'm belaboring this issue is because I have nothing to hide.  I'm not so sure about the developers of these black boxes, however.  <br />
<br />
In fact I wonder how many 'security breaches' and hacking problems are inside jobs, either perpetrated by site administators or by &quot;Remote Control&quot; by way of back doors we cannot see in these opaque binary package based linux systems such as openSUSE <br />
<br />
&quot;That can't happen in 'open source'&quot; you say?  <br />
<br />
Uh...  More coffee, anyone?  ;-)<br />
<br />
While TrollTech may have had integrity, they were bought out by Nokia.  What I'm saying is that 'good businesses' have no control over those they sell out to.<br />
<br />
The trends in the alleged &quot;free market&quot; these days is that only cheaters prosper.  There is zero or less than zero incentive to be honest or ethical in today's business environment.<br />
<br />
Just look at Bank of America's foreclosure scam.  Forged documents!  <br />
<br />
No penalty???  <br />
<br />
Worse. No justice for those ripped off.<br />
<br />
Verizon and AT&amp;T both raise prices at the same time which appears to be blatant &quot;price fixing&quot; and would contradict the assumptions of competition in a capitalistic system if that coincidence can't be justified by increased expense at some common source.<br />
<br />
How many encyclopedias could we fill with similar examples of both criminal and just plain unethical behavior paying off for the guys that are already &quot;Too Big To [J]ail&quot;?<br />
<br />
It's not bad enough that they are merely anti-democracy (&quot;FISA&quot; and the Constitution be damned) so maybe if we point out that they are even anti-capitalism?  ;-)  THEN would we recognize that this is not the &quot;American Way&quot;?<br />
<br />
I don't know about Nokia, but I do know that this accumulation of large companies under even larger companies, accelerated by the &quot;financial institutions&quot; reaping risky gains &quot;speculating&quot; in the market...  <br />
<br />
...with &quot;our&quot; money...before they lose it in a bad gamble and again afterward (the Mexican Bailout for Wallstreet in 1995 was bad enough)...<br />
<br />
Well, something pretty obviously went wrong and has stayed wrong, and it might just be this rampant 'spirit' -- this patriotism to one's money (economic warfare, which is a brand of &quot;survival of the fittest&quot; that would commit infanticide if this mental aberration carried over into the physical world) because it seems like nothing else is held in very high regard anymore.<br />
<br />
So that's why I belabored the subject.  You have a right to know where that &quot;RemoteControl&quot; string in your binary file came from.<br />
<br />
It wasn't me.<br />
<br />
:-)<br />
<br />
Neither did I put the NSA_KEY in Windows' kernel32.dll or lose 2.3 trillion dollars of &quot;taxpayers hard earned money&quot; on sept 10, 2001.  <br />
<br />
I just notice this stuff while digging around looking for causes of problems.<br />
<br />
Call me paranoid.  Or call me eternally vigilant.  What's the diff?<br />
<br />
--The Computer Mad Science Team<br />
<br />
;-)</div>

]]></content:encoded>
			<dc:creator>rainbowsally</dc:creator>
			<guid isPermaLink="true">http://www.linuxquestions.org/questions/blog.php?b=34707</guid>
		</item>
		<item>
			<title><![CDATA[stupid self-fullfilling assumptions about "normal users"]]></title>
			<link>http://www.linuxquestions.org/questions/blog.php?b=34706</link>
			<pubDate>Thu, 26 Apr 2012 17:30:38 GMT</pubDate>
			<description><![CDATA[To whom it may concern. 
re. QT GuitarTuner bug fix. 
 
The 'ptr' that was causing the problem was apparently the main app, not the GuitarTuner.  You...]]></description>
			<content:encoded><![CDATA[<div>To whom it may concern.<br />
re. QT GuitarTuner bug fix.<br />
<br />
The 'ptr' that was causing the problem was apparently the main app, not the GuitarTuner.  You can stop reading here, if this makes sense to you.<br />
<br />
But if you want to check out the guitar tuner here's a bit more info and a link to the build sources at the bottom.<br />
<br />
Check for missing deps.<br />
<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<pre class="bbcodeblock" dir="ltr" style="
		margin: 0px;
		margin-right: -99999px;
		padding: 3px;
		border: 1px inset;
		width: 98%;
		height: 82px;
		text-align: left;
		overflow: auto">int main(int argc, char** argv)
{
  return 0;
}</pre>
</div>Create a generic c++ tempate<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<pre class="bbcodeblock" dir="ltr" style="
		margin: 0px;
		margin-right: -99999px;
		padding: 3px;
		border: 1px inset;
		width: 98%;
		height: 34px;
		text-align: left;
		overflow: auto">mc2 -t c++ dummy</pre>
</div>edit the mc2.def file<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<pre class="bbcodeblock" dir="ltr" style="
		margin: 0px;
		margin-right: -99999px;
		padding: 3px;
		border: 1px inset;
		width: 98%;
		height: 498px;
		text-align: left;
		overflow: auto">OUTNAME = dummy
SRCDIR = .
&lt;...&gt;
LDFLAGS =  $(LIBSLIST) $(LIBSLIST_FULLPATH)

# list of development libs (*.so)
LIBSLIST = \
  -lQtGui \
  -lQtCore \
  -lQtDeclarative \
  -lQtScript \
  -lQtSvg \
  -lQtSql \
  -lQtXmlPatterns \
  -lQtNetwork \
  -lpthread \
  -lQtMultimedia \
  -lstdc++ \
  -lm \
  -lgcc_s \
  -lc \
  -lglib-2.0 \
  -lpng14 \
  -lz \
  -lfreetype \
  -lgobject-2.0 \
  -lSM \
  -lICE \
  -lXi \
  -lXrender \
  -lXrandr \
  -lXfixes \
  -lXcursor \
  -lXinerama \
  -lfontconfig \
  -lXext \
  -lX11 \
  -ldl \
  -lgthread-2.0 \
  -lrt \
  -lasound \
  -lpcre \
  -luuid \
  -lxcb \
  -lXau \
  ###############

# list of non-development libs or where more than one lib
# may exist (*.so.ver) requiring the full path
LIBSLIST_FULLPATH = \
  /lib/libexpat.so.1 \
  ###############</pre>
</div><div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<pre class="bbcodeblock" dir="ltr" style="
		margin: 0px;
		margin-right: -99999px;
		padding: 3px;
		border: 1px inset;
		width: 98%;
		height: 66px;
		text-align: left;
		overflow: auto">mc2 -init   # or mc2 -update if the -init switch isn't implemented 
            # in your version mc2, it does the same thing
make</pre>
</div>If all of the dependencies are resolved, or can be by using the non-development versions, this guitar tuner should compile.<br />
<br />
<br />
The problem:<br />
<br />
Sometimes it segfaulted when you closed it.  Not all the time.  This suggests a race condition between threads.<br />
<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<pre class="bbcodeblock" dir="ltr" style="
		margin: 0px;
		margin-right: -99999px;
		padding: 3px;
		border: 1px inset;
		width: 98%;
		height: 146px;
		text-align: left;
		overflow: auto">void QMetaObject::removeGuard(QObject **ptr)
{
  if (!*ptr) // when the object at ptr is null it exits cleanly 
    return;  // but sometimes it has an object pointer and then 
             // it segfaults.  This occurs when it tries to cleanup 
             // the main app.
  ....
}</pre>
</div>By making the main app a pointer and making the pointer static in main() the race condition that causes this crash can apparently be eliminated (because if the stack has collapsed the pointer will still be good).<br />
<br />
So then here's 'main()' for guitartuner.<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<pre class="bbcodeblock" dir="ltr" style="
		margin: 0px;
		margin-right: -99999px;
		padding: 3px;
		border: 1px inset;
		width: 98%;
		height: 418px;
		text-align: left;
		overflow: auto">
#include &lt;QtGui/QApplication&gt;
#include &quot;guitartuner.h&quot;

void dbg(){}

int main(int argc, char *argv[])
{
  static QApplication* a = new QApplication(argc, argv);
  GuitarTuner w;
  w.setOrientation(GuitarTuner::LockPortrait);
  
  #ifdef Q_OS_SYMBIAN
  w.showFullScreen();
  #elif defined(Q_WS_MAEMO_5) || defined(Q_WS_MAEMO_6)
  w.showMaximized();
  #else
  w.show();
  #endif
  
  int err = a-&gt;exec();
  printf(&quot;Looking for segfault -rs\n&quot;);
  dbg();
  return err;
}</pre>
</div><a href="http://rainbowsally.net/pub/lq/rs-guitartuner.tar.gz" target="_blank">http://rainbowsally.net/pub/lq/rs-guitartuner.tar.gz</a><br />
<br />
It's about half a meg and doesn't appear to actually require the mobile libs.  I also changed some &quot;qrc:&quot; paths, but if the rest of the original worked for you before, don't use my modifications, just check out the main() changes.<br />
<br />
<b>I leave you with this question.  How long ago would that application have been debugged if QT, KDE, Kubuntu, openSUSE and others not made it so hard for us to compile stuff for our systems.</b><br />
<br />
The code is fantastic.  But the trend towards a Windows-like &quot;hands off&quot; philosopy with the accompanying dependency on sometimes ill-conceived automatic tools, stupid self-fulfilling assumptions about &quot;normal users&quot; and the difficulty of getting into these apps to play with them is what's deplorable in alleged 'open source'.  <br />
<br />
T/F? _______<br />
<br />
--The Computer Mad Science Team<br />
<br />
PS. If you aren't interested in my rant but would like to play with the GuitarTuner, it works!  :-)</div>

]]></content:encoded>
			<dc:creator>rainbowsally</dc:creator>
			<guid isPermaLink="true">http://www.linuxquestions.org/questions/blog.php?b=34706</guid>
		</item>
		<item>
			<title>Red Hat Enterprise Linux Server release 5.4 (Tikanga)</title>
			<link>http://www.linuxquestions.org/questions/blog.php?b=34705</link>
			<pubDate>Thu, 26 Apr 2012 14:04:06 GMT</pubDate>
			<description>Guys i have a server thats running Red Hat Enterprise Linux Server release 5.4 (Tikanga) and would like to send mail from the server. Im trying to...</description>
			<content:encoded><![CDATA[<div>Guys i have a server thats running Red Hat Enterprise Linux Server release 5.4 (Tikanga) and would like to send mail from the server. Im trying to use mutt  and it says message sent. However the message dont get to destination.This is the command that i run<br />
 mutt -s &quot;Test mail&quot;  <a href="mailto:xyz@email.com">xyz@email.com</a> &lt; /tmp/mailmessage.txt. Are the any configurations that i have to consider.</div>

]]></content:encoded>
			<dc:creator>lyschange</dc:creator>
			<guid isPermaLink="true">http://www.linuxquestions.org/questions/blog.php?b=34705</guid>
		</item>
		<item>
			<title>tagsistant 0.4 build system fixes</title>
			<link>http://www.linuxquestions.org/questions/blog.php?b=34704</link>
			<pubDate>Thu, 26 Apr 2012 00:00:26 GMT</pubDate>
			<description>I wanted to mention, for the benefit the community, that I created a patched version of the Tagsistant (http://www.tagsistant.net/) 0.4 source, which...</description>
			<content:encoded><![CDATA[<div>I wanted to mention, for the benefit the community, that I created a patched version of the <a href="http://www.tagsistant.net/" target="_blank">Tagsistant</a> 0.4 source, which fixes a number of problems with the build system. It is available from my FTP server:<br />
<br />
<a href="ftp://frigidcode.com/patched/tagsistant/source/tagsistant-0.4.0-patched.tar.gz" target="_blank">tagsistant-0.4.0-patched.tar.gz</a><br />
<br />
Basically, I wanted to compile tagsistant on my Gentoo system, but the build system was a mess (hardcoded paths, configure script not producing the correct files, and such like). I stripped the build system down to the essential files, fixed a bunch of issues, and then regenerated everything, and my dist seems to compile and install fine. I sent the changes off to the developer, but I haven't heard back yet about it. (Probably just busy.) So, my patched version is available to anyone who might be benefited by it.</div>

]]></content:encoded>
			<dc:creator>hydraMax</dc:creator>
			<guid isPermaLink="true">http://www.linuxquestions.org/questions/blog.php?b=34704</guid>
		</item>
		<item>
			<title><![CDATA[Low Level Tools & Keeping QT Designer/Assistant from going online w/ remoteControl]]></title>
			<link>http://www.linuxquestions.org/questions/blog.php?b=34703</link>
			<pubDate>Wed, 25 Apr 2012 07:53:51 GMT</pubDate>
			<description><![CDATA[Low Level Tools & Keeping QT Designer/Assistant from going online w/ remoteControl 
 
[The fix for designer's help menu trying to get online behind...]]></description>
			<content:encoded><![CDATA[<div>Low Level Tools &amp; Keeping QT Designer/Assistant from going online w/ remoteControl<br />
<br />
[The fix for designer's help menu trying to get online behind your back is at the bottom.]<br />
<br />
Before we dig back into low level code, let's talk about low level tools in general for a sec.<br />
<br />
And what I mean by &quot;low level&quot; in this context is where things are not done so automatically for us.  Where you actually can get your hands a little dirty -- &quot;hands on&quot;, so to speak.<br />
<br />
Let's say you created a connection in qt designer by accident and you want to remove it.<br />
<br />
Good luck.<br />
<br />
If you have figured out a way to do that, good for you.  If not, use a text editor.  And the text editor is your &quot;low level tool&quot; in this case.<br />
<br />
Presets and menus can be very convenient, but if you get too hung up on them you end up boxed in rather than freed up.<br />
<br />
Now what happens if your widget has a number in it, at the end, for example. <br />
<br />
This happened to me recently.<br />
<br />
QT will not find the slots for it.  Woopsie!<br />
<br />
Choose your weapon.  That name needs to be changed in 4 files that qt's high level tools cannot change.  Find and replace is the low level tool for this job.<br />
<br />
What if your slots get confused, and two signals get sent to the same slot.<br />
<br />
That has also happened to me recently.<br />
<br />
Again, good luck.  <br />
<br />
Low level is just about the only way to go.  These things can be fixed with shell scripts, C code, or a text editor, but they don't appear to be correctable with qt's high level tools.  <br />
<br />
[Creator might be a bit better, I'm not sure.  I have uninstalled it because it is just too darned clutted with junk.  You can barely see the widget you're working on and you have almost no control over the build.]<br />
<br />
<b>THE DESIGNER HELP FIX (for removing long timeouts and disabling RemoteControl)</b><br />
<br />
One last point.  What if you don't have an internet connection and you don't want designer's assistant to time out for almost a whole minute trying to get online.  <br />
<br />
Or if you just don't like the idea of -enableRemoteControl in any app that has internet access.<br />
<br />
Backup your original 'designer' so you can afford to screw up a few times. ;-)<br />
<br />
As root use ghex2 (or any similar hex editor) and find '-enableRemoteControl' in the 'designer' binary and change that to '-quiet' and terminate that string with a '00' hex byte.<br />
<br />
You may have to test it as a normal user because the paths might not be set for your root user.  <br />
<br />
And if you like the change, keep it.<br />
<br />
Here's the more orthodox way to do the same thing if you happen to have the QT4 sources.<br />
<br />
Edit <br />
&lt;top build dir&gt;/tools/designer/src/designer/assistantclient.cpp<br />
in the function:<br />
bool AssistantClient::ensureRunning(QString *errorMessage)<br />
<br />
Around line 144 change<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<pre class="bbcodeblock" dir="ltr" style="
		margin: 0px;
		margin-right: -99999px;
		padding: 3px;
		border: 1px inset;
		width: 98%;
		height: 82px;
		text-align: left;
		overflow: auto">  // run
  // disable remote control -rs
  // QStringList args(QLatin1String(&quot;-enableRemoteControl&quot;));
  QStringList args(QLatin1String(&quot;-quiet&quot;));</pre>
</div>The stringlist needs at least one argument.  '-quiet' is innocuous enough.<br />
<br />
And try to rebuild just the designer without doing the entire 4 hour recompile, if you can.<br />
<br />
But if you can't, you might need some low level tools.<br />
<br />
-- The Computer Mad Science Team<br />
<br />
:-)</div>

]]></content:encoded>
			<dc:creator>rainbowsally</dc:creator>
			<guid isPermaLink="true">http://www.linuxquestions.org/questions/blog.php?b=34703</guid>
		</item>
		<item>
			<title>Radar maps gone retro.</title>
			<link>http://www.linuxquestions.org/questions/blog.php?b=34702</link>
			<pubDate>Tue, 24 Apr 2012 21:26:33 GMT</pubDate>
			<description>Once in a while I sort of come up with a neat idea. At least it is to me. Just because you have an old system, does not mean you can not teach it new...</description>
			<content:encoded><![CDATA[<div>Once in a while I sort of come up with a neat idea. At least it is to me. Just because you have an old system, does not mean you can not teach it new tricks. Done a lot of page scraping to get weather details, but it would be nice to use radar screens from the command line. So details in this case are not so necessary. The overall view of the weather to see what kinds of weather fronts are approching is.<br />
<br />
Here we go. We need to collect some historical data (i.e. radar screens). You can get these from the radar.weather.gov using the 3 letter designation for the area you are interested in. For example, I beleive the Dallas Fort Worth area is supposed to be FWS. You do not have to collect data just for your area. Collect data for several areas and get an overview of the weather all around.<br />
<br />
You need to collect data. Cron is the perfect tool for the job.  We need to create a batch file that will collect the pictures using cron.  You will need to find the three letter designation of your area. You can get that from the national weather service. Note we put d.sh in the bin directory because it is in the executable directory path.<br />
<br />
d.sh:<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<pre class="bbcodeblock" dir="ltr" style="
		margin: 0px;
		margin-right: -99999px;
		padding: 3px;
		border: 1px inset;
		width: 98%;
		height: 82px;
		text-align: left;
		overflow: auto">DAY=$(date +&quot;%m%d%y%H%M%S&quot;)
# picfn=&quot;pic$DAY.png&quot;
# echo $picfn
wget http://radar.weather.gov/ridge/Thumbs/FWS.png -O fws$DAY.png</pre>
</div>  */1 * * * * /home/eddie/bin/d.sh<br />
<br />
We will set it to grab a picture once a minute. AT most once a hour is fine unless you know you have inclement weather coming. Set the collection at 1 per minute for our example. That will fill up a hard drive quickly so be careful.<br />
<br />
$ chmod +x d.sh<br />
<br />
$ crontab -e to add d.sh to your cronfile. <br />
<br />
You should be collecting radar images once you have that set up. We are beginning to collect a few pictures. Now we need to convert the picture(s) to a text file.<br />
<br />
Convert.sh:<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<pre class="bbcodeblock" dir="ltr" style="
		margin: 0px;
		margin-right: -99999px;
		padding: 3px;
		border: 1px inset;
		width: 98%;
		height: 98px;
		text-align: left;
		overflow: auto">for g  in fws*.png
do
echo $g
img2txt -W 80 -f utf8 img2txt -W  80 -H 25 utf8 $g &gt; $g.txt
done</pre>
</div>Note: We used img2txt -W 80 -f utf8 img2txt -W  160 -H 60 utf8 $g &gt; $g.txt<br />
<br />
$ chmod +x convert.sh<br />
<br />
$ ./convert.sh<br />
<br />
You see the file names to be converted on the screen as they are processed.  Then you should be able to to list the generated text.files.<br />
<br />
$ ls fws*.txt<br />
<br />
We could examine each txt file to see what the weather was at the moment, but that is time consuming. Better to have sort of a page flipping to see how the weather was over time. So far so good. Now we need to create a batch file to show the animation. This is also a good start to a text based slide show.<br />
<br />
show.sh:<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<pre class="bbcodeblock" dir="ltr" style="
		margin: 0px;
		margin-right: -99999px;
		padding: 3px;
		border: 1px inset;
		width: 98%;
		height: 98px;
		text-align: left;
		overflow: auto">for g  in fws*.txt
do
tput cup 0 0
 cat $g
done</pre>
</div>$ chmod +x show.sh<br />
<br />
$ ./show.sh<br />
<br />
Watch the show. If there is not much weather change or you have only collected a few frames, you not see the whiz boom you might want to. Definitely try it when a storm is coming your way (if it is safe to do so!!)<br />
<br />
<img src="http://www.instructables.com/files/deriv/FJ1/9A6Y/H19RT8NP/FJ19A6YH19RT8NP.MEDIUM.jpg" border="0" alt="" /></div>

]]></content:encoded>
			<dc:creator>peonuser</dc:creator>
			<guid isPermaLink="true">http://www.linuxquestions.org/questions/blog.php?b=34702</guid>
		</item>
		<item>
			<title>Removing files with find, and LVM snapshots</title>
			<link>http://www.linuxquestions.org/questions/blog.php?b=34701</link>
			<pubDate>Tue, 24 Apr 2012 16:21:47 GMT</pubDate>
			<description>*Take an LVM snapshot using a loopback device* 
*Create the snapshot* 
Take a look at the devices in your volume group.  First there needs to be...</description>
			<content:encoded><![CDATA[<div><font size="3"><b>Take an LVM snapshot using a loopback device</b></font><br />
<font size="2"><b>Create the snapshot</b></font><br />
Take a look at the devices in your volume group.  First there needs to be sufficient space in the volume group for a snapshot to occur.  Check this by typing: vgdisplay and checking for Free PE / Size <br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<pre class="bbcodeblock" dir="ltr" style="
		margin: 0px;
		margin-right: -99999px;
		padding: 3px;
		border: 1px inset;
		width: 98%;
		height: 34px;
		text-align: left;
		overflow: auto">vgdisplay -v</pre>
</div>Create a loopback device to use for the snapshot.  My volume group is named vg_echo360.  I want my snapshot to be 9.9GB in size so I'm creating a loopback device which is 10GB in size.<br />
<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<pre class="bbcodeblock" dir="ltr" style="
		margin: 0px;
		margin-right: -99999px;
		padding: 3px;
		border: 1px inset;
		width: 98%;
		height: 66px;
		text-align: left;
		overflow: auto">dd if=/dev/zero of=/app/loop bs=1 count=1 seek=10737418240
losetup -f /app/loop
losetup -a</pre>
</div>Now that you see which loopback device your <i>/app/loop</i> file is using you can add it to the volume group.  For me it's <i>/dev/loop0</i>.<br />
<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<pre class="bbcodeblock" dir="ltr" style="
		margin: 0px;
		margin-right: -99999px;
		padding: 3px;
		border: 1px inset;
		width: 98%;
		height: 50px;
		text-align: left;
		overflow: auto">pvcreate /dev/loop0
vgextend vg_echo360 /dev/loop0</pre>
</div>Create the snapshot.<br />
<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<pre class="bbcodeblock" dir="ltr" style="
		margin: 0px;
		margin-right: -99999px;
		padding: 3px;
		border: 1px inset;
		width: 98%;
		height: 50px;
		text-align: left;
		overflow: auto">lvcreate -s -n echo_snapshot1 /dev/vg_echo360/lv_echo360 -L 9.9G
lvs</pre>
</div><font size="2"><b>Recover files from an existing snapshot</b></font><br />
It's relatively easy to recover files from an existing snapshot.  Basically just...<br />
<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<pre class="bbcodeblock" dir="ltr" style="
		margin: 0px;
		margin-right: -99999px;
		padding: 3px;
		border: 1px inset;
		width: 98%;
		height: 50px;
		text-align: left;
		overflow: auto">mkdir /mnt/snapshot_recovery
mount /dev/vg_echo360/echo_snapshot1 /mnt/snapshot_recovery</pre>
</div>Now the path <i>/mnt/snapshot_recovery</i> contains the filesystem at a state from when the snapshot was taken.<br />
<br />
<font size="2"><b>Remove the snapshot when no longer needed</b></font><br />
Be aware that LVM will throw out the snap space if it overflows. Keep an eye on it while changing things with the &quot;lvs&quot; command.<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<pre class="bbcodeblock" dir="ltr" style="
		margin: 0px;
		margin-right: -99999px;
		padding: 3px;
		border: 1px inset;
		width: 98%;
		height: 34px;
		text-align: left;
		overflow: auto">lvremove /dev/vg_echo360/echo_snapshot1</pre>
</div>Do not allow the LVG to allocate data to /dev/loop0 any longer.  This sets the PV Status to NOT allocatable.<br />
<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<pre class="bbcodeblock" dir="ltr" style="
		margin: 0px;
		margin-right: -99999px;
		padding: 3px;
		border: 1px inset;
		width: 98%;
		height: 34px;
		text-align: left;
		overflow: auto">pvchange -xn /dev/loop0</pre>
</div>Check out the status of <i>/dev/loop0</i> compared to the other devices.<br />
<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<pre class="bbcodeblock" dir="ltr" style="
		margin: 0px;
		margin-right: -99999px;
		padding: 3px;
		border: 1px inset;
		width: 98%;
		height: 34px;
		text-align: left;
		overflow: auto">vgdisplay -v</pre>
</div>Remove the loopback device from the LVG entirely.<br />
<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<pre class="bbcodeblock" dir="ltr" style="
		margin: 0px;
		margin-right: -99999px;
		padding: 3px;
		border: 1px inset;
		width: 98%;
		height: 34px;
		text-align: left;
		overflow: auto">vgreduce vg_echo360 /dev/loop0</pre>
</div>See that the device is missing in the following command?<br />
<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<pre class="bbcodeblock" dir="ltr" style="
		margin: 0px;
		margin-right: -99999px;
		padding: 3px;
		border: 1px inset;
		width: 98%;
		height: 34px;
		text-align: left;
		overflow: auto">vgdisplay -v</pre>
</div>Now that the device is removed from the LVG you can remove the loopback device from the system entirely.<br />
<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<pre class="bbcodeblock" dir="ltr" style="
		margin: 0px;
		margin-right: -99999px;
		padding: 3px;
		border: 1px inset;
		width: 98%;
		height: 34px;
		text-align: left;
		overflow: auto">losetup -a</pre>
</div><i>/dev/loop0</i> is the device I want to remove which is using <i>/app/loop</i>.<br />
<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<pre class="bbcodeblock" dir="ltr" style="
		margin: 0px;
		margin-right: -99999px;
		padding: 3px;
		border: 1px inset;
		width: 98%;
		height: 50px;
		text-align: left;
		overflow: auto">losetup -d /dev/loop0
rm /app/loop</pre>
</div>FINAL NOTE ON LVM SNAPSHOTS: If you accidentally removed the loopback device before removing it from the LVM that's okay.  Just be sure to run the following command on the LVG.<br />
<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<pre class="bbcodeblock" dir="ltr" style="
		margin: 0px;
		margin-right: -99999px;
		padding: 3px;
		border: 1px inset;
		width: 98%;
		height: 34px;
		text-align: left;
		overflow: auto">vgreduce --removemissing vg_echo360</pre>
</div><font size="3"><b>Using find to remove files</b></font><br />
Today at work I had to find all raw files a media server archived which were older than 120 days and delete them. They are regular files and have the following two possible extensions: .aac and .h264. So I built a single find command. I first created an LVM snapshot in case I needed to revert changes.<br />
<br />
Before running the remove command put the found file names in a temporary file.<br />
<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<pre class="bbcodeblock" dir="ltr" style="
		margin: 0px;
		margin-right: -99999px;
		padding: 3px;
		border: 1px inset;
		width: 98%;
		height: 34px;
		text-align: left;
		overflow: auto">find . -mtime +120 -type f -name '*.h264' -o -mtime +120 -type f -name '*.aac' | tr '\n' ' ' &gt; /tmp/rawfiles</pre>
</div>You can see how much space you will save by doing that.<br />
<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<pre class="bbcodeblock" dir="ltr" style="
		margin: 0px;
		margin-right: -99999px;
		padding: 3px;
		border: 1px inset;
		width: 98%;
		height: 34px;
		text-align: left;
		overflow: auto">du -shc $(cat /tmp/rawfiles)</pre>
</div>Now delete all of the files.<br />
<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<pre class="bbcodeblock" dir="ltr" style="
		margin: 0px;
		margin-right: -99999px;
		padding: 3px;
		border: 1px inset;
		width: 98%;
		height: 34px;
		text-align: left;
		overflow: auto">find . -mtime +120 -type f -name '*.h264' -exec rm {} \; -o -mtime +120 -type f -name '*.aac' -exec rm {} \;</pre>
</div>Now that all the files are deleted make sure that there aren't any left over.<br />
<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<pre class="bbcodeblock" dir="ltr" style="
		margin: 0px;
		margin-right: -99999px;
		padding: 3px;
		border: 1px inset;
		width: 98%;
		height: 34px;
		text-align: left;
		overflow: auto">du -shc $(cat /tmp/rawfiles) 2&gt; /dev/null</pre>
</div>The disk usage should say <font face="Courier New">0 total</font> used space.<br />
<br />
See man find.<br />
OPERATORS section for -o option.<br />
See TESTS subsection in the EXPRESSIONS section of the find man page for the rest of the options.<br />
<br />
Another thing to note, when using the -o option is that you have to treat each expression on either side like a completely new find command. It essentially allows you to put two find commands on a single line.</div>

]]></content:encoded>
			<dc:creator>sag47</dc:creator>
			<guid isPermaLink="true">http://www.linuxquestions.org/questions/blog.php?b=34701</guid>
		</item>
		<item>
			<title>QT Computer Mad Science: Look Ma, No Code! (designer/creator experiment)</title>
			<link>http://www.linuxquestions.org/questions/blog.php?b=34700</link>
			<pubDate>Tue, 24 Apr 2012 13:22:50 GMT</pubDate>
			<description><![CDATA[I could have sworn that early versions of QT4 couldn't do this.  It still can't do some things the old QT3 could do "progress" is like that, but it...]]></description>
			<content:encoded><![CDATA[<div>I could have sworn that early versions of QT4 couldn't do this.  It still can't do some things the old QT3 could do &quot;progress&quot; is like that, but it looks like this one might work if you have a somewhat recent version of QT4 (and designer or creator and kde).<br />
<br />
Here's a bit of Computer Mad Science that you might find interesting.  Or at least amusing.<br />
<br />
Features:<ul><li>It may run in preview mode without even compiling it.</li>
<li>It may ONLY run in preview mode if you don't have kdelibs development files.</li>
</ul>Here's the ui file with all the &lt;hints&gt;&lt;...blah blah...&gt;&lt;/hints&gt; stripped out in order to reduce the size a nub.<br />
<br />
file: src/digital_delay.ui<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<pre class="bbcodeblock" dir="ltr" style="
		margin: 0px;
		margin-right: -99999px;
		padding: 3px;
		border: 1px inset;
		width: 98%;
		height: 498px;
		text-align: left;
		overflow: auto">&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;ui version=&quot;4.0&quot;&gt;
 &lt;class&gt;digital_delay&lt;/class&gt;
 &lt;widget class=&quot;QWidget&quot; name=&quot;digital_delay&quot;&gt;
  &lt;property name=&quot;geometry&quot;&gt;
   &lt;rect&gt;
    &lt;x&gt;0&lt;/x&gt;
    &lt;y&gt;0&lt;/y&gt;
    &lt;width&gt;362&lt;/width&gt;
    &lt;height&gt;166&lt;/height&gt;
   &lt;/rect&gt;
  &lt;/property&gt;
  &lt;property name=&quot;windowTitle&quot;&gt;
   &lt;string&gt;MAd sCIeNcE - Digital Delay&lt;/string&gt;
  &lt;/property&gt;
  &lt;widget class=&quot;QPushButton&quot; name=&quot;btn_Clock&quot;&gt;
   &lt;property name=&quot;geometry&quot;&gt;
    &lt;rect&gt;
     &lt;x&gt;260&lt;/x&gt;
     &lt;y&gt;10&lt;/y&gt;
     &lt;width&gt;66&lt;/width&gt;
     &lt;height&gt;25&lt;/height&gt;
    &lt;/rect&gt;
   &lt;/property&gt;
   &lt;property name=&quot;text&quot;&gt;
    &lt;string&gt;Clock&lt;/string&gt;
   &lt;/property&gt;
  &lt;/widget&gt;
  &lt;widget class=&quot;QPushButton&quot; name=&quot;Quit&quot;&gt;
   &lt;property name=&quot;geometry&quot;&gt;
    &lt;rect&gt;
     &lt;x&gt;260&lt;/x&gt;
     &lt;y&gt;120&lt;/y&gt;
     &lt;width&gt;75&lt;/width&gt;
     &lt;height&gt;26&lt;/height&gt;
    &lt;/rect&gt;
   &lt;/property&gt;
   &lt;property name=&quot;text&quot;&gt;
    &lt;string&gt;Yow&lt;/string&gt;
   &lt;/property&gt;
  &lt;/widget&gt;
  &lt;widget class=&quot;QFrame&quot; name=&quot;frame&quot;&gt;
   &lt;property name=&quot;geometry&quot;&gt;
    &lt;rect&gt;
     &lt;x&gt;20&lt;/x&gt;
     &lt;y&gt;10&lt;/y&gt;
     &lt;width&gt;201&lt;/width&gt;
     &lt;height&gt;131&lt;/height&gt;
    &lt;/rect&gt;
   &lt;/property&gt;
   &lt;property name=&quot;palette&quot;&gt;
    &lt;palette&gt;
     &lt;active&gt;
      &lt;colorrole role=&quot;Button&quot;&gt;
       &lt;brush brushstyle=&quot;SolidPattern&quot;&gt;
        &lt;color alpha=&quot;255&quot;&gt;
         &lt;red&gt;96&lt;/red&gt;
         &lt;green&gt;0&lt;/green&gt;
         &lt;blue&gt;0&lt;/blue&gt;
        &lt;/color&gt;
       &lt;/brush&gt;
      &lt;/colorrole&gt;
      &lt;colorrole role=&quot;Base&quot;&gt;
       &lt;brush brushstyle=&quot;SolidPattern&quot;&gt;
        &lt;color alpha=&quot;255&quot;&gt;
         &lt;red&gt;255&lt;/red&gt;
         &lt;green&gt;255&lt;/green&gt;
         &lt;blue&gt;255&lt;/blue&gt;
        &lt;/color&gt;
       &lt;/brush&gt;
      &lt;/colorrole&gt;
      &lt;colorrole role=&quot;Window&quot;&gt;
       &lt;brush brushstyle=&quot;SolidPattern&quot;&gt;
        &lt;color alpha=&quot;255&quot;&gt;
         &lt;red&gt;0&lt;/red&gt;
         &lt;green&gt;0&lt;/green&gt;
         &lt;blue&gt;0&lt;/blue&gt;
        &lt;/color&gt;
       &lt;/brush&gt;
      &lt;/colorrole&gt;
     &lt;/active&gt;
     &lt;inactive&gt;
      &lt;colorrole role=&quot;Button&quot;&gt;
       &lt;brush brushstyle=&quot;SolidPattern&quot;&gt;
        &lt;color alpha=&quot;255&quot;&gt;
         &lt;red&gt;96&lt;/red&gt;
         &lt;green&gt;0&lt;/green&gt;
         &lt;blue&gt;0&lt;/blue&gt;
        &lt;/color&gt;
       &lt;/brush&gt;
      &lt;/colorrole&gt;
      &lt;colorrole role=&quot;Base&quot;&gt;
       &lt;brush brushstyle=&quot;SolidPattern&quot;&gt;
        &lt;color alpha=&quot;255&quot;&gt;
         &lt;red&gt;255&lt;/red&gt;
         &lt;green&gt;255&lt;/green&gt;
         &lt;blue&gt;255&lt;/blue&gt;
        &lt;/color&gt;
       &lt;/brush&gt;
      &lt;/colorrole&gt;
      &lt;colorrole role=&quot;Window&quot;&gt;
       &lt;brush brushstyle=&quot;SolidPattern&quot;&gt;
        &lt;color alpha=&quot;255&quot;&gt;
         &lt;red&gt;0&lt;/red&gt;
         &lt;green&gt;0&lt;/green&gt;
         &lt;blue&gt;0&lt;/blue&gt;
        &lt;/color&gt;
       &lt;/brush&gt;
      &lt;/colorrole&gt;
     &lt;/inactive&gt;
     &lt;disabled&gt;
      &lt;colorrole role=&quot;Button&quot;&gt;
       &lt;brush brushstyle=&quot;SolidPattern&quot;&gt;
        &lt;color alpha=&quot;255&quot;&gt;
         &lt;red&gt;96&lt;/red&gt;
         &lt;green&gt;0&lt;/green&gt;
         &lt;blue&gt;0&lt;/blue&gt;
        &lt;/color&gt;
       &lt;/brush&gt;
      &lt;/colorrole&gt;
      &lt;colorrole role=&quot;Base&quot;&gt;
       &lt;brush brushstyle=&quot;SolidPattern&quot;&gt;
        &lt;color alpha=&quot;255&quot;&gt;
         &lt;red&gt;0&lt;/red&gt;
         &lt;green&gt;0&lt;/green&gt;
         &lt;blue&gt;0&lt;/blue&gt;
        &lt;/color&gt;
       &lt;/brush&gt;
      &lt;/colorrole&gt;
      &lt;colorrole role=&quot;Window&quot;&gt;
       &lt;brush brushstyle=&quot;SolidPattern&quot;&gt;
        &lt;color alpha=&quot;255&quot;&gt;
         &lt;red&gt;0&lt;/red&gt;
         &lt;green&gt;0&lt;/green&gt;
         &lt;blue&gt;0&lt;/blue&gt;
        &lt;/color&gt;
       &lt;/brush&gt;
      &lt;/colorrole&gt;
     &lt;/disabled&gt;
    &lt;/palette&gt;
   &lt;/property&gt;
   &lt;property name=&quot;autoFillBackground&quot;&gt;
    &lt;bool&gt;true&lt;/bool&gt;
   &lt;/property&gt;
   &lt;property name=&quot;frameShape&quot;&gt;
    &lt;enum&gt;QFrame::StyledPanel&lt;/enum&gt;
   &lt;/property&gt;
   &lt;property name=&quot;frameShadow&quot;&gt;
    &lt;enum&gt;QFrame::Raised&lt;/enum&gt;
   &lt;/property&gt;
   &lt;widget class=&quot;KLed&quot; name=&quot;led_2&quot;&gt;
    &lt;property name=&quot;geometry&quot;&gt;
     &lt;rect&gt;
      &lt;x&gt;70&lt;/x&gt;
      &lt;y&gt;70&lt;/y&gt;
      &lt;width&gt;25&lt;/width&gt;
      &lt;height&gt;25&lt;/height&gt;
     &lt;/rect&gt;
    &lt;/property&gt;
    &lt;property name=&quot;state&quot;&gt;
     &lt;enum&gt;KLed::Off&lt;/enum&gt;
    &lt;/property&gt;
   &lt;/widget&gt;
   &lt;widget class=&quot;KLed&quot; name=&quot;led_3&quot;&gt;
    &lt;property name=&quot;geometry&quot;&gt;
     &lt;rect&gt;
      &lt;x&gt;30&lt;/x&gt;
      &lt;y&gt;70&lt;/y&gt;
      &lt;width&gt;25&lt;/width&gt;
      &lt;height&gt;25&lt;/height&gt;
     &lt;/rect&gt;
    &lt;/property&gt;
    &lt;property name=&quot;state&quot;&gt;
     &lt;enum&gt;KLed::Off&lt;/enum&gt;
    &lt;/property&gt;
   &lt;/widget&gt;
   &lt;widget class=&quot;QRadioButton&quot; name=&quot;bit_2&quot;&gt;
    &lt;property name=&quot;geometry&quot;&gt;
     &lt;rect&gt;
      &lt;x&gt;73&lt;/x&gt;
      &lt;y&gt;23&lt;/y&gt;
      &lt;width&gt;25&lt;/width&gt;
      &lt;height&gt;21&lt;/height&gt;
     &lt;/rect&gt;
    &lt;/property&gt;
    &lt;property name=&quot;text&quot;&gt;
     &lt;string/&gt;
    &lt;/property&gt;
   &lt;/widget&gt;
   &lt;widget class=&quot;QRadioButton&quot; name=&quot;bit_3&quot;&gt;
    &lt;property name=&quot;geometry&quot;&gt;
     &lt;rect&gt;
      &lt;x&gt;34&lt;/x&gt;
      &lt;y&gt;23&lt;/y&gt;
      &lt;width&gt;25&lt;/width&gt;
      &lt;height&gt;21&lt;/height&gt;
     &lt;/rect&gt;
    &lt;/property&gt;
    &lt;property name=&quot;text&quot;&gt;
     &lt;string/&gt;
    &lt;/property&gt;
   &lt;/widget&gt;
   &lt;widget class=&quot;KLed&quot; name=&quot;led_1&quot;&gt;
    &lt;property name=&quot;geometry&quot;&gt;
     &lt;rect&gt;
      &lt;x&gt;110&lt;/x&gt;
      &lt;y&gt;70&lt;/y&gt;
      &lt;width&gt;25&lt;/width&gt;
      &lt;height&gt;25&lt;/height&gt;
     &lt;/rect&gt;
    &lt;/property&gt;
    &lt;property name=&quot;state&quot;&gt;
     &lt;enum&gt;KLed::Off&lt;/enum&gt;
    &lt;/property&gt;
   &lt;/widget&gt;
   &lt;widget class=&quot;QRadioButton&quot; name=&quot;bit_1&quot;&gt;
    &lt;property name=&quot;geometry&quot;&gt;
     &lt;rect&gt;
      &lt;x&gt;114&lt;/x&gt;
      &lt;y&gt;23&lt;/y&gt;
      &lt;width&gt;25&lt;/width&gt;
      &lt;height&gt;21&lt;/height&gt;
     &lt;/rect&gt;
    &lt;/property&gt;
    &lt;property name=&quot;text&quot;&gt;
     &lt;string/&gt;
    &lt;/property&gt;
   &lt;/widget&gt;
   &lt;widget class=&quot;QRadioButton&quot; name=&quot;bit_0&quot;&gt;
    &lt;property name=&quot;geometry&quot;&gt;
     &lt;rect&gt;
      &lt;x&gt;153&lt;/x&gt;
      &lt;y&gt;23&lt;/y&gt;
      &lt;width&gt;25&lt;/width&gt;
      &lt;height&gt;21&lt;/height&gt;
     &lt;/rect&gt;
    &lt;/property&gt;
    &lt;property name=&quot;text&quot;&gt;
     &lt;string/&gt;
    &lt;/property&gt;
   &lt;/widget&gt;
   &lt;widget class=&quot;KLed&quot; name=&quot;led_0&quot;&gt;
    &lt;property name=&quot;geometry&quot;&gt;
     &lt;rect&gt;
      &lt;x&gt;150&lt;/x&gt;
      &lt;y&gt;70&lt;/y&gt;
      &lt;width&gt;25&lt;/width&gt;
      &lt;height&gt;25&lt;/height&gt;
     &lt;/rect&gt;
    &lt;/property&gt;
    &lt;property name=&quot;state&quot;&gt;
     &lt;enum&gt;KLed::Off&lt;/enum&gt;
    &lt;/property&gt;
   &lt;/widget&gt;
  &lt;/widget&gt;
  &lt;widget class=&quot;QGroupBox&quot; name=&quot;enable_2&quot;&gt;
   &lt;property name=&quot;geometry&quot;&gt;
    &lt;rect&gt;
     &lt;x&gt;250&lt;/x&gt;
     &lt;y&gt;40&lt;/y&gt;
     &lt;width&gt;91&lt;/width&gt;
     &lt;height&gt;61&lt;/height&gt;
    &lt;/rect&gt;
   &lt;/property&gt;
   &lt;property name=&quot;font&quot;&gt;
    &lt;font&gt;
     &lt;weight&gt;50&lt;/weight&gt;
     &lt;bold&gt;false&lt;/bold&gt;
    &lt;/font&gt;
   &lt;/property&gt;
   &lt;property name=&quot;title&quot;&gt;
    &lt;string&gt;enable&lt;/string&gt;
   &lt;/property&gt;
   &lt;property name=&quot;flat&quot;&gt;
    &lt;bool&gt;true&lt;/bool&gt;
   &lt;/property&gt;
   &lt;property name=&quot;checkable&quot;&gt;
    &lt;bool&gt;true&lt;/bool&gt;
   &lt;/property&gt;
   &lt;property name=&quot;checked&quot;&gt;
    &lt;bool&gt;false&lt;/bool&gt;
   &lt;/property&gt;
   &lt;widget class=&quot;QRadioButton&quot; name=&quot;run&quot;&gt;
    &lt;property name=&quot;geometry&quot;&gt;
     &lt;rect&gt;
      &lt;x&gt;30&lt;/x&gt;
      &lt;y&gt;30&lt;/y&gt;
      &lt;width&gt;50&lt;/width&gt;
      &lt;height&gt;19&lt;/height&gt;
     &lt;/rect&gt;
    &lt;/property&gt;
    &lt;property name=&quot;text&quot;&gt;
     &lt;string&gt;run&lt;/string&gt;
    &lt;/property&gt;
   &lt;/widget&gt;
  &lt;/widget&gt;
 &lt;/widget&gt;
 &lt;layoutdefault spacing=&quot;6&quot; margin=&quot;11&quot;/&gt;
 &lt;pixmapfunction&gt;qPixmapFromMimeSource&lt;/pixmapfunction&gt;
 &lt;customwidgets&gt;
  &lt;customwidget&gt;
   &lt;class&gt;KLed&lt;/class&gt;
   &lt;extends&gt;QWidget&lt;/extends&gt;
   &lt;header&gt;kled.h&lt;/header&gt;
  &lt;/customwidget&gt;
 &lt;/customwidgets&gt;
 &lt;includes&gt;
  &lt;include location=&quot;local&quot;&gt;kled.h&lt;/include&gt;
  &lt;include location=&quot;local&quot;&gt;kled.h&lt;/include&gt;
  &lt;include location=&quot;local&quot;&gt;kled.h&lt;/include&gt;
  &lt;include location=&quot;local&quot;&gt;kled.h&lt;/include&gt;
 &lt;/includes&gt;
 &lt;resources/&gt;
 &lt;connections&gt;
  &lt;connection&gt;
   &lt;sender&gt;bit_0&lt;/sender&gt;
   &lt;signal&gt;released()&lt;/signal&gt;
   &lt;receiver&gt;bit_1&lt;/receiver&gt;
   &lt;slot&gt;animateClick()&lt;/slot&gt;
  &lt;/connection&gt;
  &lt;connection&gt;
   &lt;sender&gt;bit_1&lt;/sender&gt;
   &lt;signal&gt;released()&lt;/signal&gt;
   &lt;receiver&gt;bit_2&lt;/receiver&gt;
   &lt;slot&gt;animateClick()&lt;/slot&gt;
  &lt;/connection&gt;
  &lt;connection&gt;
   &lt;sender&gt;bit_2&lt;/sender&gt;
   &lt;signal&gt;released()&lt;/signal&gt;
   &lt;receiver&gt;bit_3&lt;/receiver&gt;
   &lt;slot&gt;animateClick()&lt;/slot&gt;
  &lt;/connection&gt;
  &lt;connection&gt;
   &lt;sender&gt;btn_Clock&lt;/sender&gt;
   &lt;signal&gt;released()&lt;/signal&gt;
   &lt;receiver&gt;bit_0&lt;/receiver&gt;
   &lt;slot&gt;animateClick()&lt;/slot&gt;
  &lt;/connection&gt;
  &lt;connection&gt;
   &lt;sender&gt;run&lt;/sender&gt;
   &lt;signal&gt;clicked()&lt;/signal&gt;
   &lt;receiver&gt;btn_Clock&lt;/receiver&gt;
   &lt;slot&gt;animateClick()&lt;/slot&gt;
  &lt;/connection&gt;
  &lt;connection&gt;
   &lt;sender&gt;bit_3&lt;/sender&gt;
   &lt;signal&gt;released()&lt;/signal&gt;
   &lt;receiver&gt;run&lt;/receiver&gt;
   &lt;slot&gt;animateClick()&lt;/slot&gt;
  &lt;/connection&gt;
  &lt;connection&gt;
   &lt;sender&gt;bit_0&lt;/sender&gt;
   &lt;signal&gt;toggled(bool)&lt;/signal&gt;
   &lt;receiver&gt;led_0&lt;/receiver&gt;
   &lt;slot&gt;toggle()&lt;/slot&gt;
  &lt;/connection&gt;
  &lt;connection&gt;
   &lt;sender&gt;bit_1&lt;/sender&gt;
   &lt;signal&gt;toggled(bool)&lt;/signal&gt;
   &lt;receiver&gt;led_1&lt;/receiver&gt;
   &lt;slot&gt;toggle()&lt;/slot&gt;
  &lt;/connection&gt;
  &lt;connection&gt;
   &lt;sender&gt;bit_2&lt;/sender&gt;
   &lt;signal&gt;toggled(bool)&lt;/signal&gt;
   &lt;receiver&gt;led_2&lt;/receiver&gt;
   &lt;slot&gt;toggle()&lt;/slot&gt;
  &lt;/connection&gt;
  &lt;connection&gt;
   &lt;sender&gt;bit_3&lt;/sender&gt;
   &lt;signal&gt;toggled(bool)&lt;/signal&gt;
   &lt;receiver&gt;led_3&lt;/receiver&gt;
   &lt;slot&gt;toggle()&lt;/slot&gt;
  &lt;/connection&gt;
  &lt;connection&gt;
   &lt;sender&gt;Quit&lt;/sender&gt;
   &lt;signal&gt;clicked()&lt;/signal&gt;
   &lt;receiver&gt;digital_delay&lt;/receiver&gt;
   &lt;slot&gt;close()&lt;/slot&gt;
  &lt;/connection&gt;
  &lt;connection&gt;
   &lt;sender&gt;Quit&lt;/sender&gt;
   &lt;signal&gt;clicked()&lt;/signal&gt;
   &lt;receiver&gt;digital_delay&lt;/receiver&gt;
   &lt;slot&gt;close()&lt;/slot&gt;
  &lt;/connection&gt;
 &lt;/connections&gt;
&lt;/ui&gt;</pre>
</div>You can run run this in preview mode or compile it, especially if you have mc2 and the 'unofficial' mc2 -create qt4-files plugin setup, here:<br />
<a href="http://www.linuxquestions.org/questions/blog/rainbowsally-615861/liblq-and-mc2-makefile-creator2-the-next-generation-34648/">http://www.linuxquestions.org/questi...eration-34648/</a><br />
and of course, if you have kled.h which is (or should be) in the kdelibs development package.<br />
<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<pre class="bbcodeblock" dir="ltr" style="
		margin: 0px;
		margin-right: -99999px;
		padding: 3px;
		border: 1px inset;
		width: 98%;
		height: 130px;
		text-align: left;
		overflow: auto">mc2 -create qt4-files src/digital_delay.ui
mc2 -fetch qt4
# edit mc2.def and change OUTNAME if you like and add -lkdeui
# to the link like so:
LDFLAGS = -lQtGui -lQtCore -lkdeui 
mc2 -u
make clean; make</pre>
</div>We do actually learn something from this, believe it or not.  The 'Yow' button doesn't react sometimes because other events are crowding it out when this is 'enabled' and running.<br />
<br />
What this means is that QT just drops X events when it's too busy to read them, somehow.  The button press events are getting as far as drawing the Yow button in its up and down positions but the message is not getting to the 'close()' method in QWidget that the button output is connected to.<br />
<br />
Seems to work well enough most times BUT...  there may be other times this behavior (or lack of it) can cause more serious problems.  So we may want to see where in the system these button clicks are getting dropped.<br />
<br />
Notes:<br />
<br />
We discover that the function QT is using to wait for X events is <br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<pre class="bbcodeblock" dir="ltr" style="
		margin: 0px;
		margin-right: -99999px;
		padding: 3px;
		border: 1px inset;
		width: 98%;
		height: 34px;
		text-align: left;
		overflow: auto">bool result = g_main_context_iteration(d-&gt;mainContext, canWait);</pre>
</div>in the qeventdispatcher_glib.cpp, file around line 422.<br />
<br />
And that g_main_context_iteration() function is defined in glib-2 in glib/gmain.c<br />
<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<pre class="bbcodeblock" dir="ltr" style="
		margin: 0px;
		margin-right: -99999px;
		padding: 3px;
		border: 1px inset;
		width: 98%;
		height: 226px;
		text-align: left;
		overflow: auto">gboolean g_main_context_iteration (GMainContext *context, gboolean may_block)
{
  gboolean retval;
  
  if (!context)
    context = g_main_context_default();
  
  LOCK_CONTEXT (context);
  retval = g_main_context_iterate (context, may_block, TRUE, G_THREAD_SELF);
  UNLOCK_CONTEXT (context);
  
  return retval;
}</pre>
</div>The GMainContext struct is opaque, meaning that we cannot see what it consists of, and that's sure true enough.  (But wait!  See the screenshot at the bottom.)  Does it contain a callback for QT or are the XEvents getting picked up by glib?  <br />
<br />
We DO want to know because QT should not be dropping events like this.  (Tell yuh why later...)<br />
<br />
Now there are a couple of places QT could be getting its XEvents.  One possibility is the glib functions.  We don't know because we never read the friggin' manuals -- for one, it's boring and for two, it describes only what they think &quot;normal users&quot; need to know.<br />
<br />
Computer Mad Scientists are NOT &quot;normal&quot; users.  So forget that.<br />
<br />
The other place these X events could be coming from is from Xlib directly.<br />
<br />
We could grep through the files and find out.  But grepping glib is infinitely easier, which in the typical Gnome-ish style is a small file set, but doing a similar grep in QT is almost prohibitive.<br />
<br />
Let's start by compiling QT's Gnome dependencies so we can let a debugger walk us through the code, which gives us 'animated documentation' in a practical application.<br />
<br />
I'll try to toss in some fun stuff from time to time, but next up, let's see if our make-based system can create a debug version of glib that we can hook up with our debug version of QT4.<br />
<br />
[Stay tuned for an example of a working example of using the make-based package installer to allow us to peek into the previously invisible parts of QT where it disappears into that glib function.]<br />
<br />
And here's the QT surprise #2 from this very simple experiment: It's QT's dependecy on gnome libs for the QT main event loop.<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<pre class="bbcodeblock" dir="ltr" style="
		margin: 0px;
		margin-right: -99999px;
		padding: 3px;
		border: 1px inset;
		width: 98%;
		height: 34px;
		text-align: left;
		overflow: auto">Report bugs to &lt;http://bugzilla.gnome.org/enter_bug.cgi?product=glib&gt;.</pre>
</div>Who'd a thunk it.<br />
<br />
:-)<br />
<br />
PS. re. opaque struct?  Maybe for someone, but not for us.<br />
<br />
<a href="http://rainbowsally.net/pub/lq/qt4-glib-dbg.jpg" target="_blank">http://rainbowsally.net/pub/lq/qt4-glib-dbg.jpg</a><br />
<br />
The struct on the right had been &quot;opaque&quot;.  We can also see why glib is used, what it does, where it waits, and what it waits for.  We can also see where it calls back to QT functions to handle various 'dispatch' types for various fids.<br />
<br />
See the man page for &quot;poll&quot;.<br />
<br />
-- The Computer Mad Science Team<br />
<br />
:-)</div>

]]></content:encoded>
			<dc:creator>rainbowsally</dc:creator>
			<guid isPermaLink="true">http://www.linuxquestions.org/questions/blog.php?b=34700</guid>
		</item>
		<item>
			<title>I got online with Ubuntu 10.11</title>
			<link>http://www.linuxquestions.org/questions/blog.php?b=34698</link>
			<pubDate>Mon, 23 Apr 2012 15:04:23 GMT</pubDate>
			<description>I got online with ubuntu 11.10 oneiric ocelot on my Dell Precision T3400. It has 2.0 GiB and Intel® Core™2 Duo CPU E8400 @ 3.00GHz × 2 and it is...</description>
			<content:encoded><![CDATA[<div>I got online with ubuntu 11.10 oneiric ocelot on my Dell Precision T3400. It has 2.0 GiB and Intel® Core™2 Duo CPU E8400 @ 3.00GHz × 2 and it is 32-bit. This is how I did it.<br />
<br />
I started my computer and noticed the little triangle thingy (it's not technically a triangle, the top side is bowed out, more of an arc than a straight line) in the upper right hand corner of my computer screen didn't have any lines in it. I know from windows and mac that that means I'm not picking up any wireless internet radio waves in the air.  (By the way, the place where this triangle thingy resides is, I believe, called the “Top Panel”. I'm not sure of this. Apparently, just coming out and saying where the “top panel” is on your computer screen is some sort of taboo in linux culture. If it was called the “top tool bar” or even just the “top bar” I wouldn't have to wonder, being that this area of the screen is quite bar like, and not at all panel like, that is to say, it is long and thin like a bar, not having the low breadth to width ratio one finds with prototypical panels.) So I clicked on the triangle thing and sure enough, no networks were listed. <br />
I then embarked on a massive click-around. I clicked on everything I could to try to figure this thing out. In the triangle thingy I clicked on Enable Networking, on Edit Connections, Connection Information etc etc. No solutions there, so I decided to click around in all the networky, internetty type things I could find in system tools and programs and such. Just finding these things was no easy task. Since trying, I've read allot about Unity, and I believe the gist of the complaints I'm reading are about this new way of organizing the various files and programs.  Well, the program named “Network Manager” would not open for me, it still doesn't, actually, and I still don't know if this is normal or not, being a Linux newbie and all. <br />
In the community room of the housing co-op in which I live, there is an old pc which is online, so I began month long google search to figure out if “Network Manager” can be opened, and if so, how. I also studied internet connectivity in general vis-a-vis Linux.  I went down various different paths, and tried different sudo commands in the Terminal of my new Ubuntu operating system. I got nowhere. Well, I shouldn't say I got nowhere. I learned allot. For instance, I gradually gleaned that after typing in a sudo command, one should hit “Enter” in order to execute the command one has just typed. The dispersal of that info is another one of those Linux cultural taboos. Another general problem for Ubuntu 11.10 users is that most of the info on Ubuntu one finds on the internet was written for Gnome. In these posts, one is constantly being directed to look for things in files called “System” and “Applications”. Well, these files don't exist anymore. It took me days of staring to final realize why I couldn't find what I was supposed to find. (Had I misunderstood what a “Top Panel” is??? Is that why I can't find this or that file???) I debated documenting this search, google search for google search, sudo command for sudo command, but decided in the end it would be to much trouble. I may do this for one of the coming battles, for instance, to get my printer working, or get a photo manager downloaded. <br />
<br />
Well, after all this time of searching, I started to suspect that my Dell Precision T3400 didn't have a wireless card. I opened up the computer after using google images to find out what a wireless lan card looks like and didn't find anything like that in the computer. So I asked my father in law, who had given me this computer and he indicated doubt as to whether it had a wireless card. So I went over to our local computer recycling place, NextStep Recycling, and bought a wireless card for 15 bucks, and stuck it in. This didn't help get me online, so I started googling around to find out why. It turns out that it didn't have a chipset supported by Ubuntu 11.10. (It did allow me to bandy about terms like “chipset” which I hope has impressed my co-op friends.) So I went back to NextStep and used a very nice list I found online which lists which cards worked and which didn't with various distros to select one that looked like it should work with Ubuntu 11.10. I exchanged my unusable card for it, and it did work. Now I have to go back to that data base and list this card as working with Ubuntu 11.10, which I believe is proper open source etiquette. <br />
<br />
It was a long, slow slog, but I made it. Network Manager still doesn't open when I click on it, or command it to open using the terminal, but whatever, I'll just let that haunt me later. For now, I have other battles to fight. I think I'll try to get Geeqie downloaded and working. That will probably keep me busy for a few days, if not a few weeks.</div>

]]></content:encoded>
			<dc:creator>fred roellig</dc:creator>
			<guid isPermaLink="true">http://www.linuxquestions.org/questions/blog.php?b=34698</guid>
		</item>
		<item>
			<title>Software under Linux</title>
			<link>http://www.linuxquestions.org/questions/blog.php?b=34697</link>
			<pubDate>Sun, 22 Apr 2012 18:14:34 GMT</pubDate>
			<description>I have promised a bit about the software I regularely install on my Linux machines. For brevity I give the program name which can be searched for on...</description>
			<content:encoded><![CDATA[<div>I have promised a bit about the software I regularely install on my Linux machines. For brevity I give the program name which can be searched for on the internet and for the apt-get users the package name with wich to install as well as a short description why I install this software.<br />
<br />
Structure:<br />
Proper Name of Software / apt-get package name / description<br />
<br />
Here we go:<br />
SECURITY SOFTWARE<br />
Clam Anti Virus / clamav / the clam anti virus base<br />
ClamTK interface / clamtk / the graphical interface for KDE<br />
Rootkit Hunter / rkhunter / a scanner for rootkits<br />
chkrootkit / chkrootkit / another scanner for rootkits<br />
<br />
EDITORS<br />
-------------<br />
scite / scite / a text editor for programming languages (closest to Notepad++ I think)<br />
<br />
TOOLS<br />
-------------<br />
grsync / grsync / a bit of a special synch tool<br />
virtualbox / virtualbox..-. / Virtualbox.org from Oracle a virtualization platform to run other OS's within LINUX. Could also be used the other way round to run LINUX on Windows.<br />
gftp / gftp / an ftp application with a nice split window to shuffle files back and forth on an ftp server.<br />
syrep / syrep / another file synch tool<br />
<br />
BROWSER + PLUGINS (if not installed by OS setup)<br />
FlashPlayer for Iceweasel / flashplugin-nonfree / if not installed by setup<br />
<br />
GRAPHICS<br />
inkscape / inkscape / a vector graphics program similar to Adobe Illustrator<br />
dia / dia / a diagram editor I use for to hand draw network topology<br />
openshot / openshot / a simple yet great video editor<br />
gimp-plugin-registry / gimp-plugin-registry / s suite of the most commonly used scripts and additions to the GIMP<br />
<br />
GAMES<br />
kde-games / kde-games / a suite of nicely designed games such as patience and battlship or mine-sweeper<br />
supertux / supertux / a jump and run game in an icy world with TUX the LINUX penguin<br />
<br />
NICE<br />
stellarium / stellarium / a planetarium software and nice tool for stargazing on the computer<br />
sykpe / skype / The known VoIP software in it's LINUX flavor<br />
<br />
<br />
sources.list additional entries<br />
The below entries may have to be added to the /etc/apt/sources.list file in order for some of the above software to be installed.<br />
<br />
deb <a href="http://ftp.ch.debian.org/debian/" target="_blank">http://ftp.ch.debian.org/debian/</a> squeeze main contrib non-free<br />
deb-src <a href="http://ftp.ch.debian.org/debian/" target="_blank">http://ftp.ch.debian.org/debian/</a> squeeze main contrib non-free<br />
<br />
deb <a href="http://security.debian.org/" target="_blank">http://security.debian.org/</a> squeeze/updates main contrib<br />
deb-src <a href="http://security.debian.org/" target="_blank">http://security.debian.org/</a> squeeze/updates main contrib<br />
<br />
deb <a href="http://download.virtualbox.org/virtualbox/debian" target="_blank">http://download.virtualbox.org/virtualbox/debian</a> squeeze contrib non-free<br />
<br />
Installation tips and tricks<br />
<br />
VIRTUALBOX<br />
Install Virtualbox using: apt-get install Virtualbox<br />
Install Extension pack: download packages from website<br />
Install using VirtualBox Manager in global settings - extension packs.<br />
Install using VBoxManage as root or sudo it: VBoxManage1 extpack install &lt;tarball&gt; (this is a workaround if it fails due to user rights)</div>

]]></content:encoded>
			<dc:creator>error_401</dc:creator>
			<guid isPermaLink="true">http://www.linuxquestions.org/questions/blog.php?b=34697</guid>
		</item>
		<item>
			<title>A treat in HW has come to me - Linux on an IBM Intellistation Pro Z</title>
			<link>http://www.linuxquestions.org/questions/blog.php?b=34696</link>
			<pubDate>Sun, 22 Apr 2012 18:06:57 GMT</pubDate>
			<description>Well sometimes things happen and you have no clue why but they turn out to be great! 
 
As was the case with this one: 
 
Couple months ago an...</description>
			<content:encoded><![CDATA[<div>Well sometimes things happen and you have no clue why but they turn out to be great!<br />
<br />
As was the case with this one:<br />
<br />
Couple months ago an accquaintance turned up with an offer to buy the old hardware at their workplace. So I got myself two nice unscratched Samsung SyncMaster 910T LCD screens.<br />
I planned to look out for a video card featuring dual monitor connections so I could use it on my DELL Dimension 8300 PC for graphic design. I use Adobe's Illustrator and Photoshop in Win XP running in the VirtualBox.<br />
<br />
So the other day a friend steps into a discussion about workstations and dual displays adding that since nearly two years he's got this IBM station laying around and that I could have it if I wanted to try LINUX on it.<br />
I give it a go and pick it up to find out that it is a full IBM IntelliStation Pro Z featuring dual Xeon 3.4 MHz Processors. A lot of computing power under LINUX.<br />
<br />
I read a bit into installing Debian on that Workstation and after some time I find no newer additions than 2008 about the complicated process of building your own kernel etc.<br />
<br />
Then putting the setup CD into the drive was simply the next logical step. Again it amazed me how swift and easy the installation was within mere 2 hours one night I had a running system with my usual setup using Debian Squeeze and the KDE desktop.<br />
<br />
Setting up VirtualBox and Windows plus the needed software was an additional 3 hours. And now I have a running dual processor machine offering an incredible speed in manipulating images. Of course GIMP is on it as I prefer doing all I can on the Linux side sparing the Win for use with professional printing services which need Illustrator or Photoshop formats.<br />
<br />
So a nice story about funny things happening and all comes together to give me a new workstation I can do all the work I need for less than 500$. Ain't that great!</div>

]]></content:encoded>
			<dc:creator>error_401</dc:creator>
			<guid isPermaLink="true">http://www.linuxquestions.org/questions/blog.php?b=34696</guid>
		</item>
		<item>
			<title>ns-2.33 with mobiwan error</title>
			<link>http://www.linuxquestions.org/questions/blog.php?b=34694</link>
			<pubDate>Sun, 22 Apr 2012 08:18:35 GMT</pubDate>
			<description><![CDATA[i tried to patch mobiwan with ns-2.33 and after that when i run any tcl script it gives me an error: 
 
[riaz@riaz new_project]$ can't read...]]></description>
			<content:encoded><![CDATA[<div>i tried to patch mobiwan with ns-2.33 and after that when i run any tcl script it gives me an error:<br />
<br />
[riaz@riaz new_project]$ can't read &quot;EnableHierRt_&quot;: no such variable<br />
&gt;     (Object set line 1)<br />
&gt;     invoked from within<br />
&gt; &quot;Simulator set EnableHierRt_&quot;<br />
&gt;     (procedure &quot;_o10&quot; line 10)<br />
&gt;     (Node attach line 10)<br />
&gt;     invoked from within<br />
&gt; &quot;$node attach $agent&quot;<br />
&gt;     (procedure &quot;_o3&quot; line 2)<br />
&gt;     (Simulator attach-agent line 2)<br />
&gt;     invoked from within<br />
&gt; &quot;$ns_ attach-agent $n0 $udp0&quot;<br />
&gt;     (file &quot;packetsend.tcl&quot; line 18)<br />
&gt; [riaz@riaz new_project]$ <br />
<br />
<br />
please help me to resolve this... thanks in anticipation</div>

]]></content:encoded>
			<dc:creator>Riaz Khan</dc:creator>
			<guid isPermaLink="true">http://www.linuxquestions.org/questions/blog.php?b=34694</guid>
		</item>
		<item>
			<title>xfce4 version 4.10 preview before final release.</title>
			<link>http://www.linuxquestions.org/questions/blog.php?b=34693</link>
			<pubDate>Sun, 22 Apr 2012 02:09:19 GMT</pubDate>
			<description><![CDATA[I built xfce4 version 4.10pre2 from the source provided on the site and thought I'd do my bit to help the upcoming release and give give it some much...]]></description>
			<content:encoded><![CDATA[<div>I built xfce4 version 4.10pre2 from the source provided on the site and thought I'd do my bit to help the upcoming release and give give it some much deserved promotion .  Disclaimer, Xfce4 is my desktop environment of choice, as most of you know. I don't like giving up performance for the sake of bells and whistles but thanks to Xfce4 I can have both. <br />
<br />
<a href="http://www.youtube.com/watch?v=Pawg3pY9oak" target="_blank">xfce4 version 4.10 preview before final release.</a></div>

]]></content:encoded>
			<dc:creator>stretchedthin</dc:creator>
			<guid isPermaLink="true">http://www.linuxquestions.org/questions/blog.php?b=34693</guid>
		</item>
		<item>
			<title>Why is netfilter in kernel space?</title>
			<link>http://www.linuxquestions.org/questions/blog.php?b=34692</link>
			<pubDate>Sat, 21 Apr 2012 20:11:11 GMT</pubDate>
			<description><![CDATA[Isn't one of the kernel design intentions to move more things to user space and keep the kernel itself smaller?  I think network filtering should be...]]></description>
			<content:encoded><![CDATA[<div>Isn't one of the kernel design intentions to move more things to user space and keep the kernel itself smaller?  I think network filtering should be one of those things.<br />
<br />
So why haven't they done that?  Is it considered too much of a performance issue to use user processes filter packets?  I don't think it would be.  But maybe there is some functionality missing that can be done in the kernel and not in user space?<br />
<br />
The API would not be hard.  Just create device nodes or socket names that correspond to each of the possible hooks.  The user process with the right credentials can open them for read/write.  Each packet (or ethernet frame) would come in to that process by reading.  Then it would write the packet (or frame) back out the same descriptor if it passes.  If the descriptor closes, it goes back to default behavior (probably to pass everything transparently).  Multithread or multiplex I/O could be used to maximize the performance.<br />
<br />
This could allow more innovation in filter design strategies since it become readily pluggable, and faulty programs won't take down an entire system.</div>

]]></content:encoded>
			<dc:creator>Skaperen</dc:creator>
			<guid isPermaLink="true">http://www.linuxquestions.org/questions/blog.php?b=34692</guid>
		</item>
		<item>
			<title>NAM of ns2.23 not working</title>
			<link>http://www.linuxquestions.org/questions/blog.php?b=34689</link>
			<pubDate>Fri, 20 Apr 2012 14:43:21 GMT</pubDate>
			<description><![CDATA[hi ... i installed ns-2.33 successfully but the problem is that NAM is not working. when i run a tcl script it gives an error : 
  
"stop" 
...]]></description>
			<content:encoded><![CDATA[<div>hi ... i installed ns-2.33 successfully but the problem is that NAM is not working. when i run a tcl script it gives an error :<br />
 <br />
&quot;stop&quot;<br />
 [root@localhost programs]# ns 5nodes.tcl<br />
 ns: finish: couldn't execute &quot;nam&quot;: permission denied<br />
 while executing<br />
 &quot;exec nam out.nam &amp;&quot;<br />
 (procedure &quot;finish&quot; line 6)<br />
 invoked from within<br />
 &quot;finish&quot;<br />
 <br />
<br />
my OS is fedora 16<br />
 i downloaded nam 1.14 and unpacked it and then kept it in usr/local/bin by typing the command &quot;cp nam /usr/local/bin&quot; on ROOT<br />
 please sugest<br />
 <br />
<br />
thanks in anticipation</div>

]]></content:encoded>
			<dc:creator>afsha2719</dc:creator>
			<guid isPermaLink="true">http://www.linuxquestions.org/questions/blog.php?b=34689</guid>
		</item>
		<item>
			<title>GUI coding.  A peek at run-time inheritance (method lookups)</title>
			<link>http://www.linuxquestions.org/questions/blog.php?b=34688</link>
			<pubDate>Fri, 20 Apr 2012 13:23:06 GMT</pubDate>
			<description><![CDATA[GUI coding.  A peek at run-time inheritance (method lookups) 
 
In previous blog entries we built QT's example/desktop/screenshot  application and...]]></description>
			<content:encoded><![CDATA[<div>GUI coding.  A peek at run-time inheritance (method lookups)<br />
<br />
In previous blog entries we built QT's example/desktop/screenshot  application and did a bit of tracing with a debugger.<br />
<br />
Let's take a look at the metaobject definition file (moc_screenshot.cpp) next.<br />
<br />
This is where QT implements a class' method inheritance.  It looks up 'methods' from the widget's parent first, then if parent doesn't handle the '_id' we try it here, and if we don't handle it we subtract the number of methods we DO implement and pass the result back to whoever called us -- which could be another widget which could be a child of this one.<br />
<br />
This is pretty cool.<br />
<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<pre class="bbcodeblock" dir="ltr" style="
		margin: 0px;
		margin-right: -99999px;
		padding: 3px;
		border: 1px inset;
		width: 98%;
		height: 306px;
		text-align: left;
		overflow: auto">
int Screenshot::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
  _id = QWidget::qt_metacall(_c, _id, _a);
  if (_id &lt; 0)
    return _id;
  if (_c == QMetaObject::InvokeMetaMethod) {
    switch (_id) {
      case 0: newScreenshot(); break;
      case 1: saveScreenshot(); break;
      case 2: shootScreen(); break;
      case 3: updateCheckBox(); break;
      default: ;
    }
    _id -= 4;
  }
  return _id;
}</pre>
</div>If this widget had no parents and only had one method, for case 0, it would subtract 1 if it executed, returning -1, notifying the caller (possibly a child widget) that the method was at least within range, and presumably had been handled.<br />
<br />
If the id was out of range, it would return the original _id - 1.  <br />
<br />
So if this were called by a a child widget whose id's also start at 0 now having the id decremented by its parent's number of methods (1 in this case), would execute the method for case 0 when it initially received an _id = 1.<br />
<br />
Sorry if that's confusing. Let's look at this another way.<br />
<br />
If a child of the actual Screenshot class had one _id, it's case switch would be case 0.  But to execute it you'd have to pass it an _id of 4 (IF Screenshot had NO parent methods), and Screenshot would subtract 4 from the _id when it returned, and we'd then handle case 0.<br />
<br />
For C/C++ newbees:<br />
<br />
In actual fact, however Screenshot does have parent methods.  How many?  <br />
<br />
Need a clue?  See 'qt_meta_data_Screenshot' in the moc_screenshot.cpp file.<br />
<br />
[Ans: ten.]<br />
<br />
Okay then, what _id would you have to send to this metaobject to execute it's 'shootScreen' method?  What parameters and what types would they have to be in order to avoid crashing in the C++ call?<br />
<br />
Yer on your own for that one.  :-)<br />
<br />
Then rewrite the moc_screenshot case switch to use A, B, C, D instead of 0,1,2,3, and add:<br />
<br />
[We CAN do this with our own makefile system!]<br />
<br />
enum // as a typedef and named if you know how to get it to compile that way.<br />
{<br />
  A = 0,<br />
  B,<br />
  C,<br />
  D<br />
}; <br />
<br />
<br />
Is there an advantage to using enums rather than QTs numeric _id system?  Is there a disadvantage?  (Requires disassembly, use objdump -d o/moc_* to see it.)<br />
<br />
[Ans: nope.  Not with gcc 4.5 anyway.  No difference at all.]<br />
<br />
For C/C++ intermediate and advanced guys:<br />
<br />
How would you parse a header file to generate enums for calling various functions declared in that header that would allow changes (addition or deletion) in a parent's chain of methods (possibly loaded in a shared object -- i.e, possibly no headers for the parent chain) without skewing and screwing up the method IDs in the current set of methods?<br />
<br />
How would you assure that a method id that once referred to a function that was present in one specific class or file but, had been removed, doesn't call the wrong method without doing a time consuming name lookup and comparison?<br />
<br />
:-)</div>

]]></content:encoded>
			<dc:creator>rainbowsally</dc:creator>
			<guid isPermaLink="true">http://www.linuxquestions.org/questions/blog.php?b=34688</guid>
		</item>
		<item>
			<title>New digital tune / gFifteen version 1.0</title>
			<link>http://www.linuxquestions.org/questions/blog.php?b=34687</link>
			<pubDate>Fri, 20 Apr 2012 06:34:31 GMT</pubDate>
			<description>I finally was able to get a power adapter for my old CASIO keyboard, plus a MIDI adapter. With that and some RG editing I was able to produce this...</description>
			<content:encoded><![CDATA[<div>I finally was able to get a power adapter for my old CASIO keyboard, plus a MIDI adapter. With that and some RG editing I was able to produce this little tune:<br />
<br />
<a href="https://frigidcode.com/digital-music/m05/m05.ogg" target="_blank">https://frigidcode.com/digital-music/m05/m05.ogg</a> (Ogg Vorbis)<br />
<a href="https://frigidcode.com/digital-music/m05/m05.mp3" target="_blank">https://frigidcode.com/digital-music/m05/m05.mp3</a> (Mp3)<br />
<br />
*****<br />
<br />
This is somewhat old news, but I should mention that gFifteen version 1.0 is available, with three additional tile sets for variety. Debian packages are available for 32 and 64 bit platforms, and gFifteen 1.0 is also in official Gentoo portage.<br />
<br />
<a href="https://frigidcode.com/code/gfifteen/" target="_blank">https://frigidcode.com/code/gfifteen/</a></div>

]]></content:encoded>
			<dc:creator>hydraMax</dc:creator>
			<guid isPermaLink="true">http://www.linuxquestions.org/questions/blog.php?b=34687</guid>
		</item>
		<item>
			<title>Master Command history in Linux Bash</title>
			<link>http://www.linuxquestions.org/questions/blog.php?b=34686</link>
			<pubDate>Fri, 20 Apr 2012 00:16:49 GMT</pubDate>
			<description>Before you learn any commands in Linux, get to know how you can make the most of the history functions in Bash.  This will save you and your fingers...</description>
			<content:encoded><![CDATA[<div>Before you learn any commands in Linux, get to know how you can make the most of the history functions in Bash.  This will save you and your fingers a lot of wear and tear. Learning this and making sure your working in a terminal emulator that has good copy past functionality and your going to find the command line a pretty comfortable place. <br />
<a href="http://youtu.be/VKH1PearPwM" target="_blank">Master Command history in Linux Bash</a></div>

]]></content:encoded>
			<dc:creator>stretchedthin</dc:creator>
			<guid isPermaLink="true">http://www.linuxquestions.org/questions/blog.php?b=34686</guid>
		</item>
		<item>
			<title>Cut and paste</title>
			<link>http://www.linuxquestions.org/questions/blog.php?b=34685</link>
			<pubDate>Thu, 19 Apr 2012 21:57:39 GMT</pubDate>
			<description><![CDATA[The "legacy os" people pride themselves in how they support pentium 3 and pentium 4 systems. Funny. We still use linux on pentium I and pentium II...]]></description>
			<content:encoded><![CDATA[<div>The &quot;legacy os&quot; people pride themselves in how they support pentium 3 and pentium 4 systems. Funny. We still use linux on pentium I and pentium II machines.<br />
<br />
Thanx to all the people who have viewed <a href="http://www.instructables.com/member/computothought/" target="_blank">http://www.instructables.com/member/computothought/</a>. Over 236,000 views now.<br />
<br />
Trying to think of a super simple example of cut and paste for a class. Here is what I came up with:<br />
<br />
Play pretend here for a second. You are a new accountant for a company and you  need to make a consolidated financial report of many units. (This example is way over simplified, but I think you will get the idea.) You need to get a report out, but you do not have time to re-enter figures, because all the units send their data in ascii or what is known as text files. How can we get the computer to compile the data so it can be easily entered into the spreadsheet?  Heres how!<br />
<br />
A good prerequisite for this post is at: <a href="http://www.linuxintheshell.org/" target="_blank">http://www.linuxintheshell.org/</a><br />
<br />
Units one, two, and three send their data in, but they are in an ascii file. We want to convert them  so they can be easily converted for use in a spreadsheet.<br />
<br />
From Unit 1 in unit1:<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<pre class="bbcodeblock" dir="ltr" style="
		margin: 0px;
		margin-right: -99999px;
		padding: 3px;
		border: 1px inset;
		width: 98%;
		height: 66px;
		text-align: left;
		overflow: auto">           Unit 1
Income     5000
Expenses   2000</pre>
</div>Data from Unit  2 in unit2:<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<pre class="bbcodeblock" dir="ltr" style="
		margin: 0px;
		margin-right: -99999px;
		padding: 3px;
		border: 1px inset;
		width: 98%;
		height: 66px;
		text-align: left;
		overflow: auto">           Unit 2
Income     45000
Expenses   46000</pre>
</div>Data from Unit 3 in unit3:<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<pre class="bbcodeblock" dir="ltr" style="
		margin: 0px;
		margin-right: -99999px;
		padding: 3px;
		border: 1px inset;
		width: 98%;
		height: 66px;
		text-align: left;
		overflow: auto">           Unit 3
Income     18000
Expenses   18000</pre>
</div>Lets create a program to compile the data. Nice thing about this is all we have to do to add units that use the same file naming  scheme in the directory. No requirements to change the program file. Warning it will kill the old cutitdata, so be sure and back all the files up and and delete ones you do not need. There is of course and easier way, but we will save that for later….<br />
<br />
compiledata.sh<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<pre class="bbcodeblock" dir="ltr" style="
		margin: 0px;
		margin-right: -99999px;
		padding: 3px;
		border: 1px inset;
		width: 98%;
		height: 434px;
		text-align: left;
		overflow: auto"># Get data from unit files and create .CUT files.
for f in unit?
do
    newfile=&quot;$f.CUT&quot;
    cut -c 12-25 $f &gt; $newfile
done

# create tmpfile.
touch cutfile
rm cutfile
touch cutfile

#create Labels for the file.
echo &quot; &quot; &gt; cutitfile
echo Income &gt;&gt; cutitfile
echo Expenses &gt;&gt; cutitfile

# put it all together.
for g  in unit?.CUT
do
   paste --d , cutitfile  $g &gt;&gt; cutfile
   mv cutfile cutitfile
done

# uncomment the next line if you want to use sc
# psc -d , &lt; cutitfile &gt; Units.sc</pre>
</div>Make an executable file:<br />
<br />
$ chmod +x  compiledata.sh<br />
<br />
Run the program:<br />
<br />
$./compiledata.sh<br />
<br />
See the result file:<br />
<br />
$ cat cutitfile<br />
<br />
, Unit 1, Unit 2, Unit 3<br />
Income:, 5000, 45000, 18000<br />
Expenses, 2000, 46000, 18000<br />
<br />
This is what is known as a comma delimited file which most Spreadsheets can import easily.<br />
Now we can use the spreadsheet to import the data.<br />
<br />
If you want to stay completely command line, you can use the program called sc.<br />
You will need to do a conversion though.<br />
<br />
$ psc -d , &lt; cutitfile &gt; Units.sc<br />
$ sc Units.sc<br />
<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<pre class="bbcodeblock" dir="ltr" style="
		margin: 0px;
		margin-right: -99999px;
		padding: 3px;
		border: 1px inset;
		width: 98%;
		height: 178px;
		text-align: left;
		overflow: auto">sc 7.16:  Type '?' for help.
Reading file &quot;Units.sc&quot;
        A       B       C       D        E         F         G         H     
  0            Unit 1  Unit 2  Unit 3
  1   Income     5000   45000   18000
  2  Expenses    2000   46000   18000
  3
  4
  5
  6</pre>
</div></div>

]]></content:encoded>
			<dc:creator>peonuser</dc:creator>
			<guid isPermaLink="true">http://www.linuxquestions.org/questions/blog.php?b=34685</guid>
		</item>
		<item>
			<title>GUI coding.  The 4 main parts of a typical GUI toolkit</title>
			<link>http://www.linuxquestions.org/questions/blog.php?b=34684</link>
			<pubDate>Thu, 19 Apr 2012 18:34:07 GMT</pubDate>
			<description><![CDATA[Let's start slow. 
 
First of all, most of the GUI toolkits including QT4 are set up in the following steps, and in this order. 
 
1.  Create an...]]></description>
			<content:encoded><![CDATA[<div>Let's start slow.<br />
<br />
First of all, most of the GUI toolkits including QT4 are set up in the following steps, and in this order.<br />
<ol style="list-style-type: decimal"><li> Create an application, possibly with commandline args.  (If not created explicitly this 'application' thing will already exist somewhere.)</li>
<li> Create a main widget with the 'application' thingie as its parent.</li>
<li> Show the main widget.</li>
<li> Run the application event loop.</li>
</ol><br />
The 'application' is the main event dispatcher which translates X events to events or &quot;messages&quot; understood by the toolkit's widgets.  <br />
<br />
It should do some pre-processing in order to make sure only those events that are applicable are passed to the application's children (like seeing if a mouse click occurs in a location inside a widget's boundaries).  And the widget may in turn do other translating and/or filtering and sending of messages to its own children.<br />
<br />
In any case, the main widget needs some kind of connection to the application in order to receive events (or messages).<br />
<br />
We need to 'show' the widget before running the main loop.  This 'show' command may only set a flag in the widget telling it to draw itself.  When not shown, the widget may completely destroy itself, freeing all memory.  There is no universal way to deal with visibility, but the basic concept exists in all the toolkits I've seen so far.<br />
<br />
Back to QT4.<br />
<br />
Here's the 'main.cpp' code for examples/desktop/screenshot in the QT4 installation in case this is one of the demos and examples actually in a precompiled package for your distro.<br />
<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<pre class="bbcodeblock" dir="ltr" style="
		margin: 0px;
		margin-right: -99999px;
		padding: 3px;
		border: 1px inset;
		width: 98%;
		height: 402px;
		text-align: left;
		overflow: auto">#include &lt;QApplication&gt;

#include &quot;screenshot.h&quot;

int main(int argc, char *argv[])
{
  // Certain standard args like --help may be processed here.  If they are, the 
  // function won't return.  -rs
  
  QApplication app(argc, argv); 
  
  // This creates the widget.  It is not explicitly linked to the parent, 
  // class which should be 'app' so we may want to trace this and see how it 
  // gets connected. -rs
  
  Screenshot screenshot;
  
  // This either sets flags or actually fills in variables. (Turns out in QT it
  // does both) -rs
  screenshot.show();
  
  // app.exec() returns 0 if there are no errors.  It runs the main loop. 
  return app.exec();
}</pre>
</div>Even Windows implements these 4 parts though they may appear to be 6 or 7 parts, the RegisterWindow() call being the 'connection' between the main widget and the 'application' and the main loop being partially visible (which is a nice feature) allowing overrides of default message handling by intercepting certain messages before sending them back to DefWindowProc() (default window proc = parent class vtable, in essence).  <br />
<br />
In Windows the object (or object header) is the WNDCLASS or WNDCLASSEX and the equivalent of a vtable is the WNDPROC.  But who cares about Windows, other than noticing they have a nifty hook that can be used to intercept messages within the main loop -- which we may also want to do with other toolkits.  <br />
<blockquote>I did this to FLTK, by the way, which required a complete rewrite of their system to call 'handle' functions through jump vectors which can be set and reset as required.  <br />
<br />
Works great but this is another strike against FLTK as our model toolkit since that is a MASSIVE rework of the entire system and mostly only applies to FLTK message handling though it <b><i>is</i></b> an interesting experiment if you already have FLTK sources.</blockquote>--------------------------------<br />
<br />
If you have kde, take kdbg (v &gt;= 5.0) for a spin.  Any insight-like debugger will probably do, but I love kdbg.<br />
<br />
:-)<br />
<br />
Here's the mc2.def file for compiling screenshot without qmake, adding debug info you can step through.  <br />
<br />
Create a new directory for the Makefile and copy the sources into a new subdir named 'src'. (for this example).<br />
<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<pre class="bbcodeblock" dir="ltr" style="
		margin: 0px;
		margin-right: -99999px;
		padding: 3px;
		border: 1px inset;
		width: 98%;
		height: 498px;
		text-align: left;
		overflow: auto">## The output file name not including path
OUTNAME = screenshot

## use default dirs

## What COMPILE should do.
COMPILE = g++ -c                # making no assumption about register width here
CFLAGS = -g3                    # debuggable
INCLUDE = -I/usr/include  -I/usr/include/Qt -I/usr/include/QtGui
# as needed add:
# /usr/include/Qt             /usr/include/QtHelp         /usr/include/QtSvg
# /usr/include/Qt3Support     /usr/include/QtMultimedia   /usr/include/QtTest
# /usr/include/QtCore         /usr/include/QtNetwork      /usr/include/QtUiTools
# /usr/include/QtDBus         /usr/include/QtOpenGL       /usr/include/QtWebKit
# /usr/include/QtDeclarative  /usr/include/QtScript       /usr/include/QtXml
# /usr/include/QtDesigner     /usr/include/QtScriptTools  /usr/include/QtXmlPatterns
# /usr/include/QtGui          /usr/include/QtSql


## What LINK should do.
LINK = g++                      # making no assumption about register width here
LDFLAGS = -lQtGui -lQtCore      # must be symlinks named &lt;name&gt;.so
# as needed add: libQtCore -lQt3Support -lQtDeclarative.so -lQtGui.so -lQtNetwork.so
# -lQtOpenGL.so -lQtSql.so -lQtSvg.so , etc...
# Note, however, that if you list a lib it WILL be considered a dependency and
# the app will abort at runtime if the lib is missing from the user's system 
# even it's not really needed.  Therefor, as a rule, do not list libs that aren't 
# really needed.  An exception might be for MULTI types of mc2 builds, where a 
# shotgun spread of libs is usually ok.

# adjust this path for your own system.  Use 'locate libQtGui.so, for example, and 
# copy that path if you need to.
LIB = -L/usr/lib

################################################################
## User Defined Targets

clean:
@rm -f $(MAIN)
@rm -f $(OBJ)
@rm -f *~ */*~ */*/*~ */*/*/*~

moc: force
cd src &amp;&amp; moc screenshot.h &gt; moc_screenshot.cpp

force:</pre>
</div>The moc file needs to be built before it can be automatically added to the build by mc2.<br />
<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<pre class="bbcodeblock" dir="ltr" style="
		margin: 0px;
		margin-right: -99999px;
		padding: 3px;
		border: 1px inset;
		width: 98%;
		height: 162px;
		text-align: left;
		overflow: auto">mc2 -update         # create a new makefile after which 'make update' works

# We need to create the metaobject and we'll name it moc_screenshot.cpp
# This only needs to be done once unless the header file changes.
make moc            # create the missing cpp file

# now we can add the new file to the build
make update         # adds the new file
make                # and there you have it.</pre>
</div>Creates screenshot with debug info which you can trace, as I did, minus the trips into qwidget.cpp and qapplication.cpp which may require a custom qt4 build that includes debug symbols (i.e., -g3 flag for g++ compilation.)<br />
<br />
If you can't get qmake to let you compile a debug version of this or other QT4 apps, d/load mc2 and see if that helps.  [You'll need the libLQ d/load to compile it.]<br />
<a href="http://www.linuxquestions.org/questions/blog/rainbowsally-615861/liblq-and-mc2-makefile-creator2-the-next-generation-34648/">http://www.linuxquestions.org/questi...eration-34648/</a><br />
<br />
Next let's take a look at how messages are passed internally.  In the case of QT4, method calls are also messages or 'signals' of sorts, and they are processed in a case switch called 'slots'.<br />
<br />
QT calls this kind of method call case switch metaobjects.  This is the equivalent of a Windows WNDPROC but it's all set up automatically, as most late-binding linux toolkits do.  <br />
<br />
[GTK does, Fox does, however XForms/FLTK and so forth do not even do late-binding of methods to to dynamically created classes, but this should be fairly generic nonetheless.]<br />
<br />
.</div>

]]></content:encoded>
			<dc:creator>rainbowsally</dc:creator>
			<guid isPermaLink="true">http://www.linuxquestions.org/questions/blog.php?b=34684</guid>
		</item>
		<item>
			<title>GUI coding: First Stop QT4</title>
			<link>http://www.linuxquestions.org/questions/blog.php?b=34683</link>
			<pubDate>Wed, 18 Apr 2012 19:55:13 GMT</pubDate>
			<description><![CDATA[First of all, let me say that I've needed a widget that acts like a terminal -- like forever -- and I've checked out a LOT of toolkits having various...]]></description>
			<content:encoded><![CDATA[<div>First of all, let me say that I've needed a widget that acts like a terminal -- like forever -- and I've checked out a LOT of toolkits having various degrees of success with each.  <br />
<br />
Perhaps oddly, tk was the best.  QT4 was the worst.  I subclassed a text editor widget and YOW! was it ever slow!!  But I think we'll give QT another look and this is why.<br />
<br />
I've checked out many toolkits including<ul><li>tcl/tk (and variants)</li>
<li>xclass and xforms and it's descendants</li>
<li>fltk v 1.x</li>
<li>fltk v 2.x</li>
<li>FTL (my own derivative of the once defunct fltk 2.0)</li>
<li>gtk/glade 2 (and a quick spin with glade 3)</li>
<li>Fox</li>
</ul><br />
<br />
These all have certain advantages and disadvantages.  The X-based systems don't rely on any particular desktop manager, for example.  <br />
<br />
If you pretty well crash your system, there's a good chance they will still run.  And they are fairly simple to understand (except xclass, which is somewhat buggy to boot).<br />
<br />
TK is too hard to get at directly.  We don't want to rely on the interpreter (tcl) because too much is impossible to trace with a debugger in interpreters.  Same goes for all the GUI toolkits that are interpretive.  No good for our low level Computer Mad Science experiments.<br />
<br />
Fox is quite nice in its own way and I did like the file dialog.  It's the old win-98 style file dialog, you can see everything laid out in a nice scroll widget.  I don't like the gtk file dialog at all and fltk's was even worse.  (They now accommodate a 'native' file dialog but it's missing the extremely easily implemented 'kdialog' version for some reason.)<br />
<br />
I like a lot about Fox, but without a dialog editor (not nearly as simple to create as one might think -- I and others have tried), Fox is also out.<br />
<br />
Hat's off anyway.  It's a great little toolkit.<br />
<br />
And all of these toolkits except GTK come in a single integrated download with at most a couple of additional small downloads.<br />
<br />
But as a dialup user myself GTK is out.  After the 15th download, and discovering new unexpected dependencies, some that are incompatible with my current system which would require even more wild goose chases, it's just not practical for me.  So I'm afraid gtk is out of the race for now, though I appreciate their glade-3 having sensible shortcut keys and in fact having these small modules DOES make it easier to debug and contribute to their effort, once you are in sync with the developers.<br />
<br />
I like the GTK concept but the 'dependencies' issue is a clincher, I'm afraid.<br />
<br />
I must say, that in some ways, I like xforms a lot.  It's versatile, though limited in its original state.  But it would be too much work to get it up to the point where it could (let's say) &quot;clone&quot; other GUI's.  GTK and QT4 can both mimick other GUIs by way of 'themes', though they don't tell us how to do that ourselves.  <br />
<br />
[With a good debugger we can find out though.]<br />
<br />
In any case xforms is out due to it's being stuck with a clunky antique look.  Same with xclass which has some cool demos but is in fact a bit buggy.<br />
<br />
What about FLTK, then?  It's a fairly painless download.<br />
<br />
FLTK is backward compatible with xforms.  It IS a toolkit.  But the widget names are hard to type fast, being mixed case and with underscores, both making for something of a typists nightmare if you do much hand coding.<br />
<br />
FLTK Version 1.3 is coming along (very slowly) with it's fluid interface, but it can't clone other GUIs and the buttons.  But the buttons, at least, look a little nicer, but then again they are still drawn line by line instead of using image files.  <br />
<br />
Oh!  Almost forgot.  SPIF, a spinoff from FLTK, had the image files for buttons, tabs, etc. for and themes (nice too), but it didn't have a dialog editor and last time I checked, which was in fairness quite a while ago, the automatic layout wasn't problem-free.  <br />
<br />
SPIF is out too.  We need our toolkit to have a graphical dialog/widget editor which I doubt they have yet but I may check again later.<br />
<br />
FTL.  FLTK version 2.0 was in complete shambles when I picked it up.  It had been on mothballs for six years.  I remade the makefiles with AutoBake (similar to mc2) and got all the examples working (including theme plugins), debugged what I could and converted it to at least being able to use images for buttons and borders. (If 2.0 now has the XT theme, I passed that to BigBen a while back.  Not looking for credit here, just explaining what a mess it was.)<br />
<br />
But FTL is not finished yet.  FTL is out of the running along with FLTK.<br />
<br />
Both have great widget description formats though.  Similar the NextSTEP menu definitions which are human readable and manually editable while xml format (the OTHER main system being used) is a nightmare to read and nearly impossible to edit by hand.<br />
<br />
What a notion.  Wouldn't that be a kick in the pants if we could port linux applications to linux?  :-)  I'd like to see a universal GUI description, not in xml format, that could be used to generate (at a minimum) QT ui forms from glade generated UI's and visa versa.  And if this were done in a NextSTEP-like format, or like FLTK, it would be much easier to convert other UI description files to the same format.<br />
<br />
Anyways....<br />
<br />
What does that leave?<br />
<br />
QT has a few problems in my opinion (their thread implementation looks to be insane if it really IS based on timer widgets which in the impression I got last time I played with it several years ago), but it's accessible and in fact ubiquitous among KDE users and has a very interesting 'inheritance' scheme that is worth taking a look at even if we didn't want to play with their GUI.<br />
<br />
We'll check out that inheritance scheme shortly.<br />
<br />
Also, QT4 has an outstanding dialog/widget editor.  The best of all them in terms of simple setup of forms and widgets but I don't like their qtcreator.  (And I don't have to use it, thank goodness.)<br />
<br />
Also, for my own purposes, since I now have a debug version of QT4 installed that I can trace, though it isn't compatible with my very slightly older qt4 that runs my KDE system.  (It's a long story.)<br />
<br />
So for our first round we will go with QT4 and see where we end up.<br />
<br />
Notes re. my QT4 demos, examples, with debug info:<br />
<br />
Let me start by explaining that by compiling from sources, I was able to install THOUSANDS of demos and examples that had been missing from RPM and DEB packages.<br />
<br />
Let that suffice as a reason to explain how I did this.<br />
<br />
For my own setup I set up qt4 configure with debug info to put qt4 in prefix=/UsR with sysdir=/EtC (which wasn't used), both of which belonged to my normal user so that attempts to install into other system folders would fail as I installed as a normal user.<br />
<br />
I tarred up the result in /UsR and moved it to a directory where I unpacked it into TREE created by 'new.make'.<br />
<br />
Using UsR2usr I checked and changed all the rpaths and paths in the script files (bear in mind the package is pushing 20 thousand files) and after several relocations using the make-based system (new.make) I finally decided to put the debug version in /opt/qt4 which I add to LD_LIBRARY_PATH in kdbg (gdb) environment, not in the regular LD_LIBRARY_PATH, so that the debugger and the targets both load the right libs from the right folders and so I can trace into the deepest parts of QT4 without any hangups in the debugger.<br />
<br />
I cannot, however, install the compiled QT4 into the root file system (/usr) yet though.  There are problems with phonon missing certain functions and also dbus which requires the newer QtCore lib which is incompatible with the rest of the system leading to a huge problem of what order to install things in.<br />
<br />
But for now that doesn't matter.  <br />
<br />
Let's dig into a somewhat typical though a bit large GUI toolkit.  QT4.<br />
<br />
Coming up... The 4 main parts of a typical GUI using a typical GUI toolkit.</div>

]]></content:encoded>
			<dc:creator>rainbowsally</dc:creator>
			<guid isPermaLink="true">http://www.linuxquestions.org/questions/blog.php?b=34683</guid>
		</item>
		<item>
			<title>Setting up Ubuntu / Squid Transparent Proxy</title>
			<link>http://www.linuxquestions.org/questions/blog.php?b=34682</link>
			<pubDate>Wed, 18 Apr 2012 11:28:49 GMT</pubDate>
			<description>New to Ubuntu and Linux, I hope someone will give sometime to help me out. I want to setup a transparent proxy server in ubuntu 10.04 or 11.04 using...</description>
			<content:encoded><![CDATA[<div>New to Ubuntu and Linux, I hope someone will give sometime to help me out. I want to setup a transparent proxy server in ubuntu 10.04 or 11.04 using an Intel Pro 1000 MT Dual Network Adapter. My setup are as follows:<br />
<br />
Modem &gt; [eth0] Transparent Proxy [eth1] &gt; Switch &gt; Clients<br />
<br />
Data obtain from Linksys E1000 Router:<br />
 - IP Address: 122.52.126.xx6<br />
 - Subnet Mask: 255.255.255.248<br />
 - Default Gateway: 122.52.126.xx5<br />
 - DNS 1: 124.106.5.xxx<br />
 - DNS 2: 124.106.7.xxx<br />
<br />
I have followed this link (<a href="http://www.tuxgarage.com/2011/01/how-to-setup-transparent-proxy-with.html" target="_blank">http://www.tuxgarage.com/2011/01/how...roxy-with.html</a>) and some other guides.<br />
<br />
 auto eth0 (I dont know that to put here)<br />
 iface eth0 inet static<br />
 address <br />
 netmask <br />
 network <br />
 broadcast <br />
 gateway <br />
<br />
 post-up iptables-restore &lt; /etc/iptables.up.rules<br />
<br />
 auto eth1<br />
 iface eth1 inet static<br />
 address 192.168.2.1<br />
 netmask 255.255.255.0<br />
 network 192.168.2.0<br />
 broadcast 192.168.2.255<br />
<br />
I will appreciate it very much for help. Thank you!</div>

]]></content:encoded>
			<dc:creator>anthraxbb</dc:creator>
			<guid isPermaLink="true">http://www.linuxquestions.org/questions/blog.php?b=34682</guid>
		</item>
		<item>
			<title>Mount Iphone/Ipod touch in Linux</title>
			<link>http://www.linuxquestions.org/questions/blog.php?b=34681</link>
			<pubDate>Tue, 17 Apr 2012 20:31:12 GMT</pubDate>
			<description>Mount Iphone/Ipod touch in Linux 
This tutorial is thanks to a request from a subscriber on the Youtube channel.  The tutorial addresses the steps...</description>
			<content:encoded><![CDATA[<div>Mount Iphone/Ipod touch in Linux<br />
This tutorial is thanks to a request from a subscriber on the Youtube channel.  The tutorial addresses the steps necessary to get the newer Apple iPod Touch and iPhone devices to mount so they can be accessed by your Linux box.  Even if your Linux distribution can do this out of the box, you may find it helpful to know what is at work, so you can address the situation if something goes wrong.<br />
<a href="http://www.youtube.com/watch?v=9YjUNQ46GVI" target="_blank"><br />
Mount Iphone/Ipod touch in Linux (Vectorlinux)</a></div>

]]></content:encoded>
			<dc:creator>stretchedthin</dc:creator>
			<guid isPermaLink="true">http://www.linuxquestions.org/questions/blog.php?b=34681</guid>
		</item>
		<item>
			<title>New versions links (mc2, libLQ, new-make)</title>
			<link>http://www.linuxquestions.org/questions/blog.php?b=34680</link>
			<pubDate>Tue, 17 Apr 2012 01:46:04 GMT</pubDate>
			<description>Latest mc2 (automatic makefile creator) and libLQ (our first library) are here. 
...</description>
			<content:encoded><![CDATA[<div>Latest mc2 (automatic makefile creator) and libLQ (our first library) are here.<br />
<br />
<a href="http://www.linuxquestions.org/questions/blog/rainbowsally-615861/liblq-and-mc2-makefile-creator2-the-next-generation-34648/">http://www.linuxquestions.org/questi...eration-34648/</a><br />
<br />
For the Computer Mad Scientists, you might find uncmake/uncmakefile Usr2usr, and the make-based binary package installer uninstaller utilities interesting as well.<br />
<br />
Uncmake latest will be posted here:<br />
<a href="http://www.linuxquestions.org/questions/blog/rainbowsally-615861/computer-mad-science-uncmake-to-rip-parts-of-cmake-d-installations-34669/">http://www.linuxquestions.org/questi...lations-34669/</a><br />
<br />
UsR2usr latest will be posted here:<br />
<a href="http://www.linuxquestions.org/questions/blog/rainbowsally-615861/usr2usr-liblq-version-34673/">http://www.linuxquestions.org/questi...version-34673/</a><br />
<br />
new-make (binary package installer/uninstaller system) latest will be posted here.<br />
<br />
<a href="http://www.linuxquestions.org/questions/blog/rainbowsally-615861/tying-up-loose-ends-the-make-based-package-installer-uninstaller-34641/">http://www.linuxquestions.org/questi...staller-34641/</a><br />
<br />
:-)</div>

]]></content:encoded>
			<dc:creator>rainbowsally</dc:creator>
			<guid isPermaLink="true">http://www.linuxquestions.org/questions/blog.php?b=34680</guid>
		</item>
		<item>
			<title><![CDATA[Window manager's in Linux, Sawfish]]></title>
			<link>http://www.linuxquestions.org/questions/blog.php?b=34679</link>
			<pubDate>Mon, 16 Apr 2012 18:20:59 GMT</pubDate>
			<description>There is plenty to choose from in the way of Window Managers in Linux, so what makes Sawfish special. Once the default window manager of the Gnome...</description>
			<content:encoded><![CDATA[<div>There is plenty to choose from in the way of Window Managers in Linux, so what makes Sawfish special. Once the default window manager of the Gnome desktop environment. Sawfish is now an independent window manager.<br />
<br />
Here is the screencast...<br />
<a href="http://www.youtube.com/watch?v=1KpX1QeVskU" target="_blank">Window manager's in Linux, Sawfish</a></div>

]]></content:encoded>
			<dc:creator>stretchedthin</dc:creator>
			<guid isPermaLink="true">http://www.linuxquestions.org/questions/blog.php?b=34679</guid>
		</item>
		<item>
			<title>Wireless software issues</title>
			<link>http://www.linuxquestions.org/questions/blog.php?b=34678</link>
			<pubDate>Mon, 16 Apr 2012 17:07:15 GMT</pubDate>
			<description>After fruitless attempts to get the MSI wireless dongle (comes with the Intel motherboard) to work, I bought a Hawking Wireless 150N wireless...</description>
			<content:encoded><![CDATA[<div>After fruitless attempts to get the MSI wireless dongle (comes with the Intel motherboard) to work, I bought a Hawking Wireless 150N wireless adapter. Still USB, but it has an external antenna and an amplifier. It worked better, but the problem with staying connected remained. It uses the same Ralink 2870 chip as the MSI adapter. Finally, I tried the &quot;bleeding edge&quot; wireless drivers in compat-wireless-2.6 (latest version). Although not all the drivers in the package will compile on my Slackware64-13.37 kernel, the Ralink drivers will, and they mostly fixed the problem. I get very infrequent disconnects that I don't get with the Broadcom drivers on my laptop, but they quickly reauthenticate and reassociate without error. So my new system is now completely functional. I just wish I had a larger flat-screen TV, since I can't read the display from my favorite chair at any reasonable zoom level. But then I'd need a larger wall and a bigger house!<br />
    If I around to it, I'll try the original MSI adapter with the new drivers and post the results.</div>

]]></content:encoded>
			<dc:creator>Rod3775</dc:creator>
			<guid isPermaLink="true">http://www.linuxquestions.org/questions/blog.php?b=34678</guid>
		</item>
		<item>
			<title>dejavu</title>
			<link>http://www.linuxquestions.org/questions/blog.php?b=34677</link>
			<pubDate>Mon, 16 Apr 2012 12:57:01 GMT</pubDate>
			<description>Has anyone amongst you experienced the feeling of *_dejavu_*.I have been experiencing it since I was aged 18 I guess.We see something in our dreams...</description>
			<content:encoded><![CDATA[<div>Has anyone amongst you experienced the feeling of <b><i><u>dejavu</u></i></b>.I have been experiencing it since I was aged 18 I guess.We see something in our dreams and later when it actually happens in your real life you just recall that I have seen it somewhere before.It makes me think &quot;Has whole of our life already been written and we are just acting out the script&quot;.If everythings already been written then why I am doing the things that I am doing now.If eventually I am I going to end up is already been written then why am I even trying to change it.This gives me a puppety feeling and sometimes I start loosing hope in what I am doing.</div>

]]></content:encoded>
			<dc:creator>Ajit Gunge</dc:creator>
			<guid isPermaLink="true">http://www.linuxquestions.org/questions/blog.php?b=34677</guid>
		</item>
		<item>
			<title>Pure Bash option handling</title>
			<link>http://www.linuxquestions.org/questions/blog.php?b=34675</link>
			<pubDate>Mon, 16 Apr 2012 06:44:46 GMT</pubDate>
			<description><![CDATA[I like the standard getopt way of specifying script and/or program parameters, but I don't like its quirks, and it is pretty cryptic if you don't use...]]></description>
			<content:encoded><![CDATA[<div>I like the standard<font face="Monospace"> getopt </font>way of specifying script and/or program parameters, but I don't like its quirks, and it is pretty cryptic if you don't use it often enough.<br />
<br />
Here is pure Bash skeleton to implement script option parsing. It is long, but it should be easier to read and understand than one implemented using<font face="Monospace"> getopt</font>.<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<pre class="bbcodeblock" dir="ltr" style="
		margin: 0px;
		margin-right: -99999px;
		padding: 3px;
		border: 1px inset;
		width: 98%;
		height: 498px;
		text-align: left;
		overflow: auto">#!/bin/bash
set +f                  # Enable filename globbing
set -B                  # Enable brace expansion
shopt -s dotglob        # Include names that start with a dot
shopt -s nullglob       # No match expands to an empty string


# Create a safe temporary directory to put temporary files into,
# and make sure it is automatically deleted after this script exits.
# You can use any filename &quot;$WORK/filename&quot; as a temporary file.
# Omit this if you dont need it.
WORK=&quot;$(mktemp -d)&quot; || exit $?
trap &quot;rm -rf '$WORK'&quot; EXIT


# Output usage to standard error, then exit.
# Exit status is optional (default 0), first parameter.
#
Usage () {
    exec &gt;&amp;2

    echo &quot;&quot;
    echo &quot;Usage: $0 [-h|--help]&quot;
    echo &quot;       $0 [-t TYPE|--type=TYPE] FILES...&quot;
    echo &quot;&quot;

    exit $[ $1-0 ]
}


# TYPE is stored in this parameter.
# You can also set a default value.
unset Type

# If you want no parameters to yield the usage,
# uncomment the next line:
# [ $# -gt 0 ] || Usage 0

# Parse command line arguments.
#
args=()
while [ $# -gt 0 ]; do

    # No options follow --
    if [ &quot;$1&quot; = &quot;--&quot; ]; then
        shift 1
        args=(&quot;${args[@]}&quot; &quot;$@&quot;)
        shift $#
        continue
    fi

    # Not an option?
    if [ &quot;${1:0:1}&quot; != &quot;-&quot; ]; then
        args[${#args[@]}]=&quot;$1&quot;
        shift 1
        continue
    fi

    # A long option?
    if [ &quot;${1:0:2}&quot; == &quot;--&quot; ]; then

        # Skip the two dashes at start, and consume this one
        option=&quot;${1:2}&quot;
        shift 1

        # --option=value or --option value
        value=&quot;${option#*=}&quot;
        if [ &quot;$value&quot; = &quot;$option&quot; ]; then
            value=&quot;$1&quot;
            valueshift=1
        else
            option=&quot;${option%%=*}&quot;
            valueshift=0
        fi
        #
        # If $value is used, then do
        #   shift $valueshift

        # Long options:
        #
        case &quot;$option&quot; in

          help)
            Usage 0
            ;;

          type)
            Type=&quot;$value&quot;
            shift $valueshift
            ;;

          *)
            echo &quot;--$option: Unknown option.&quot; &gt;&amp;2
            exit 1
            ;;

        esac

    elif [ &quot;$1&quot; = &quot;-&quot; ]; then

        # A single dash is interpreted as &quot;standard input&quot;.
        shift 1
        args[${#args[@]}]=&quot;/dev/stdin&quot;

    else

        # Short option or multiple short options. Consume.
        options=&quot;${1:1}&quot;
        shift 1

        # Handle each short option character separately.
        while [ ${#options} -gt 0 ]; do

            # Short options are handled character-by-character.
            option=&quot;${options:0:1}&quot;
            options=&quot;${options:1}&quot;

            # Short options:
            #
            case &quot;$option&quot; in

              h)
                Usage 0
                ;;

              t)
                Type=&quot;$1&quot;
                shift 1
                ;;

              *)
                echo &quot;-$option: Unknown option.&quot; &gt;&amp;2
                exit 1
                ;;

            esac
        done

    fi
done
# Set positional arguments &quot;back&quot;.
set -- &quot;${args[@]}&quot;


#
# The actual script starts here.
#

if [ $# -gt 0 ]; then
    printf '%d command line parameters:\n' $#
    printf '\t\047%s\047\n' &quot;$@&quot;
else
    printf 'No command line parameters.\n'
fi

if test -v Type ; then
    printf 'TYPE was specified as \047%s\047.\n' &quot;$Type&quot;
else
    printf 'TYPE was not specified.\n'
fi</pre>
</div>The way this skeleton works is that the huge loop parses all command line parameters, handles both short and long options (<font face="Monospace">-p </font>or<font face="Monospace"> -p <i>value</i> </font>or<font face="Monospace"> --parameter </font>or<font face="Monospace"> --parameter=<i>value</i> </font>or<font face="Monospace"> --parameter <i>value</i></font>), and finally puts back all non-option parameters into the positional parameters list (<font face="Monospace">$1</font>,<font face="Monospace"> $2</font>,...).<br />
<br />
Option processing stops at<font face="Monospace"> -- </font>so that users can supply files beginning with a dash easier.<br />
<br />
Parameter<font face="Monospace"> - </font>is converted automatically to positional parameter<font face="Monospace"> /dev/stdin</font>, i.e. the standard input &quot;file&quot;. This way users can specify<font face="Monospace"> - </font>to refer to standard input.<br />
<br />
Unknown options will abort the script. Currently, the skeleton supports only the standard options<font face="Monospace"> -h </font>and<font face="Monospace"> --help </font>to output the usage, and an example option<font face="Monospace"> -t <i>TYPE</i> </font>or<font face="Monospace"> --type=<i>TYPE</i> </font>or<font face="Monospace"> --type <i>TYPE</i> </font>.<br />
<br />
Run the skeleton to see how it behaves. Any comments or questions are welcome.</div>

]]></content:encoded>
			<dc:creator>Nominal Animal</dc:creator>
			<guid isPermaLink="true">http://www.linuxquestions.org/questions/blog.php?b=34675</guid>
		</item>
		<item>
			<title>Security.  Malware and vulnerabilities.</title>
			<link>http://www.linuxquestions.org/questions/blog.php?b=34674</link>
			<pubDate>Mon, 16 Apr 2012 02:27:08 GMT</pubDate>
			<description><![CDATA[I'd just like to contrast an example of a win and a fail in relation to dealing with security issues. 
 
Win.  A student found a vulnerability in...]]></description>
			<content:encoded><![CDATA[<div>I'd just like to contrast an example of a win and a fail in relation to dealing with security issues.<br />
<br />
Win.  A student found a vulnerability in Wicd that could result in unauthorised root access.  <a href="http://www.infosecinstitute.com/courses/ethical_hacking_training.html" target="_blank">That vulnerability was patched</a> pretty much the same day most sites reported the problem.<br />
<br />
Fail!  On the other hand, we have the Flashback trojan which apple have only just released tools to fix.  I found a <a href="http://www.intego.com/mac-security-blog/intego-security-memo-september-26-2011-mac-flashback-trojan-horse-masquerades-as-flash-player-installer-package/" target="_blank">report of it's existence</a> going back to September last year...<br />
<br />
Didn't someone once say that given enough eyeballs, all bugs are shallow?</div>

]]></content:encoded>
			<dc:creator>rich_c</dc:creator>
			<guid isPermaLink="true">http://www.linuxquestions.org/questions/blog.php?b=34674</guid>
		</item>
		<item>
			<title>UsR2usr (libLQ version)</title>
			<link>http://www.linuxquestions.org/questions/blog.php?b=34673</link>
			<pubDate>Sun, 15 Apr 2012 21:42:50 GMT</pubDate>
			<description><![CDATA[Here's UsR2usr version 1.5 (using libLQ) 
 
file: src/Usr2usr.cpp 
purpose: allows dummy installations and renaming of paths and rpaths for creating...]]></description>
			<content:encoded><![CDATA[<div>Here's UsR2usr version 1.5 (using libLQ)<br />
<br />
file: src/Usr2usr.cpp<br />
purpose: allows dummy installations and renaming of paths and rpaths for creating binary installations without committing to overwriting original files until you're ready.<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<pre class="bbcodeblock" dir="ltr" style="
		margin: 0px;
		margin-right: -99999px;
		padding: 3px;
		border: 1px inset;
		width: 98%;
		height: 498px;
		text-align: left;
		overflow: auto">// UsR2usr.cpp

#include &lt;stdio.h&gt;        // printf, sprintf, etc.
#include &lt;stdlib.h&gt;       // exit()
#include &lt;unistd.h&gt;       // tons of stuff
#include &lt;malloc.h&gt;       // memory allocation
#include &lt;string.h&gt;       // strings and block comparisons and moves
#include &lt;ctype.h&gt;
#include &quot;version.h&quot;
#include &lt;LQ/slist.h&gt;

void dbg() {
}                // a breakpoint for kdbg.exec

// simplified syntax for comparing and moving str/mem
// case insensitive
#define streq(a, b) (strcasecmp(a, b) == 0)

// case sensitive
#define memeq(buf, str) \
(memcmp(buf, str, strlen(str)) == 0)

// move a string minus terminator
#define memstrcpy(buf, str) \
memcpy(buf, str, strlen(str))

enum {
  FILETYPE_ELF = 101,
  FILETYPE_TEXT,
  // others...
  FILETYPE_BINARY
};

static char errmsg[256];
typedef struct {
  char *buf;
  size_t buflen;
  bool armed_flag;      // = 0;
  bool etc_flag;        // = 0;
  bool elf_only_flag;     // = 0;
  bool pass_filter;
  int filetype;        // elf, text, other binary..
  int scan_number;      // = 0; // true if first file in scan
  const char *filename;
} VARS;

VARS *global_vars;
// #define obj (*global_vars)

VARS *vars_new() {
  VARS *vars = (VARS *) malloc(sizeof(VARS));
  memset(vars, 0, sizeof(VARS));
}

void vars_delete(VARS ** po) {
  // destructor
  if(*po)
    free(*po);
  *po = 0;
}

void obj_setPassFilter(VARS * o);
void obj_setFiletype(VARS * o);

// returns count of replacements proposed
int obj_scanAndReplace(VARS * o);

// returns 0 on success, else fatal
int obj_processFile(VARS * o, const char *filename);


const char *appname;

int usage(int errcode);
int show_version(int errcode);
int do_errmsg(int errcode, const char *msgfmt, const char *errvar);
int reorder_args(int argc, char **argv);

int main(int argc, char **argv) {
  dbg();

  appname = basename(argv[0]);
  int arg_offset = reorder_args(argc, argv);

  if(argc == 1)
    return usage(1);

  if(streq(argv[1], &quot;--help&quot;))
    return usage(0);

  VARS *o = vars_new();

  for(int i = 1; i &lt;= arg_offset; i++) {
    if(streq(argv[i], &quot;--armed&quot;))
      o-&gt;armed_flag = 1;
    else if(streq(argv[i], &quot;--etc&quot;))
      o-&gt;etc_flag = 1;
    else if(memeq(argv[i], &quot;--elf&quot;))  // --elf | --elf-only
      o-&gt;elf_only_flag = 1;
    else if(streq(argv[i], &quot;-v&quot;) || streq(argv[i], &quot;--version&quot;))
      return show_version(0);
    else {
      fprintf(stderr, &quot;Unknown switch '%s'\n&quot;, argv[i]);
      exit(1);
    }
  }

  const char *dirname = argv[1 + arg_offset];

  // get list of files in dirname
  char tmpbuf[4096];
  char **filelist = slist_new();
  int numfiles;

  sprintf(tmpbuf, &quot;find %s -type f&quot;, dirname);
  slist_pipeRead(&amp;filelist, tmpbuf);

  numfiles = slist_count(filelist);

  // tell type of scan
  if(numfiles &gt; 0) {
    printf(&quot;\n&quot;);
    sprintf(tmpbuf, &quot;Scan type selected = [%s, %s]&quot;,
        o-&gt;armed_flag ? &quot;ARMED&quot; : &quot;check&quot;,
        o-&gt;elf_only_flag ? &quot;ELF only&quot; : &quot;all&quot;);
    printf(&quot;%s\n&quot;, tmpbuf);
    for(int i = 0; i &lt; strlen(tmpbuf); i++)
      printf(&quot;-&quot;);
    printf(&quot;\n&quot;);
  } else {
    printf(&quot;%s: No files!\n&quot;, appname);
    return 1;
  }

  for(int i = 0; i &lt; numfiles; i++) {
    const char *filename = filelist[i];
    int fatal = obj_processFile(o, filename);
    if(fatal)
      return 1;

  }
  vars_delete(&amp;o);
  slist_delete(&amp;filelist);
  return 0;
}

int show_version(int errcode) {
  printf(&quot;UsR2usr version %s&quot;, VERSION);
  return errcode;
}


int do_errmsg(int errcode, const char *msgfmt, const char *errvar) {
  if(errvar == 0)
    errvar = (char *)&quot;&quot;;
  sprintf(errmsg, msgfmt, errvar);
  perror(errmsg);
  return errcode;
}


int usage(int errcode) {
#include &quot;usage_str.dat&quot;    // has one %s format for appname

  // test for presence of kdialog for the usage message
  char syscmd[4096];
  sprintf(syscmd, &quot;kdialog -v &gt;/dev/null 2&gt;&amp;1&quot;);
  int err = system(syscmd);

  if(err)
    printf(usage_str, appname);
  else {
    char msg[4096];
    sprintf(msg, usage_str, appname);
    sprintf(syscmd, &quot;kdialog -msgbox \&quot;%s\&quot; -title \&quot;Usage     \&quot;&quot;,
        msg);
    err = system(syscmd);

    if(err)
      printf(usage_str, appname);
  }
  return errcode;
}

int reorder_args(int argc, char **argv) {
  // make literal copy of argv in temporary list
  char **tmp_args = (char **)malloc(argc * sizeof(char **));
  memcpy(tmp_args, argv, argc * sizeof(char **));

  int cnt = 1;        // current copy back number, app path is at [0] still
  int nswitches = 0;      // the value to return

  // copy switches back first
  for(int i = 1; i &lt; argc; i++)
    if(tmp_args[i][0] == '-')
      argv[cnt++] = tmp_args[i];

  nswitches = cnt - 1;    // number of actual switches

  // copy non-switches back next
  for(int i = 1; i &lt; argc; i++)
    if(tmp_args[i][0] != '-')
      argv[cnt++] = tmp_args[i];

  free(tmp_args);
  return nswitches;
}


void obj_setFiletype(VARS * o) {
  do {
    if(memeq(o-&gt;buf + 1, &quot;ELF&quot;))
      printf(&quot;&quot;);
    if(memeq(o-&gt;buf, &quot;\177ELF&quot;))
      printf(&quot;&quot;);
    if(o-&gt;buflen &gt;= 4) {
      if(memeq(o-&gt;buf, &quot;\177ELF&quot;)) {
        o-&gt;filetype = FILETYPE_ELF;
        break;
      }
    }
    int testlen = 32;
    int ascii_flag = 1;
    if(o-&gt;buflen &lt; testlen)
      testlen = o-&gt;buflen;
    for(int i = 0; i &lt; testlen; i++) {
      if(!isascii(o-&gt;buf[i])) {
        ascii_flag = 0;
        break;
      }
    }
    if(ascii_flag &amp;&amp; (testlen &gt; 0)) {
      o-&gt;filetype = FILETYPE_TEXT;
      break;
    }
    // other checks..
    // default
    o-&gt;filetype = FILETYPE_BINARY;
  } while(0);
}

// returns 0 on success, else fatal
int obj_processFile(VARS * o, const char *filename) {
  o-&gt;filename = filename;
  FILE *fp = fopen(filename, &quot;rb+&quot;);
  if(!fp)
    return do_errmsg(1, &quot;Can't open file '%s'&quot;, o-&gt;filename);

  fseek(fp, 0, SEEK_END);
  o-&gt;buflen = ftell(fp);
  fseek(fp, 0, SEEK_SET);

  o-&gt;buf = (char *)malloc(o-&gt;buflen);
  if(!o-&gt;buf)
    return do_errmsg(1, &quot;Can't allocate memory&quot;, 0);

  fread(o-&gt;buf, 1, o-&gt;buflen, fp);

  // check file type and set accessible flag to indicate 
  // whether this is selected to be modified or not.
  obj_setFiletype(o);
  obj_setPassFilter(o);

  // scan for text /UsR or UsR/ and replace with 
  // /usr or usr/
  // save file only if not just checking and
  // filetype matches user selection
  if(o-&gt;pass_filter) {
    int count = obj_scanAndReplace(o);
    if(count &lt; 0)
      return do_errmsg(1, &quot;Can't scan file '%s'&quot;, o-&gt;filename);

    int nbytes;       // for debugger
    if(o-&gt;armed_flag) {
      //fseek(fp, 0, SEEK_SET);
      fseek(fp, 0, SEEK_SET);
      nbytes = fwrite(o-&gt;buf, 1, o-&gt;buflen, fp);
    }
  }
  fclose(fp);
  free(o-&gt;buf);
  return 0;
}

void obj_dumpContext(VARS * o, char *bufptr, bool change) {
  if(!o-&gt;scan_number)
    printf(&quot;\n&quot;);

  o-&gt;scan_number += 1;

  // hex dump 16 bytes of context

  unsigned char *cptr;
  int dumplen = 16;

  cptr = (unsigned char *)bufptr - 6;
  if((char *)cptr &lt; o-&gt;buf)
    cptr = (unsigned char *)o-&gt;buf;

  char *bufend = o-&gt;buf + o-&gt;buflen;
  if(cptr &gt; (unsigned char *)bufend)
    dumplen = (unsigned char *)bufend - cptr;

  if(!change)
    printf(&quot;NOT &quot;);

  printf(&quot;To change in '%s' at offset 0x%0X:\n&quot;, o-&gt;filename,
       bufptr - o-&gt;buf);
  for(int i = 0; i &lt; dumplen; i++) {
    printf(&quot;%0.2X &quot;, cptr[i]);
  }
  printf(&quot; %s\&quot;...&quot;, change ? &quot;CHG: \x1b[1;31m&quot; : &quot;---- \x1b[37m&quot;);
  for(int i = 0; i &lt; dumplen; i++) {
    if(isprint(cptr[i]))
      printf(&quot;%c&quot;, cptr[i]);
    else
      printf(&quot;.&quot;);
  }
  printf(&quot;...\&quot;\x1b[0;30m\n\n&quot;);
}


void obj_showStatus(VARS * o, char *bufptr, bool change) {
  if(o-&gt;armed_flag) {
    printf(&quot;Found 'UsR' in '%s' at 0x%X %s\n&quot;, o-&gt;filename,
         bufptr - o-&gt;buf, change ? &quot;(CONVERTED)&quot; : &quot;(No Change)&quot;);
  } else {
    obj_dumpContext(o, bufptr, change);
  }
}


// returns number of changes made.
int obj_scanAndReplace(VARS * o) {
  int count = 0;
  char *ptr = o-&gt;buf;
  char *bufend = ptr + o-&gt;buflen;

  int found;
  found = 0;
  while(ptr &lt; bufend) {
    found = 0;        // flag found in context
    const char *replstr = 0;  // flag and string to skip
    do {
      // UsR in correct context
      // check for any all at once
      if(strchr(&quot;/U\'\&quot;&quot;, *ptr)) {
        if(*ptr == 'U') {
          static const char *this_str = &quot;UsR/&quot;;
          if(memeq(ptr, this_str)) {
            found++;
            replstr = &quot;usr/&quot;;
          } else if(memeq(ptr, &quot;UsR&quot;)) {
            replstr = &quot;UsR&quot;;
          }
        } else if(*ptr == '/') {
          static const char *this_str = &quot;/UsR&quot;;
          if(memeq(ptr, this_str)) {
            found++;
            replstr = &quot;/usr&quot;;
          }
        } else if(*ptr == '\'') {
          static const char *this_str = &quot;\'UsR\'&quot;;
          if(memeq(ptr, this_str)) {
            found++;
            replstr = &quot;\'usr\'&quot;;
          }
        } else if(*ptr == '\&quot;') {
          static const char *this_str = &quot;\&quot;UsR\&quot;&quot;;
          if(memeq(ptr, this_str)) {
            found++;
            replstr = &quot;\&quot;usr\&quot;&quot;;
          }
        }
      }          // if(strchr

      //  found &amp; show copy count steps
      //        | (replstr &amp; steps | 1step)
      if(found) {
        obj_showStatus(o, ptr, true); // and show 'change'
        memstrcpy(ptr, replstr);
        ptr += strlen(replstr);
        count++;
      } else if(o-&gt;etc_flag) {
        // same thing but for EtC to etc
        if(strchr(&quot;/E\'\&quot;&quot;, *ptr)) {
          if(*ptr == 'E') {
            static const char *this_str = &quot;EtC/&quot;;
            if(memeq(ptr, this_str)) {
              found++;
              replstr = &quot;etc/&quot;;
            } else if(memeq(ptr, &quot;EtC&quot;)) {
              replstr = &quot;etc&quot;;
            }
          } else if(*ptr == '/') {
            static const char *this_str = &quot;/EtC&quot;;
            if(memeq(ptr, this_str)) {
              found++;
              replstr = &quot;/etc&quot;;
            }
          } else if(*ptr == '\'') {
            static const char *this_str = &quot;\'EtC\'&quot;;
            if(memeq(ptr, this_str)) {
              found++;
              replstr = &quot;\'etc\'&quot;;
            }
          } else if(*ptr == '\&quot;') {
            static const char *this_str = &quot;\&quot;EtC\&quot;&quot;;
            if(memeq(ptr, this_str)) {
              found++;
              replstr = &quot;\&quot;etc\&quot;&quot;;
            }
          }
        }        // if(strchr
        if(found) {
          obj_showStatus(o, ptr, true); // and show 'change'
          memstrcpy(ptr, replstr);
          ptr += strlen(replstr);
          count++;
        }
      }

      if(!found)      // not found
      {
        if(replstr) {
          obj_showStatus(o, ptr, false);  // show 'no change'
          ptr += strlen(replstr);
        } else
          ptr++;    // step 1
      }

    } while(0);       // do
  }              // while(bufptr...)
  return count;
}

void obj_setPassFilter(VARS * o) {
  // if filetype = elf or --all then true else false
  o-&gt;pass_filter = false;
  if(o-&gt;filetype == FILETYPE_ELF)
    o-&gt;pass_filter = true;
  else if(!o-&gt;elf_only_flag)
    o-&gt;pass_filter = true;
}</pre>
</div>file: src/version.h<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<pre class="bbcodeblock" dir="ltr" style="
		margin: 0px;
		margin-right: -99999px;
		padding: 3px;
		border: 1px inset;
		width: 98%;
		height: 370px;
		text-align: left;
		overflow: auto">// created 
// #define VERSION &quot;1.0&quot;

// added '--check' option, tweeked help and more options and added version printout
// #define VERSION &quot;1.1&quot;

// minor changes.
// #define VERSION &quot;1.2&quot;

// Feb 2, 2012
// added  gui-based help if supported, made vars an 'object' for better
// debug view, etc.
// #define VERSION &quot;1.3.0&quot;

// Feb 9, 2012
// added /EtC to conversions for stuff like gtk+
// added warn if info/dir is present in share/info directory.
// #define VERSION &quot;1.4.0&quot;

// Apr 15, 2012 
// converted to use libLQ slist funcs
#define VERSION &quot;1.5.0&quot;</pre>
</div>file: src/usage_str.dat<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<pre class="bbcodeblock" dir="ltr" style="
		margin: 0px;
		margin-right: -99999px;
		padding: 3px;
		border: 1px inset;
		width: 98%;
		height: 498px;
		text-align: left;
		overflow: auto">/* usage_str.txt converted with txt2cstr */
const char *usage_str =
  &quot;Usage: %s [switches] dir\n&quot;
  &quot;\n&quot;
  &quot;  For use with 'configure' based installations to install into\n&quot;
  &quot;  prefix=/UsR and then converted to a binary installation into the\n&quot;
  &quot;  real /usr folder.\n&quot;
  &quot;\n&quot;
  &quot;  How: \n&quot;
  &quot;  This application scans and replaces the path UsR found in elf\n&quot;
  &quot;  binaries and other files allowing installation into /UsR and\n&quot;
  &quot;  then changing the path to a real system directory.\n&quot;
  &quot;\n&quot;
  &quot;  Several checks are performed on the text before committing to\n&quot;
  &quot;  a change and it can be first (without the --armed switch( which \n&quot;
  &quot;  you can verify in a hex viewers before creating the binary \n&quot;
  &quot;  installation.  \n&quot;
  &quot;\n&quot;
  &quot;  Is it fool proof?  Pretty close, but some caution is advised.\n&quot;
  &quot;  Keeping a backup of folders and doing a test installation on\n&quot;
  &quot;  your own system to see what changes is just good sense and as\n&quot;
  &quot;  usual, no warantees at this end.  Just best wishes and a bit\n&quot;
  &quot;  of optimism considering the alternatives which you might want\n&quot;
  &quot;  to check out if there are any.\n&quot;
  &quot;\n&quot;
  &quot;  Switches:\n&quot;
  &quot;    [none]          - prints file names and offsets where /UsR is\n&quot;
  &quot;                      found and set to be changed in an armed run.\n&quot;
  &quot;                      Shows a bit of context (hex/ascii dump) and\n&quot;
  &quot;                      can also be used to view in a hex editor.\n&quot;
  &quot;\n&quot;
  &quot;                      Includes text files and other other binaries\n&quot;
  &quot;                      in the scan in addition to elf binaries (the\n&quot;
  &quot;                      default).\n&quot;
  &quot;\n&quot;
  &quot;    --etc             Adds /EtC to /etc conversion for installations \n&quot;
  &quot;                      that need --infodir=/EtC to keep them from \n&quot;
  &quot;                      clobbering installed files.\n&quot;
  &quot;\n&quot;
  &quot;    --armed         - commit to changes reported in dry run (default).\n&quot;
  &quot;\n&quot;
  &quot;    --elf | --elf-only\n&quot;
  &quot;                    - Only change rpaths and other occurrances of \n&quot;
  &quot;                      UsR in a path context in elf binaries (libs\n&quot;
  &quot;                      and executables).\n&quot;
  &quot;\n&quot;
  &quot;  Tips: \n&quot;
  &quot;    * After intalling into prefix=/UsR, tar up the /UsR directory\n&quot;
  &quot;    where it is before moving the files to where you will build\n&quot;
  &quot;    your package to avoid broken links and missing files, etc.\n&quot;
  &quot;\n&quot;
  &quot;    * If after running with no switches and none of the non-elf files\n&quot;
  &quot;      need to be modified, you can add the '--elf' switch for the \n&quot;
  &quot;      armed run.\n&quot;
  &quot;\n&quot;
  &quot;    * For use as a non-root user, any directory tree is assumed to \n&quot;
  &quot;      have come from and is intended to be installed at root.  You \n&quot;
  &quot;      may run this before or after having moved the files.  Don't\n&quot;
  &quot;      run it in the source though. :-)\n&quot;
  &quot;\n&quot;
  &quot;  Note: The /UsR (prefix) folder you install into using the initial\n&quot;
  &quot;  compilation and installation must be located at the root of the\n&quot;
  &quot;  file system.  The number of letters in the path is critical to\n&quot;
  &quot;  this application's ability to accurately modify 'rpath' and other\n&quot;
  &quot;  text after you have installed into the /UsR dummy directory.\n&quot;
  &quot;\n&quot;
  &quot;    Copyright (C) 2012, Rainbow Sally\n&quot;
  &quot;\n&quot; &quot;    Released under the GPL license.\n&quot; &quot;\n&quot;;</pre>
</div>[If you use mc to create the makefile start with the LQ++ template: 'mc2 -fetch LQ++' and edit the OUTNAME = UsR2usr.]</div>

]]></content:encoded>
			<dc:creator>rainbowsally</dc:creator>
			<guid isPermaLink="true">http://www.linuxquestions.org/questions/blog.php?b=34673</guid>
		</item>
		<item>
			<title>Birthday email</title>
			<link>http://www.linuxquestions.org/questions/blog.php?b=34672</link>
			<pubDate>Sun, 15 Apr 2012 21:41:31 GMT</pubDate>
			<description>I want the person or persons who decided to send birthday emails to members ontheir birthdays to stand in front of a mirror and repeat the following:...</description>
			<content:encoded><![CDATA[<div>I want the person or persons who decided to send birthday emails to members ontheir birthdays to stand in front of a mirror and repeat the following: &quot;People don't choose linux because they want the usual microsoft stupidity. People choose linux to get away from that crap.&quot; Now, slap yourself in the head hard enough to leave a red mark. This increases the likelihood of you actually getting a fucking clue. You douchebags have all this crap about &quot;don't waste our time with stupid questions&quot; and then you send me an automated birthday greeting. I don't need an automated birthday greeting from my linux questions group. I don't need one from my bank, or from my telephone company.  I don't need one from my dishwasher or my broom either. My claw hammer, also not. Fuckwits.</div>

]]></content:encoded>
			<dc:creator>fred roellig</dc:creator>
			<guid isPermaLink="true">http://www.linuxquestions.org/questions/blog.php?b=34672</guid>
		</item>
		<item>
			<title>Rethinking network configuration</title>
			<link>http://www.linuxquestions.org/questions/blog.php?b=34671</link>
			<pubDate>Sun, 15 Apr 2012 07:43:39 GMT</pubDate>
			<description>Previously I wrote about configuring interfaces with static IPs based on matching them with what actual network (subnet) the interface is connected...</description>
			<content:encoded><![CDATA[<div>Previously I wrote about configuring interfaces with static IPs based on matching them with what actual network (subnet) the interface is connected to.  Now I'm thinking about it in even more different terms.  But this concept will need some changes in the kernel itself.<br />
<br />
To start with, the kernel already (by default) will &quot;leak&quot; an IP address to other interfaces.  Specifically, if an ARP query comes in on one interface for an IP address only configured on another interface, it will be answered, anyway, on the interface it arrives on.  The concept is explained in the kernel source tree file Documentation/networking/ip-sysctl.txt where it describes the &quot;arp_filter&quot; setting:<br />
<br />
<div style="margin:20px; margin-top:5px; ">
	<div class="smallfont" style="margin-bottom:2px">Quote:</div>
	<table cellpadding="3" cellspacing="0" border="0" width="100%">
	<tr>
		<td class="bbcodeblock" style="border:1px inset">
			
				0 - (default) The kernel can respond to arp requests with addresses from other interfaces. This may seem wrong but it usually makes sense, because it increases the chance of successful communication. IP addresses are owned by the complete host on Linux, not by particular interfaces. Only for more complex setups like load-balancing, does this behaviour cause problems.
			
		</td>
	</tr>
	</table>
</div>So it should make sense to simply have all the host IP addresses collected in one common place.  Then sort out what goes where by where (interface) the ARP queries come in at.  It would still be good to have a way to filter this by policy rules, so you can, for example, disallow certain IPs (or MACs) at certain interfaces.<br />
<br />
Then there is also the issue of which IP address to use as a source IP when initiating outbound IP traffic.  Normally, the best IP address (if that interface has IPs in the destination subnet, that first of those is best) configured on the interface that is the best path to the destination would be used for that.  This much is probably still best solved by exploring the connected subnet to see what is there (ask DHCP, spy on ARP queries, etc).<br />
<br />
But for incoming traffic, a master list of IP addresses to recognize would make more sense.<br />
<br />
More network rethinking ideas will come later.</div>

]]></content:encoded>
			<dc:creator>Skaperen</dc:creator>
			<guid isPermaLink="true">http://www.linuxquestions.org/questions/blog.php?b=34671</guid>
		</item>
		<item>
			<title>Computer Mad Science - UnCMake (to rip parts of cmake-d installations)</title>
			<link>http://www.linuxquestions.org/questions/blog.php?b=34669</link>
			<pubDate>Sun, 15 Apr 2012 00:34:46 GMT</pubDate>
			<description><![CDATA[[See also UsR2usr for creating binary trees without committing to a full install until you can test the installation with this or any other package...]]></description>
			<content:encoded><![CDATA[<div>[See also UsR2usr for creating binary trees without committing to a full install until you can test the installation with this or any other package installer.<br />
<a href="http://www.linuxquestions.org/questions/blog/rainbowsally-615861/usr2usr-liblq-version-34673/">http://www.linuxquestions.org/questi...version-34673/</a> ]<br />
<br />
Bug Fix: Apr 24, 2012<br />
[Corrected file names in the main executable.  Ouch!]<br />
<br />
uncmake-1.1.8 (system) installer/uninstaller<br />
<br />
<a href="http://rainbowsally.net/pub/lq/uncmake-1.1.8.tar.gz" target="_blank">http://rainbowsally.net/pub/lq/uncmake-1.1.8.tar.gz</a><br />
<br />
After installation try this.<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<pre class="bbcodeblock" dir="ltr" style="
		margin: 0px;
		margin-right: -99999px;
		padding: 3px;
		border: 1px inset;
		width: 98%;
		height: 50px;
		text-align: left;
		overflow: auto">uncmake -set ; ls /usr/bin/uncmake.*
uncmake -reset ; ls /usr/bin/uncmake.*</pre>
</div>And watch the files change.  uncmake.state is the flag file and uncmake.dir contains the path to uncmake.txt dump file.<br />
<br />
uncmakefile is also and interesting app.  Not as scary, but then it really needs uncmake to do much of anything really useful.<br />
<br />
Here's the README.<br />
<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<pre class="bbcodeblock" dir="ltr" style="
		margin: 0px;
		margin-right: -99999px;
		padding: 3px;
		border: 1px inset;
		width: 98%;
		height: 498px;
		text-align: left;
		overflow: auto">This is a precompiled binary installer/uninstaller using make.

It installs 'uncmake' and 'uncmakefile' utilities for demystifying
cmake and other opaque make system builds.

To install requires root permissions. It installs all the files 
into /usr/bin, where we presume gcc, g++, and ld are also.  The
files TREE is an image of what gets installed minus the PREFIX
defined in the Makefile.

To install, as superuser type 'make install'.

To uninstall, as superuser type 'make uninstall'.


------------------------------------------------------------------

Uncmake -set and -reset switch between uncmake mode and normal mode
for dumping cmake commands to a file initially named uncmake.txt in
the folder where you execute the 'cmake' command.

It requires root permissions in order to switch states.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
       This is a DANGEROUS but very useful application
               when used with a little caution
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


HOW IT WORKS:

It will change the names of gcc, g++ and ld depending on the 
cmake.state (which is a file in /usr/bin that it creates) so that 
normal gcc, g++, and ld functions can be preempted by the uncmake 
utility when it is set.

Unless you update* while in cmake mode, the original files will be 
named /usr/bin/cmake.&lt;name&gt;.orig.  All of the files involved have
the &quot;cmake.&quot; prefix.

-----------
* There is another potential problem besides updating while uncmake 
is -set as well.  See &quot;NOTE&quot; below.


DANGER:

What makes it dangerous is that uncmake may be in the wrong state 
if there's a power outage, or if you reboot while uncmake-ing.

It should be possible to 'uncmake -reset' after booting back up, but 
the output file will be corrupted by anthing that uses gcc, g++ or 
ld behind the scenes during the boot process.

uncmake doesn't depend on cmake.  It works with the files named above.

And things could get even worse if you upgrade your gcc, g++, or ld 
while uncmake-ing.  There's a good chance you'll have to reinstall 
them if you ever 'uncmake -reset' after this.  If it's already 
-reset when you upgrade there should be no problem since the files 
will all be restored to their original 'state' and cmake.state (the 
state flag file) will have been removed.

The best thing to do if this happens is to uninstall uncmake to 
remove junk files including 'uncmake.state' and reinstall it.  No 
guarantees.  That's untested but should probably work.

Gcc, g++, and ld are the only files affected.  You might want to back 
them up (whether they are symlinks or regular files) as an extra 
measure of safety.

NOTE that in addition to the above possible gotcha's some other 
utilities do the same thing to gcc, g++, and ld and these do not 
play well together.  For example, 'checkinstall' may cause problems 
with uncmake due to unsynchronized changing of these three critical 
files.  (This is unconfirmed but at one time, checkinstall backed up 
some pretty strange files shortly before a reinstall of gcc, g++, and 
ld became necessary.)

And while the scenarios described such as power outages and updating 
are fairly rare, this kind of issue with 'checkinstall' or other
similar apps could happen just as a matter of not knowing whose the 
boss in these situations at any time when both are working at the 
same time.

And one more issue to look out for is that ALL gcc, g++ and ld 
commands will get copied to the uncmake.txt file while uncmake 
is -set.  Even if another user executes commands that invoke these 
applications.  If it's a large file it could be quite time consuming 
to sift through and remove the unwanted portions of the dump.

Best used on a single user system.


USEFUL:

What makes this useful is that we can see the exact commands cmake 
and most other make systems are running.

And with uncmakefile (included in this package) the output file can 
be translated into convenient sub-parcels of make commands that can 
be imported into a makefile in order to work with just one or a small 
handfull of the files you normally can't get at even if you could 
find them nevermind edit, debug, or test.

For example, did you know that kdesu is created by simply linking 
kwrapper.o with the output name kdesu?  That is not at all obvious 
but we can see this in an uncmake dump file.  Once we know this we 
can see that kwrapper takes the name from argv[0] and prefixes that 
name with 'lib' and does the call.  Pretty nifty trick.

FUN:

There are some test&lt;N&gt;.in files in the uncmakefile-sources tarball if 
you want to see what it does.  

And there's a copy of the executable in the TREE folder you can copy 
for testing before committing to installation.

Uncmakefile does NOT require root permissions and is quite safe to play 
with.  :-)</pre>
</div></div>

]]></content:encoded>
			<dc:creator>rainbowsally</dc:creator>
			<guid isPermaLink="true">http://www.linuxquestions.org/questions/blog.php?b=34669</guid>
		</item>
		<item>
			<title>Tiling window management the easy way.</title>
			<link>http://www.linuxquestions.org/questions/blog.php?b=34668</link>
			<pubDate>Sun, 15 Apr 2012 00:07:45 GMT</pubDate>
			<description><![CDATA[Been a couple days but here's a new one.  As a bonus you get to see what I look like. (Well maybe bonus is the wrong word.) 
The floating desktop...]]></description>
			<content:encoded><![CDATA[<div>Been a couple days but here's a new one.  As a bonus you get to see what I look like. (Well maybe bonus is the wrong word.)<br />
The floating desktop metaphor has dominated the modern desktop.  It has it's strengths, but it's weakness make it more time consuming to resize, and work in  multiple windows.  Tiling window management addresses these issues.<br />
<br />
<a href="http://www.youtube.com/watch?v=9F_zd51jNSs" target="_blank">Tiling Window management, the easy way.</a></div>

]]></content:encoded>
			<dc:creator>stretchedthin</dc:creator>
			<guid isPermaLink="true">http://www.linuxquestions.org/questions/blog.php?b=34668</guid>
		</item>
		<item>
			<title>Ch...ch...ch...changes!</title>
			<link>http://www.linuxquestions.org/questions/blog.php?b=34667</link>
			<pubDate>Sat, 14 Apr 2012 21:04:28 GMT</pubDate>
			<description><![CDATA[Over the past few months, I've made a few changes to my desktop hardware. Transplants really, though I might have been better off building a new...]]></description>
			<content:encoded><![CDATA[<div>Over the past few months, I've made a few changes to my desktop hardware. Transplants really, though I might have been better off building a new computer from scratch. Boosted the RAM from 4 GB to 8 GB, more scope for virtualisation. Then a new graphics card to replace the integrated graphics. This is where I slipped up a bit. I got a NVidia 560Ti, but found it was too long, the drive cage got in the way. But since I can't recall seeing the physical dimensions of it anywhere, only the tech. specs, I reckon I'm only 90% to blame for that. :redface: . So I returned it. Got an NVidia 430, but then I found out a 450 would fit - so another swap. And another :redface: . And finally, I replaced the 400 W PSU with a 650 W.<br />
And now for the REALLY embarrassing part. Worth at least a dozen redfaces. I've stated in a few posts on LQ that I'm NOT INTERESTED in Windows 7, and have NO INTENTION of installing it. Well...I've got it, and installed it. Curiosity got the better of me: how would it be on this newly doctored desktop? First impressions: I like it, but not as much as Linux. Slackware will be going back on, of course, in a dual-boot setup. One thing for sure, installing Windows is still as tedious as it ever was. At least that hasn't changed.</div>

]]></content:encoded>
			<dc:creator>brianL</dc:creator>
			<guid isPermaLink="true">http://www.linuxquestions.org/questions/blog.php?b=34667</guid>
		</item>
	</channel>
</rss>

