message-passing

Passing message from background.js to popup.js

旧巷老猫 提交于 2019-11-27 16:14:09
问题 I'm trying to implement my own chrome extension on which, on a certain event, create a browser notification and fills the popup with data calculated in background.js Here is mymanifest file : { "name": "Dummy name", "description": "Description", "manifest_version": 2, "version": "1.1.3", "icons": { "16": "icon_16.png", "48": "icon_48.png", "128": "icon_128.png", "256": "icon_256.png" }, "browser_action": { "default_icon": "icon_48.png", "default_title": "Test", "default_popup": "popup.html" }

How does Actors work compared to threads?

非 Y 不嫁゛ 提交于 2019-11-27 09:04:52
问题 Is there any good and short explanation of how Actors works compared to threads? Can't a thread be seen as an actor and send messages to other threads? I see some difference, but it's not that clear for me. Can I use Actors in any language by using threads differently? 回答1: The actor model operates on message passing. Individual processes (actors) are allowed to send messages asynchronously to each other. What distinguishes this from what we normally think of as the threading model, is that

Scatter Matrix Blocks of Different Sizes using MPI

﹥>﹥吖頭↗ 提交于 2019-11-27 07:52:45
(Suppose all the matrices are stored in row-major order.) An example that illustrate the problem is to distribute a 10x10 matrix over a 3x3 grid, so that the size of the sub-matrices in each node looks like |-----+-----+-----| | 3x3 | 3x3 | 3x4 | |-----+-----+-----| | 3x3 | 3x3 | 3x4 | |-----+-----+-----| | 4x3 | 4x3 | 4x4 | |-----+-----+-----| I've seen many posts on Stackoverflow (such as sending blocks of 2D array in C using MPI and MPI partition matrix into blocks ). But they only deal with blocks of same size (in which case we can simply use MPI_Type_vector or MPI_Type_create_subarray and

What does `Fatal Python error: PyThreadState_Get: no current thread` mean?

扶醉桌前 提交于 2019-11-27 07:04:24
问题 I am passing an mpi communicator from python to C. I chose to use boost's mpi communicator as mpi4py does not seem to have good C support. Check it out: try: from boost.mpi import world except ImportError: from mpi import world err = run_with_mpi(infile, world, stdout, stderr, exc) On systems where boost.mpi is installed, this raises no errors. However, boost.mpi cannot be installed on mac. I installed boost's mpi.so module using homebrew's boost155 formula then added the .so file to

Cancel an already executing task with Celery?

孤街醉人 提交于 2019-11-26 23:37:25
I have been reading the doc and searching but cannot seem to find a straight answer: Can you cancel an already executing task? (as in the task has started, takes a while, and half way through it needs to be cancelled) I found this from the doc at Celery FAQ >>> result = add.apply_async(args=[2, 2], countdown=120) >>> result.revoke() But I am unclear if this will cancel queued tasks or if it will kill a running process on a worker. Thanks for any light you can shed! mher revoke cancels the task execution. If a task is revoked, the workers ignore the task and do not execute it. If you don't use

How to send and receive broadcast message

谁说胖子不能爱 提交于 2019-11-26 22:41:00
问题 I am trying to pass data between two activities that are inside of tabs. I am trying to use sendBroadcast() . With breakpoints set I never reach onReceive() . Manifest: <activity android:name=".WebResults" android:label="@string/app_name"> <intent-filter> <action android:name="com.toxy.LOAD_URL" /> </intent-filter> </activity> Activity Sender: Intent intent=new Intent(getApplicationContext(),WebResults.class); intent.setAction("com.toxy.LOAD_URL"); intent.putExtra("url",uri.toString());

How do I send a string from one instance of my Delphi program to another?

Deadly 提交于 2019-11-26 19:44:06
What is the best and easiest way to send a string from one instance of my program to another instance of my program? The receiving program has to execute a procedure, using the received string as a parameter. I started reading about DDE but I got confused. What other options do I have, and what is the easiest way to implement this? Use named Pipes, but I would recommend Russell Libby's named Pipe components. There is a TPipeClient and TPipeServer component. As of (2013-10-04) Francoise Piette and arno.garrels@gmx.de updated this source code to compile with Delphi 7 to XE5 (earlier versions may

Scatter Matrix Blocks of Different Sizes using MPI

99封情书 提交于 2019-11-26 17:43:20
问题 (Suppose all the matrices are stored in row-major order.) An example that illustrate the problem is to distribute a 10x10 matrix over a 3x3 grid, so that the size of the sub-matrices in each node looks like |-----+-----+-----| | 3x3 | 3x3 | 3x4 | |-----+-----+-----| | 3x3 | 3x3 | 3x4 | |-----+-----+-----| | 4x3 | 4x3 | 4x4 | |-----+-----+-----| I've seen many posts on Stackoverflow (such as sending blocks of 2D array in C using MPI and MPI partition matrix into blocks). But they only deal

Cancel an already executing task with Celery?

流过昼夜 提交于 2019-11-26 07:55:42
问题 I have been reading the doc and searching but cannot seem to find a straight answer: Can you cancel an already executing task? (as in the task has started, takes a while, and half way through it needs to be cancelled) I found this from the doc at Celery FAQ >>> result = add.apply_async(args=[2, 2], countdown=120) >>> result.revoke() But I am unclear if this will cancel queued tasks or if it will kill a running process on a worker. Thanks for any light you can shed! 回答1: revoke cancels the

How do I send a string from one instance of my Delphi program to another?

时光毁灭记忆、已成空白 提交于 2019-11-26 07:24:24
问题 What is the best and easiest way to send a string from one instance of my program to another instance of my program? The receiving program has to execute a procedure, using the received string as a parameter. I started reading about DDE but I got confused. What other options do I have, and what is the easiest way to implement this? 回答1: Use named Pipes, but I would recommend Russell Libby's named Pipe components. There is a TPipeClient and TPipeServer component. As of (2013-10-04) Francoise