js call JSON.parse() or eval() to object exception: Uncaught SyntaxError: Unexpected token
Reason : json string include \r\n or \n or \t
resolve : json string .replace(/\r\n/g,"\\r\\n").replace(/\n/g,"\\n").replace(/\t/g,"\\t")
Reason : json string include \r\n or \n or \t
resolve : json string .replace(/\r\n/g,"\\r\\n").replace(/\n/g,"\\n").replace(/\t/g,"\\t")
.SUFFIXES:.c .o
CC=gcc
SRCS=filerw.c
OBJS=$(SRCS:.c=.o)
EXEC=demo
start: $(OBJS)
$(CC) -o $(EXEC) $(OBJS)
@echo '@_@@_@@_@@_@@_@@_@@_@@_@ ok @_@@_@@_@@_@@_@@_@@_@@_@'
.c.o:
$(CC) -Wall -g -o $@ -c $<
clean:
rm -f $(OBJS)
struct person
{
int id;
char name[20];
int age;
int sex;
char tel[20];
};
int main(int arg, char *args[])
{
FILE *p = fopen(args[1], "w");
if (p == NULL)
{
printf("error is %s\n", strerror(errno));
} else
{
printf("success\n");
struct person man;
memset(&man, 0 ...
int main(int arg, char *args[])
{
if (arg <2)
return 0;
DIR *dp;
struct dirent *dirp;
dp = opendir(args[1]);
if (dp == NULL)
{
printf("error is %s\n", strerror(errno));
return 0;
}
while((dirp = readdir(dp)) != NULL)
{
printf("%s\n", dirp->d_name);
}
closedir(dp);
return 0;
}
[root@linux ~]# history [n]
[root@linux ~]# history [-c]
[root@linux ~]# history [-raw] histfiles
-n :number, meaning ' the n command to list the most recent list ' means!
-c :All the history in the current shell delete all content
-a :Will be added into the history currently added instruction in histfiles, if not histfiles, then the ...
pip install virtualenv
virtualenv envfolder(Virtual environment name)
After you create a successful, will generate the corresponding directory files in the current directory.
cd envfolder/
Then start
source ./bin/activate
deactivate
[root@localhost han]#/etc/init.d/mysqld stop
Stop MySQL: [OK]
[root@localhost han]#mysqld_safe --user=mysql --skip-grant-tables --skip-networking &
(Prompt message: [root@localhost han]# nohup: ignoring input and redirecting stderr to stdout Starting mysqld daemon with databases from /var/lib/mysql)
#!/bin/bash
echo "clean all rules before"
iptables -F
iptables -X
echo "setting up default rules"
iptables -P FORWARD ACCEPT
iptables -P INPUT ACCEPT
iptables -P OUTPUT ACCEPT
echo "allow local address"
iptables -A INPUT -i lo -p all -j ACCEPT
echo "allow now connection"
iptables -A INPUT -p all -m state --state ESTABLISHED,RELATED ...
wget http://li.nux.ro/download/nux/dextop/el6/x86_64/nux-dextop-release-0-2.el6.nux.noarch.rpm
(x86_64)
or
wget http://li.nux.ro/download/nux/dextop/el6/i386/nux-dextop-release-0-2.el6.nux.noarch.rpm
(i386)
rpm -ivh nux-dextop-release-0-2.el6.nux.noarch.rpm ...