Thursday, October 14, 2010
Sum compiler typenotall error
The piece of crud excuse for a compiler has the most meaningless errors ever. "typenotall" means that something BEFORE your type/class (ie the prior line) is missing/wrong like a ";"
Thursday, October 7, 2010
Google Goggles
Well it looks like google has released an image search this stuff is seriously non-trival so anything is better than nothing!
http://www.google.com/mobile/goggles/#text
Get it for the iphone at:
http://itunes.apple.com/us/app/google-mobile-app/id284815942?mt=8
http://www.google.com/mobile/goggles/#text
Get it for the iphone at:
http://itunes.apple.com/us/app/google-mobile-app/id284815942?mt=8
Labels:
google
Wednesday, October 6, 2010
A hacky way to get your class streaming out
Needing a quick way to seem to contents of a classes.. dump it into cout with a overloaded operator<< and an existing print function of some kind with very little fuss..
//complie with g++
#include <iostream>
#include <sstream>
using namespace std;
class A {
public:
A(): str1("Hi"), str2("There") {}
string print()
{
ostringstream out;
out << " str1: " << str1 << endl;
out << " str2: " << str2 << endl;
return out.str();
}
private:
string str1;
string str2;
};
ostream& operator<<(ostream& out, A& val)
{
out << val.print();
return out;
}
int main()
{
A test;
cout << test << endl;
return 0;
}
Monday, October 4, 2010
supressing purecov messages for untested functions
Add the "purecov: begin inspected" blocks around the untestable/difficult to test code.
/* purecov: begin inspected */
void Timer::tickTock()
{
}
/* purecov: end inspected */
Determine the arch type of the executable
file <exe_name>
Sunday, October 3, 2010
Sudo trick to get a root like shell
Here is the command to get a su like shell from sudo
sudo -i
Labels:
system admin
Friday, October 1, 2010
Ksh completion
Here is kshs way of getting file completion. (just another useless fact)
| Keystoke | Action |
|---|---|
| ESC ESC | tab complete |
| ESC = | list possible completions |
| ESC * | expand all possible completions into command line |
Labels:
just another useless fact,
ksh
Subscribe to:
Posts (Atom)