这是我的汇编级代码......
section .text
global _start
_start: mov eax, 4
mov ebx, 1
mov ecx, mesg
mov edx, size
int 0x80
exit: mov eax, 1
int 0x80
section .data
mesg db 'KingKong',0xa
size equ $-mesg
Run Code Online (Sandbox Code Playgroud)
输出:
root@bt:~/Arena# nasm -f elf a.asm -o a.o
root@bt:~/Arena# ld -o out a.o
root@bt:~/Arena# ./out
KingKong
Run Code Online (Sandbox Code Playgroud)
我的问题是全球_start用于什么?我和Mr.Google试了一下运气,我发现它用来说明程序的起点.为什么我们不能_start告诉程序在哪里开始,如下面给出的那个在屏幕上产生一种警告
section .text
_start: mov eax, 4
mov ebx, 1
mov ecx, mesg
mov edx, size
int 0x80
exit: mov eax, 1
int 0x80
section .data …Run Code Online (Sandbox Code Playgroud) 我尝试开发第一个从网上下载图像并在gridview中显示它们的应用程序.gridview是主Activity的片段.下载过程是使用onCreate函数中的AsyncTask完成的.为了在更改方向时不再下载图像,我android:configChanges="orientation|screenSize"在Android Manifest中设置了它.然后onCreate函数只调用一次,一切都很好......除了我必须在横向模式下对gridview片段的布局进行一些更改.所以我创建了2个布局表:fragment_library.xml并fragment_library_land.xml在布局/文件夹中.为了使这些更改起作用,我尝试使用onConfigurationChanged函数手动更改库片段的布局.在运行时,程序会评估函数并传递好的情况(纵向或横向),但使用的布局仍然是纵向模式:fragment_library.xml...
public class LibraryFragment extends Fragment {
public GridView gridview;
private Boolean isImageAdapterPopulated = false;
@Override
public void onCreate(Bundle savedInstanceState){
super.onCreate(savedInstanceState);
GetLibraryTask getLibraryTask = new GetLibraryTask(this);
getLibraryTask.execute(Config.URL + "action=getLibrary");
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
if (container == null)
return null;
// gridview
View V = inflater.inflate(R.layout.fragment_library, container, false);
gridview = (GridView)V.findViewById(R.id.gridview);
if(this.isImageAdapterPopulated)
this.setGridAdapter();
return V;
}
@Override
public void onConfigurationChanged(Configuration newConfig){
super.onConfigurationChanged(newConfig);
if (newConfig.orientation == …Run Code Online (Sandbox Code Playgroud) 如果我有一些示例数据,如何将其放入SQLite(最好是全自动的)中?
{"uri":"/","user_agent":"example1"}
{"uri":"/foobar","user_agent":"example1"}
{"uri":"/","user_agent":"example2"}
{"uri":"/foobar","user_agent":"example3"}
Run Code Online (Sandbox Code Playgroud) 我现在确实想运行 lua 或任何类似的东西来解析 GitHub 的请求并验证它,然后删除一个文件(当然,如果请求有效)。
最好所有这一切都应该在没有维护额外 PHP 安装的麻烦的情况下发生,因为目前没有,或者需要使用 fcgiwrap 或类似的。
在 nginx 方面,我有相当于
location /deploy {
# execute lua (or equivalent) here
}
Run Code Online (Sandbox Code Playgroud)