This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package | |
{ | |
import flash.display3D.Context3D; | |
import flash.display3D.IndexBuffer3D; | |
import flash.display3D.VertexBuffer3D; | |
import flash.utils.ByteArray; | |
import flash.utils.Endian; | |
/** | |
* ... | |
* @author Wisher |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
C/C++ -> Advanced -> Calling Convention = _cdecl | |
C/C++ -> Advanced -> Compile As = Compile as C Code |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
avg, sum = average(10, 20, 30, 40, 50) | |
print("The average is ", avg) | |
print("The sum is ", sum) | |
print("Versioin is ", VERSION) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. 编译命令:cl /I"include" /D "__WIN32__" /MT /Gd /TC main.c /link /LIBPATH:"lib" "wsock32.lib" "ei.lib" "erl_interface.lib" /OUT:"target.exe" | |
2. 定义__WIN32__是因为ei.lib需要这个定义 | |
3. /MT表示构造支持多线程的exe,这是ei.lib的默认配置 | |
4. /Gd表示调用约定为__cdecl,纯C代码的dll或lib一般都要用这个设置(比如Lua) | |
5. /TC表示按照C的格式来编译源代码,这个设置之后源代码里就不需要加入extern "C"的标记了 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <ei.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <fcntl.h> | |
#include <io.h> | |
#include "marsharling.h" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. 被lua调用的C函数里似乎不能动态分配太多内存(char s[1024*1024]),如果使用外面分配好的大内存则没有问题 | |
2. lua_pop永远弹出栈顶的元素,很容易和其他函数的index用法弄混,必须小心 | |
3. 使用setvbuf(stdout, NULL, _IOFBF, MAXBUFSIZE)设置stdout和stdin的buffer尺寸,让其和ei使用的buf尺寸匹配 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{xml, "F:/broadband/cwmp/tr-196-2-0-full.xml"}, | |
{ignore_names, [description, bibliography]}, | |
{ignore_attributes, ['xmlns:dm', 'xmlns:dmr', 'xmlns:xsi', 'xsi:schemaLocation', spec, file, 'dmr:version']} | |
]. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-module(xfl). | |
-author("Wisher"). | |
-email("hustitecwisher@gmail.com"). | |
-export([extract/1]). | |
% All bgm is ogg format, but have a 66 bytes fake wave header.(Liar...) | |
extract(File) -> | |
{ok, Bin} = file:read_file(File), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-module(cwmp). | |
-author("Wisher"). | |
-email("hustitecwisher@gmail.com"). | |
-export([create_model/1]). | |
-include_lib("xmerl/include/xmerl.hrl"). | |
create_model({_, _, Xml}) -> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Solved this by running | |
echo "export TERM=xterm" >> /etc/bash.bashrc | |
in my Dockerfile when building my container. | |
OR: | |
docker run -t -d reds |
OlderNewer