• Fedora14下txt乱码 - [About Linux]

    2011-06-19

    Tag:Fedora

    来自Windows的txt文件与Linux下的编码不同导致乱码发生。

    解决办法:Applications->System tools->Configuration editor.

    then: apps->gedit-2->Preferences->encodings.

    在auto_detected属性里加上如图所示的若干中文编码方式。ok。

  • 原因是yum的源不可用。

    解决办法:修改/etc/yum.repos.d/目录下的文件fedora-updates.repo和fedora.repo,将base行的注释去掉,将mirror行注释起来。(做之前先备份)

  • “最近更新Ubuntu至10.04,发现小喇叭的声音选项中“Headphone Jack Sense”功能不见了,播放音乐的时候耳机和音响一起响(笔记本),修复方法:打开新立得,安装gnome-alsamixer,在终端中运 行:gnome-alsamixer,选择“Headphone Jack Sense”即可”

    补充一下:把Speaker推到最小就是把音箱禁音了,耳机对应Headphon。

  • class A
    {
    protect:
        A(){}

    public:
        public A* Get_A
        {
            static A* aa=null
            if(aa==null)   aa=new A();         
            return aa;
        }
    }

  • 具体介绍http://msdn.microsoft.com/zh-cn/library/ydd48eyk(VS.90).aspx

    DataRowCollection.Find()是用主键的值来找个记录。比如

    DataColumn[] key = new DataColumn[1];
    key[0] = thisDataSet.Tables["xsb"].Columns["学号"];
    thisDataSet.Tables["xsb"].PrimaryKey = key;
    DataRow findrow = thisDataSet.Tables["xsb"].Rows.Find(xh);   //xh是主键的值
    findrow.Delete();
    thisAdapter.DeleteCommand = new MySqlCommand("delete from xsb where 学号='" + xh + "'",conn);
    return thisAdapter.Update(thisDataSet, "xsb");

    但当如果主键是由多列组成时,则要用一个数组作为参数。

    DataColumn[] key = new DataColumn[2];
    key[0] = thisDataSet.Tables["cjb"].Columns["学号"];
    key[1] = thisDataSet.Tables["cjb"].Columns["课程号"];
    thisDataSet.Tables["cjb"].PrimaryKey = key;
    string[] aa={xh,kch};
    DataRow findrow = thisDataSet.Tables["cjb"].Rows.Find(aa);
    findrow.Delete();
    thisAdapter.DeleteCommand = new MySqlCommand("delete from cjb where 学号='" + xh + "' and 课程号='" + kch + "'", conn);
    return thisAdapter.Update(thisDataSet, "cjb");