自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

Genesislive的专栏

独学而无友,则孤陋而寡闻

  • 博客(29)
  • 收藏
  • 关注

转载 在Windows下面进行LLVM与CLANG的安装(转载)

在Windows下面进行LLVM与CLANG的安装(转载)原文链接:在Windows下面进行LLVM与CLANG的安装在Windows下面进行LLVM与CLANG的安装目录§ 1 需要环境§ 2 用SVN下载source code§ 3 编译llvm及clang§ 4 安装§ 5 验证与练习需要环境本文

2012-12-27 22:12:30 10706

原创 Erlang 笔试题 2

1、求hd(tl(tl([1,2,3,4,5,6])))的值。2、

2014-04-10 20:14:00 3364 1

原创 Cocos2d-X 3.0 创建项目

Cocos2D-X 3需要使用命令cocos new创建项目,cocos命令在tools\cocos2d-console\bin下面>cocos new --helpusage: cocos new [-h] [-p PACKAGE_NAME] -l {cpp,lua,js} [-d DIRECTORY]                 [-t TEMPLATE_NAME] [

2014-03-28 16:54:28 954

原创 Erlang 笔试题 1

1、写一个函数,功能如下:    0 返回 white    1 返回 green    2 返回 blue   其他 返回 yellow   分别用function clause, case clause, if clause 实现 color1(0) -> white;color1(1) -> green;color1(2) -> blu

2014-03-28 14:10:43 2419

原创 gen_server:terminate/2调用前提

开发过程中遇到gen_server终止时terminate方法没有被调用,这里记录一下如果需要在gen_server终止的时候通过terminate方法保存数据,前提条件:        1、捕获退出信号 erlang:process_flag(trap_exit, true)        2、shutdown策略必须是数值,不能是brutal_kill

2014-03-27 19:24:21 1037

原创 Python Challenge 10 Solution

gist: https://gist.github.com/genesislive/5106789#!/usr/bin/env python# -*- coding: UTF-8 -*- __author__ = 'Genesislive' # http://www.pythonchallenge.com/pc/return/bull.html# username: h

2014-03-27 19:09:01 862

原创 Cocos2D-X 2.2.3 使用CCPhysicsSprite

在Cocos2D-X 2.2.3中,让CCPhysicsSprite支持Box2DVisual Studio配置步骤1:右键libExtensions,选择“配置属性”->“C/C++”->“预处理器”->“预处理器定义”,将CC_ENABLE_CHIPMUNK_INTEGRATION=1改为CC_ENABLE_BOX2D_INTEGRATION=1步骤2:代码添加

2014-03-27 19:08:10 913

原创 CentOS安装SVN脚本

gist:https://gist.github.com/genesislive/6397781

2013-11-30 17:06:26 716

原创 Erlang服务端开发(无需Erlang基础)笔试题

某游戏公司Erlang服务端开发(无需Erlang基础)笔试题,面向C/C++程序员一、用你熟悉的语言解决下面的问题。1、反转输出字符串,并移除其中的空格。2、快速的判断一个数是否素数的方法。3、给一个数组进行排序。4、设计一个背包系统,提供增加、查找、排序等功能。请你设计数据结构。二、给出下面题目的思路5、已知当前位置(x,

2013-11-30 17:02:27 3017 1

原创 Python Challenge 09 Solution

#!/usr/bin/env python# -*- coding: UTF-8 -*- # http://www.pythonchallenge.com/pc/return/good.html __author__ = 'Genesislive' import Image # hint: first+second=? first = [146, 399, 163, 403,

2013-04-22 14:27:05 842

原创 简单的列表解析

简单的列表解析[{"aa",2},{"bb",3},{"aa",3}...],把后面为3的都取出来1> [{A, B} || {A, B} <- [{"aa", 2}, {"bb", 3}, {"aa", 3}], B == 3].[{"bb",3},{"aa",3}]lists:filter(fun(Elem)-> if element(2, Elem) == 3 ->

2013-04-16 11:27:21 865

原创 某游戏公司笔试题(2)

以下是某游戏公司的C++开发的部分笔试题,不分顺序。1、什么是面向对象?面向对象的特征是什么?请简要叙述这些特征。2、用变量a给出下面的定义a) 一个整型数(An integer) b)一个指向整型数的指针( A pointer to an integer) c)一个指向指针的的指针,它指向的指针是指向一个整型数( A pointer to a pointer to

2013-04-03 20:24:16 1522

原创 Python Challenge 08 Solution

#!/usr/bin/env python# -*- coding: UTF-8 -*- __author__ = 'Genesislive' # http://www.pythonchallenge.com/pc/def/integrity.html import bz2 # Python bz2 module: http://effbot.org/librarybook/bz

2013-03-31 11:54:51 830

原创 Python Challenge 06 Solution

gist: https://gist.github.com/genesislive/5098123#!/usr/bin/env python# -*- coding: UTF-8 -*- # http://www.pythonchallenge.com/pc/def/channel.html# # see readme in http://www.pythonchalle

2013-03-31 11:53:23 945

原创 Solve Josephus Problem Using Erlang

Josephus(约瑟夫)问题的数学方法%%%----------------------------------------------------------------%%% @author Genesislive %%% [https://]%%% @copyright 2013 %%% @doc josephus problem%%% @end%%%------

2013-03-27 16:00:51 756

原创 Python Challenge 05 Solution

gist: https://gist.github.com/genesislive/5097610#!/usr/bin/env python# -*- coding: UTF-8 -*- # http://www.pythonchallenge.com/pc/def/peak.html __author__ = 'Genesislive' import urllibim

2013-03-25 17:17:35 743

原创 Erlang Echo Server

-module(tcp_echo). -export([listen/0, listen/1]). -define(DEFAULT_PORT, 1155).-define(OPTION, [binary, {active, false}, {reuseaddr, true}]). listen() -> ListenPort = get_app_env(listen_port,

2013-03-25 17:14:40 1147

原创 Python Challenge 04 Solution

gist: https://gist.github.com/genesislive/5097515#!/usr/bin/env python# -*- coding: UTF-8 -*- # http://www.pythonchallenge.com/pc/def/linkedlist.php import urllib, re uri = 'http://www.

2013-03-20 19:49:11 750

原创 Python Challenge 03 Solution

gist#!/usr/bin/env python# -*- coding: UTF-8 -*- # http://www.pythonchallenge.com/pc/def/equality.html import re # the content of equality.txt is from the# source of equality.htmlwith

2013-03-20 19:48:34 855

原创 Python Challenge 02 Solution

gist: https://gist.github.com/genesislive/5097326#!/usr/bin/env python# -*- coding: UTF-8 -*- # http://www.pythonchallenge.com/pc/def/ocr.html import re # the content of rare_characters

2013-03-17 22:03:48 832

原创 Python Challenge 01 Solution

gist: https://gist.github.com/genesislive/5097213#!/usr/bin/env python# -*- coding: UTF-8 -*- # http://www.pythonchallenge.com/pc/def/map.html import string text = '''g fmnc wms bgblr

2013-03-16 20:09:49 745

原创 某公司笔试题

以下是某游戏公司的C++开发的部分笔试题,不分顺序。1、new, delete, malloc, free的关系。2、delete和free的异同。3、delete和delete[]的差异。4、int function(int num){    count =  0;    while(num)    {        ++count;

2013-03-10 23:03:47 1181

原创 快速排序Python实现

快速排序Python实现gist: https://gist.github.com/genesislive/5081031#!/usr/bin/env python# -*- coding: UTF-8 -*-__author__ = 'Genesislive'def partition(list, start, end): pivot = list[sta

2013-03-04 17:19:24 604

原创 KMP算法

KMP算法gist: https://gist.github.com/genesislive/5081013#include #include void get_nextval(const char *T, int nextval[]){ int j = 0, k = -1; nextval[0] = -1; while (T[j] !=

2013-03-03 14:24:29 547

原创 统计Git提交次数

备忘:统计Git提交次数git log | grep -e 'commit [a-zA-Z0-9]*' | wc -l

2013-01-23 14:58:25 4064

原创 afconvert批量转换文件

将当前目录下面的所有mp3文件转换为8位单通道caff格式Shell 脚本:#!/bin/shfor file in *.mp3 do afconvert -f caff -d LEI8@44100 -c 1 $filedone

2013-01-14 14:44:10 1083

原创 在Windows下面编译Qt的MySQL驱动

在Windows下面编译Qt的MySQL驱动在Windows下面编译Qt的MySQL驱动 1、下载MySQL网址http://dev.mysql.com/downloads/mysql/ ,选择Windows (x86, 32-bit), ZIP Archive 对应的下载。注意要下载完整版,大小在100M以上,因为安装程序提供的库是不完整的,直

2012-12-27 22:15:21 703

原创 NSData和int的互换

NSData和int的互换1、NSData -> intint tmpOffset = 0;[tmpdata getBytes:&tmpOffset];或者[tmpdata getBytes:&tmpOffset length:sizeof(tmpOffset)];在项目中转换出现了一些预想不到的情况,后来给tmpOffset赋了初始值才成功。

2012-12-27 22:14:06 893

原创 Windows下面编译Boost_1_49_0

Windows下面编译Boost_1_49_01、下载Boost_1_49_0.zip或检出Boost源码。svn co http://svn.boost.org/svn/boost/trunk boost-trunkgit clone git://gitorious.org/boost/svn.git boost-trunk 2、解压到编译目录(这里为D:

2012-12-27 22:11:19 1191

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除