首页 \ 问答 \ 实现页面卷曲功能(Implementing page curl feature)

实现页面卷曲功能(Implementing page curl feature)

我正在创建一个类似于iphone地图应用程序的地图应用程序。 我需要具有页面卷曲功能,与地图应用程序中的相同。 在这种情况下需要帮助。


I am creating a map application similar to the iphone map app. I need to have the page curl feature, same as that in the map app. Need help in this case.


原文:https://stackoverflow.com/questions/8443280
更新时间:2024-03-26 08:03

最满意答案

在Linux上,该进程使用内存映射将可执行文件的文本部分和共享库直接映射到正在运行的进程内存。 所以如果你可以覆盖可执行文件,它会影响正在运行的进程。 但是,禁止写入映射为执行的文件 - 您会收到“文本文件忙”错误。

但是,您仍然可以重新编译该程序。 如果编译器(实际上是链接器)出现此错误,它将删除旧的可执行文件并创建一个新文件。 在Unix上,如果删除正在使用的文件,则文件内容实际上并未从磁盘中删除,只删除目录条目中的引用; 在所有对它的引用(目录项,文件描述符和内存映射)消失之前,该文件并未完全删除。 因此,正在运行的进程将继续映射到旧的无名文件。 您可以通过以下演示来看到这一点:

barmar@dev:~$ ls -li testsleep
229774 -rwxr-xr-x 1 barmar adm 4584 Apr 24 04:30 testsleep
barmar@dev:~$ ./testsleep &
[1] 17538
barmar@dev:~$ touch testsleep.c
barmar@dev:~$ make testsleep
cc     testsleep.c   -o testsleep
barmar@dev:~$ ls -li testsleep
229779 -rwxr-xr-x 1 barmar adm 4584 Apr 24 04:32 testsleep

当我在程序运行时重新编译程序时,inode号从229774改为229779 ,表示创建了一个新文件。


On Linux, the process uses memory mapping to map the text section of the executable file and shared libraries directly into the running process memory. So if you could overwrite the executable file, it would affect the running process. However, writing into a file that's mapped for execution is prohibited -- you get a "Text file busy" error.

However, you can still recompile the program. If the compiler (actually the linker) gets this error, it removes the old executable file and creates a new one. On Unix, if you remove a file that's in use, the file contents are not actually removed from the disk, only the reference from the directory entry is removed; the file isn't fully deleted until all references to it (directory entries, file descriptors and memory mappings) go away. So the running process continues to be mapped to the old, nameless file. You can see this with the following demonstration:

barmar@dev:~$ ls -li testsleep
229774 -rwxr-xr-x 1 barmar adm 4584 Apr 24 04:30 testsleep
barmar@dev:~$ ./testsleep &
[1] 17538
barmar@dev:~$ touch testsleep.c
barmar@dev:~$ make testsleep
cc     testsleep.c   -o testsleep
barmar@dev:~$ ls -li testsleep
229779 -rwxr-xr-x 1 barmar adm 4584 Apr 24 04:32 testsleep

The inode number changed from 229774 to 229779 when I recompiled the program while it was running, indicating that a new file was created.

相关问答

