- 浏览: 208171 次
- 性别:
- 来自: 北京
最新评论
-
fuliang:
more cleanner than before
Big Integer Arithmetic -
yaojingguo:
Hi, Liang LiangThanks for the i ...
Redirect and restore stdout in C -
fuliang:
使用gcc编译.cpp,可以使用-lstdc++选项,这样gc ...
Redirect and restore stdout in C
文章列表
libevent is a popular notification library. The API is elegant. And the performance is good. The bad thing is that there is no much information about its implementation. After failing to find such information on the web, I decide to take a look at the source code of libevent. I have analyzed its defa ...
Set password for root.
$mysql -u root
mysql>set password = password('root_password');
mysql>flush privilege;
Allow root connect to this mysql server from anywhere.
mysql>grant all privileges on *.* to 'root'@'%' identified by 'root_password';
mysql>flush privilege;
6.7.8 Initialization of C99 standard has an explanation about initialization. Here is the code to help me understand it.
#include <stdio.h>
int main(int argc, const char *argv[])
{
int auto_no;
static int static_no;
int initialized[5] = {9};
int uninitialized[5]; ...
GCC allows us to give more arguments than needed. But G++ does not allow it. I have checked c99 standard document. I can't find a description of this behavior. So it is possible that GCC has chosen to allow such kind of function invocations.
#include <stdio.h>
void show()
{
p ...
Section 5.5 of The C++ Programming Language (Special 3rd Edition) has a precise explanation about references. I use the following code to help me understand it.
#include <iostream>
#include <vector>
using namespace std;
void a() {
cout << "a-----------------" ...
With Ruby 1.8, require 'rubygems' is needed in Avro Ruby code. I have gone through a pain to figure this out.
Do the following change in syntax/c.vim
syn keyword cOperator sizeof
to
syn keyword cStatement sizeof
4.5 of Advanced Programming in the UNIX programming has a very clear explanation for file access permissions.
Here is an experiment to show the explanation.
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
int main(int arg ...
C extern is confusing. The C Programming Language gives a simple treatment for it. But its usage is quite convoluted in C99 standard ant various C implementations.For a complete understanding of extern keyword and external declaration/definition, we have to refer to C99 standard which is hard to read ...
C++ syntax is complex and counter-intuitive. Here is the code to help me understand const.
#include <stdio.h>
/*
* const data
*/
void constData(const char *arg)
{
// can't be compiled
// *arg = 'A';
arg = "A";
}
void constPointer(char * const p)
{
...
ALT+F2 to open "Run Application" dialog.
Run gconf-editor.
Navigate to apps/nautilus/preferences.
Edit toolbar_items.
Add Up.
Refer to http://ubuntuforums.org/showthread.php?t=659294
Save a copy for all the folders and files.
$ rm -rf .gnome .gnome2 .gconf .gconfd .metacity
Logout and login again.
Refer to http://linuxfud.wordpress.com/2007/02/14/how-to-reset-ubuntugnome-settings-to-defaults-without-re-installing/
$rm ~/.gnome2/Vim
Java does not support unsigned byte. But it is needed for some situations. One
example is UTF-8 encoding. One solution to this problem is to bitwise and the
byte.
// encoding byte for 0x80
byte b = -128;
/*
* 0xff is a integer literal. So 0xff and b need to converted to integer ...
This is how I have solved this problem.
If xulrnner 1.9.2 not installed, run:
$ sudo apt-get install xulrunner-1.9.2
If xulrunner 1.9.1 installed, run:
$ sudo apt-get remove --purge xulrnner-1.9.1
For details, refer to
https://bugs.eclipse.org/bugs/show_bug.cgi?id=304718http ...