Entropy of photons

Question: Do low energy photons have greater entropy than high energy photons, or is the entropy of all photons the same (and the relationship between high and low entropy radiation is just a function of the number of photons - i.e. a closed system with more photons has higher entropy than the same sized system with fewer photons, regardless of the individual energies of the photons)?  Is the entropy related to the number of different energies of a group of photons (i.e. do ten photons with the same wavelength have lower entropy than ten photons with different wavelengths)?
Comment: Interesting question. I can't write a definite answer without research, so I'll add a comment. I don't think you can define the entropy of a single photon (or a single particle for that matter) because entropy is a property of an ensemble. In the case of photons entropy is related to the electronic properties of the material emitting the light (temperature of the electron gas) because photon themselves cannot interact to reach equilibrium. I'm sure there are more rigorous definitions and I hope others will comment.
Answer: If you know the precise state of a photon, then the system which contains only the photon has 0 entropy... there is no knowledge that can be gained about the system.
Typically the energy of a system is related to the entropy in a monotonically increasing fashion because in most systems (and a better condensed matter specialist would have more to say here) more energy leads to more possible configurations which the system could occupy. For instance, if a many body quantum system is in a non-degenerate ground state, then again the system has 0 entropy since the precise state of the system is known. However, when all that is known about the system is that it has some average energy $<E>$ above the ground state energy, then there  are many states of system which could lead to this measurement.
So your question is not really well defined. But generally, no, higher energy does not imply higher entropy.
Answer: I suggest, the entropy of the photon is a constant $3.72938*10^{-23}$ joule/kelvin.
As entropy is energy divided by temperature we need a temperature before we can estimate the entropy. Black body radiation does have temperature so if we estimate the average energy of a photon in black body radiation at a certain temperature and divide it with the temperature we got a measure of entropy. If that that value is independent of the temperature as it indeed is we got a value for the photon entropy.

The formula for Black body radiation:
$$P(\text{f}):=\frac{8 \pi  f^3 h}{c^2 \left(e^{fh/k T}-1\right)}$$
P(f) = energy as a function of frequency in joule / hertz
T = temperature in kelvin
c = the speed of light = $2.998*10^{8}$ meter / second
k = the Boltzmann constant = $1.38064852*10^{-23}$ joule / kelvin
h = the Planck constant = $6.626*10^{-34}$ joule seconds

Now integrate to find the value:
$$S=\frac{\int_0^{\infty } P(f) \, df}{T \int_0^{\infty } \frac{P(f)}{f h} \, df}=\frac{\pi ^4 k}{30 z (3)}≈3.72938*10^{-23}$$
Where z is the Riemann zeta function.
A formidable integral but put into Mathematica, or something similar, it is easily calculated.
Comment: Entropy, in a sense, counts the degeneracy of the macroscopic state in terms of microstates. A better definition of entropy, using your notation, is $S=-\int_\infty^\infty P(f)\ln(P(f))df$.This is the entropy of ensemble of photons. If you have a single photon in thermal equilibrium then this isits entropy.

Entropy of photons


How to know if phone has been connected via USB? (connection log on the phone?)

Question: I'm trying to find out if someone has connected the Android phone (Samsung Note 4) to the PC via USB. Is there a log somewhere on the device showing the timestamp of connection? Preferably without turning on the debug mode?
Comment: Another way is to use `adb shell dmesg` and look for power connection/disconnection logs there. That's the best source to consider. In Android 4.2.1 you can check kernel logs (if rooted) without ADB by browsing into `/data/log_temp/`.
Answer:
Preferably without turning on the debug mode?

Sorry! I don't have a solution that doesn't require USB debugging as of now. A workaround is to use a rooted device and run ssh server on Wi-Fi.
Anyhow, if the device has been connected to PC using USB, then it must have drawn some power, miniscule and momentarily it may be.
Setup adb in PC, turn on USB debugging on phone or use the workaround, and enter the command:

For Lollipop 5.0.2:
dumpsys batterystats | grep -A30 "Statistics since last unplugged:"

or, to get the most relevant details only:
dumpsys batterystats | grep -A30 "Statistics since last unplugged:" | grep -B30 "Device is currently"

The output could be like:
Statistics since last unplugged:
  Time on battery: 23m 13s 868ms (100.0%) realtime, 23m 13s 868ms (100.0%) uptime
  Time on battery screen off: 22m 13s 363ms (95.7%) realtime, 22m 13s 362ms (95.7%) uptime
  Total run time: 23m 13s 868ms realtime, 23m 13s 868ms uptime
  Start clock time: 2015-08-09-06-50-16
  Screen on: 1m 0s 505ms (4.3%) 0x, Interactive: 1m 0s 758ms (4.4%)
  Screen brightnesses:
  dark 1m 0s 505ms (100.0%)
  Total partial wakelock time: 22m 13s 363ms
  Mobile total received: 0B, sent: 0B (packets received 0, sent 0)
  Phone signal levels:
  moderate 22m 35s 311ms (97.2%) 1x
  good 38s 557ms (2.8%) 0x
  Signal scanning time: 0ms
  Radio types:
  none 23m 13s 868ms (100.0%) 0x
  ...
  Device is currently unplugged

I've removed some output denoted by ... since it's not relevant here.
Now, the latest unplugged detail highlights:

Start clock time: 2015-08-09-06-50-16 -- On Aug 9, 2015 at 06:50:16 AM, my device was unplugged from USB
Time on battery: 23m 13s 868ms -- time for which the device has been running on battery since last unplugged

You can do the calculation now, based on your case.
Note that this info has nothing to do with full charge details. It simply tells us the details for the event when the device was connected to a source that supplied it power.
For Android 4.4.2:
dumpsys batterystats | grep -A30 "Statistics since last unplugged:" | grep -B30 "Device is currently*"

For Android 4.2.1:
dumpsys batteryinfo | grep -A30 "Statistics since last unplugged" | grep -B30 "Device is currently*"

Note: In the last two cases, Start clock time isn't available but Time on battery among other things.

