Questions tagged [shared]

In VB.NET, the Shared keyword is roughly equivalent to the static keyword used by many other languages.

In , the Shared keyword is roughly equivalent to the static keyword used by and many other languages.

For example, the following code snippet in VB.NET:

Public Class Foo
    Public Shared Bar As String
End Class

Is equivalent to the C#:

public class Foo
{
    public static string Bar;
}

Further Reading

OpenMP

In OpenMP, it corresponds to the status of a variable. In a parallel section, a SHARED variable will be shared by all the running threads, meaning they will all access this variable and could modify it simultaneously. It is the default status of every variable in a parallel section, apart from the iteration counters.

1404 questions
5
votes
1 answer

How to create a shared directory with read and write access to all applications in Android?

How do I create a shared directory with read/write permissions to all applications installed on my phone and that is not on the sdcard? I tried that : File f = new File("/tmp"); f.mkdir(); but it is not working.
Arutha
  • 26,088
  • 26
  • 67
  • 80
5
votes
3 answers

Shared Apache / MySQL / PHP setup on multiboot

In short: I have a multiboot machine with Win XP, Windows 7 and Ubuntu, and I would like my localhost web projects to be shared by all three OSes. Details: I finally want to get rid of Windows XP for my web development work, but my local Apache +…
donquixote
  • 4,877
  • 3
  • 31
  • 54
5
votes
2 answers

OS X Shared Memory Cleanup

I'm sharing memory between a parent process and multiple children processes by allocating shared memory segments with shm_open/mmap in OS X. Either parent or children may create the segment then communicate the identifying name to either. My…
ericspod
  • 113
  • 1
  • 6
5
votes
0 answers

POSIX Shared Memory: XSI or Realtime?

It appears that POSIX defines two different optional IPC APIs that provide shared memory: the XSI extension (shmget, shmctl, shmdt) and the Realtime option group (shm_open, shm_unlink). The documentation on opengroup for shmget says, in the…
sinjin
  • 189
  • 1
  • 6
5
votes
0 answers

Getting VBox IIS to use shared volume for website physcial path

Im trying to use a VM as the webserver to test code and design changes made to content on development systems. The following what I am doing. Create Windows 7 Enterprise VM on Virtual Box On Virtual Box share the Web development folder on Host…
rocketdoctor
  • 368
  • 3
  • 16
5
votes
1 answer

android: is there a way to remove a string from shared preferences by its value instead of its key?

Pretty much what the title says. I have got a checkbox which on checked puts a string into shared prefs, and when unchecked should remove that same string. I wanted to use the editor.remove but it asks for a key and not a string value and I can't…
Dadi
  • 77
  • 1
  • 3
5
votes
2 answers

Set value of string in a shared c_wchar_p in a subproccess?

I've a situation like this: The main process generate some sub-process that they should write the result in a shared object in string and numeric types, for the numeric types there's no problem but with the string the value will be lost. import…
Giggi
  • 681
  • 2
  • 9
  • 17
5
votes
3 answers

Android Shared Internal Storage

Is there such thing on any Android based device as shared internal storage? I know you can use the SDCard as a shared file location between applications, but for a project I'm working on we dont want the ability for a SD Card to go missing…
Andy Davies
  • 4,287
  • 5
  • 24
  • 31
4
votes
1 answer

Distribute matlab functions without source

I have written a set of Matlab functions and I want to distribute it to few people for testing. But I do not want to reveal the source to them. All these people have matalb installed on their systems. So I don't want to make standalone executable…
4
votes
3 answers

Standard non-code resource location for python packages

This should be a common scenario, but could not find any relevant post yet.. I plan to deploy a Python library (I guess the same applies to regular applications) which makes use of some images and other resource files. What is the standard location…
Dimitri Tcaciuc
  • 5,053
  • 5
  • 20
  • 22
4
votes
1 answer

How to program shared behaviors in Rust without repeating same code in each module?

For writing a very large program, I see no way to alleviate having to write the same code for each struct that uses a certain shared behaviour. For example, Dog may "bark": struct Dog { is_barking: bool, .... } impl Dog { pub fn…
4
votes
2 answers

gcc generates shared object with execute permissions

I am building a shared library on linux using gcc. I get no compile or link errors but my shared object always has the execution bit set (though readelf indicates its a shared object). I am just doing this: > echo "int f() {return 1;}" > a.cpp > gcc…
samwise
  • 181
  • 2
  • 10
4
votes
1 answer

Is it possible to turn a segment of shared memory into private memory?

Say I have a c program (in a linux environment) that uses shared memory to send data to and from several processes. Let's say later in the program the parallel processes finish and I have only one process. Now but I want to fork() off another one…
John Smith
  • 41
  • 1
4
votes
2 answers

GWT - What to put in the shared folder?

I'm still unsure on what to put into the shared folder. If I'm doing RPC requests, and sending Pojos from the client to the server and vice versa, do I have to put them into the shared folder (because they are used by both - client and…
helpermethod
  • 59,493
  • 71
  • 188
  • 276
4
votes
1 answer

How to save FCM notification in a custom ArrayList?

I'm trying to save a custom Arraylist in shared preference, but when i restart or re-run and send a new push ,it overwritte the others @Override public void onMessageReceived(RemoteMessage remoteMessage) { …
Ervin
  • 336
  • 1
  • 10