Linux USB声卡USB音箱不发声的问题


刚入手的USB音箱VK-01在ubuntu上试了下,居然没有声音,鼓捣一会儿后,终于解决了,其实方法真的很简单,现在共享出来

1.运行" sudo aplay -l " 命令,看系统是否支持USB声卡,如果不支持的话,则要去搜驱动下载安装了
sudo aplay -l
  1. **** PLAYBACK 硬體裝置清單 ****
  2. card 0: Intel [HDA Intel], device 0: ALC269 Analog [ALC269 Analog]
  3.   子设备: 1/1
  4.   子设备 #0: subdevice #0
    ......

用CSS3实现鼠标经过(hover)元素旋转


具体请看DEMO, (IE浏览器无效)

创建系统管理员X开发X客户X其他X.btn-gray { border-radius: 2px 2px 2px 2px;font-size: 13px;font-weight: bold;height: 27px;line-height: 27px;margin-right: 16px;min-width: 54px;outline: 0 none;padding: 0 5px;text-align: center; background-color: #F5F5F5;background-image: -moz-linear-gradient(center top , #F5F5F5, #F1F1F1);border: 1px solid rgba(0, 0, 0, 0.1);color: #444444;cursor:pointer;-moz-user-select: none;float:left; }.btn-gray:hover { background-color:#f8f8f8;border:1px solid #c6c6c6;background-image: -moz-linear-gradient(center top , #f8f8f8, #f1f1f1);color:#333333;box-shadow:0 1px 1px rgba(0,0,0,0.1) }.btn-gray:active { border:1px solid transparent;box-shadow:0 0 0 1px #ffffff inset;outline:0 none transparent }.btn-orange { background-color:#D14836;background: -moz-linear-gradient(center top , #DD4B39, #D14836) repeat scroll 0 0 ;border: 1px solid transparent;color: #FFFFFF;text-shadow: 0 1px rgba(0, 0, 0, 0.1);-moz-user-select: none;height: 27px;line-height: 27px;min-width: 54px;outline: medium none;padding: 0 8px;text-align: center;cursor:pointer;font-size:14px;border-radius: 2px 2px 2px 2px;margin-right: 16px;float:left; }.btn-orange:hover { background: -moz-linear-gradient(center top , #DD4B39, #C53727) repeat scroll 0 0 #D14836;color:#FFFFFF;box-shadow:0 1px 1px rgba(0,0,0,0.2);border-color:#b0281a #b0281a #af301f;border-style:solid;border-width:1px; }.btn-orange:active{ background-color:#b0281a;border:1px solid #992a1b;box-shadow:0 1px 2px rgba(0,0,0,0.3) inset;background-image: -moz-linear-gradient(center top , #DD4B39, #b0281a) }.hover-icon { margin-left:5px;width:
......

ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' 的解决办法


春节休假完毕,刚上班,从JIRA上领了一个任务,在本地调试了下,发现mysql服务启动不了, 于是检查mysql的权限和配置,没有发现问题,遂运行以下命令:

代码如下
  1. mysql -u root -p
返回结果
  1. ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
代码如下

  1. ......

wordpress---置顶(sticky)功能排序(order by)


wordpress中有一个很好用的功能--置顶, 现在来研究下使用方法:设置:在列表页点快速编辑(Quick Edit), 然后把置顶勾上,如图


使用:
  1. ......
  2. $sticky = get_option('sticky_posts');
  3. $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
  4. query_posts
    ......

wordpress ---- 相册插件[NextGEN Gallery] 404 错误解决办法


最近wordpress网站出现404错误, URL类似于:
http://www.xxxxxx.com/gallery/10-really-expensive-christmas-gifts/gallery/image/louis-vuitton-condom
http://www.xxxxxx.com/gallery/awesome-gifts-a-man-should-ask-for/gallery/image/louis-vuitton-condom
http://www.xxxxxx.com/gallery/12-must-play-christmas-songs/gallery/image/louis-vuitton-condom
......

看这地址就知道插件开启了Activate permalinks,


遂用下面地址访问
http://www.xxxxxx.com/gallery/10-really-expensive-christmas-gifts/?pid=122
发现能正常访问,初步判断应该是RewriteRules出问题了;

最后查看[NextGEN Gallery]插件源码,一步步排查,发现这个插件不支持此类型的地址
http://www.xxxxxx.com/gallery/10-really-expensive-christmas-gifts/gallery/image/louis-vuitton-condom
仅仅支持此类型的
http://www.xxxxxx.com/10-really-expensive-christmas-gifts/gallery/image/louis-vuitton-condom

打印出RewriteRules就很明白了:
代码如下
  1. [([^/]+)/gallery/page-([0-9]
    ......

用wubi安装ubuntu,开机后出现try(hd0,0) NTFS 'prefix' is not set 的解决办法


用wubi安装ubuntu,开机后出现
  1. Try (hd0,0):NTFS:error:"prefix" is not set
  2. error:NO such device:/ubuntu/disks/root.disk

Try (hd0,0):NTFS:error:"prefix" is not seterror:NO such device:/ubuntu/disks/root.disk然后就进入到了grub>命令行,grub启动菜单显示不了解决办法:

重启后进入到win7,找到ubuntu的安装目录,在隐藏文件夹found.000/dir0000.chk/   找到root.disk . 然后在ubuntu目录下面新建文件夹disks,把found.000/dir0000.chk/目录下面的所有文件都移动到这里,最后重启,就能进入到ubuntu了,

===========================================
看来这个问题挺常见的,天天都有人搜进来,还有一种情况是:

/ubuntu/disks目录下面的文件都存在,found.000里面也没有任何文件,但还是报错, "prefix" is not set
真的挺纠结的,试了很多种方法都不行,最后这样操作:
1. 把/ubuntu/disks/目录下面的所有文件移动到found.000目录下面

......

"android.view.ViewRoot$CalledFromWrongThreadException: Only the original thread that created a view"的解决方法


 最近在学习Android, 在创建线程的时候操作视图出现了问题:

代码如下
  1. 09-20 08:42:44.234: ERROR/AndroidRuntime(399): android.view.ViewRoot$CalledFromWrongThreadException: Only the original thread that created a view hierarchy can touch its views.

找了好久资料才知道,线程里面操作视图要在Handler里面,而不能在主线程里面

下面是原来的代码:
代码如下
  1.  

  2. ......

在Linux中使用yuicompressor


使用步骤:1.安装java环境2.将yuicompressor.jar放在任意目录,比如/opt/software/yuicompressor/yuicompressor.jar3.编写bash脚本,保存为yui.sh
  1. #!/usr/bin/env bash
  2. java -jar /opt/software/yuicompressor/yuicompressor.jar $1 > $2
4.运行命令使yui.sh可执行
  1. chmod +x /opt
    ......

conflicting types for ‘getmaxx’|conflicting types for ‘getmaxy’


在ubuntu下安装TurboC,make的时候出现了以下错误:
代码如下
  1. cc -O0 -g -DWITH_X -I/usr/X11R6/include -Wall -c -funsigned-char -o arc.o arc.c
  2. In file included from arc.c:36:0:
  3. graphics.h:485:12: error: conflicting types for ‘getmaxx’
  4. /usr
    ......

在wordpress二次开发中实时清空W3 Total Cache缓存


在wordpress二次开发中,假如用到了W3 Total Cache插件,那么在程序中也许需要清空一下缓存, 研究了下W3 Total Cache的源码,发现可以用以下方法实现实时清空W3 Total Cache的缓存,而不用专门跑到它的设置页面清空
代码如下
  1. update_option('widget_unit2_settings',serialize($arr));
  2. if(class_exists('W3_Plugin_TotalCache')){
  3.      //flush cache
  4.     
    ......

Search On Site