更多
  • 这就是我所做的: - 一旦我的属性被设置,我把所有必须在堆栈中执行的步骤名称, - 我创建了一个决定器,弹出堆栈,并决定哪一步必须通过返回新的FlowExecutionStatus。 Hejk Here is what I did: - once my properties are set, I put all the step names which has to be executed in a Stack, - I have created a Decider which pops the Stack ...
  • 通过SSH连接到群集并从终端应用程序启动程序“解决”问题。 movies.dat文件也需要在集群本地文件系统上。 Connecting to the Cluster via SSH and starting the program from the Terminal App "solves" the problem. The movies.dat file needs to be on the clusters local file system, too.
  • 关于内存使用情况,如果您定义宏CALC_EXACT_MALLOC_SIZE (不确定在哪里,但在ruby.h可能有效)并重新编译Ruby,您将能够调用GC.malloc_allocated_size来了解malloc分配了多少内存(几乎所有内容),以字节为单位 No, it appears it is not possible.
  • 那将是一个有趣的功能请求! 也许InstallShield可以被教导尊重(理论上) ISSuppressLogging属性的值,该属性在立即操作时或者在安排延迟操作时是非空的。 但是现在不可用,并且需要对InstallShield的自定义操作进行基于代码的更改。 回到现在。 InstallShield没有提供任何选项来抑制其日志记录语句,至少在它明确尝试支持的几种情况下,因此您可能会留下以下可能无法满足您需求的选项: 使用MsiHiddenProperties显式阻止记录特定属性的值。 请注意,有几个操作会 ...
  • 在Linux上,该进程使用内存映射将可执行文件的文本部分和共享库直接映射到正在运行的进程内存。 所以如果你可以覆盖可执行文件,它会影响正在运行的进程。 但是,禁止写入映射为执行的文件 - 您会收到“文本文件忙”错误。 但是,您仍然可以重新编译该程序。 如果编译器(实际上是链接器)出现此错误,它将删除旧的可执行文件并创建一个新文件。 在Unix上,如果删除正在使用的文件,则文件内容实际上并未从磁盘中删除,只删除目录条目中的引用; 在所有对它的引用(目录项,文件描述符和内存映射)消失之前,该文件并未完全删除。 ...
  • 这是通过java配置使用拆分的示例。 在此示例中,流1和2将并行执行: @Configuration public class BatchConfiguration { @Autowired private JobBuilderFactory jobBuilderFactory; @Autowired private StepBuilderFactory stepBuilderFactory; @Bean public Tasklet tasklet() ...
  • 您正在创建一个匿名函数并立即执行( IIFE ) 然后,在此范围函数中: 你声明一个值为g a var 您声明了一个名为foo的函数,该函数具有父函数作用域(IIFE作用域)的可见性。 所以它可以看到a变量。 不立即调用此foo函数。 在log语句中,执行foo : 记录a(值g ) IIFE范围中a var更改为值7 foo什么都不返回 然后记录: foo返回undefined值(无返回值) a值,执行foo后为7 。 所以你在控制台中: g undefined 7 You are creating a ...
  • 这是很久以前的问题,但答案是:只在ThreadLocal变量中保持状态,或者更好地将ThreadLocal变量包装在您自己的一个类中。 例如,请使用此代码 国家阶级 public class State { private ThreadLocal state; public void setState(String state) { this.state.set(state); } public String getState() { re ...
  • 您列出的第一种格式是正确的,但您必须确保使用的是步进路径而不仅仅是块的路径。 假设您通过此调用从部署计划中获取了块。 curl -uadmin:password http://localhost:4516/deployit/tasks/v2/28830810-5104-4ab9-9826-22f66dee265d 这将产生结果:
    根据标准5.4节 ,只有第一个分支执行时: case陈述的执行选择了一种且只有一种备选方案,因为这些选择是详尽且相互排斥的。 从逻辑上讲,这也是有道理的,因为case语句的标题中的A可以是任何表达式,不一定是单个变量。 如果改变导致case表达式改变的状态可能导致选择其他分支,那么代码将变得更难以遵循(并且语言将成为实现的噩梦)。 According to the standard, section 5.4, only the first when branch would be executed: The ...

相关文章

更多

最新问答

更多
  • Runnable上的NetworkOnMainThreadException(NetworkOnMainThreadException on Runnable)
  • C ++ 11 + SDL2 + Windows:多线程程序在任何输入事件后挂起(C++11 + SDL2 + Windows: Multithreaded program hangs after any input event)
  • AccessViolationException未处理[VB.Net] [Emgucv](AccessViolationException was unhandled [VB.Net] [Emgucv])
  • 计算时间和日期差异(Calculating Time and Date difference)
  • 以编程方式标签NSMutableAttributedString swift 4(Label NSMutableAttributedString programmatically swift 4)
  • C#对象和代码示例(C# objects and code examples)
  • 在python中是否有数学nCr函数?(Is there a math nCr function in python? [duplicate])
  • 检索R中列的最大值和第二个最大值的行名(Retrieve row names of maximum and second maximum values of a column in R)
  • 给定md5哈希时如何查找特定文件(How to find specific file when given md5 Hash)
  • Python字典因某些原因引发KeyError(Python Dictionary Throwing KeyError for Some Reason)
  • 如何让Joomla停止打开新标签中的每个链接?(How do I get Joomla to stop opening every link in a new tab?)
  • DNS服务器上的NS记录不匹配(Mismatched NS records at DNS server)
  • Python屏幕捕获错误(Python screen capture error)
  • 如何在帧集上放置div叠加?(How to put a div overlay over framesets?)
  • 页面刷新后是否可以保留表单(html)内容数据?(Is it possible to retain the form(html) content data after page refreshed?)
  • 使用iTeardownMyAppFrame和iStartMyAppInAFrame在OPA5测试中重新启动应用程序超时(Restart app within OPA5 test using iTeardownMyAppFrame and iStartMyAppInAFrame timed out)
  • 自动拆分文本内容到列(Automatically splitting text content into even columns)
  • 在r中的循环中将模型名称分配给gbm.step(assigning model names to gbm.step in loop in r)
  • 昆明哪里有电脑等级考试二级C培训?
  • C ++模板实例化,究竟是什么意思?(C++ template instantiation, what exactly does it mean?)
  • 帮助渲染来自fields_for的部分内容(Help to render a partial from fields_for)
  • 将url.action作为json对象返回mvc(return url.action as json object mvc)
  • 使用.BAT中的.application文件类型运行ac#Console App(Run a c# Console App with .application file type from a .BAT)
  • 将bindingRedirect添加到.Net标准库(Adding a bindingRedirect to a .Net Standard library)
  • Laravel版本升级会影响您的控制器吗?(Laravel version upgrade affects your controller?)
  • imaplib.error:命令SEARCH在状态AUTH中非法,只允许在SELECTED状态(imaplib.error: command SEARCH illegal in state AUTH, only allowed in states SELECTED)
  • 如何在eclipse debug impala前端
  • 如何通过Ajax API处理多个请求?(How to handle multiple requests through an Ajax API? [closed])
  • 使用Datetime索引来分析数据框数据(Using Datetime indexing to analyse dataframe data)
  • JS 实现一个菜单效果