hook

Hooking thread creation/termination

做~自己de王妃 提交于 2019-12-17 19:01:40
问题 Is it possible to hook into thread termination on Windows? IOW, I would like to be notified if a thread inside the process (not interested in other processes and their threads) has terminated (either normally or - more important - forcefully). Alternatively, hooking into thread creation would also do. Rationale: I have a library that manages some information on per-thread basis (think of it as a process-wide per-thread cache for some information). When a thread is terminated I have to remove

How to filter messages in Ejabberd

安稳与你 提交于 2019-12-17 18:37:47
问题 I have Ejabberd up and running with test users, and its working fine. I want to write a module that can intercept messages and modify them, as follows : intercept "messages" send them to a php file get the result from the same php file (immediate) Modify the message stanza and send it down the wire to the recipient The ejabberd documentation is weak and tutorials are non-existent. Can you give me some sample code that does this. I can then figure how to configure it for my needs. Thanks a

ipython notebook --script deprecated. How to replace with post save hook?

回眸只為那壹抹淺笑 提交于 2019-12-17 18:18:37
问题 I have been using "ipython --script" to automatically save a .py file for each ipython notebook so I can use it to import classes into other notebooks. But this recenty stopped working, and I get the following error message: `--script` is deprecated. You can trigger nbconvert via pre- or post-save hooks: ContentsManager.pre_save_hook FileContentsManager.post_save_hook A post-save hook has been registered that calls: ipython nbconvert --to script [notebook] which behaves similarly to `--script

Using SVN post-commit hook to update only files that have been committed

随声附和 提交于 2019-12-17 17:42:00
问题 I am using an SVN repository for my web development work. I have a development site set up which holds a checkout of the repository. I have set up an SVN post-commit hook so that whenever a commit is made to the repository the development site is updated: cd /home/www/dev_ssl /usr/bin/svn up This works fine but due to the size of the repository the updates take a long time (approx. 3 minutes) which is rather frustrating when making regular commits. What I'd like is to change the post-commit

Using SVN post-commit hook to update only files that have been committed

会有一股神秘感。 提交于 2019-12-17 17:41:34
问题 I am using an SVN repository for my web development work. I have a development site set up which holds a checkout of the repository. I have set up an SVN post-commit hook so that whenever a commit is made to the repository the development site is updated: cd /home/www/dev_ssl /usr/bin/svn up This works fine but due to the size of the repository the updates take a long time (approx. 3 minutes) which is rather frustrating when making regular commits. What I'd like is to change the post-commit

How to require commit messages in VisualSVN server?

笑着哭i 提交于 2019-12-17 17:25:16
问题 We've got VisualSVN Server set up as our Subversion server on Windows, and we use Ankhsvn + TortoiseSVN as clients on our workstations. How can you configure the server to require commit messages to be non-empty? 回答1: VisualSVN Server 3.9 provides the VisualSVNServerHooks.exe check-logmessage pre-commit hook that helps you reject commits with empty or short log messages. See the article KB140: Validating commit log messages in VisualSVN Server for instructions. Besides the built-in

Can I run a script when I commit to subversion?

不想你离开。 提交于 2019-12-17 16:26:14
问题 I'd like to run a script that builds the documentation for my php project. It is basically just using wget to run phpdoc. 回答1: Here's a fairly extensive tutorial on SVN hooks 回答2: (Answering my own question, I just thought others would like to know as well). Yes, and also TortoiseSVN supports it. The word you are looking for is 'hooks'. For TortoiseSVN, open settings and 'Hook Scripts'. Click 'Add...' and chooe post_commit_hook (for running after the commit is done). Then add whatever script

Hook/Overlay a DirectX game?

岁酱吖の 提交于 2019-12-17 10:25:25
问题 Can anyone tell me how to hook/overlay a DirectX game in C#? I've tried getting a fullscreen C# window to overlap a game, however it wont. After researching a little, I found out that I need to hook the game and then display the C# window. Can anyone explain how I would do this? Would I be able to display a C# form over a DirectX game? 回答1: (disclosure: I work for this company) You can try our Deviare API, it has functionality to hook COM objects from C#. It's a set of COM objects that can be

How can I hook into Perl's print?

佐手、 提交于 2019-12-17 06:35:35
问题 Here's a scenario. You have a large amount of legacy scripts, all using a common library. Said scripts use the 'print' statement for diagnostic output. No changes are allowed to the scripts - they range far and wide, have their approvals, and have long since left the fruitful valleys of oversight and control. Now a new need has arrived: logging must now be added to the library. This must be done automatically and transparently, without users of the standard library needing to change their

In Git, how can I write the current commit hash to a file in the same commit

徘徊边缘 提交于 2019-12-17 04:14:31
问题 I'm trying to do a fancy stuff here with Git hooks, but I don't really know how to do it (or if it's possible). What I need to do is: in every commit I want to take its hash and then update a file in the commit with this hash. Any ideas? 回答1: I would recommend doing something similar to what you have in mind: placing the SHA1 in an untracked file, generated as part of the build/installation/deployment process. It's obviously easy to do ( git rev-parse HEAD > filename or perhaps git describe [