All of this info would be helpful if only you have not plugged the device into charger or PC since the above battery-stats doesn't differentiate between the two.
Nonetheless, it is still a good lead!
Comment: [This answer](http://android.stackexchange.com/a/113421/96277) by Matthew Read also deals with the same thing.
Comment: I see. This is a good lead... I think the battery graph in control panel shows a similar output... but I've since charged my phone several times so it's not possible to trace back to the time my phone was in someone else's hand. So Android doesn't log USB plug/unplug at all?
Comment: It does log, the kernel logs precisely speaking has those plug/unplug entries. It's in the output of `adb shell dmesg`. I can't seem to find where does Android 4.4+ and 5.x stores these kernel logs which `dmesg` outputs.


Castle ActiveRecord / NHibernate optimization

Question: I have the following structure: message (message table) may have multiple fields (fields table), and each field may have multiple subfields (stored in the same "fields" table with the only difference that fields dont have values in the "ParentField" column). Subfields may have subsubfields, etc., but this is not important.
When I retrieve 10 messages that have 10 field each, and each field has 20 subfields, I can see from the log file that NHibernate generates 2000 SQL calls.
Is there a way to optimize that?
Thanks!
Here is one of 2000 SQL statements generated by NHibernate:
SELECT   fieldresul0_.MessageResults_ID as MessageR6___2_,
         fieldresul0_.ID as ID2_,
         fieldresul0_.ID as ID5_1_,
         fieldresul0_.Field_ID as Field2_5_1_,
         fieldresul0_.Name as Name5_1_,
         fieldresul0_.Value as Value5_1_,
         fieldresul0_.MessagePosition as MessageP5_5_1_,
         fieldresul0_.MessageResults_ID as MessageR6_5_1_,
         fieldresul0_.ParentField_ID as ParentFi7_5_1_,
         fieldresul1_.ID as ID5_0_,
         fieldresul1_.Field_ID as Field2_5_0_,
         fieldresul1_.Name as Name5_0_,
         fieldresul1_.Value as Value5_0_,
         fieldresul1_.MessagePosition as MessageP5_5_0_,
         fieldresul1_.MessageResults_ID as MessageR6_5_0_,
         fieldresul1_.ParentField_ID as ParentFi7_5_0_
FROM     FieldResults fieldresul0_
         LEFT OUTER JOIN FieldResults fieldresul1_
                      ON fieldresul0_.ParentField_ID=fieldresul1_.ID
WHERE    fieldresul0_.MessageResults_ID=@p0
ORDER BY fieldresul0_.MessagePosition

Here is mapping file that ActiveRecord generates:
<?xml version="1.0" encoding="utf-16"?>
    <hibernate-mapping  auto-import="true" default-lazy="false" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:nhibernate-mapping-2.2">
      <class name="FieldResult, Data" table="FieldResults">
        <id name="ID" access="property" column="ID" type="Int32" unsaved-value="0">
          <generator class="native">
            <param name="sequence">FieldResults_ID</param>
          </generator>
        </id>
        <property name="FieldID" access="property" type="String">
          <column name="Field_ID"/>
        </property>
        <property name="Name" access="property" type="String">
          <column name="Name"/>
        </property>
        <property name="DisplayValue" access="property" type="String">
          <column name="Value"/>
        </property>
        <property name="MessagePosition" access="property" type="Int32">
          <column name="MessagePosition"/>
        </property>
        <many-to-one name="ParentMessage" access="property" class="MessageResult, Data" column="MessageResults_ID" />
        <many-to-one name="ParentField" access="property" class="FieldResult, Data" column="ParentField_ID" />
        <bag name="Children" access="property" table="FieldResults" lazy="false" cascade="all" order-by="Field_ID">
          <key column="ParentField_ID" />
          <one-to-many class="FieldResult, Data" />
        </bag>
      </class>
    </hibernate-mapping>`

Answer: I'd guess this was a select n+1 issue. Have you tried eager loading, or a custom HQL query? I'll post some example HQL to get around this if you haven't
Answer: there is a way to help nhibernate perform some more efficient joins.  explicitly tell the query processor to include lookup tables with a "join fetch" and get your results via HQL and Session.CreateQuery()
from FieldRestults fr
left join fetch fr.ParentMessage
left join fetch fr.ParentField

optimizing a bag in another issue that i'm currently investigating.


Problem installing Bluetooth Dongle on Raspberry Pi 3 running Windows 10 IOT Core

Question: I recently bought the plugable Bluetooth USB adapter usb-bt4le and I want to use it with my RPi3. I have windows 10 core IoT installed on the RPi. I have disabled the on-board bluetooth and I wish to use the usb bluetooth for communicating with the RPi. I wish to know how to install the bluetooth drivers on the RPi. Their support site mentioned that windows installs the drivers by itself but it doesn't seem to be doing that. I tried downloading the drivers from the website but that isn't installing the drivers either. Is there something I am missing?
Answer: Unlike Windows 10 Desktop OS Windows IoT doesn't support a lot of Bluetooth or wireless devices, please check this link to know which devices are supported https://docs.microsoft.com/en-us/windows/iot-core/learn-about-hardware/hardwarecompatlist


Gap between new ceiling tile and stone fireplace

Question: We removed 12x12 acoustic ceiling tiles that were stapled in. Put up Armstrong track system to install new tiles. The new tile lays from 1 inch to 2 inches above fireplace. It is a stone fireplace with many different sized stones. So not a flat surface.
Contractor was going to try and scribe wood trim to fill in gap. We're not happy with that look and not confident that she can do it. Any other ideas would be appreciated. TIA
Comment: pictures would be needed to understand your question
Answer: You've basically got 2 choices:

Scribe some sort of material to match the stonework.

Have a straight edge (presumably the aluminum track) along the front of the fireplace, leaving gaps where the stone doesn't meet the track.

It seems you don't think you'll like the scribed look - maybe you should ask your contractor if one of her previous clients has a similar setup that you could see in person so you'll know for sure.
If you don't like the look of scribed, you're pretty much stuck with straight.


EXPTIME in Oracle database stands for?

Question: I want to know the table name and what it actually stands for - EXPTIME apart from CTIME, LTIME and PTIME
Comment: What is the context?
Answer: Are you talking about user$ table?
If yes then the column EXPTIME stands for EXPiry TIME and represents(with conjunction ASTATUS ACCOUNT_STATUS) with  EXPIRY_DATE on dba_users table, which mean Date of expiration of the account.
USER$ is  Oracle's internal tables and undocumented.

EXPTIME in Oracle database stands for?


Uniform convergence of $f_n(x)$

Question: Given a sequence of functions $f_n(x)={{(x-1)^n}\over{1+x^n}} \arctan({n^{x-1}}).$
I have studied its pointwise convergence and I found as set of convergence $E=[0,+\infty)$ and as limit function the null function.
But I have a problem with the uniform convergence: how can I calculate  $\;\sup|f_n(x)|\;$ in $E?$
Comment: There is no $y$-dependence in the function. Is this intentional or a typo?
Answer: There is no need to compute the maximum (or minimum) of $f_n$; it is enough to have inequalities. We have
$$
|f_n(x)|\le\frac\pi2\,\frac{|x-1|^n}{1+x^n}\le\frac\pi2\,\,\Bigl|1-\frac1x\Bigr|^n\quad\forall x\ge0.
$$
Let $A>3/2$. If $3/4\le x\le A$, then
$$
|f_n(x)|\le\frac\pi2\,\Bigl|1-\frac1A\Bigr|^n,
$$
proving that $f_n$ converges uniformly to $0$ on $[3/4,A]$.
Let's treat now the case $0\le x\le3/4$. Then $n^{x-1}\le n^{-1/4}$,
$\arctan(n^{x-1})\le n^{-1/4}$ and $|f_n(x)|\le n^{-1/4}$, proving uniform convergence on $[0,3/4]$.
What happens on $[0,\infty)$? The convergence is not uniform. To prove it, we bound from below $f_n(n)$, $n\in\Bbb N$. First of all, $\arctan(n^{n-1})\ge \pi/4$ for all $n\in\Bbb N$. Next,
$$
\frac{|n-1|^n}{1+n^n}\ge\frac{|n-1|^n}{2\,n^n}=\frac12\,\Bigl|1-\frac1n\Bigr|^n\to\frac1e>0.
$$
This shows that $f_n(n)\ge c$ for some constant $c>0$, proving that $f_n$ does not converge uniformly to $0$ on $[0,\infty)$.
Comment: It seems to me that the proposed argument is not enough. To conclude that $\left|1-\frac1A\right|^n\rightarrow 0$ as $n\rightarrow +\infty$ you must have $\left|1-\frac1A\right|<1$, that holds if and only if $A>\frac 12$. Thus the proposed estimate shows uniform convergence in $\left[\frac 12 +\delta, \frac 12 + \delta'\right]$ for all $\delta>0$ and $\delta'>\delta$.

An extra effort is needed to prove uniform convergence on $[0,\delta]$ for every $\delta>0$.
Comment: @AlessioDV Oops! You are right. I will modify my argument.
Comment: Great answer,  i was giving  a generic response without trying to solve it . There is indeed no need to compute the maximum
Answer: In general you can find the supremum of function by finding its maximum.I dont recommend differentiating the whole function.
You should use the fact that $ arctan $  is bounded by $ \pi/2 $. Then find $max$ of $ {{(x-1)^n}\over{1+x^n}} $ ( the maximum  will be a function of n).
[ By multiplying $ \pi/2 $ and $max$ you might get something that is bigger than the actual but it doesnt because matter $ \pi/2 $ can get infront of $lim$.]

Uniform convergence of $f_n(x)$


Converging to better solutions by running RRTstar for multiple Iterations

Question: In the Literature I have read so far, I saw RRT star was running in multiple loops to converge to a better solution ( near optimal). I was wondering how I could implement the same, as most pseudocodes don't explain that part.
Answer: RRT* indeed runs in multiple iterations to converge to an asymptotically-optimal solution.
In simple words: you could understand RRT* as an RRT, but with: 1) the stopping criteria being time/iterations instead of reaching the goal node and 2) with an extra re-wiring step that chooses, inside of a neighborhood of radius r from your already wired sample, the neighbor that can see its path cost more reduced, and attempts to connect to it. With this last methodology you get more styled branches which lead faster to the goal.
Here you got a video that explains RRT.
The same author makes another video on RRT* (in particular the re-wiring process).
Comment: How is the goal corresponded out of the explored nodes if that is the case?
Comment: @Ajin2305 the goal node has already been found, then you keep iterating to refine the branches. You do not lose the goal node you found, but might find a new path to it due to this refinement. Is that an answer to your comment?
Comment: I got the following characteristics for convergence, is it right? https://robotics.stackexchange.com/questions/16318/rrt-star-convergence


How can I open and reset the combination lock on my suitcase, I have forgotten the combination

Question: How can I reset the combination and open my suitcase? I have forgotten the origanal combination.
Comment: Not really a duplicate of [this answer](https://travel.stackexchange.com/a/76073/10051), but I have explained in details how to open it.
Comment: Is it the kind that has three or four wheels with letters or numbers?  There's always the brute force approach, if you're patient.
Comment: Can you be more specific about the suitcase model and how many digits the lock has? It might be helpful.
Comment: There's a detailed description of what to do here https://barcelonalowdown.com/how-unlock-your-suitcase-forgot-combination/ Haven't tried it myself so can't vouch for whether it works!
Answer: Does the lock have the Travel Sentry logo on it?

Locks sold for the US market will have this logo along with a key slot for a TSA master key.
You can purchase a set of these master keys on eBay, Amazon, Wish, or many other shopping web sites around the world. The key with the code printed on your lock will open it. Or you can 3D print just the key you need, if you have a 3D printer.
Comment: "Brute force" means trying every combination, not actually "forcing" anything. The quality of the lock doesn't come into it...
Comment: Whilst this may well work, it's overkill for 99.9% of all suitcase combination locks which can be opened with no more than a few minutes of either brute force.
Comment: @Doc Oh, certainly brute force or some of the tricks you described will work. So I voted up your answer. Some people might not be comfortable with applying brute force to something of obviously relatively low quality though.
Answer: Combination locks used on luggage are generally very poor quality, and not intended to do much more than keep out an opportunistic thief.
If you look somewhere like Youtube you will find countless videos that will show you how to open such locks.  The exact method will depend on the quality of the lock and how many digits it contains, but could be as simple as simply rolling through all possible combinations (especially if the lock only has 3 digits).
To do it a little quicker (especially for 4 digit locks) you can normally apply pressure somewhere on the lock and feel when the lock falls into place.  Again, the exact method will depend on the lock, so look on youtube to find one that is similar, and/or just follow the general advice given in these videos.
I recently found a 4-digit combination lock in the back of a rental car.  Despite being a reasonable quality lock, it took me about 30 seconds to open by simply moving the rollers and feeling for them to latch.


Effect of charges near a parallel plate capacitor

Question: If I charge a parallel plate capacitor  and  I insert a charged body near one of the plates will there be any interactions like attraction or repulsion?
What if I disconnect the battery?
Comment: Better. Ideally, people should be able to infer from the title on the Phys.SE front page whether they want to click on the post or not.
Comment: There will be always interaction (even if the capacitor would be uncharged). For the sign of the force take a look at [wikipedia](http://en.wikipedia.org/wiki/Image_charge).
Answer: Consider two plates, with area $a$. Let's say that the left plate has charge $q$ and the right has charge $-q$, so the charge density $\pm\rho = \pm q/a$. The plates are a distance $d$ apart. For parallel plate capacitors, the electric field in the gap is given by:
$E = \rho / \epsilon = q / (\epsilon a)$
The field magnitude is the force per unit charge, and it will be acting from one plate to the other (depending on the charge of the particle). So the particle will feel this force:
$F = E Q = qQ / (\epsilon a)$
Note that as the field has no dependence on the position between the plates, this force is constant. So aligning the plates horizontally we could vary the plate charge $q$ until it cancelled the gravitational force on the particle, and the particle would levitate between the plates (assuming you slowed it down - with no overall force it will continue at whatever speed it has).
The electromagnetic interaction is so much stronger than the gravitational interaction that for charged particles it would be very difficult to balance the forces. On the other hand, macroscopic objects have a charge so nearly neutral that gravity wins in any reasonable field.
The charge on a capacitor is due to the position of the charges, so disconnecting the battery will just stop charging the capacitor. Unless the plates are discharged in some way, the field will persist between them.
This is not free energy, however; the particle itself will have its own effect on the field, so if we added many particles they would all end up on the attracting plate; electrons would land on the positive plate and thus reduce its positive charge until it was entirely discharged, and eventually they would stop when both plates were equally negatively charged. The amount of energy available is simply the electric potential energy, a little less than the energy required to charge it initially.
Answer:
If your charged body doesn't have a permanent supply of electric charge,

Of course, there would be electrostatic induction for sure. But, I'd say that it would diminish within certain period of time. As a parallel plate capacitor is always grounded, the induced charges would be neutralized. You can't notice this time though.

The other case: If it is provided by a constant supply of charges,

Now, The interaction would be noticeable. And, it won't be a capacitor afterwards :-)


How did older computers like the Commodore 64 output to a display?

Question: I've been wondering about this for a while now. I understand that graphics cards now days hold the pixel information in their dedicated memory and output that information through the card and onto the screen. The commodore 64 and most older computers, from what I understand didn't have these video cards with dedicated memory however. I suppose they could have reserved a portion of their system memory as a sort of frame buffer. The processor could calculate pixel values and store the data in this frame buffer and then output that information to the screen. Is this how those older computers worked or is it some other process completely different?
Answer: Yes that is basiclly how video outputs were done thoseadays. There were memory between 1 and 8 kB reserved as video buffer, the CPU calculated the output and saved it in RAM.
However there are some differences to a modern video card:

There were no high resolution interfaces like HDMI or VGA. Usually composite video with NTSC or PAL color schema was used for home computers to be connected to a television.
For text mode, only the ASCII code was saved byte for byte in the memory. The video circuit had a small ROM containing the 5x7 dot matrics of each character. In such way a screen of 40x25 characters can be saved in just 1 kB.
There were special chips like intel 8275 that integrates everything (access to buffer memory, generation of pixel clock and sync for NTSC monitors, access to character dot matrics ROM and so on), but sometimes the whole video logic was built with TTL logic ICs (example: Apple II).
Since RAM was shared, the video circuit used DMA or other method to interrupt CPU for RAM access. Video circuit almost always had higher priority since there were no pipelines to buffer the data, and the pixel output of the video signal was time critical.
Answer: I'm assuming you're talking about home computers of the late 1970s/early 1980s. Those computers did pretty much work as you conjectured. There were some complications, like hardware sprites, redefinable characters, and nonlinear memory layouts, but basically all those computers had at least a text mode where characters were stored as bytes in memory; and then later and fancier ones had color and bitmap graphics.
However, there was an older type of graphical display, the vector display, that only required the computer to keep the coordinates of visible points in memory. This was advantageous when manufacturers and consumers couldn't afford the memory required to hold even a very low-resolution bitmap.
Answer: The 6502 microprocessor needs to use its memory bus for half of each cycle; many computers of the late 1970s and early 1980s took advantage of this by constructing their memory system so it would connect the 6502 to the memory during one half of the cycle, and connect video circuitry during the other half.  It's interesting to note that the Apple II, Vic-20, and Commodore 64, took different approaches to the video timing.
The Apple II fetched one byte of video memory per CPU cycle, which determined which character should be displayed.  Characters were eight scan lines high, so each byte of character data would get fetched eight times per frame--once on each of eight consecutive lines.  The six bits of the fetched character byte would then be used, along with the bottom 3 bits of a scan line character, as an address in a 512x5-bit ROM.  The top two bits of the fetched character byte would then select normal, inverse, or blinking mode.
The VIC-20 used wider characters, and fetched a character every other CPU cycle; on the cycle after each character fetch, it would take the 8 bits of character data along with 3 bits of scan-line count, add that value to a value programmed in a register, fetch a byte from that address, and display that as eight consecutive pixels.  This approach meant that character shapes could be stored in RAM rather than ROM, and reprogrammed as convenient (the character-memory address could also be set to ROM if desired, to save 2K of RAM).
The Commodore 64 needed to fetch two bytes per character like the VIC-20,
but needed to output characters to the screen twice as fast (like the Apple).
To balance these needs, while it's showing the first scan line of each row
of text, it alternates between fetching characters and fetching their shapes
while the CPU isn't allowed to do anything.  As it is fetching the character data, however, the video chip also copies it to a 40-byte buffer.  While the next seven scan lines of text are shown, the video chip fetches character data from that buffer rather than from RAM, thus allowing the CPU its share of cycles.  This makes it possible for the system to show more text like the Apple while also allowing reprogrammable character fonts like the VIC-20.  Unfortunately, it stalls the CPU 25 times each frame, for 41-43 cycles each time (starting/stopping the CPU adds 3 cycles of uncertainty)--a design decision which was reasonable at the time but had some unfortunate consequences (the worst of which was that the floppy drive to wait long enough after sending each bit that communications wouldn't get corrupted by having the video chip disrupt the CPU for 43 cycles).


what are other idioms one can use to express getting on well with someone?

Question: I am looking for an idiom describing a close acquaintanceship or getting on well with someone other than "like a house on fire'.
Comment: by *close acquaintanceship*, do you mean *friendship*? Also never heard of *like a house on fire*...
Comment: @virmaior Seems there are lots that you've never heard of! :)
Comment: @Kris, Notably the idiom is ***get on** like a house on fire* at least according to this question on SE ( (http://english.stackexchange.com/questions/45733/where-does-the-phrase-to-get-on-like-a-house-on-fire-come-from ) ...
Comment: @virmaior Yes, it is. I already provided a link at josh314's answer below.
Comment: Let's see - "We are a house on fire." Doesn't seem amicable to me. Seems rather contentious relationships going on, doesn't it?
Answer: I've never heard "like a house on fire," so maybe I don't quite know what you mean. That said, a common idiom for quickly coming to a good relationship with someone would be "hit it off," as in "Joe and Martha just met tonight, but they really seem to be hitting it off."
[Edit]: Some others came to mind for me. Two people who are inseparable might be described as "attached at the hip." Also, two close individuals, particularly if they are similar in many ways, may be called "two peas in a pod."
Comment: @Kris Actually, we do both. Searching online is certainly a great tool, but that wouldn't mitigate the fact that I have no first-hand experience with the phrase. There are likely nuances in usage or implication which wouldn't be easily gleaned from a dictionary-style reference and could only be picked up from natural experience with the usage in verbal or written contexts. Nevertheless, thank you for the link.
Comment: These days we no longer *hear*, we *find* online.   http://idioms.thefreedictionary.com/get+on+like+a+house+on+fire
Comment: @Kris BTW, if the downvote was by you, I am somewhat puzzled by that. If you care to explain, I would appreciate it.
Comment: Yes, the down vote was indeed mine, accompanied by a relevant comment as you see. In three hours, one *could* Google than declare that the idiom was not known to them. Or **read the other answers**. I so many times spend hours thinking and reading relevant literature before understanding a Q, let alone trying to answer it. Whence the down vote.
Answer: The Cassell Dictionary of Cliches (1996) confirms that "get along like a house on fire" means "to get on together extremely well." A shorter (and less flamboyant) expression of the same idea is "They get along famously [or swimmingly]." Yet another is "They're hand in glove," signifying a close fit or match of interests between two people. Or you could say that they are "birds of a feather."
Another possibility is to say that the two people "take to each other like a duck to water" or that they "go together like a horse and carriage" (or like bread and butter, or peanut butter and jelly, or salt and pepper, or milk and cookies, or macaroni and cheese, or spaghetti and meatballs, or any complementary pair of things, really).
A less complimentary term for closeness is "thick as thieves."
Comment: Only because a comparison between the particular people in question and thieves may not seem desirable or appropriate in some settings. I don't mean to say that there is no honor (or thickness) among thieves. But I have heard the expression "They're thick as thieves" used with an overtone of disapproval—in particular, by my grandmother in connection with politicians she mistrusted.
Comment: Thick as thieves in my area means you are scheming with someone.
Comment: Why do you say that "*thick as thieves*" is less complimentary?
Comment: +1 esp., for *any complementary pair of things, really*
Answer: hit it off
get along famously
.
Answer: From Forrest Gump:  "We goes together like peas and carrots."
Meaning: I love you, we belong together, we go well together.
Answer: Hot and heavy

If something or someone is hot and heavy, they are full of strong
  emotions or sexual feelings:

Seinfeld usage:
  Elaine dates a jazz saxophonist named John Jermaine and admits to
  Jerry that she has reservations about their dating, because John
  "actually, he, um, doesn't really like to do 'everything'"[1] (a
  reference to oral sex). In spite of this, Jerry incautiously tells one
  of the band members, Clyde (played by Leonard Lightfoot) that Johnny
  and Elaine are "pretty hot and heavy."
When Jerry tells Elaine what he said, Elaine is alarmed and shows some
  uncharacteristic considerateness: "I don't want John thinking that I'm
  hot and heavy if he's not hot and heavy. I'm trying to get a little
  squirrel to come over to me here. I don't wanna make any big, sudden
  movements. I'll frighten him away!"
Answer: like two peas in a pod

from ehow:
History
    Versions of the phrase "two peas in a pod" date back to as early as the 16th
century. In Tudor England, "pease" was the singular form, with the word "pea" not
coming into use until the 17th century.

Types
Two peas in a pod is commonly used to describe best friends, twins, siblings,
lovers or people in a close relationship who share likes and dislikes.


How do I convert my Blackberry contacts to a standard format?

Question: I want to migrate from Blackberry (RIP).  How do I convert my contacts to a standard format?
Comment: Wondering, what your source format of your contacts? I'm assuming you were working from a literal BlackBerry backup file? Thanks for any insight.
Answer: I just got this working so figured I'd document it for posterity.
sudo apt-get install barry-util barrybackup-gui barrydesktop

Then use the backup utility GUI to make a complete backup of your database.  We'll call it backup.tar.gz.
Unfortunately the desktop utility seems to only export one record at a time.
Instead, use the command line:
btardump -d 'Address Book' -V backup.tar.gz > address_book.mime

That's it.  The .mime file should have a bunch of VCards inside.
Comment: Which package has to be installed?
Comment: @thefourtheye Oops.  Thanks for reminding me.  This is actually critical to the ease-of-use of this approach, as other instructions for doing part of this out there want a library that's not in the main repository.


How to get Linux users list from LDAP

Question: We've just linked one of our Linux host to LDAP and ActiveDirectory. Now I'm trying to  check how I get list of users and their details from within the Linux side.
Answer: You can achieve that by either typing in
getent passwd |less

or performing a LDAP search, such as
ldapsearch -x -LLL uid=*

(assuming that the bind DN and credentials are set in the ldap.conf file or you have read access to AD in other ways).
Answer: If you want to check if your Linux sees the POSIX entries from a LDAP server, use
getent passwd

The output should display entries both from local /etc/passwd and LDAP server. If you are wondering how to get to the point, when there's something to check, this may prove to be a good starting point.
Answer: Use the ldapsearch command line tool to query the directory server for information. For more information, see "LDAP: Mastering ldapsearch".
Answer: Depending on how your Linux host is set up, wbinfo -u may work for you.
From the wbinfo's manpage:

wbinfo - Query information from winbind daemon
...
-u|--domain-users
       This option will list all users available in the Windows NT domain
       for which the winbindd(8) daemon is operating in. Users in all
       trusted domains will also be listed. Note that this operation does
       not assign user ids to any users that have not already been seen by
       winbindd(8) .

Example:
antonio@debian:~$ wbinfo -u
administrator
antonio
guest
support_388945a0
krbtgt
antonio@debian:~$

Answer: Linux usually uses PAM for its authentication needs. It's an open architecture, so you can use the pam_ldap module to use LDAP on Linux.

How to get Linux users list from LDAP


Can I use a noun with a posessive determiner as adjunct?

Question: For example: "Your level English" (Your level = adjunct)? Does it have the same meaning as "English of your level"?
Answer: At the very least you'd need to hyphenate, like this: your-level English. This would arguably be understood by most native speakers to mean English of your level. But I doubt any native speaker would actually use such a construction under normal circumstances; it's just not natural. It is true that there are similar constructions that are fully idiomatic, such as higher-level math, next-level advice, etc. But is just a fact of life that your normally can't enter into such constructions.
CGEL would refer to both higher-level and next-level as an attributive modifier realized by a nominal. The your-level modifier would be a nonce formation similar to a no-frills airline and an all-or-nothing approach. Nonce here means that 'forms of these types are not
systematically admissible in this construction' (CGEL, p. 444). In these cases, the obstacle is that they contain determiners (genitives like your function as determiners), and determiners are not systematically admisible as constituents of attributive modifiers. They are only admissible as particular nonce formations—sometimes. Not in your case, however. I don't know a deep reason why that is; we just don't normally use your (or other possessive pronouns such as my, his, her, our, and their) in such constructions, and unfortunately that's all I can say about it.
Comment: This post would be twice as good, imo, without the last clause
Answer: Level can refer to status or an even, flat surface/temperament. It fits after English not before in your context. 'What is your English level?' Usually, a person would leave the word unspoken, as in 'How's your English?'
Because of its double meaning a person can also complain about unfairness in not finding a level playing field for all. If they raise their voice, you should tell them to keep their tone level, keep a level tone or level their tone.
Helpful?
Comment: The OP wonders when and if it is permissible to replace certain *of your* + N phrases by pre-head modifiers, like this: *people of your background* -> * *your background people*, *country of your origin* -> * *your origin country*, etc. (Answer: generally, that replacement would not result in acceptable constructions.)


In what sense are quasiholes and quasiparticles "excitations" in Fractional Quantum Hall (FQH) systems?

Question: In the theory of Fractional Quantum Hall states, one often sees quasi-holes and quasi-electrons (or quasi-particles) being called "excitations" from the ground state initially given by Laughlin (Jastrow-Laughlin style wavefunctions). Usually when one speaks of excitations, it is to a higher energy level. However from the wavefunctions of the quasi-holes and quasi-particles, it seems to me that we are still in the Lowest Landau Level. My question is: in what sense are these "excitations"?
Comment: They are excitations from the vacuum. The vacuum is the state where there are no quasiparticles.
Comment: Could you be a bit more elaborate? i.e. How are the opposite kinds of excitations which can annihilate each other and be produced in pairs from the vacuum?
Answer: I will first repeat some semiconductor physics and then move to the fractional quantum hall effect.
In an undoped semiconductor there are many real electrons and real protons that interact. For $T=0$ they condense into a stable neutral state. Let´s call this state the vacuum. We can create create quasi-electron and quasi-holes as fermionic excitations from this vacuum state. These quasi-electrons and quasi-holes are the non-interacting electrons and holes that provide charge transport in a semiconductor.
For the fractional quantum hall effect, there is not just one vacuum state but there are many. Each Laughlin-wavefunction-like state could be considered as the vacuum. So you can switch from one vacuum to another by changing the magnetic field. And in each of these vacua you can create excitations in the form of quasi-particles and quasi-holes. The properties of these quasiparticles will be different for each vacuum. These quasiparticles are typically anyons (somewhere between a fermion and a boson) and have fractional charge.
There are many good introductory texts about the fractional quantum hall effect. For instance this one by Girvin.
Answer: The full microscopic Hamiltonian of the Hall effect
$$ H = \sum_j \frac{1}{2m} \left [\frac{\hbar}{i} \nabla_j + \frac{e}{c} A(\mathbf{r}_j) \right ]^2 + \sum_{i<j} \frac{e^2}{|\mathbf{r}_i - \mathbf{r}_j|}$$
In the quantum Hall effect, the dynamics is restricted to the lowest Landau level due to the application of very high magnetic fields.
Restricted to the Lowest Landau level the first part of the Hamiltonian is a multiple of the zero point energy, thus an unimportant constant. Thus the Hamiltonian of the restricted dynamics becomes:
$$H_{LL} = P_{LL} \sum_{i<j} \frac{e^2}{|\mathbf{r}_i - \mathbf{r}_j|} P_{LL}$$
Where $P_{LL}$ is the lowest Landau projector. It is of course very hard to write a closed analytic expression of the projected Hamiltonian.
The quasiparticle states are very good approximations to the excited eigenstates of this interaction Hamiltonian.


Parent and Child table question

Question: Another question on the photo organisation and storage app design I am working on for my class: the specifications mention that people are able to be recorded in the database even if they don't appear in any photograph and that a location can be recorded even if there aren't any photographs associated with them. I'm not sure I understand what this would mean. Would you say this would mean the person and location tables should be parent tables to the photo table or am I missing something?
Comment: locations and persons should be a 1:n relation and so would egt a relationship table betweenthe tables. and oif you dont add an entry in that relation table, no loacation or person is added
Comment: So you're saying a photo is the parent to both person and location tables? But then why do they say the bit about them being able to be recorded even if there aren't any photos associated with them?
Comment: i can't tell you why, because i don't know the background, but with my approach it doesn't matter, you can add every person to a photo. Lets say you photograph a house of babara streisand , then you would add babata streisand to the foto even when she is not visible
Comment: Ah, ok. That makes sense. Possibly also that a user of the app could be a person that exists in the system even without being in a photo, and they themselves could be associated with a location. Also, a photo album could have several locations even if photos themselves aren't all associated with a location, I guess. Thanks nbk
Answer: Basically it comes to this:
Your photo is abourt a house, that belongs to a person. your photo has no persons in iit, but it still belongs to the person, so you can add a relationship to the photo.
The same goes for for locations the Washington Monument  is located between  Capitol and Lincoln Memorial so you can add a relationship between tose .

Parent and Child table question


Serial COM Port not opening

Question: I am trying to open the serial COM PORT in a Win32 Application. The port is opening correctly but I can send a receive bytes just if I previously opened it using Teraterm or Hyperterminal.
If I deactivate and activate the COM port from Device Manager (so the port is freshly unused) I need to simply open the COM port with Teraterm or Putty and afer I closed it  and then run my software I can send and receive properly at anytime.
I am using Embarcadero X3 with FileMonkey to make the application compatible with MACOSX and Win32 at the same time. FileMonkey does not suuport VCL.
The same code is working fine on Builder 6 c++ using VCL but it should not influence it in anyway. My code is really simple.
This is a very weird behavior. Seems like I need to INIT the COM (I am using FTDI converter) before I can use it and when the PC restarts or I deactivate and activate back the COM from Device Manager it seems this INIT is vanished and I simply need to open up the COM to revive it using another Serial Software and then use my software.
Note: Once the port is INIT I have the full control from my software. I am sure my code is truly opening the COM port because the COM appears busy once the iNIT is done if I try to use it with other softwares. So no flase alarm and more the application is working on the other side so far.
I have this problem since long and I now decided to solve it!
This is my code:
<code>// GLOBAL VARIABLES
HANDLE hComm = NULL;
COMMTIMEOUTS ctmoNew = {0}, ctmoOld;

DCB dcbCommPort;
      hComm = CreateFile("COM2",

                      GENERIC_READ | GENERIC_WRITE,
                      0,
                      0,
                      OPEN_EXISTING,
                      0,
                      0);

    if(hComm == INVALID_HANDLE_VALUE)
     {

        Application->Terminate();
     }

    GetCommTimeouts(hComm,&ctmoOld);
    ctmoNew.ReadTotalTimeoutConstant = 100;
    ctmoNew.ReadTotalTimeoutMultiplier = 0;
    ctmoNew.WriteTotalTimeoutMultiplier = 0;
    ctmoNew.WriteTotalTimeoutConstant = 0;
    SetCommTimeouts(hComm, &ctmoNew);
    dcbCommPort.DCBlength = sizeof(DCB);
    GetCommState(hComm, &dcbCommPort);
    BuildCommDCB("115200,N,8,1", &dcbCommPort);
    SetCommState(hComm, &dcbCommPort);
</code>
Answer: Just a possibility, not certain that this is the problem.
But one difference to our typical COM port opening code is that we use SetupCom directly after the CreateFile succeeded and set our buffer sizes, typically 4KB.
Answer: Change your settings to:
"115200,NOPARITY,8,ONESTOPBIT"

Serial COM Port not opening


What is the optimal base layout?

Question: Similar to this question for XCOM:EU, what is the optimal base layout in XCOM 2?
Answer: That's a difficult question, as most adjacency bonuses have been removed, having an optimal layout is not that important anymore. It's more a question about WHEN do you build a facility rather than WHERE and this comes down to personal preference and needs. E.g. Psi-Lab is something you'll want early, if you want to heavily use the class, but you may wait a long while, if you don't feel they are necessary. AWC is important to get, if you suffer from a lot of wounded soldiers, but doesn't do all that much in the early game otherwise.
What I can say, is you want to get the GTS and the Comms quickly on higher difficulties.
The only base-placement you have to worry about is the workshop, as  it still provides adjancency bonuses, regarding that, please check this question: Which buildings benefit from engineers?
There may be an optimal placement strategy, if you can build 2 workshops, but that's not possible, I finished my workshop and cannot build another on the tile next to it.
Comment: I've heard you want to get upgraded AWC as early as possible, to get the bonus ability for your units.  [Because of the way it works](http://gaming.stackexchange.com/questions/254251/how-do-the-bonus-perks-from-the-advanced-warfare-center-work#comment354113_254431), if you don't get it early, you could lose the bonus for some units.
Comment: There is a mod to fix that and I'm pretty sure it will be fixed in a patch as well. You still need to reach a certain rank to get the bonus ability and you'll only benefit from building and upgrading it early, when the bonus ability is available on corporal or sergeant, which is far from guaranteed. The mod I'm referring to: http://steamcommunity.com/sharedfiles/filedetails/?id=620586407
Comment: `{pedant-incoming}` The last sentence is a bit confusing as it says "There *may* be X, if Y, but not Y, I could not do Y.". It seems to be better if this says "There *would* be X if Y, but not Y. I could not do Y.". The second wording also requiring only one comma.
Answer: I find it's best to optimize placement, instead of rushing certain things like in XCOM 1.
Workshop should be placed in the middle, second row down. A lot of the other facilities should be built around the workshop.
Your first facility should almost always be the GTS. The rookie training and extra squad size makes a big difference in early survival.
Second facility would be the power. Build it on a power conduit, even if you have to dig to the bottom. It's worth doubling up on engineers to dig that far.
Third would be either Proving Grounds or Comms.
Comms obviously gives you money. But unintuitively, you may not want to rush this. You'll want to spread into the direction of alien facilities rather than going for cash and region bonuses. The facility itself only gives 1 link; you'll have to dedicate an engineer for 2 more. So it depends very much in your engineering capabilities.
Proving Grounds tends to have unlimited projects, so you'll want to start early. The skulljack/skullmining gives you strategic bonuses that make the game much easier. Mid game, this becomes the bottleneck.
Workshop should be finished quite early as it's cheap, low power and effectively gives you bonus engineers. It can help you dig or simply assign engineers to facilities that have to be constantly manned.
Psi lab should be done early if at all. Training psionicists can take months.
AWC is more a mid game thing. Early in the game (pre armor), your best chance at survival is to keep the enemy from shooting at all. It's better to put those supplies into flashbangs, skills, and guns. Once you get decent armor, you'll have a lot more 'gravely wounded' people who are not dead. AWC becomes great here.
The laboratory is not that helpful. It barely increases research rate. Mid game, research isn't even your main bottleneck... engineering is.
Defense matrix is very rarely useful. Again, whatever resources here might as well go into better weapons and armor.
Answer: Due to the lack of adjacency bonuses, it matters far less than in the first game. Therefore, there are only really three guidelines to try to follow:

Do not put the Workshop against the edge. It can provide a "free" engineer in any (non-diagonal) direction, so this maximises its flexibility.
Only put facilities that can use engineers next to the workshop.
Try to build power relays on power coils. They produce much more power this way. If you can't do that, then put your most power-intensive facilities on the power coils so that their power requirement is reduced to zero.

What is the optimal base layout?


Sent BTC from Coinbase, blockchain explorer says Confirmed. Recipient didn't receive it. How can I confirm?

Question: On Thursday evening July 21 @ 23:42 PM CT I transferred around $501.22 from Coinbase to an external wallet.
Per Coinbase, they sent it out to the BlockChain, it was confirmed by the BlockChain.
I noticed it has 235 confirmations - Not sure if this is how it works.
The recipient insists they didn't receive the funds.
A week earlier, on July 14, I sent BTC from Coinbase to the same Dest address and it was received within 20 min.
Would anyone be willing to look at the hash below for both transactions and help me to understand how to read it if everything seems legit?
!! Destination BTC wallet address for both transactions:
bc1q7gedlrgmvgw6xfzam9jj2fl4lde3heeqnd23zm
!! July-21 hash
46ecef0a25568bcd2fa28d2ef4ee3d8320b21e7a5305f3340982528fc597ae7c
!! July-21 - None working transaction:
https://www.blockchain.com/btc/tx/46ecef0a25568bcd2fa28d2ef4ee3d8320b21e7a5305f3340982528fc597ae7c
!! July-14 - working transaction:
https://www.blockchain.com/btc/tx/20b92f07301d9bd3ae713ace94611a0d5c47feb923cf62009a367e351d50cf4f
Much appreciate it folks!!
Answer: Both the July 21st and July 14th transaction went through, and the coins were received at bc1q7gedlrgmvgw6xfzam9jj2fl4lde3heeqnd23zm. In fact, in both cases, the coins were spent by the recipient and transacted further.
If the recipient claims they haven't received it, they're either lying or incompetent.
Comment: I had no doubt they received it. Thanks for checking for me.


htaccess rewrite

Question: I have a site with urls mysite.com/?p=605, I want any URLs containing /?p=123 to be rewritten to mysite.com/remap.php?page_id=123 with a 301. Can anyone provide a simply rewrite for this please?
Thanks in advance for your help.
John
Answer: <code>RewriteEngine On
RewriteBase /

RewriteCond %{QUERY_STRING} ^p\=([0-9]+)$
RewriteRule ^$ /remap.php?page_id=%1 [R=301,L]
</code>
should work
Comment: Hi, Thanks for the post. I had hoped I could get it in without conflict with the other rewrites, but this is not the case. I have a rewrite rule to RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f Can you think of a way to stop it conflicting?
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
Comment: Your given, two rewrite rules makes no sense for me. You just remove them, as the only thing they are doing - replicating default apache behaviour, for PHP - load index.php/index.html for directory URL's. Additionally, if you noticed "L" flag in the end of rules - that means, if that rule is triggered, it will stop matching process, and wont try to match rules that are lower in access file.

htaccess rewrite


Using an iPhone as a controller for a flash game

Question: How can I use an iPhone as a controller for a flash game, as described here?
Comment: I've made a few extreme edits to the question and title in order to try to clarify exactly what you're asking for.  Please revert the edit if I've misunderstood what you were asking.
Answer: I don't think it's hard to do assuming your setup is something like this
phone --- remote server --- flash
The flash app and the app on the phone need to share a code to be bonded togheter.
You can ask the user to insert a code manually or you can use a QR code.
The flash app use a socket to connect to the remote server, the phone app do the same. Both the apps send the shared code to the server and the server now knows that the input from the phone app need to be redirected to the flash app with the same code.


Build automation, VMWare server 2.0, Final builder

Question: I have a database in a VMWare Server 2.0 Virtual machine. I also have a web application in the IIS (7) in the VM.
Now I want to execute some database scripts that are in the VM, from the Host machine.
Also I have a VB script in the VM that I want to run from the Host machine.
How do I go about setting this up. I can buy Final builder if that will help me.
Since I am looking to automate the above from the Host machine, I was wondering what I would have to do to execute the database and the VB scripts that are in the VM, but execute them from the Host machine, so that these update the database and IIS (vb script thing) in the VM.
Thanks.
Answer: The easiest approach is to configure the VM with a network connection that is reachable from the host machine, and run the scripts across the network connection the same as you would if you had a physical machine instead of a virtual machine.  If your goal is to keep the VM isolated from your existing network and servers, then you need merely configure a private network between the host and the guest, and use that.  With this approach, you don't need any extra software.
Answer: I'd suggest to attach a host share as a network drive and then use vmrun. Here is an example:
<code>    vmrun -T server -h https://hostname:8333/sdk -u root -p mypassword -gu administrator -gp guestpaswd
  runProgramInGuest "[Vol1] win2008-1/win2008-1.vmx" -activeWindow "c:\windows\system32\cmd.exe"
</code>
Surely, the VmWare Tools are to be installed.


What can I use instead of `diff-buffers` in Aquamacs?

Question: According to the Emacs manual, "the command M-x diff-buffers compares the contents of two specified buffers". But Aquamacs (Aquamacs 3.2 GNU Emacs 184.108.40.206, macOS 10.14.4) gives me no match for this command. What can I use instead?
Answer: diff-buffers is a new command in Emacs 27.1.
Do you really want to see the diff output, rather than compare the buffers? Emacs has a nice built-in interface to compare two files: Ediff. (Note that Ediff has its own manual, separate from the Emacs user manual, even though it's been bundled with Emacs since the last century.) Run M-x ediff-buffers and choose the two buffers (defaulting to the current buffer and the last one you visited). There's also an "Ediff" submenu in the "Tools" menu.
After starting an Ediff session, the diff is in a buffer called *ediff-diff* (or *ediff-diff2* etc. if you have multiple active Ediff sessions). Perhaps more conveniently, or if you want a diff format that's different from the one Ediff uses, you can save the diff output to a file by typing wd (ediff-save-buffer) in the Ediff control buffer. Set ediff-custom-diff-options to control the options passed to diff when saving the diff.
I can't think of a generic way to run a command on two buffers. If both buffers are visiting files, you can use M-x diff:

Visit file 1. Save if necessary.
Run find-file (C-x C-f), press down or C-n (next-history-element) to have the full path to the current file, and copy the full path to the kill-ring (clipboard).
Visit file 2. Save if necessary.
Run M-x diff. Paste the path to file1, and accept the default for file2.
Answer: You are using Emacs version 24, but the online manual is for Emacs 27.
You either need to upgrade, or to read the Emacs manual that came with your copy of Emacs. Type C-h i to open the info viewer, then select Emacs.


How to upgrade g++ to 4.7.1?

Question: Richard Holloway's answer to this thread nicely explains how to upgrade from 4.6.3 to 4.7.0 (on 12.04, in my case) but I would like to upgrade to 4.7.1, which has been available for awhile.  However there is no package g++-4.7.1 and I don't know otherwise how to do it, does anyone else?
Comment: [How to install and use GCC g++ v4.7 and C++11 on Ubuntu 12.04](http://charette.no-ip.com:81/programming/2011-12-24_GCCv47/).
Comment: @lammilind Does this install 4.7.1?  Looks like it's 4.7.0 instructions.
Comment: @MattPhllips, now better to install 4.8.0. Above link illustrates the process. You should change the version number according to need.
Answer: Wow, this was excruciating. Here's how I did it (NB, for a 32-bit system):

$sudo apt-get install gcc-multilib
$sudo apt-get install m4
Download mpfr, configure, make, make install
Download gmp, configure, make, make install
Download mpc, configure, make, make install
In order to compensate for insufficient path information, added this to .bashrc

export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
export LIBRARY_PATH=/usr/lib/i386-linux-gnu export
export C_INCLUDE_PATH=/usr/include/i386-linux-gnu export
export CPLUS_INCLUDE_PATH=/usr/include/i386-linux-gnu

the former I got from here and the latter from here, modified appropriately for my install locations.
.7. Add these symlinks for the same reason:

$sudo ln -s /usr/include/i386-linux-gnu/gnu/stubs-32.h /usr/include/gnu
$sudo ln -s /usr/lib/i386-linux-gnu/crti.o /usr/lib/crti.o
$sudo ln -s /usr/lib/i386-linux-gnu/crt1.o /usr/lib/crt1.o
$sudo ln -s /usr/lib/i386-linux-gnu/crtn.o /usr/lib/crtn.o
$sudo ln -s /usr/local/lib/libmpc.so.3
  /usr/lib/libmpc.so.3

.8. Download g++-4.7.1, configure, make, make install
Answer: Try to compile g++-4.7.1
List of mirrors:
http://gcc.gnu.org/mirrors.html
Select mirror, click releases and search for gcc-4.7.1.
Download source, and compile.
Comment: Thanks, working on it--looks like there's a lot of dependencies to wade through first so it might be awhile.
Comment: Well, after installing gmp, mpc, and mpfr as well as gcc-multilib (to get rid of an error arising because the compiler couldn't find `bits/predefs.h`), now the compiler can't find `gnu/stubs-32.h`.  The weird thing is that this seems to be a problem when compiling in 32 bit mode on a 64-bit system--however I'm doing this on a 32-bit laptop.  `apt-file` says this is part of the `libc6-dev` package, but I already have the newest version installed...

How to upgrade g++ to 4.7.1?


Problem Frozen flour

Question: Have kept flour in freezer all the time - last time we got out the 5 lb bag it had chunks of flour in it.  Can only assume it is caused by moisture in the flour since it was kept in original bag - have never placed the flour in air tight container and never had this problem.  Can running the flour thru a food processor to break it up "hurt" the flour?
Comment: Have you checked if it still smells okay? Another good reason to keep flour airtight is to keep it from picking up odors, and if it managed to pick up that much moisture it might well have picked up other things.
Comment: I probably should have asked this earlier... are they ice chunks or just all-flour globs that break up easily by hand? You certainly wouldn't want to use flour that has chunks of water in it.
Comment: I agree with Jefromi - years ago when I first started storing whole-grain flours in the freezer, I didn't bother putting them in sealed bags.  I never had the problem described in the question, but I did notice my flour picked up noticeable odors which in one case even seemed to give some bread a weird flavor, and thus I've sealed it in the freezer ever since.
Answer: Not that I can imagine. Many of the recipes I use call for making doughs in a food processor and the first step is often "sifting" the flour by pulsing it a couple of times either alone or with the leavening agents.
This shouldn't hurt your flour, particularly if your recipe calls for sifting your flour.
I do recommend that you consider measuring your flour by weight (if you are able), if the chunks are too big to give you a good volumetric measurement before processing, especially if you're making a recipe that's generally "picky" about flour amounts or specifically calls for "pre-sifted" volume measurements. Processing the flour will likely aerate it somewhat and may throw your volumetric measurements off slightly. Weight measurements shouldn't be effected by this.
If the chunks are small (1/2 inch/1 cm), you  may be able to get a good volume measurement before you process the flour.
Consider coming back and letting us know how it goes!
Answer: I always save the small silica packets that come in spices, vitamins, and many other products to absorb moisture. Throw them in your flour bag and voila no more moisture. Can also be done after the fact to absorb moisture already mistakenly introduced to food.
Comment: This is a pretty oblique answer... not going to delete it, because the question can certainly be interpreted as "how do I unclump the flour", but it's not exactly obvious.

Problem Frozen flour


Using citations in chapter headings?

Question: I noticed in some books I read that under each chapter title, there is a citation, somewhat related to what the chapter in question is about. I was thinking of maybe using the same technique for my (first) novel. I have no experience in creative writing and so I was wondering whether this is frowned upon or generally accepted? Are there any legal considerations when quoting somebody in a book?
Comment: Personally, I find these annoying.
Comment: @what Thank you, I'll bear it in mind. You can't please everybody...
Comment: @what: Personally, if I find these annoying, I just skip them. Sometimes they contribute quite a bit to a story, sometimes they are worthless fluff.
Comment: Well, the question is: Why do you add an epigraph? To show that you have read all these classics? To let the reader know what the book or chapter is about? Often, if the novel is SciFi, the quotes from novels of the present past are incongruous and clash with the fiction of being in the future. And so on. Like everything in a novel, you should not just add epigraphs to add epigraphs. You should add them only if they add to what you want to do with your book. In many book, in my opinion, the epigraphs distract and subtract from an otherwise good book. So think carefully what you do. That's all.
Answer: This is widely accepted, a rather common "flavor".
Yes, there are legal implications, unless you use public domain works or made-up citations.
In case of citations from works still covered by copyright, such use is not covered by Fair Use clause (unless you're parodying the content of the citation in in the following chapter, or referring to it by some other Fair Use clause) so either you obtain permission from the copyright holder (not always for free, not always granted at all), or you just violate the copyright.
While such minor copyright violations are hardly ever pursued by the copyright holder if the work is niche, you're likely to hear from their lawyers if you publish a popular book that earns you significant profits.
...that's why you'll usually find the quotes from Shakespeare, authors good 200 years old, or ancient philosophers. Quoting a modern pop song lyrics is asking for trouble.
Comment: @am304: Yes, copyrights on anything published before 1923 have already expired. (except of some rare special exceptions covered by separate local laws, like in the KJV Bible in the UK, being under perpetual copyright of the Queen.) Note it's the publication date that counts, not the creation date (see a case of an [XIX century letter only recently published.](http://blog.librarylaw.com/librarylaw/2010/03/factoids-what-is-the-oldest-work-protected-by-copyright-in-the-us-what-work-will-have-the-longest-protection.html)).
Comment: Thank you very much. So presumably, this one for example would be OK: "All that is necessary for the triumph of evil is that good men do nothing." Edmund Burke - Irish orator, philosopher, & politician (1729 - 1797)

Using citations in chapter headings?


Question about narrative mode

Question: So I am reading an essay by George Orwell. The essay is written in first person (I) but what I
cannot understand is whether that is Orwell speaking in the essay or some random speaker that speaks in first person. Basically what I am asking is whether that is possible for there to be a narrator of a story who talks in first person without it being the author of the essay.
Comment: That's what's fun about first-person essays. You can't tell. And that's on purpose. You're **sposta** wonder about that, and question it, and think about it, and maybe do some research of your own to answer the question. That's why people write essays in the first place -- to stimulate thought and doubt and questions.
Comment: If it's fiction, the first-person narrator is usually the character in the story, unless the story is semi-autobiographical. If it's non-fiction, I'd assume the narrator is the author.
Answer: Without knowing which particular essay you are talking about, it's impossible to tell whether you are reading the thoughts of George Orwell as his earnest self or as a character whose views and prejudices he is trying to represent to entertain his readers or to make a point about the character— or perhaps to try to re-create his younger self in hopes of understanding and explaining his motives. Even in books like Down and Out in London and Paris and The Road to Wigan Pier and Homage to Catalonia, the narrator describing the action is not simply the man responsible for writing the story—he is also a crucial character in selectively remembered and inevitably dressed-up scenes.
This would certainly hold true for a biographical essay such as "Shooting an Elephant," in which the narrator closely analyzes the pressures and motives and conduct of the George Orwell (or Eric Blair) he used to be, but also draws out the ways in which this younger Orwell embodies the burdens of empire—the defining, inescapable arrogance and fear of an imperial functionary.
One great instance of a narrator/memoirist who is clearly not identical to the author behind the scenes is Franz Kafka's "A Report to the Academy." In this biographical essay, the narrator recalls his early days as a free ape and discusses how his subsequent captivity forced him to become human. So the narrator is not at all like Kafka—except that the more deeply you read the piece, the more similar the situations of the former ape and of Kafka (and of all of us) seem to be.

Question about narrative mode


Can anyone suggest a detailed installation process for Ubuntu on Windows 8.2?

Question: I have never used Linux based OS and looking forward to use Ubuntu. I want guidance on installing Ubuntu with Windows 8.2 as dual boot?
Answer: Make a bootable USB-stick
To create a bootable USB drive the tool that I advocate using is the Universal USB Installer from www.pendrivelinux.com.
Partition
Windows takes up the whole of the drive when it is first installed. In order to install Ubuntu you will need to make space for it.
Press the "super key" (Windows key) on your keyboard and click the magnifying glass in the top right corner. In the search box start typing "Partitions".
Click on the option called "Create and format partitions". This will bring up the "Disk Management" screen.
To shrink the drive, right click on the "OS (C:)" volume and select "Shrink volume".
A screen will appear showing how much you can shrink the drive by. You can of course choose to shrink the drive by less than offered but never go for any more than offered as you will break your Windows 8.1 operating system if you do.
Click "Shrink" to continue.
When you are finished you will see that there is a lot of unpartitioned space. This is where Ubuntu will be installed.
Fast Boot
To be able to boot to your Ubuntu USB drive you will need to turn off the fast boot option.
Press the "super" key (Windows key) and then click the magnifying glass in the top right corner.
Enter "Control Panel". Click on the "Control Panel" option that appears.
When the "Control Panel" appears click on the "System and Security" heading.
Now click on "Power Options".
On the following screen click on "Choose what the power button does".
A screen will appear with the heading "Define power buttons and turn on password protection".
Scroll down until you see "Shutdown Settings".
An option should be available called "Turn on fast startup" (recommended).
Uncheck this option.
Click "Save Changes".
Secure Boot
In theory you don't need to turn off Secure Boot any more. In practise it is almost certain that you will.
Turning off secure boot depends on the make and model of your computer as each one has slightly different methods for turning it off.
Basically though click on the "super" key (Windows key) and then click on the power icon next to your user name.
Hold down the shift key on your keyboard and select restart computer. Keep the shift key held down until your computer reboots.
You will now have an option to go into your UEFI boot settings.
Within the UEFI settings look for the option to turn off secure boot. You don't have to switch to legacy mode and you shouldn't switch to legacy mode as this will not help your cause.
Save and exit the UEFI settings
Install Ubuntu
When you have turned off secure boot, save and reboot. You will probably end up back in Windows.
Now at this point to boot into Ubuntu on the USB drive I had to again hold down the shift key whilst rebooting the computer.
One of the options that appeared let me boot from the USB drive into Ubuntu 14.04 live and you should have a similar option available to you.
To begin the installation double click on the "Install Ubuntu 14.04 LTS" icon.
The first thing you need to do is decide which language you would like to use.
Unless you feel like the challenge isn't great enough I would choose the language that you would normally use.
Click "Next" to continue.
The next screen lets you choose which internet connection to use whilst installing Ubuntu.
Do what you want...
If you have a good broadband connection you may wish to connect to it now so that you download updates as you go. This will slow down the initial install but will save time later on as you won't have to install lots of updates.
When you click "Next" you will be shown a tick list highlighting how prepared you are for installing Ubuntu.
Click "Continue".
In the past there used to be an option on the "Installation Type" screen to install alongside Windows.
If you are installing alongside Windows 7 on a non-EFI based system then you will still have that option.
Click on "Something Else" and click "Next".
The next screen show the partition table on your computer.
Be very careful with the next few steps.
If you haven't taken that Windows backup, quit the installation, reboot and follow step 1 of this tutorial again.
You will see a large portion of free space, this is from the shrinking before. This is where I put Ubuntu.
The free space is going to be split into 3.
The first partition is for Ubuntu and will be 50 Gigabytes in size. (Examples size)
The second partition is for your home partition and stores configuration files and your personal files such as music, pictures etc.
The third partition is for swap space and is used for intensive operations and suspending the computer.
When you have found the partition with free space, click on it and press the plus symbol (+) under the disk layout.
In the size box enter 50000, select logical as the partition type, select beginning of this space and choose EXT4 as the file system.
For the mount point choose / (this means root).
Click "OK".
The disk layout screen should now show a new partition for /.
Find the large section of free space again, click on it and press the plus symbol again (+).
This time you want to set the size to be the rest of the free disk space minus 2x the amount of memory in your computer.
If you have 8 gigabytes RAM, subtract 16 gigabytes.
Again choose "Logical" as the partition type, beginning of this space for where to put the partition and EXT4 as the file system.
For the mount point choose /home.
The issue of how much swap space to use is constantly up for debate. Some people say you don't need any at all, some go for 1.5 times the amount of RAM and some say 2x.
Unless disk space is at a premium I would just go for the 2x and have done with it.
In theory if you are running lots of intensive processes such as video editing then the swap space is used to store memory that isn't currently being used (swapped) to disk. This is disk intensive and slows down your computer but it will help to prevent a crash. Swap space is also used for suspending your computer.
Now find the free disk space again, click on it and press the plus symbol. (+).
Leave the size as the rest of the free disk space, choose logical as the file system and beginning of this space as the location.
Choose "swap area" as the mount point.
The final thing to concern yourself with when partitioning is where to install the boot loader.
By default it is set to /dev/SDA on the "Installation Type" screen. This can be changed but unless you are using multiple disks you should leave this well alone.
Press "Install Now" to continue.
This worked for me.
Comment: For a guide with pics, try this: http://askubuntu.com/questions/221835/installing-ubuntu-on-a-pre-installed-windows-8-64-bit-system-uefi-supported
Answer: Get a disk image of ubuntu (.iso file), and put it on a USB drive using win32diskimager or Unetbootin.
Then boot the the USB drive and follow the instructions given.
From there u can choose the amt. of space you want to give to each OS and also if you want some space for a swap


How Can I Set Width Of A Razor Grid

Question: I Want To Set The Width Of Razor Grid In MVC 3 ....Please Any One Guide Me . I will Be Very Thankful If Any Also Tell Me The Way To Make Grid More Attractive And Beautiful
Answer: CSS is a good way to achieve this. And here's a blog post which illustrates different techniques for applying class names to different parts of the WebGrid.

How Can I Set Width Of A Razor Grid


Substitute Sherry for Wine in Sour dough cookies?

Question: Can I substitute Sherry for Wine in my sour dough molasses cookies?
Wondering if the Sherry might have a different effect on the fermentation of my dough.
Answer: Sherry is wine, so yes, you can use Sherry in your recipe. Sherry is fortified, so its percentage of alcohol is perhaps a third more than most other wines. You don't say what kind of wine you usually use, but you could slightly dilute the Sherry with water to give it a close to equal percentage of alcohol as your usual choice. That would be the safest way to make the substitution.
Comment: Thanks to both of you. I had Canadian Sherry not sure of the Alcohol content. It was an "I'm out of" situation and had a bit of Sherry. A neighbour gave me enough wine. I only needed two tables spoons. I do appreciate your answers and will tuck the knowledge away for future reference. I will be more specific when asking questions in the future. Of course the amount being substituted would make a difference.
Answer: There are many types of sherry, just like there are many types of wines.  Alcohol content is one difference: normal wine can be anywhere from 8% to 15% alcohol, depending on type.  Sherry can vary in the 15-22% range.  Unless you are using a lot of alcohol in your recipe, it's doubtful that it will have a major impact on yeast growth.  It may take a bit longer for your dough to rise with higher alcohol, but if the wine/sherry is only part of the liquid, this effect will be relatively minor.
The other main difference can be sugar content.  If you are just using something labeled generic "sherry," it's probably fairly sweet.  However, sherry is also a term used to refer to a wide variety of Spanish fortified wines, varying from extremely dry fino sherries (usually 15-17% alcohol, not much more than normal wine) to dry oloroso sherries (usually higher alcohol content, but still dry) to the more "dessert wine" type sherries (like "cream sherry" and Pedro Ximénez or PX) that can be much sweeter than any normal wine.  A high alcohol sweet sherry might actually add enough sugar to give a slight boost to the yeast and somewhat counteract any minor slowdown from the alcohol.
If I were substituting sherry for wine, I would choose a style of sherry closest to the wine I normally use, if possible.  If you use a dry white, substitute with a fino.  If you use a dry rich red, try an oloroso, or perhaps an amontillado for a lighter red.  If you use a sweet red wine or rosé, perhaps a sweet or cream sherry could work as a substitution (probably most common for cookies).
In general, if there's only a small amount of wine in the recipe, the substitution probably won't make any noticeable difference.  If the wine content is high enough to influence the flavor, I'd be much more concerned about choosing a sherry with a similar flavor than I would be with minor differences caused by alcohol content and yeast; usually it might just require a little more patience for the dough to rise.
(If your recipe has a huge amount of wine in it, you might follow Jolenealaska's advice to dilute the sherry with some other liquid to avoid problems with yeast.  But that could also dilute the flavor, so I'd try a small batch first doing a straight substitution.)
Comment: Thanks to both of you. I had Canadian Sherry not sure of the Alcohol content. It was an "I'm out of" situation and had a bit of Sherry. A neighbour gave me enough wine. I only needed two tables spoons. I do appreciate your answers and will tuck the knowledge away for future reference. I will be more specific when asking questions in the future. Of course the amount being substituted would make a difference.


What is the correct way to solve this problem?

Question:
I first solved it by converting the two star connected networks into delta networks and further solving them.
Then I solved by considering one star, converted that to delta and then used parallel series concepts.
If anyone can tell me what's the correct approach I would appreciate the help.
Thanks!
Comment: Welcome to EE.SE. If you have tried something, please write every calculation you have done into your question not only some abstract ideas. Otherwise we cannot tell you where you are stuck. Hint: Redraw that circuit in "canonical" form. (I can solve it without pen, paper or calculator)
Comment: They look like stars, don't they. But had you noticed that the 8 ohm is in parallel with the horizontal 4 ohm resistor (why do we use component designators?), and the vertical 4 ohm is in parallel with the 3 ohm? Does that make it easier? What result do you get now?
Comment: Same suggestion here: show us the calculations you have done so far, even if it's a photo of what you did on paper! We want to see what have you done so far, if and where you got it wrong, and if you have invested more time and effort than what you expect from us to invest while helping you.
Answer: You have been trying to solve it the complicated way before trying the simple way.
The key thing is to first carefully observe it.
Then you will notice that the 4Ω and 3Ω (R2 and R3 in my schematic) are in parallel, as well as the 8Ω and the other 4Ω (R5 and R6), and that R2, R3, R5 and R6 are connected all together at one end.

simulate this circuit – Schematic created using CircuitLab

simulate this circuit

simulate this circuit
Then you notice that R1 is in series with the R2/R3 combination, just like R4 is in series with the R5/R6 combination, and the obvious fact that R1 and R4 are connected together at the "A" point:

simulate this circuit
Now you calculate the parallel resistance of R2 and R3, and the parallel resistance of R5 and R6.
Then you calculate the series resistance of the R1 branch which is R1 in series with the calculated R2/R3 parallel combination, and do the same with the R4 branch.
Finally, you calculate the parallel resistances of those 2 branches.
See how easy that was? No need for stars and deltas.
Think in simple terms first, and then use the more complex terms when you realize the simple terms can't work.
Again, the key is to carefully observe first. There is no shame in taking a little more time in the beginning just to see the whole picture, as that will save you from the headaches, problems, incorrect solutions, and the waste of even more time down the road.


How to Divorce my wife

Question: How do I kill my wife? I married a assassin girl thing and if I attack her in my house will she attack back? Or will my housecarl then attack me? I'm stumped
Answer: Your wife can be killed, tho not sure if she will attack back. I am not sure if the housecarl will "defend" her, so you could for safety just lead the housecarl into another room, close the door, then go and knock your wife out. Alternative is to order your housecarl to attack your wife first, beware they MIGHT not be able to do that, as they then will say "can not do that".
Whatever the case, both your wife and the housecarl are no match of you are decently geared. Your wife will at least not carry anything more than maybe an iron dagger. Your housecarl, if you've not armored him\her up, they will usually carry a iron shield and sword, meaning they won't do much damage. Housecarl usually seem to have high healthpool, tho (they don't die so easily).
You can not divorce your wife\husband, you can only kill them. You can't re-marry either, so if you wanna divorce to change wife\husband, you're out of luck. There might be a mod that let you do it, but I am certain you can't without.
Comment: Man, this question/answer/game mechanic cracked me up. For a second I thought I was on Stack Overflow.

How to Divorce my wife


Fitting curved lines to scatterplots in R

Question: I have created a scatterplot. I want to see the trend of how the number of fishing cat scats vary with an increase in perimeter of water body. Hence my response variable is number of fishing cat scats and predictor variable is perimeter of water body. After creating a scatterplot, I gave an abline (lm) command, which has given me a linear regression line, which doesn't exactly portray the relationship between number of fishing cat scats and perimeter of water body. What command do I need to use to generate a curve which fits the data?
I am using R as my statistical software.
Comment: The answers you got are fine;  just suggesting that this sort of question may get a lot more views in SO.
Answer: I recommend using the ggplot2 package. The command geom_smooth() will add a loess line by default, which may result in overfitting. You can also plot a second- or third-order function using stat_smooth(formula=y~scale(x)+I(scale(x)^2)) (modify this formula to suit your model). Example:
perimeter=rgamma(999,100);catscats=rpois(999,5);require(ggplot2)             #Simulated data
ggplot(data.frame(catscats,perimeter),aes(x=perimeter,y=catscats))+          #Call plot
stat_smooth(method='glm',family='poisson',formula=y~scale(x)+I(scale(x)^2))+ #Plot GLM line
geom_smooth(col='red',se=F)+geom_point()         #Plot LOESS line in red and add scatterplot

BTW, I fit a Poisson regression line here, but a negative binomial model might be wiser for your data depending on the dispersion of cat scats. You may prefer a confidence band around the LOESS line.
Comment: Thank you so much. My data is zero inflated count data.........so after running the command it says  "negative values not allowed for the 'Poisson' family"........what to do now?
Comment: Describe your new problem more specifically in a new question if you can't find another that already answers it.
Answer: Here is another way to do this, using the same data (except for random variation) that @Nick used
perimeter=rgamma(999,100);
catscats=rpois(999,5);
df <- cbind(perimeter,catscats)
plot(perimeter,catscats)
lines(lowess(df))


Is there a way to prevent a "keyword" from being syntax highlited in MS Visual Studio

Question: MS Visual Studio editor highlights some non-keyword identifiers as keywords
in C++ files. Particularly "event" and "array" are treated as keywords.
That's very annoying to me, because they are not C++ keywords.
I know how to add my own keywords to the list of syntax-highlighted identifiers,
but how to remove existing built-in ones?
I'm aware that this may require patching some executable files.
So does anyone know how to do this?
Comment: Possible duplicate: http://stackoverflow.com/questions/372580/why-is-array-a-reserved-word-in-c-c
Comment: That's not a duplicate - that's asking why 'array' is a keyword in the language.
Answer: Thanks to article mentioned by Steve Guidi, I was able to find executable file that contains Colorizer and IScanner classes. It is named vcpkg.dll and located in /Microsoft Visual Studio 8/VC/vcpackages. (I'm using Visual C++ 2005 Express Edition, things may be different in other versions.)
The vcpkg.dll contains null-terminated UTF-16 encoded strings. I've opened it with hex editor, and searched for "array". There is only one such string in the file, so I've replaced it with "arrry". (It is important to maintain relative alphabetical order with respect to other keywords.) Then I've searched for "event", it shows up in several places, but there is only one that isn't part of some longer string, so I've replaced this one with "evvvt". After starting Visual Studio, it turned out that "array" and "event" weren't any longer highlighted, but "arrry" and "evvvt" were!
Of course this is an ugly hack, and it will void your warranty,
and probably goes against Microsoft EULA, but what a relief for the eyes!
Anyway, if you want to do it, be careful and remember to backup the file.
Answer: It doesn't look like a disable-syntax-coloring feature is exposed in a user-friendly way.
The only way I can think of selectively disabling syntax coloring is to create a new syntax coloring plugin for the IDE, and list all of the keywords you want colored.  Microsoft gives information in this article on how to accomplish this task.
The drawback to this approach is that your IDE will now have two C++ languages and I'm not sure how it will select which plug-in to choose from once it loads a .h or .cpp file.  However, this article suggests that you can override the existing C++ plug-ins by rewriting some registry keys.
Comment: That would get rid of all C++ IntelliSense features as well.
Answer: I think the only "semi-practical" way to accomplish this to create a Visual Studio package that uses Text Markers to selectively cover up the keywords you don't want colored. Even that is not a little one-day task. Edit: Probably not even a full week task for someone not intricately familiar with the Visual Studio API and all its quirks, especially not getting it bug-free.
In other words, you probably want to just ignore them.


Recursively count number of sub-directories

Question: Is there any command or the group of commands that can count the number of all sub-directories recursively starting with the certain specific letter?
Answer: You can use a combination of the find and wc commands
For example, to count the directories starting at the current directory . and starting with letter 's'
find . -type d -name 's*' -printf "1" | wc -c

The -name condition matches against the name of the directory, using shell pattern matching rules (it is also possible to match using regular expression syntax, however that would be overkill here). The -printf "1" part prints the character 1 each time a match is found, and wc -c counts these characters.
The choice of 1 as the character printed and counted is arbitrary.

To display and count, you could do
find . -type d -name 's*' | tee >(wc -l)

however be aware that the count may be inaccurate if any directory names include newline characters (rare - but legal).
Comment: what does -name actually does ?? and what does -printf "1" does in this case ??
Comment: @Abiral please see updated answer
Answer: With python one-liner:
$ tree top
top
├── sub1
│   └── another_subdir
├── sub2
└── sub3

4 directories, 0 files

$ python -c 'import os,sys;print(sum([ 1 for r,s,f in os.walk(sys.argv[1]) for i in s if i.startswith("s")    ]))' ./top
3

The one-liner works as so:

We're going to pass the directory which we want to traverse as command-line argument, and for that we need sys module, while for directory traversal we need os.walk() function - hence we need `os module.
print() will print output of sum() which sums all items inside the list that we create via list comprehension (the [i for i in iterable] form).
The list comprehension can be treated as two nested for loops. On each iteration os.walk() gives top directory, its subdirectories list, and its files list. When we iterate over s subdirectories list, we'll check if each subdirectory starts with letter s , via .startswith() method, and if it does, 1 will be put on to the list. Thus sum() will basically add up together a  long list of 1's.
Answer: find . -type d -not -path '.' -printf 0 | wc -c ;
Recursively find all directories (-type d) within current directory (find .) that is not (.) directory and print 0 for each directory found. Then wc -c counts the number of characters (0) from the previous command output.


what are the implications of installing APC on a VPS running multiple Drupal sites?

Question: I have a single VPS running a number of independent Drupal sites. What considerations do I need to make (if any) when installing APC?
Comment: What are you using APC for? Some usages have no impact, others can have very large ones.
Comment: i have just read that apc can increase drupal performance. and at the hit that drupal takes on a server, anything can be good at this point.
Comment: i know this is a pretty general statement, but I am not a sysadmin and need to remedy the sluggishness of my drupal sites.
Answer: One thing to keep in mind is that APC will require quite a bit of memory if you have multiple sites because each file will be kept in memory, even if it is in fact exactly the same file, just with a different path.
So you need to watch and tune the amount of memory that apc uses/can use. By default, it's 32MB, that's often too less for even a single Drupal site if you have many contrib modules. The problem is that if APC has not enough memory, it will always have to delete files from the cache. If it has much to less (e.g. not even enough for all files in a single page request), it will make your site slower than if you hadn't used APC at all.
VPS often don't have a lot of memory, make sure that you have enough for your sites. You could consider merging them into multi-sites to save memory.
Answer: The implications are a much faster website!  Check out this article, and others, by 2bits.com
http://2bits.com/articles/benchmarking-apc-vs-eaccelerator-using-drupal.html
Here is another that talks specifically about tuning APC for drupal sites
http://2bits.com/articles/high-php-execution-times-drupal-and-tuning-apc-includeonce-performance.html
My company runs several sites on a single VPS with APC configured as suggested in the above articles.  That, with memcache, significanly speeds up our sites.
We have not witnessed any server issues or conflicts or had any security concerns, if that's more what you are asking.
Comment: any suggestions on configuring drupal and apc to run in a multiple site environment (i.e. non multisite environment)? or is it just enable and go?!!!
Comment: Just enable and go! APC is simply a caching mechanism to speed things up a bit. If APC finds that a script has already been executed, it will used the cached version.  This happens at the Apache layer. It does not matter where the PHP originated (what site I mean), so you should not have conflicts, regardless of the number of sites you may have. Use that 2nd article as a guide - You should not have any problems. ahem. try this on a testing server first, make backups, etc. Also remember to enable the PHP extension and restart apache.
Comment: Enable and go? The second article you link to describes some serious tweaking of APC before they found the sweet spot. The default performance was actually worse than without APC.
Comment: You can start with apc.shm_size and apc_stat. You can read up on those here. http://php.net/manual/en/apc.configuration.php For most of our sites on a shared ubuntu vps, those are really the only 2 we have to worry about. I have found that shm_size really needs to be set to about 300M for a drupal 7 site. After installing, pear will unpack 'apc.php.' You can copy that file into your root directory and monitor performance. This will help you find that sweet spot. Ex: http://goniseko.com/apc.php
Answer: APC as a general opcode cache is entirely safe, and will greatly help the performance of your sites. However, there is one potential problem. You can't use Drupal modules like http://drupal.org/project/apc in most shared server APC environments as it's a big security risk. The APC cache is generally shared between all sites running on the server without a lot of thought going into separating them. If you are not a sysadmin, I would steer well clear of these modules.
That said, just installing APC for the opcode cache will generally increase the performance of your sites by quite a bit, so it's definitely worth using. Just be aware of some of the issues with the other functionality provided by APC.


to remove casing from sausages or not?

Question: Is it best to remove sausage casing before cooking sausages or not?
I don't see it mentioned in recipes, but have seen it done by people when cooking. Is this a matter of preference or is there any improvement to quality of flavor when casings are removed?
Answer: I'm sure it's a personal preference.
Personally, I'd never dream of doing it, unless it was for a dish that specifically called for it, or one that requires 'chunks'*. Part of the job of the casing is to keep the sausages moist. You shouldn't even prick them with a fork whilst frying [yet some people do].
For chunks, there's a distinct difference between frying them whole & cutting up than cutting then frying. The first retains the shape, the second tends to squeeze out of the ends as the casing shrinks.
Answer: This is simply about the final preparation.  Casings are neutral when it comes to flavor.  If you prefer to serve your sausages whole, in the casing, they might add to the "snap", or mouth feel when you bite into it.  Otherwise, it is dependent on the recipe.

to remove casing from sausages or not?


Display the Business data that reside on PDW to sharepoint list

Question: I was trying to display the Business data that reside on PDW or APS (parallel data warehouse),  to SharePoint list .And to do so I tried to connect to the database server using SharePoint designer external Content Type feature but wasn't able to. I am not sure if SharePoint allows to connect to External Data source (PDW). I would appreciate if someone could assist me.
Thanks
Comment: Take a look here: https://msdn.microsoft.com/en-us/library/office/jj163975.aspx
Answer: You will have to make sure that the Business Data Connection Services is Activated and the external content type you have created contains information about connections, access, methods of operation, columns etc. Please follow this article to get further help:
https://support.office.com/en-us/article/Create-and-update-an-external-data-column-in-a-list-or-library-44EFF2C5-8051-489D-989C-F5D09F527AEE