OS:openSuSE Leap-42.1
When I run gnuplot from the shell or a script, the resulting plot flashes by on the screen and then disappears
  1. Put a pause -1 after the plot command in the file, or at the file end.
  2. Use command gnuplot filename.gp - (yes, dash is the last parameter) to stay in the interactive regime when the script completes.
  3. Run gnuplot as gnuplot -persist
  4. On Windows you can also use either -persist or /noend.
  5. Give the persist option as part of the set terminal command.

reference: gnuplot FAQ 7.4

  • If the scale of data is growing bigger and bigger when calculating, try to use logarithm to replace multiplication with addition so that scale will hold down.

Question:

I suppose Perl has a REPL for some simple inputs, but there is not. So I wonder is there a interactive form within Perl itself or I must install some other add-in or REPL programs for Perl.

Answer:
1
perl -de1

also:

1
perl -d -e 1

There also some external implements for Perl`s REPL. Look at reference:

reference: stackoverflow

OS:openSuSE Leap-42.1

  • can’t find X includes

    解决方案:

    安装libxt-dev

  • ‘erase’ was not declared in this scope ns2

      
    解决方案:

    修改ls文件:ns-2.35/linkstate/ls.h

    第137行

    void eraseAll() { erase(baseMap::begin(), baseMap::end()); }

    改为:void eraseAll() { this->erase(baseMap::begin(), baseMap::end()); }

    然后重新 ./install

  • 在nam文件夹下 make 说找不到 X11/xmu/winutil.h

    ns2安装好之后运行“exec nam”是提示“couldn’t execute “nam”: no such file or directory

    在网上查说nam没有安装好,但在ns2下的nam文件夹中编译时又提示找不到 “X11/xmu/winutil.h”

    解决方案:

    在32位系统中 安装 libXmu-dev

    在64位系统中 安装yum install libXmu-devel.i686

    reference:stackoverflow

  • Tcl版本问题

    nam编译安装好之后运行发现Tcl版本不对。

    如下

    nam:
    [code omitted because of length]
    : version conflict for package “Tcl”: have 8.6.1, need exactly 8.5.10
    while executing
    “package require -exact Tcl 8.5.10”

    我印象中电脑里和Tcl有关的python(Tk有用到),但不管怎样现在需要将其替换成Tcl 8.5.10。

    用update-alternatives将/usr/bin下的tclsh替换成ns2目录下的Tcl 8.5.10中的tclsh。

    之后重新编译安装nam,运行nam成功。

Welcome to Hexo! This is your very first post. Check documentation for more info. If you get any problems when using Hexo, you can find the answer in troubleshooting or you can ask me on GitHub.

Quick Start

Create a new post

1
$ hexo new "My New Post"

More info: Writing

Run server

1
$ hexo server

More info: Server

Generate static files

1
$ hexo generate

More info: Generating

Deploy to remote sites

1
$ hexo deploy

More info: Deployment

  在Linux下编写的文件,push到github再clone到Windows下时出现了问题,在git status时出现’Filename too long’。Windows下用的是msys-git,查资料有的说msys用的是老的Windows API,不支持长文件名,但实际上是可以通过配置打开长文件名功能的。

1
git config --system core.longpaths true

reference: stackoverflow

  从手机自带的通讯录导出工具导出VCF文件后,打开发现里面中文部分变成了十六进制的编码,例如:

1
'=48=53'

  利用python提取想要的信息并利用binascii模块进行转换,如

1
name = binascii.a2b_hex(name)

  最后完成的VCF提取工具vcf info extractor

OS:openSuSE Leap-42.1 Win8

  双系统openSUSE42.1和Win7,想要把Win7换成Win8,安装Win8,会覆盖grub2引导。于是现在U盘上装了openSUSE42.1做启动盘,以便安装完win8后修复。
  主要做法是,先挂载root,再把其他分区挂载到root下面,swap无须挂载。例如:

1
2
3
4
5
6
7
8
#root
mount /dev/sdax /mnt

#boot
mount /dev/sday /mnt/boot

#home
mount /dev/sday /mnt/home

  我用的是LVM,其实做法差不多,只不过应该在/dev/mapper下找对应分区。而boot分区并不在LVM中,所以boot挂载和上面一样。

1
2
3
4
5
#root
mount /dev/mapper/XX-root /mnt

#home
mount /dev/mapper/XX-home /mnt/home

  之后执行:

1
2
3
4
5
mount -t proc proc /mnt.proc
mount --rebind sys /mnt/sys
mount --rebind dev /mnt/dev

chroot /mnt /bin/bash

  生成grub2文件:

1
2
3
4
5
6
grub2-mkconfig -o /boot/grub2/grub.cfg

grub2-install /dev/sda

exit
reboot