Monday, 30 September 2013

Icons on the desktop do not state the name of the file/directory?

Icons on the desktop do not state the name of the file/directory?

How do I fix the desktop icon which don't show the file/directory names
they are associated with and has an icon size which is to small to be on
the desktop?
I scanned through unity-tweak-tool but found no option option relevant to
this.
Ubuntu 13.04 it is.
Screenshot:

Does case carry into an appositive=?iso-8859-1?Q?=3F_=96_german.stackexchange.com?=

Does case carry into an appositive? – german.stackexchange.com

I'll ask this question in English, because I'm not sure I could articulate
it well enough in German. So this question too is about my essay. The
relevant part of the original sentence was «...die …

Placing numeric value into an Array range

Placing numeric value into an Array range

I have an array that has numeric values stored. like this:
$ranges = array(1=> '33', 2=> '66', 3=> '99');
i have a variable called $result that gives me a dynamic value between 0-100.
for example:
If $result is equal to or greater than 33 AND less than 66, then the
returned key should be 1
If $result is equal to or greater than 66 AND less than 99, then the
returned key should be 2
If $result is equal to or greater than 99, then the returned key should be 3
Any ideas on how this can be achieved?

How to use profilling for Mac OS X Applications?

How to use profilling for Mac OS X Applications?

I am looking forward to do some profiling to find cpu usage of my
application. Also in which part of the code its taking more cpu time. I am
fresh to the profiling. I need help regarding this,

Sunday, 29 September 2013

Jquery Form plugin : dynamic target/multiple forms

Jquery Form plugin : dynamic target/multiple forms

I am using the form plugin from http://malsup.com/jquery/form/
I am trying to set the target div to be updated dynamically. At the moment
this is what the code looks like but instead I want to pas a different
value for target through a hidden form field, so the #target2 can be
dynamically changed to #target20, #target40 etc. Thanks.
<script type="text/javascript">
$(document).ready(function() {
$('.htmlForm').ajaxForm({
target: '#target2',
success: function() {
$('#target2').fadeIn('slow');
}
});
});
</script>
and the form html
<form class="htmlForm" action="ajax-data.php" method="post">
<input type="hidden" name="target" value="ztest" />
Message: <input type="text" name="message" value="Hello HTML" />
<input type="submit" value="Echo as HTML" />
</form>
and the div to be updated
<div id="ztest"></div>
another form
<form class="htmlForm" action="ajax-data.php" method="post">
<input type="hidden" name="target" value="ztest2" />
Message: <input type="text" name="message" value="Hello HTML" />
<input type="submit" value="Echo as HTML" />
</form>
and another div to be updated
<div id="ztest2"></div>

How to differentiate between pipe and interactive stdin

How to differentiate between pipe and interactive stdin

So far, I have that if the filename argument (fname) is left empty, the
program reads stdin automatically.
if (!strcmp(fname, ""))
fin = stdin;
But I need to know whether that stdin was piped in, or interactive,
because I could possibly get something like:
rsm: reading from (stdin)
^Z
rsm:(stdin):1: not an attribute: `&#8730;&#9496;2ç&#8745;'
if interactive input was used. Is there some sort of library function I
could use?

How to correctly extend a class in C++ and writing its header file?

How to correctly extend a class in C++ and writing its header file?

I'm pretty new to C++ and I'm trying to create my first little project. I
encounter some problems during compilation. It says C2504 Person: base
class undefined. I know that, in a header file, I need to declare or
include tha class that I'm extending in the correspondent *.cpp file. I'll
write the code to understand better.
main.cpp
#include <Windows.h>
#include "client.h"
using namespace person;
using namespace std;
int __stdcall WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPTSTR lpCmdLine,
int cmdShow)
{
try
{
Person *p = new Client;
// DO STUFF
}
catch(Exception &e)
{
//Error, so let's exit 1
return 1;
}
//No errors, so we return with 0
return 0;
}
client.cpp
#include <time.h>
#include <ctype.h>
#include <string>
#include "client.h"
using namespace person;
using namespace std;
class Client : public Person {
public:
Client()
{
//DO STUFF
}
void onMessage(const char * const message)
throw(Exception &)
{
//DO STUFF
}
private:
void gen_random(char *s, const int len) {
//DO STUFF
}
};
client.h
#ifndef CLIENT_H
#define CLIENT_H
#include "person.h"
class Client : public Person {
public:
Client();
void onMessage(const char * const message) throw(Exception &);
private:
void gen_random(char *s, const int len);
};