2017-09-01 AnnatarHe
太多的不同 总所周知,世界上有着太多太多的编辑器。每个编辑器又各不相同,它们具体表现在各式各样的配置文件上,vim 用 vimscript 写配置文件。emacs 用 commonLisp 写配置。sublime text 和 vs code 都是用 json 配置,然而两个配置文件又不能通用。 继续阅读 »
2015-08-31 码农明明桑
android最近的support库提供了AlertDialog,可以让我们在低于5.0的系统使用到跟5.0系统一样的Material Design风格的对话框,但是使用了一段时间想到一些办法去改变对话框按钮字体的颜色,都不生效。 最近在网上找到了改变的方法,首先来说一下。 more 改变AlertDialog的样式 在xml中定义一个主题: xml <!-- Used for the buttons --> <item name="colorAccent">#FFC107</item> <!-- Used for the title and text --> <item name="andr 继续阅读 »
2019-01-10 Alex Sun
一、Hello World 使用镜像的代码为: ```js const http = require('http') const os = require('os') const hostname = os.hostname() const server = http.createServer((req, res) => { res.writeHead(200, { 'Content-Type': 'text/plain' }) res.end(Hello world from ${hostname}) }) 继续阅读 »
2014-01-04 W.Y.
在前端开发的过程中,一个最繁琐的工作就是写 HTML、CSS 代码。数量繁多的标签、属性、尖括号、标签闭合等,让前端们甚是苦恼。于是,我向大家推荐 Emmet,它提供了一套非常简单的语法规则,书写起来非常爽快,然后只需要敲一个快捷键就立刻生成对应的 HTML 或 CSS 代码,极大提高了代码书写效率。 more Emmet 的前身是大名鼎鼎的 Zen coding,它是一个编辑器插件,需要基于指定的编辑器使用,官方网站提供多编辑器支持,目前它支持的编辑器如下: Sublime Text Eclipse/Aptana TextMate Coda Espresso Chocolat Komodo Edit Notepad++ PSP 继续阅读 »
2014-08-29 Mithrilwoodrat
[CDATA[<p class="text" #include include typedef unsigned char * byte_pointer; unsigned replace_byte(unsigned x,unsigned char b,int i); int main() { unsigned x = 0x12345678; unsigned char b =0xab; int i = 0; scanf("%d",&i); printf("%x",replace_byte(x,b,i)); return 0; } unsigned replace_byte(un 继续阅读 »
2016-08-23 craneyuan
本文就关于IO资源的处理问题,提出三种方案。 close()放在try块中 close()放在finally块中 使用try-with-resource语句 close()放在try块中 more //close() is in try clause try { PrintWriter out = new PrintWriter( new BufferedWriter( new FileWriter("out.txt", true))); out.println("the text"); out.close(); } catch (IOException 继续阅读 »
2014-03-22 码农明明桑
Android中提供一种简单的Toast消息提示框机制,可以在用户点击了某些按钮后,提示用户一些信息,提示的信息不能被用户点击,Toast的提示信息根据用户设置的显示时间后自动消失。Toast的提示信息可以在调试程序的时候方便的显示某些想显示的东西,或者给用户提供友好的界面显示效果。 有两种方式去创建并且显示Toast: more Toast.makeText(Context context, int resId, int duration) Toast.makeText(Context context, CharSequence text, int duration) Context为上下文, 继续阅读 »
2014-10-06 Mithrilwoodrat
[CDATA[<p class="text" 在coursera上有个csapp有关的公开课 The Hardware/Software Interface 上面的lib2和csapp上的二进制炸弹实验一样,但是是64位的=.=,于是我还是去 http://csapp.cs.cmu.edu/public/labs.html上下载了一个32位的文件来练习. 下面是第一关的反汇编 Dump of assembler code for function phase_1: 0x08048b20 <+0>: push %ebp 继续阅读 »
2014-09-16 码农明明桑
在Android系统中打开Activity,Service, BroadCast 都需要使用到Intent(意图),那么作为一个开发者就需要知道怎么使用Intent,知道怎么通过Intent的匹配规则打开其他的组件,或者给其他组件提供访问接口。因此在这里总结一下Intent和Intent的匹配规则。 Intent使用示例 显式使用Intent java Intent intent = new Intent(context, XXXActivity.class); intent.putExtra(Intent.EXTRA_TEXT, "string text"); 隐式使用 java Intent intent = new 继续阅读 »
2016-04-18 Jason Liao
D3.js 是一个用来做数据展示的库,可以用它来封装一些成一些基础的数据展示组件,也可以从中学习到 SVG 的知识。现在我们就来学习 D3 吧! Baisc Methods select() 选择一个区域,进行我们的工作 append() 为这个区域添加一个标签 text 为这个标签添加文本内容 attr() 为添加的标签添加属性 继续阅读 »