跳至主要内容

博文

Windows 10 Version 1709 的累积更新失败

笔记本的Windows 10自动更新要求重启,但是重启之后提示说更新安装失败。再次尝试,重启后还是如此,于是陷入了这个魔咒无法脱身。 后来查了Google,发现都不如Windows自带的链接管用,根据KB的号码找文档,可以下载到相应的独立更新安装包。 另外还参考了一个[微软的官方客服回答](https://answers.microsoft.com/en-us/windows/forum/windows_10-windows_install/getting-error-0x80070bc2-doing-cumulative-update/24e80681-eb22-4439-8677-638fce437186?page=7)执行了如下cmd操作: ``` SC config wuauserv start=auto SC config bits start=auto SC config cryptsvc start=auto SC config trustedinstaller start=auto ```

Dev's Ranting - Hibernate batch processing

Recently I have been working on a performance issue of a small application. It utilizes Hibernate to delete a lot of entities from database. Unfortunately the application died throwing a `OutOfMemoryError`. After discussing with my colleagues and reading some posts about how Hibernate works in batch mode, it appears to me that Hibernate's batch mode (`order_inserts` and/or `order_updates`) may played some role in this issue. Ref: * [Why is Hibernate batching / order_inserts / order_updates disabled by default](https://stackoverflow.com/questions/27755461/why-is-hibernate-batching-order-inserts-order-updates-disabled-by-default) * [Hibernate Batch Processing - Why you may not be using it. (Even if you think you are](https://abramsm.wordpress.com/2008/04/23/hibernate-batch-processing-why-you-may-not-be-using-it-even-if-you-think-you-are/)

PowerShell Exercises - Rename file names in batch

以前用TotalCommander来做batch rename的,GUI下输入pattern挺方便的。现在的PC上没有安装,于是要靠命令行了。 好在PowerShell的pipe也不算太糟糕: Get-ChildItem directory | Rename-Item -NewName { $_.Name -replace '^filename_+','' } 如果有多个 patterns 需要替换可以使用多组 `-replace` 表达式组合。

组合使用 you-get 和 ffmpeg

最近对 `you-get` 这个神奇的下载器挺感兴趣的,用它在油管上下了一些MV,顺手下了另一个大名鼎鼎的工具 `ffmpeg` 将歌曲转换为 MP3。 > you-get -o D:\DOWNLOAD http://some-url 假定文件保存为 `'some-mv.mp4'`, > ffmpeg -i D:\DOWNLOAD\some-mv.mp4 -vn -ab 256k some.MP3。 有的时候如果需要截取部分来转换,可以加上两个参数 `-ss` 和 `-to`: > ffmpeg -i D:\DOWNLOAD\some-mv.mp4 -vn -ab 256k -ss 00:03:12 -to 04:15:43 sub-convert.mp3 简单的参数解释: + `-vn` 不要视频,也就是转换为音频格式 + `-ab bitrate` 指定音频的比特率 + `-ss time_offset` 指定从哪个时间点开始 + `-to time_stop` 指定停止的时间点 当然 `ffmpeg` 提供的参数远不止这些,[这里](http://blog.topspeedsnail.com/archives/1699)有一片不错的使用介绍可以参考。

From markdown to PDF using Pandoc

花了点儿时间玩 Pandoc,将一些 Markdown 文档转换为 PDF 文档。 首先参考[官方文档](https://pandoc.org/installing.html)在 Mac OS 上安装了 Pandoc: > You can install pandoc using homebrew: `brew install pandoc`. > > There is a package installer at pandoc’s download page. If you later want to uninstall the package, you can do so by downloading this script and running it with perl uninstall-pandoc.pl. > > We also provide a zip file containing the binaries and man pages, for those who prefer not to use the installer. Simply unzip the file and move the binaries and man pages to whatever directory you like. > > For PDF output, you’ll also need LaTeX. Because a full MacTeX installation takes more than a gigabyte of disk space, we recommend installing BasicTeX (64M) and using the tlmgr tool to install additional packages as needed. If you get errors warning of fonts not found, try `tlmgr install collection-fontsrecommended` 安装了 BasicTex 之后一直在 Apps 里寻找 `LaTex` 或是 `BasicTex` 这样的应用,但是一无所获(?!) 后来跑到 MacTex...

Code to Graph

花了点儿时间寻找适合 code 转换为 graph 的工具,发现了 pandoc 和 Graphviz。 [Graphviz](https://graphviz.gitlab.io/documentation/) 貌似比较有趣,下载了一个Windows的版本,安装之后在 Win10 上没有任何的图标添加,要自己到安装目录下找到 `bin/gvedit.exe` 打开。 另外找到了一篇[很详细的攻略](http://blog.jobbole.com/94472/)来学习如何使用 Dot 语言来绘图。

解决由ATI显卡驱动导致的爆音

一直以来电脑有个问题,在开始播放音乐或是看片的时候,音箱里首先一下爆音。如果播放的音频时间很短,那么干脆就听不见——甚至连Windows的开机声音也没有。 花了点儿功夫求助Google,初步得到的结论是由于PC上的ATI显卡驱动和主板的Realtek音频驱动有冲突导致的。后来找到了 [Realtek 官网所提供的 High Definition Audio Codecs](http://www.realtek.com.tw/downloads/downloadsCheck.aspx?langid=1&pfid=24&level=4&conn=3&downtypeid=3),其中有一个专门为 ATI 设备编写的驱动名为『ATI HDMI Audio Device』,版本是R2.70,虽然最后的更新时间是五年前(2012/6/2)不过这不重要,果断下载安装。 重启后一切搞定~