I'm trying to convert a Bitmap to a BitmapImage in WPF. Basically, I'm starting with a Bitmap created in memory (from another process) and I need to use it elsewhere, but as a BitmapImage.  I found this answer , but the author's function Bitmap2BitmapImage does not work (at least in DotNet4.5) as there is no such method called Imaging.CreateBitmapSourceFromHBitmap - so no luck there (at least no way to convert to a VB.Net equivalent function).
I have an instance of a System.Drawing.Bitmap and would like to make it available to my WPF app in the form of a System.Windows.Media.Imaging.BitmapImage.  What would be the best approach for this?
How to speed up 4e combat I DM a group of four PC's and even "easy" battles take at least an hour to resolve. Normal encounters take even longer! I want to speed up combat so my players can do more in a session.  I've been trying a lot to speed up combat, we are already using:   Initiative cards that the players keep up 30 second bonus rule: if someone take his turn within 30 seconds, he receives a token. This token can be used to give a +1 on attack or damage, after rolling. Completely removed healing surges Checked all character sheets, they are roughly equal Roll damage and attack at the same time   I even introduced an experienced player, which helped my party to play more strategic, but speed hasn't improved.  Also the party is Lv 8, nearing Lv 9.  This is not an issue of the DM's turn taking too long. My turns take about 60 seconds tops. The 30 second rule helps a lot, most of the the players turns are within or near 30 seconds.   The major issue appears to be the sheer number of rounds, averaging on 25-30 rounds needed to resolve even a "normal" encounter.  What can I change to resolve combat faster?  I'm looking for both 4e solutions, system agnostic and home brew solutions. How many physical degrees of freedom does the $\mathrm{SU(N)}$ Yang-Mills theory have? I am trying to write a VF page to list all the id and name columns from a custom object but found an error "List has more than 1 row" in the VF page.  Can anyone tell me what have I done wrong?  VF Page:  &lt;apex:page Controller="MP_controller" showHeader="false" sidebar="false"&gt;   &lt;apex:pageBlock&gt;      &lt;apex:pageBlockTable value="{! mp}" var="item"&gt;         &lt;apex:column value="{! item.id}"/&gt;         &lt;apex:column value="{! item.name}"/&gt;       &lt;/apex:pageBlockTable&gt;   &lt;/apex:pageBlock&gt; &lt;/apex:page&gt;   Apex controller  global with sharing class MP_controller {     public Merchant_Profile__c mp{get;set;}     public MP_controller(){         mp = [SELECT                  ID, name, Profile_account_name__c, Merchant_ID__c, Bank_Code__c, Country_Code__c,                 Currency_Code__c, Merchant_Level__c, Merchant_Type__c, MSO__c, Region__c,                 Retail_Products__c, Transaction_Mode__c, Created_Date__c, Date_Disabled__c, Date_Live__c,                 Merchant_Category_Code__c                FROM Merchant_Profile__c               WHERE Profile_Account_Name__c = '001O000000bQFnyIAG'];     } } Joining non-spatial CSV file to spatial data (shapefile) using QGIS? I have a CSV file which has postcode data in a field, but it is non-spatial e.g. no Easting and Northing.   I have a shapefile with postcode in a field and some additional data.  I want to join the CSV with the shapefile based on attributes (postcode fields). I know I can do this in ArcMap, but how can I achieve the same thing in QGIS? Quotient group $G/H$ is abelian iff $[G,G] \subseteq H$ Please allow using nested expressions when filtering with tags Please support the use of nested expressions like  and (or ) when searching.  Looking here, on meta, at questions tagged   and at questions found with +search +tag +boolean I didn't see any information on this topic. Review sections to be always in the same place Moving app to production mode in Symfony 2 I want to subtract a constant number from my data to get new data file. For example, I want to subtract  10 from my data.   data.txt  Id  a   b   c   d   e 1   1   2   3   4   5 2   2   3   4   5   6 3   3   4   5   6   7 4   4   5   6   7   8 5   5   6   7   8   9 6   6   7   8   9   10 7   7   8   9   10  11 8   8   9   10  11  12 9   9   10  11  12  13 10  10  11  12  13  14 11  11  12  13  14  15 12  12  13  14  15  16 13  13  14  15  16  17 14  14  15  16  17  18   Required output:  out.txt   Id  a   b   c   d   e 1   -9  -8  -7  -6  -5 2   -8  -7  -6  -5  -4 3   -7  -6  -5  -4  -3 4   -6  -5  -4  -3  -2 5   -5  -4  -3  -2  -1 6   -4  -3  -2  -1  0 7   -3  -2  -1  0   1 8   -2  -1  0   1   2 9   -1  0   1   2   3 10  0   1   2   3   4 11  1   2   3   4   5 12  2   3   4   5   6 13  3   4   5   6   7 14  4   5   6   7   8 Delete Everything(the rest of the text) after a specific string hard disks spin up by processes / applications that simply get a list of disks? How to prevent? I have a 24/7 always-on Debian Jessie based headless home server that has a large 1TB SSD for the OS and all of my frequently accessed files. This same system has 4 larger hard disk drives in a SnapRAID array. These are mainly for archiving infrequently accessed Blu-rays and want those drives to remain spun down in standby unless I actually read or write to them. They are all formatted as ext4 and mounted with noatime and nodiratime enabled.  So even though no process or program should be regularly accessing those drives in any direct way, the hard drives constantly get spun up from standby. It seems to be related to graphical programs that provide a gui file browser, even something like Chromium. If I don't even browse into those drives, I'm thinking that these processes by simply getting a list of available drives spins up the hard disks. Much like blkid does. The problem is, it's hard to determine the root cause of this since none of these processes are actually reading or writing the filesystem on those drives, so no files are actually changing or being touched. Is there some sort of cache that I can populate or a buffer to prevent these programs from spinning up the hard drive simply by getting a list of available disks? This is honestly driving me insane, since I can't find a reliably way to keep these disks spun-down even though there is no direct access of the filesystem.  UPDATE: Thanks to Stephen's answer, I was able to trace the disk activity to gvfs and udisks. It's a real shame that these processes insist on waking up disks in standby when they aren't actually being accessed to do any real I/O with the filesystem. So far I just uninstalled them, knowing that it will remove some functionality from PCManFM and the like. What is the typical orbital life of an artificial satellite? The orbit of satellites around Earth eventually decays, or so I read. This is typically caused either by atmospheric drag, or by tides. I would assume most satellites have a limited service life in orbit. Hence the question - What is the typical orbital life of a satellite? How long before it's successor must be launched into orbit ?  EDIT: For instance, a weather satellite Is there any Android XML documentation? Conditionally enabling systemd files through Debian packaging I've created a  package which installs a service.  On our embedded devices, I want this package to automatically enable the service.  On our developer workstations, I want the developers to systemctl start foo manually (it's a heavy service, and so it just consumes resources if run all of the time on a desktop environment).  How can I go about prompting the user for their decision during the apt-get step? Is that the best solution?  Note, I've created the package using dh_make and debhelper and enabled it with:  %:     dh $@ --with=systemd  override_dh_systemd_enable:     dh_systemd_enable --name=foo foo.service I want to save the list of packages that have installed. I figured it might be the best to list all and diff it with the default set.  Edit: Clarification: I don't want to get the list of installed packages that are installed at the moment. Rather I want to get the list of packages that I added since the default install. Inequality with exponents $x^x+y^y \ge x^y +y^x$ Let $x,y$ be positive numbers. Prove that $x^x+y^y \ge x^y +y^x$.   This question appeared in Summer 1991 Russian Olympiad team test. Apparently, I tried to come up with different approach such as Jensen, Karamata's inequality and nothing works so far. I just need a discussion here. Hints are not necessary. I am an undergrad in economics and really want to get a helping hand as I get from math and stats from a Stack Exchange site for economics. Where can I post my questions on economics topics? Is there a database of Linux compatible hardware? I want to know if there is a centralised community site where all Hardware is listed in terms of compatability with Linux. Something like AppDB for Wine. How to search entire hard drive for a file? How to compare (probability) predictive ability of models developed from logistic regression? I know some well-known measures are $c$ statistic, Kolmogorov-Smirnov $D$ statistic. However, as far as I know, those statistics take into account only of the rank order of the observations, and is invariant under changing the intercept of the logistic regression model (e.g. in oversampling-correction exercise).  In my current application, I need to depend on the accuracy of the logistic regression to predict probability of event. I know only of qualitative way of assessing models for probability prediction ability, namely by plotting "QQ-plot" of the actual vs predicted probability of event:   Score the validation dataset using the developed model. Rank the observations according to the predicted probability and group into $n$ buckets according to their rank of predicted probability. (First 1/n would go to the first bucket, next 1/n would go to the next ...) Calculate the average predicted and actual probability of Event for each bucket. Create a scatter plot of Predicted vs Actual - one point for each bucket.   I am wondering:   Is the "Q-Q plot" I mentioned above a legitimate way to assess predictive performance of models developed from logistic regression? If so, where may I find more reference for that? Is there any known quantitative way to assess the probability prediction ability of this kind of model?