樹心幽徑

20170505在Ubuntu安裝toshiba356網路印表機
2017/05/05,12:48

在啟動欄的系統設定值點印表機圖案來安裝

alt

20170504用C設計的SavePGM()與SavePBM()影像存檔函數
2017/05/04,15:28

int savePGM(unsigned char *imgb,int width, int height,int maxgray,char *fname)
{
FILE *outfile;
outfile = fopen(fname, "wb");
fprintf(outfile,"P5 %d %d %d ",width,height,maxgray);
for (int y=0;y<height;y++){
    for (int x=0;x<width;x++){
        fprintf(outfile,"%c ",*(imgb+width*y+x));
        }
    fprintf(outfile,"\n");
    }
fclose(outfile);

}


int savePBM(char *img,int width, int height,char *fname)
{
FILE *outfile;
outfile = fopen(fname, "w");
fprintf(outfile,"P1\n%d %d\n",width,height);
for (int y=0;y<height;y++){
    for (int x=0;x<width;x++){
        fprintf(outfile,"%d",*(img+y*width+x)-'0');
        }
    fprintf(outfile,"\n");
    }
fclose(outfile);
}

20170502ubuntu network setup
2017/05/02,10:01

treehrt@hrt:~$ sudo vi /etc/network/interfaces
[sudo] password for treehrt:

# interfaces(5) file used by ifup(8) and ifdown(8)
auto lo
iface lo inet loopback

auto eno1
iface eno1 inet static
address 163.25.20.90
netmask 255.255.255.0
gateway 163.25.20.254
dns-nameserver 163.25.20.1
dns-search kmvs.km.edu.tw

 

treehrt@hrt:~$ sudo /etc/init.d/networking restart
[ ok ] Restarting networking (via systemctl): networking.service.
treehrt@hrt:~$

 
Accessible and Valid XHTML 1.0 Strict and CSS Powered by LifeType