In my project I reference a managed dll, that references other unmanaged dlls. I would like to know how I can embed these unmanaged dlls instead of putting them in the application's directory. I can not embed them as I would with a regular managed dll since they can not be added as a reference in my project. Thanks
I have a managed C# dll that uses an unmanaged C++ dll using DLLImport. All is working great. However, I want to embed that unmanaged DLL inside my managed DLL as explain by Microsoft there:    So I added the unmanaged dll file to my managed dll project, set the property to 'Embedded Resource' and modify the DLLImport to something like:  [DllImport("Unmanaged Driver.dll, Wrapper Engine, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null", CallingConvention = CallingConvention.Winapi)]   where  'Wrapper Engine' is the assembly name of my managed DLL 'Unmanaged Driver.dll' is the unmanaged DLL  When I run, I get:     Access is denied. (Exception from HRESULT: 0x80070005   (E_ACCESSDENIED))   I saw from MSDN and from  that's supposed to be possible...
In Pokémon Sun and Moon, when you've finished the game you can switch day and night by going though the wormhole at the altar where you've caught the box legendary. Are there any more differences when going through the wormhole, excluding the day or night difference? For example, the altar of the sunne and altar of the moone switch when going through the portal. Make program first read from pipe, then from keyboard What happens when you plug two sides of a cable to a single networking device? What is likely to happen when you plug two ends of a network cable to a single switch/router? Will this create problems on the network, or just be ignored? Wrap Caption Around TikZ Figure Proving by strong induction that $\forall n \ge 2, \;\forall d \ge 2 : d \mid n(n+1)(n+2)...(n+d-1) $ Windows 8.1 64-bit: High memory usage I have 8GB of memory on a 64 bit windows 8.1 machine, and windows is telling me I'm using 91% of my memory, yet its simultaneously telling me I'm only using 3GB.  I literally just restarted my machine a few minutes ago because it was being incredibly rediculously slow. I'm currently only running chrome (with a ton of tabs, but doesn't add up to anywhere near 7.5GB). What could be going on here?   Here's a bunch of my current info       I took a look at this:  but I wasn's able to use xperf and the rest didn't lead me to a solution.  UPDATE - RamMap:   UPDATE 2: I checked Resource Monitor at Wouter's suggestion and found an "Image" called lxdecoms.exe with over 6GB of Commt (KB). I tried killing the process, but while it lowered my Commit Charge, it didn't affect "Used Physical Memory". So I restarted hoping to capture it again in full, but its not back yet and yet the problem persists.  I should note that I do have a Centos virtual box virtual machine running on my machine, not sure if that has any weird memory impacts that aren't reflected in the numbers in these tools.   I got xperf working, so here's my resource monitor and a wpa analysis of my xperf output (from xperf -on ReferenceSet -BufferSize 1024 -MaxFile 512 -FileMode Circular  &amp;&amp; timeout 5 &amp;&amp; xperf -d MemUsage.etl):     What is N/A that's taking up 2.7GB of memory? My VM? Here's the very dumb way:  def divisorGenerator(n):     for i in xrange(1,n/2+1):         if n%i == 0: yield i     yield n   The result I'd like to get is similar to this one, but I'd like a smarter algorithm (this one it's too much slow and dumb :-)  I can find prime factors and their multiplicity fast enough.  I've an generator that generates factor in this way:  (factor1, multiplicity1) (factor2, multiplicity2) (factor3, multiplicity3) and so on...  i.e. the output of   for i in factorGenerator(100):     print i   is:  (2, 2) (5, 2)   I don't know how much is this useful for what I want to do (I coded it for other problems), anyway I'd like a smarter way to make  for i in divisorGen(100):     print i   output this:  1 2 4 5 10 20 25 50 100     UPDATE: Many thanks to Greg Hewgill and his "smart way" :) Calculating all divisors of 100000000 took 0.01s with his way against the 39s that the dumb way took on my machine, very cool :D  UPDATE 2: Stop saying this is a duplicate of  post. Calculating the number of divisor of a given number doesn't need to calculate all the divisors. It's a different problem, if you think it's not then look for "Divisor function" on wikipedia. Read the questions and the answer before posting, if you do not understand what is the topic just don't add not useful and already given answers. I recall in at least two episodes of Star Trek ( from the original series and  from The Next Generation) that there is reference to and contact with species from external galaxies.  By the 29th century, we see that timeships exist.  My question is, is there any reference to intergalactic relations in Star Trek in the future (say, by the 29th Century), or does the Star Trek Universe stay in the Milky Way Galaxy? What are the applications of the ## preprocessor operator and gotchas to consider? As mentioned in many of my previous questions, I'm working through K&amp;R, and am currently into the preprocessor. One of the more interesting things &mdash; something I never knew before from any of my prior attempts to learn C &mdash; is the ## preprocessor operator. According to K&amp;R:     The preprocessor operator ##   provides a way to concatenate actual   arguments during macro expansion. If a   parameter in the replacement text is   adjacent to a ##, the parameter is   replaced by the actual argument, the   ## and surrounding white space are   removed, and the result is re-scanned.   For example, the macro paste   concatenates its two arguments:      #define  paste(front, back)  front ## back      so paste(name, 1) creates the token   name1.   How and why would someone use this in the real world? What are practical examples of its use, and are there gotchas to consider? What's the easiest way to play a sound file (.wav) in Python? By easiest I mean both most platform independent and requiring the least dependencies. pygame is certainly an option, but it seems overkill for just sound. How to ignore deprecation warnings in Python Most properties of a single binary operation can be easily read of from the operation's table. For example, given $$\begin{array}{c|ccccc} \cdot &amp; a &amp; b &amp; c &amp; d &amp; e\\\hline a     &amp; e &amp; d &amp; b &amp; a &amp; c\\ b     &amp; d &amp; c &amp; e &amp; b &amp; a\\ c     &amp; b &amp; e &amp; a &amp; c &amp; d\\ d     &amp; a &amp; b &amp; c &amp; d &amp; e\\ e     &amp; c &amp; a &amp; d &amp; e &amp; b \end{array}$$ it is easy to check that it is closed (no elements occur in the table which don't occur as row or column index), commutative (the table is symmetric), has a neutral element (the row and column of $d$ are copies of the index row/column), and has an inverse element for each element (there's a $d$ in each row and column). In other words, almost all important properties can immediately be seen. The only part missing is associativity.  Therefore my question: Is there a simple way to see directly from the operation's table (i.e. without doing explicitly all the calculations) if an operation is associative? What should I look for when shopping for my first DSLR? I am thinking of buying a digital SLR camera. What things should I be looking for? Sometimes I create Material Groups to be used as appendable reusable assets. Unfortunately sometimes parameters I want to control using a Group Node's slider are not available for routing to a Group Node's input socket. Some examples of these are the Color Ramp and the Mapping Node.  So here's what I want to do:    Can this be done? If so, how?  Thanks! Is it time to be rid of automatic down votes on certain closed questions? Right now,  carry automatic downvotes.  The  for this was largely to enforce specific quality bans in part because people were not down voting questions. Now that question down votes are free on questions and it seems to be pretty commonplace for question quality bans to trigger, even without the automatic votes from closure, and we have completely revamped the closure system. Is it time to reevaluate whether or not these automatic votes are still a good idea?  What benefits do the automatic votes provide and have they effectively run their course? How can I add a new user as sudoer using the command line? After I add a user using adduser, I can't see it via System > Administration > Users and Groups unless I log out and then log in again. Is that normal?  Also, can I set a newly added user as a sudoer or do I have to change that only after adding it? How can I do that via the shell?  Finally, can I delete the original user that was created upon initial installation of Ubuntu, or is this user somehow 'special'? I'm a fourth year undergraduate student in a university in the U.S., and this is my last semester. I have already applied to graduate schools, and I'm currently awaiting responses. Since I have already finished all my requirements and am ready to graduate, I wanted to go part time this semester. I am aware of how it affects my financial aid; however, I do not know if it has an effect on my admittance to graduate school. I do not mean whether or not I get accepted (the decisions will happen without knowledge of my current semester), but whether I am eligible to attend graduate school if I have been part time for a semester. That is, will there be any potential issues when the schools that have accepted me see my final transcript and see I was part time? Is there a universal answer to this? Or should I contact each school individually and ask about their policy?   Also, are there any other potential issues with going part time that I haven't mentioned? Anything noteworthy I might have missed? I'd like to copy files from one external drive to a network connected drive. I want to make sure that there are no errors.  I know of MD5 hash files that I see for large single files that are download from the internet. I also know that I can use the terminal to 'diff' the two sets of files.  However, I'm looking for a piece of software that could confirm that all the files in the file structure have been copied by the finder completely, or a piece of software that would do the copying for me and confirm that all the bits are exactly the same.  The files are video related - and are often over a TB in size (not in one file - complex multi-folder nested files)  I'm fine if there is a terminal command that can do the copy and compare for me as well. (although being able to see the amount of time left on a copy is a very nice feature... additionally, I want to make sure I get ALL of the file - resource forks and all) An alternative software to Live Writer? Loading OpenStreetMap data in QGIS?