Are "fake rimshots" really viable, and how can they be done?

Question: I've heard a couple anecdotes of a drummer in a studio who wanted a rimshot sound from the snare and was told to not play rimshots- so that the engineer could use compression later to make the normal hits sound like rimshots.  The idea is that the result would be more consistent and possibly have more body/low end.  However, I've never seen this demonstrated, so I'm skeptical that you could really get the same "crack" and energy out of a normal hit with compression.  Is it really possible to do this convincingly, and how exactly is it done?
Comment: The engineer may have just wanted the drummer to focus on executing the part by pointing out the fact that the sound in the headphones may not be the final drum sound.
Comment: Telling a drummer to change their technique would make them focus MORE on technique, and less on the part...
Comment: Sounds like you've already got the answer you want.
Answer: I wonder if they mean what I'd call the 'Green Day sound'? Not that they're the only band to ever do it, but just the one I specifically noticed first.
It's a sound I liked when I first noticed them using it, on the American Idiot album. They tweaked it up to be even snappier by 21st Century Breakdown & then 'perfected it' on Uno…
Unfortunately, by the time they'd 'perfected' it I think they'd also killed it. It's fine for one track but if you listen through the entire album it rather rapidly becomes tiresome & you're crying for a little less consistency & bit bit more humanity.
Have a listen to bits of all three albums [the rockier stuff, or course, they don't do it right through every single track] & see if you can hear what I mean.
Lots of compression, leaving a good snap at the front of the strike, but overall very high consistency between strikes. You can get clever with this by using the output of the top mic as a side-chain on the underside mic. You snap the top mic down hard but slow with a relatively long release, but make the bottom mic pretty much eliminate the head of the sound [there's value in playing with the attack on this, similar to the top mic, but you kind of want to tune it in afterwards], then let it breathe a bit sooner. That can really bring up some controllable ring. [I'd be pretty sure Green Day don't do this, but it's an option if you want a bit more life in it.]
Comment: I'd probably also trigger a sample and mix that in to beef it up a bit, if I wanted to have it created in the mix and not in the room
Comment: Those tracks sound like convincing rim shots to me, but do we know that the sounds were achieved as I described?  If I didn't know better, I'd guess they were using a sample for that snare tone.  I haven't been able to get the compression right to match this, it always sounds like a normal hit that's been heavily compressed (which it is), and not a convincing rimshot.
Comment: To me they don't really sound like rimshots, but I can imagine someone describing them as such. I learned decades ago to accurately rimshot every time, so if I'm playing, as I'm also an engineer, I often get a lot of say on what the recordist is doing [or at least a healthy input - if I'm just session I do what they ask eventually;) I doubt there's a sample added to that sound. Green Day don't strike me as the kind of band that would put up with that. Bear in mind, this isn't a garage band in a local studio, there's money & expertise went into this.
Comment: Without knowing anything about the equipment or room used, to me it's the epitome of the Black Beauty in a good room, good mics, good overheads, good engineer. In 2005 compression tech was sufficiently advanced that it would be pure guesswork to try figure out just *exactly* how it was done. Maybe see if Google can turn up an engineer/producer interview from one of the recording mags.


Laptop cpu staying 98 degree celcius for 1 minutes during rendering video

Question: My Dell Inspiron 3501 having 11th gen 1135g7 with igpu iris xe is reaching around 98 degree (aprox for 1 minutes) continiously  during video rendering(of 4minutes). After one minute fan kicks on full speed and temperature goes down to around 85. For next 3 minutes temp was around 82-85 degree celcius. Is it safe for my motherboard and CPU?????????????
temp graph
Comment: No; Those temperatures are not normal; You have cores nearing their maximum temperatures; Did you disabled any cpu features designed to down clock your CPU?  Whatever codec your using to encode their video should be avoided
Comment: I dont disable any cpu feature. In Dell power manager I have changed my options from cool mode to Ultra performance mode, also i have changed my windows power slider to best performance. If i select "COOL" mode then temp only reaches upto 65 degree and my render time just doubles. But i am wonder how temperature can go as high as 98 and stays for 1 minute. I dont have installed any video codec externally. Whatever codec is there is only by windows update.
Comment: "Cool" mode is adjusting the clock of the CPU.  What does Dell indicate it's supposed to do?  Your using something to encode the video which is using a codec
Comment: Yes Dell Cool mode actually decrease performance by limiting clock and increase fan spinning rate. I have two drivers installed HEVC video extension from device manufacturer and MPEG-2 Video extension. I dont know if these are working as codec. Also during rendering in Premier pro my integrated graphics (dont have discrete) are not utilized (only 2-5% utilization) and my cpu and ram utilization is 100%.
Comment: Both of those are a codec but there likely are not the codec Adobe Premier is using.  Adobe hardware acceleration requires specific hardware, it sounds like your iGPU, is NOT supported.
Comment: I have checked. Only for MPEG videos format it wont use iGPU but for every other format like AVI it is using iGPU(100%), CPU 70% and ram 85% But still my temp are around 88-92 during rendering for the . I think i have to use it in COOL mode where temp. decreases to 65 and time just doubles.
Answer: Yes. That is within limits and the fact that the Fan kicks in as it should and then the CPU cools down means the Fan is working properly.
So long as it works like this and cools down after a minute means your computer is working properly.
Consider your long term needs as eventually you may need a stronger computer, one geared to high loads. In particular a CPU designed to handle your load over long periods of time on a very good heat sink (the biggest that the manufacturer can fit in).
Answer: These temperatures are acceptable, but high.
I don't know much about your hardware and video, but the video codec that you use
might not be able to use the GPU. Installing a good codecs pack might help with
a better codec that will offload the video work from the CPU to the GPU.
On Windows I recommend the
K-Lite Codec Pack.
Comment: You r right. Task manager tells GPU is not getting used and only CPU and ram is 100% utilized. I dont know much about codec for rendering. I am using adobe premier pro 2021. My laptop is new and every drivers are preinstalled. Will video codec will transfer video render work to GPU????? I have only integrated graphics Iris xe 80 eu. But in my opinion temp are too much and not acceptable. 100 is Tj for my processor so temps cant go above that and staying in 98 for a minute can damage it in long term. I know my processor can definitely bear that temp but i am sure my motherboard can't.
Comment: Adobe published an article indicating which GPU are supported for hardware encoding. Your question failed to identify the software and failed to identify what GPU you have. If the only GPU you have is the igpu that changes everything
Comment: I only have integrated graphics Iris Xe. Is it the reason Premier Pro isn't able to use my igpu??
Comment: This Adobe Premiere Pro [article](https://helpx.adobe.com/premiere-pro/kb/gpu-and-gpu-driver-requirements-for-premiere-pro.html) might mean that it likes best Nvidia GPUs. Try to install a codec pack, and if this doesn't help then you will have to live with it. Ensure clean airways and perhaps invest in a cooling pad.


When does depth testing happen?

Question: I'm working with 2D sprites - and I want to do 3D style depth testing with them. When writing a pixel shader for them, I get access to the semantic DEPTH0. Would writing to this value help? It seems it doesn't. Maybe it's done before the pixel shader step? Or is depth testing only done when drawing 3D things (I'm using SpriteBatch)? Any links/articles/topics to read/search for would be appreciated.
Answer: Depth testing, according to the description of modern 3D pipelines, is done after the pixel shader, which is why Direct3D provides the DEPTH output semantic and OpenGL provides the gl_FragDepth built-in variable that allow you to change the value against which depth testing is performed.
However, it's kind of a waste of precious GPU processing power to shade a pixel and then throw it out because it's behind an object that we already knew was there, particularly if the pixel shader doesn't change the Z value. This is the idea behind the Early-Z optimization, where if you're rendering a pixel whose pixel shader doesn't change the depth, the hardware may never actually run the pixel shader (or, more likely, if a full 2x2 quad of pixels is occluded, then none of them will be run through the pixel shader). This is why you want to render a fully-opaque scene from front to back.
This leads into another almost universally-implemented optimization called hierarchical Z-culling, or Hi-Z. The idea here is that the hardware can keep lower-resolution conservative depth buffers around and throw out huge chunks of pixels at once if it knows that all those pixels are occluded by pixels currently in the depth buffer (by knowing the "rearmost" depth over large regions of the depth buffer). This process is not unlike mipmapping, but it keeps the maximum (or most permissive) depth value instead of the average one.
Neither of those optimizations are available if you change your output depth in the pixel shader, so for 3D scenes doing so is discouraged. However, both Direct3D and OpenGL have a "conservative depth output" feature that is intended to let you change the depth and still let the GPU do its optimization (this is SV_DepthGreater, SV_DepthLessEqual, and friends in Direct3D 11 and ARB_conservative_depth in OpenGL). The idea there is that you're allowed to change the depth as long as you make some promise about it: i.e. "my altered depth is always less than the original depth." If you promise never to bring an object forward in the scene, the GPU can throw out pixels that are definitively behind another object because it knows your pixel shader won't screw everything up.
All this is intended to say that you should be careful when changing a pixel's depth. In 2D most of the culling-related implications probably won't affect you very much, so you're probably in the clear. But you should be aware that when pipeline descriptions say that the depth test happens after the pixel shader, they're only telling part of the truth.
Comment: +1 Great answer, with lots of additional bits of information that I had no idea about (i.e. they weren't even mentioned on the books I've read).
Comment: This is the only book I know of that mentions the interaction between Hi-Z and conservative depth output, although I'm sure there are more: http://www.amazon.com/dp/1568817207
Comment: Thanks for the reference! I've had my eye on that book for a while now, so this is yet another reason for me to get it. I admit that most of my knowledge is still frozen at DX9 hardware level..
Answer: In the traditional render pipeline, depth testing occurs between the stencil and blending steps of fragment processing (source).  Usually it's something that can only be taken control of via state variables (at least in OpenGL), and I must admit that I'm not as familiar with the pipeline of XNA.
I guess what I'm trying to get at is the depth-buffer corresponding to the active frame-buffer is not typically something that is part of the programmable graphics pipeline.  Several techniques will usually fill the depth-buffer in one pass and access it as a texture in a second pass.
To sum up, depending on how you draw your primitives, it may already be done for you.
Comment: The flow diagram in that pdf was exactly what I was looking for. I'll read through and let you know if I was able to figure it out.
Answer: Depth testing happens in what is known as the merging stage after the pixel shader (also check this link). There's however an optimization technique called the "Early-Z Test" which is available in some graphic cards, and it consists of moving the check before the pixel shader so that it can be skipped completely for occluded fragments.
As for whether you can modify the depth value of a fragment in the pixel shader, yes you can and this source confirms it. although I'm not sure how to use it correctly. Quoting:

The DEPTH output semantics can be used to change the destination depth value at the current raster location.

As for your confusion regarding 3D, you should know that the SpriteBatch class also works with 3D behind the scenes. It's basically generating two triangles (i.e. one quad) for each of your draw calls.
Finally, I think what you're trying to achieve is usually done in another way, by using deferred rendering, where you'll also need an heightmap (and a normal map if you intend to do lighting) for each for your sprites. Check this amazing video example of the technique. I used to see an article with an implementation of the technique but I can't seem to find it at the moment. The video does state at one point "Writing the heightmap to the depth buffer allows for objects to intersect in 3D" which might be a useful hint.
Comment: @UtkarshSinha Yes, from my experience, if you don't define your own vertex shader, the SpriteBatch will fallback on the default implementation. As an added note, whenever I've had to implement my custom vertex shader for SpriteBatch, the following bit of code was always necessary: [sample](http://pastie.org/3723974).
Comment: That video is actually what I'm hoping to do! I am trying to use the 'builtin' depth testing functions to work on the heightmaps instead of using another rendertarget and doing it 'manually' with shaders.
Comment: @UtkarshSinha I figured :) I'd also like to try it sometime.
Comment: If SpriteBatch generates triangles - and my shader doesn't have a vertex shader function, how does it render? Does it use some default vertex shader?

When does depth testing happen?


How to track category,subcategory and product details in omniture?

Question: How to track category, subcategory and product details that is being viewed by a user in Omniture sitecatalyst?
Answer: If you are talking about groupging products into categories and so on, the best practice method with Omniture is to capture the individual products (e.g. SKU), and then manage the groupings of these through SAINT Classifications.
Basically this is a text file lookup which has your SKUs, along with the various categories etc you want to assign to each. You synchronise this with the SiteCatalyst GUI.
This works better than trying to record these groupings at the time the code fires.
Answer: Your account should be configured with Site Section and Site Sub Section (and perhaps sub-sub section) properties. You should populate Site Section (s.prop2 in my configuration) with your category, and Site Sub Section (s.prop3 for me) with your subcategory.
You can send a product details in the s.products variable in the format of:
s.products="Category;Product;Quantity;Price[,Category;Product;Quantity;Price]"
When multiple products are purchased at once, you should separate each data set by a with a comma.
Answer: There is another way of tracking category, sub category and sub sub category. We can use evar4, evar5 and evar6.
evar4= "parent category";

evar5="sub category";

evar6="sub sub category";

If you are in parent category, then all these three vars have same value.
if you are in sub category then evar4 holds parent category, evar5 and evar6 holds sub category name.
if you are in sub sub category then evar4, evar5 and evar6 holds first, second and third level of category name.


Can I sync a Norman strobe pack with a Nikon D5100 with something that goes on the hot shoe?

Question: I have a Nikon D5100. I am trying to use it in a studio setting with a Norman 800w strobe pack. How do I sync the light to the camera? Is there something that can go on the hot shoe at the top of the camera?
Comment: Do you mean the Norman P808m/TLC-1 Power Supply?
Comment: Did your Normal light(s) come with PocketWizard slave? Which Norman strobe are you using?
Answer: You need a hotshoe-to-PC sync adaptor on your hotshoe and a PC to 1/4" sync cord (or a cheaper generic) to run from the adapter on your hotshoe to the Norman Power Pack. The cords are available in many lengths and brand/quality levels. There are also a large number of sources for such adapters.
Check your camera's manual to find the maximum flash voltage tolerance and check the manual of your Norman Power pack to find the trigger voltage. If your camera can't tolerate the trigger voltage of the Norman Power Pack, you'll need a hotshoe-to-PC sync adapter that also provides voltage reduction. Otherwise you could fry your camera's flash circuit or maybe even your camera's main power board.


will increasing threshold always increase precision?

Question:
here precision at threshold 0.85 > precision at threshold 0.90. shouldnt it be the other way round? increasing threshold will reduce False positive and precision will be greater than before?
Answer:
here precision at threshold 0.85 > precision at threshold 0.90. shouldnt it be the other way round? increasing threshold will reduce False positive and precision will be greater than before?

Precision is $\frac{\text{TP}}{\text{TP}+\text{FP}}$
Both $\text{TP}$ and $\text{FP}$ are reduced when you increase the threshold. If both decrease in proportion to the current precision (i.e. they are spread evenly at each confidence value), then precision will remain the same. Most models on most datasets will tend to increase precision as the threshold increases, at least initially (e.g. moving from 0.5 to 0.6) as false positives may commonly be found as uncertain edge cases with low confidence, i.e. false positives tend to occur more frequently at low confidence, so increasing threshold will exclude a higher ratio of false positives than true positives than the current precision. However, there is no guarantee of that.
The value of precision will vary in practice depending on what the model predicted for each example. If you have a cluster of highly confident false positives, they can cause precision to drop as threshold grows, until they get excluded. The most extreme example would be where the most confident classification is incorrect, in which case the highest possible threshold will score zero precision.
Comment: Thank you for the explanation :)
Answer: If you look at ROC curve you get to see a different picture
ROC-AUC curve

Uptill point A TPR is increasing faster than FPR so that means precision should be higher here. After point A TPR is increasing at slower rate than FPR and so Precision should start decreasing, after point B the precision should further decrease.
Here in ROC from left to right threshold is increasing, so as threshold increases, initially precision also increases but then later starts to drop. Recall continues to increase from left to right.
But my doubt is if really threshold is increasing in ROC from left to right, most of the online notes and text just says "ROC is plotted against different threshold values" It doesn't say whether threshold is increasing from left to right or decreasing.


failure to upgrade Windows 10 from Windows 7

Question: I have tried a number of times (6) to upgrade to Windows 10 and they all failed when I get close to the end and my system is being configured.  My previous windows is reinstalled and I get the message:  0x8007002C 0x4000D The installation failed in the SECOND BOOT with an error during MIGRATE_DATA operation.    I have uninstalled all my virus and malware software and done a clean boot before downloading - unplugged all my usb connections but to no avail.   Any ideas would be greatly appreciated before I give up on the whole idea.
Answer: I would advise downloading the Media creation tool from here
https://www.microsoft.com/en-us/software-download/windows10 then create an ISO and then install from that.
Comment: Thanks for that I will give it a try - nothing else works
Comment: Tried that, burnt ISO to Disk and went through the same process, this time disconnected from the net while doing so and got to exactly the same stage again with the same result and the same error code/message. I don't understand the problem as I have a new computer with nothing weird or unusual installed on it.
Comment: Check out the setuperr.log located in C:\$windows.~bt\Sources\Panther. Enable show hidden files and system files. This looks to be similar http://brandonpotter.com/2012/10/29/windows-8-setup-setup-has-failed-to-apply-migration-data/
Answer: Look at my solution http://www.howto.probably.me.uk/windows10.html
After trying to upgrade from Windows 7 many many times, and failing and just about to give up, I found that this worked.
Comment: Please see my comment on your [other answer](http://superuser.com/a/1095030/364367).  In general, link only answers are a problem because links break and then the answer has no value.  Include the essential information within your answer and use the link for attribution and reference.  You've got both a registered and an unregistered account, which will create problems for you on your own threads.  See http://superuser.com/help/merging-accounts.  BTW, repeatedly posting just links to your own website is likely to be treated as spam.


Get FVector from Blueprint tick function

Question: In my BluePrint Tick function for my character, I have a FVector that always changes, and in my C++ component, I want to get this changing FVector and use it in my C++ Tick function, is that possible to do?
Answer: To set this in C++, you need to create a UPROPERTY in your C++ code then write a function to set this property.
In your C++ header file:
UPROPERTY(BlueprintReadWrite, Category = "FVectors")
FVector MyCPPVector;

UFUNCTION(BlueprintCallable, Category = "FVectors")
void SetFVector(FVector VectorIn);

And in your cpp file
void SetFVector(FVector VectorIn)
{
    MyCPPVector = VectorIn;
};

Now after you've set the FVector in your Blueprint, call the SetFVector function and plug the BP FVector output into the input of the function.
Comment: This is the correct and most concise solution


If surface area decreases then potential energy reserved by the topmost molecules of the liquid also decreases, but how?

Question: In a liquid the molecules which are closest to the surface has a net force downwards. But how it helps them to store potential energy? And to minimize the potential energy the surface area shrinks forming a circular shape. How forming a circular shape helps to reduce stored potential energy?
Comment: Surface molecules are generally associated with unsatisfied bonds, which means that the energy is higher than it would be otherwise (because bonds release energy when they form). Is this concept familiar?
Comment: Yes i know. When bonds are formed then potential energy inside the atoms are released. Okay now i have some idea about how potential energy is stored in surface molecules. But what about the shaping phenomenon?
Answer: Forming bonds releases energy. I can see you are aware of that from the comments.

Now, how can a liquid form as many bonds as possible and reduce the number of unsatisfied, unformed possible bonds as much as possible? It can do that by giving all molecules as many neighbours as possible to bond with.
And which molecules have the least neighbours? Those at the surface.

So this essentially comes down to reducing the surface area as much as possible.

And which shape has the smallest surface area? That happens to be a ball.

You can see that simply by calculating the surface area of a ball and comparing it with surfaces areas of other shapes with the same volume.
Answer: In brief, minimizing the surface area of condensed matter releases (not stores) the maximum amount of energy.
Surface molecules generally feature unsatisfied bonds because it's not possible for bonds to form in all directions, as they would in the bulk. This situation is equivalent to an energy penalty for every unit of surface area that exists. This penalty can drive surface reconstruction, for example, in which the state of bonding near the surface changes form, density, orientation, and so on. It also drives spontaneous reduction of the surface area. (A reduction in energy over a distance is equivalent to a force, which we call surface tension.)
Thus, a drop of water in 0 g spontaneously forms a sphere. In this way, the maximum number of molecules are on the inside, forming fully satisfied bonds with the neighboring molecules and thus releasing the maximum possible amount of energy to the surrounding environment.


Does cron execute jobs asynchronously?

Question: If I add 5 jobs in my crontab, do they execute asynchronously in parallel ? Two of my jobs may take 10 minutes to complete and I want to know if I need to run them in the background (by adding the & at the end of the command).
Answer: crontab entries are processed independently, so yes, the jobs are run asynchronously, in parallel. You don't need to background them.
If you ever need to synchronise jobs, check out the techniques mentioned in Can a crontab job run concurrently with itself?.
Answer: The exact sequence in which jobs are executed will depend on the implementation of your systems' crond.
What is your OS?
If you have cronjob in a crontab:
Job 1
Job 2
Job 3

In Debian Job1 will start, without waiting to finish Job 2, etc.  In Debian and Ubuntu derivatives it is top-bottom
In FreeBSD it is bottom-top
If your cronjobs are in /etc/cron.hourly(or daily/monthly/weekly) - then the script that runs them does it sequently, not in paralel. (a script loops though them and waits for each to finish)
EDIT
Add two different cronjobs (here I assume you have syslog configured)
* * * * * ls /etc/
* * * * * echo "whatever
tail -f /var/log/cron
Comment: We are using Centos 6
Comment: CentOs6 uses top-bottom as well.

Does cron execute jobs asynchronously?


Did a Vice President ever cast a tie-breaking vote against his own party?

Question: The Vice President is theoretically allowed to vote according to his own conscience, just as all other members of the Congress. But did a situation ever occur where the Vice President cast a tie-breaking vote against the party of which they were currently a member?
Comment: Before the adoption of the [12th Amendment](https://en.wikipedia.org/wiki/Twelfth_Amendment_to_the_United_States_Constitution) in 1804, the President and Vice President were not necessarily from the same party. It's quite likely some VPs form this era cast tie breaking votes against the party of the President.
Comment: @RoyalCanadianBandit  There was only one vice president of a different party than the president prior to 1804, Thomas Jefferson was VP to John Adams from 1801 to 1805.  The only other time that happened was Andrew Johnson (Democrat) in Abraham Lincoln's administration (Republican), but technically they ran on the Union ticket (1864).  They had no congressional party.
Comment: that still wouldn't fit the question: "against the party of which they were currently a member" I think a better guess would be under either Roosevelt, one switched parties and the other switched VP's twice. So the VP might be assumed to be at odds with the president, or the administration at odds with the party. I don't know my history well enough to even name the VP's though.
Answer: Yes, in January 1832 when Vice President John C. Calhoun (who had served as VP under John Quincy Adams and Andrew Jackson) cast tie-breaking votes on two different occasions to kill President Jackson's nomination of Martin Van Buren to be the U.S. Minister to England.
Comment: Good catch. Also, Good call on Calhoun's part. Van Buren was one of the more mediocre U.S. politicians.
Comment: It's worth noting that the US was in the middle of a realignment then.  While both Jackson and Calhoun had been Democratic Republicans, Calhoun was a Nullifier in 1832 while Jackson was a Democrat or Jacksonian.  So Calhoun wasn't necessarily acting against his party.  He was a different party from the president.  A third example (along with Jefferson and Johnson) of a VP not of the same party as the president.


Check Valve Or A Flapper Valve For My Sewer Drain

Question: I live in a trailer, so my sewer line is above ground, with the clean-out plug between 12" & 18" above ground. During the cold winter in arkansas the toilet paper tends not to flow. Each trailer , there are 12 in line with my trailer being #10. We all tie into the same drain line. When the line get clogs at trailer 11 and/or 12 the back-up from trailers 1 thru 10 tends to fill my bath tub & over flows my toilet. My question is.. Is there some sort of check valve or a flapper system i can install that will prevent the this from happening and still operate properly when the main line is flowing/draining correctly? Thanks to all who respond with any advise.
Answer: There are back flow preventers they cost about 50.00 and do keep others sewer from coming in. They need servicing on occasion but with a pair of rubber gloves are much easier to clean than your tub filling up.


Urxvt: change background color on the fly

Question: Is there away to change the background color of a rxvt-unicode session on the fly? Like with Ctrl key?
I have a bunch of Urxvt windows and I would like to color some dynamically to help me distinguish them. But again, I mean on the fly...
Comment: No. You can with [Termite](https://wiki.archlinux.org/index.php/Termite), though...
Answer: urxvt 2.6 in 2004 added support for xterm's dynamic colors feature.  In XTerm Control Sequences, this is OSC 11.  OSC 10 sets the default text color.  The changelog mentioned part of the change:
2.6  Fri Apr  2 03:24:10 CEST 2004
        - minor doc corrections.
        - WARNING: changed menu sequence from ESC ] 10 to ESC ] 703 to
          avoid clashes with xterm.
        - changed OSC701/OSC702 sequence to return standard escaped reports.
        - xterm-compat: make set window colour and other requests report
          window colour when arg is "?".

but the source-code tells the story, as usual:
 /*
  * XTerm escape sequences: ESC ] Ps;Pt (ST|BEL)
  *       0 = change iconName/title
  *       1 = change iconName
  *       2 = change title
  *       4 = change color
+ *      10 = change fg color
+ *      11 = change bg color
  *      12 = change text color
  *      13 = change mouse foreground color
  *      17 = change highlight character colour
@@ -2949,20 +3236,21 @@
  *      50 = change font
  *
  * rxvt extensions:
- *      10 = menu (may change in future)
  *      20 = bg pixmap
  *      39 = change default fg color
  *      49 = change default bg color
  *      55 = dump scrollback buffer and all of screen
  *     701 = change locale
  *     702 = find font
+ *     703 = menu
  */

The manual rxvt(7) gives no useful information:

   XTerm Operating System Commands
       "ESC ] Ps;Pt ST"
           Set XTerm Parameters. 8-bit ST: 0x9c, 7-bit ST sequence: ESC \
           (0x1b, 0x5c), backwards compatible terminator BEL (0x07) is also
           accepted. any octet can be escaped by prefixing it with SYN (0x16,
           ^V).

This simple example sets both foreground (text) and background default colors:
#!/bin/sh
printf '\033]10;red\007'
printf '\033]11;green\007'

Like xterm, these default colors can be overridden temporarily by "ANSI" colors.
The feature can be disabled in xterm using the dynamicColors resource.  Unlike xterm, urxvt has no resource-setting for the feature.
VTE also implements the feature, and likewise doesn't document it.  urxvt at least started with documentation from rxvt.  For VTE, you have to read the source code.  The relevant feature in vteseq.cc looks like this:
/* Change the default background cursor, BEL terminated */
static void
vte_sequence_handler_change_background_color_bel (VteTerminalPrivate *that, GValueArray *params)
{
        vte_sequence_handler_change_special_color_internal (that, params,
                                                            VTE_DEFAULT_BG, -1, 11, BEL);
}

/* Change the default background cursor, ST terminated */
static void
vte_sequence_handler_change_background_color_st (VteTerminalPrivate *that, GValueArray *params)
{
        vte_sequence_handler_change_special_color_internal (that, params,
                                                            VTE_DEFAULT_BG, -1, 11, ST);
}

That code dates back to sometime in 2003 (when it was written in C):
commit f39e281529827f68fd0e9bba41785d66a21efc1c
Author: Nalin Dahyabhai <email@example.com>
Date:   Wed Jan 22 21:35:22 2003 +0000

    accept OSC{number};{string}ST as set-text-parameters, per XTerm docs (part

    * src/caps.c: accept OSC{number};{string}ST as set-text-parameters, per XTerm
        docs (part of #104154).
    * src/keymap.c: revert change to prepend "1;" to keys with modifiers (#104139).

Further reading:

Can I set a color by its number? (xterm FAQ)
Comment: I tested it last night with urxvt 9.15 on my Debian 7 (to be certain that I was reading the source correctly).
Comment: I just wanted to follow up on this and say that it works like a dream. Thanks again as this info would be hard to find.
Comment: I haven't tried this but this is so impressive and hard to find I will make it accepted! I hope it works in URXVT.
Comment: Finally I can change URxvt border color with `printf '\x9d708;black\x9c'`. Yes, I live dangerously and use 8-bit control characters. Thomas, thank you again, I always learn a lot from your answers.
Answer: I added the following to my ~/.Xresources file to change to colors on the fly pressing Ctrl and 7 or 8 or 9.
! change to red background
URxvt.keysym.C-7: command:\033]11;#ff0000\007

! change to light background
URxvt.keysym.C-8: command:\033]11;#ffffff\007

! change to dark gray background
URxvt.keysym.C-9: command:\033]11;#777777\007

If you want to set foreground and background color at the same time, just concatenate the commands (some colors are defined by names):
! change to red background
URxvt.keysym.C-7: command:\033]11;#ff0000\007\033]10;yellow\007

You can test your colors with a simple echo command, like this one:
echo -e '\033]11;#ff0000\007\033]10;yellow\007'   # changes to red background and yellow foreground

Attention
I used code 11 for background color and code 10 for foreground color. The definitions for Urxvt cited by Thomas Dickey indicate to use 49 and 39 instead (which I tested and also work).
Comment: Now `rxvt.h` says that codes 39 and 49 (Rxvt_restoreFG and Rxvt_restoreBG) are deprecated, so 10 and 11 are the right choice.
Answer: Dynamic Colors is an example of dynamically switching colors.
It begins with using these two .Xresources:
xterm*dynamicColors: true
urxvt*dynamicColors: on

In spite of the lead, I have not gotten color changing working with urxvt though! This technique works great with xterm. Dynamic Colors calls these "OSC escape sequences" that alter the terminal.
The example to make the background red is: echo -e "\033]11;#ff0000\007".
Comment: For me the color of the background changes to red if I put this in the command line: `echo -e "\033]11;#ff0000\007"`
Answer: I have the following in my Xresources for quick switching (yes, it's based on dynamic colors).
URxvt*keysym.Control-Shift-F10: command:\033]11;#2c2c2c\007\033]10;#dcdcdc\007\033]12;#dcdcdc\007\033]4;0;#3f3f3f\007\033]4;1;#705050\007\033]4;2;#60b48a\007\033]4;3;#dfaf8f\007\033]4;4;#9ab8d7\007\033]4;5;#dc8cc3\007\033]4;6;#8cd0d3\007\033]4;7;#dcdcdc\007\033]4;8;#709080\007\033]4;9;#dca3a3\007\033]4;10;#72d5a3\007\033]4;11;#f0dfaf\007\033]4;12;#94bff3\007\033]4;13;#ec93d3\007\033]4;14;#93e0e3\007\033]4;15;#ffffff\007
URxvt*keysym.Control-Shift-F11: command:\033]11;#000000\007\033]10;#ffffff\007\033]12;#ffffff\007\033]4;0;#000000\007\033]4;1;#cc0000\007\033]4;2;#4e9a06\007\033]4;3;#c4a000\007\033]4;4;#3465a4\007\033]4;5;#75507b\007\033]4;6;#06989a\007\033]4;7;#d3d7cf\007\033]4;8;#555753\007\033]4;9;#ef2929\007\033]4;10;#8ae234\007\033]4;11;#fce94f\007\033]4;12;#729fcf\007\033]4;13;#ad7fa8\007\033]4;14;#34e2e2\007\033]4;15;#eeeeec\007
URxvt*keysym.Control-Shift-F12: command:\033]11;#000000\007\033]10;#a9a9a9\007\033]12;#a9a9a9\007\033]4;0;#000000\007\033]4;1;#cc0000\007\033]4;2;#00cc00\007\033]4;3;#cccc00\007\033]4;4;#0000cc\007\033]4;5;#cc00cc\007\033]4;6;#00cccc\007\033]4;7;#cccccc\007\033]4;8;#555555\007\033]4;9;#ff0000\007\033]4;10;#00ff00\007\033]4;11;#ffff00\007\033]4;12;#0000ff\007\033]4;13;#ff00ff\007\033]4;14;#00ffff\007\033]4;15;#ffffff\007

You can also take a look for another approach here: https://github.com/sos4nt/dynamic-colors
Answer: I wrote an extension called urxvt-theme that adds this functionality to rxvt-unicode (with a simple context menu) using X resources and dynamic colors.


Is it possible to handle 32-bit dependencies without adding foreign architecture to 64-bit Linux?

Question: I want to install an old 64-bit Linux program that depends on some old 32-bit libraries. I don't want to install these old libraries system-wide because other programs won't use them. Also, my package manager can't handle them because some of them are not available in the repositories (even if I add i386 architecture). How can I deal with odd libraries without messing my system? I don't want to add i386 architecture just for these libraries. Is there a workaround?
Answer:
old 64-bit Linux program that depends on some old 32-bit libraries

really?
Spin up a VM running the OS/distribution/version the code last ran on and start from there. You will likely have to do a lot of archaeology to sort out the dependencies.


Balance charging connection for 2 cell li-ion

Question: I am designing a circuit powered using two 18650 li ion cells in series, I will wish to charge it with an imax b6 charger with balance output. Is it enough to connect the 3 terminals of the charger to the batteries directly (one at -ve of bat1, one between the series connection and one at +ve of bat2)? Or any additional circuit is needed? Is it okay to charge while the circuit is powered?
Thanks.
Answer: The charger will need 5 connections, +ve and -ve charger outputs, and three to the balance port. I know the charger and the outer balance lines are duplicated at the battery, but they're required at the charger.
If you charge a battery that's also powering a load, the charger will misread the battery charge current, as it's not able to measure the load current. Depending on the load current, it may undercharge the battery, or report it faulty and refuse to charge it. Charge on load requires a charger that knows about the load.


Bounce processing is not switching the Primary email after marking an Email "On Hold"

Question: Our CiviCRM system has bounce processing setup.  It appears to be correctly pulling the emails from the mailbox we setup.  The issue is that once it marks a users profile as "On Hold", it is not automatically switching to a new Primary email.  As I understood bounce processing, there is a threshold number of bounces that gets reached before marking the email as "On Hold" and switching the Primary.  Am I missing a setting somewhere?  Is there a way to bulk update all the "On Hold" emails to their alternative emails (when available)?
Comment: "and switching the Primary". I don't believe this is automated
Comment: we found a similar logical impasse, namely if someone registers for an event, and uses a different email to their primary one (which might be on hold) the rego confirmation email goes to the Primary one (or not if it is on hold), not the one they actually added via the form. which i think we did a patch for https://github.com/civicrm/civicrm-core/pull/18984
Comment: sorry doesn't help with your 'how to modify in bulk', just the issue of 'on hold' rang a bell so i went digging to see what we had actually addressed
Answer: Not a simple solution, but the best I've found to this long-time annoyance. Using Searchkit, you can set up a saved search for contacts with a primary email on hold bounce, who have a second email address that is not on hold. Then use an unequal field transformation, so you'll only see the secondary email addresses that are different than the primary ones.

You can add a table which will sort these descending on the second email field, so you'll see the contacts with a viable second email on the top of the search results and with an edit in place column for Primary for the second email, so you can make the switch right on this table. Would be ideal if this happened automatically, but in the meantime, this is the least painful solution that I've found.


Is there a security threat to a Windows XP computer only being used as an analogue fax server?

Question: The XP computer is not directly connected to the internet.  However, it is on the LAN where it holds analogue faxes for manual processing by staff.  The other computers on the LAN are all Windows 10 computers.  The entire LAN is behind a 3rd party firewall.
Answer: Despite this XP machine is not directly accessible from the Internet and there might not be attack vectors through the analogue fax machines, being on the same LAN makes it a good target for lateral movement and gaining persistence on your network.
I'd put this XP machine on a separate VLAN and isolate it as much as possible i.e. only allow the mandatory access for this legacy functionality. That could be e.g.

deny access from the machine to the Internet.

this must be done on network level, as once someone is already inside he can modify the settings on the local machine

deny access from the machine to the LAN

there's no harm to assume it could be compromised

allow limited access from the LAN to the machine

only the ports absolutely required
IDS/IPS on the traffic, if possible
if someone gets limited access to any of the LAN computers, he could use this to gain full access on this vulnerable XP.
Comment: great, thanks.  We will swap it out for a windows 10 comp.  It is old anyway.  Thanks again for the answer.


Is there a case that random forest data (a bunch of trees) consumes MB or GB of memory?

Question: Is there any case that random forest (a bunch of trees) consumes too much memory in practice?
I'm wondering why my scikit-learn consumes large amount of memory.
Answer: In theory, it could consume any amount of memory.
You could use an infinite amount of trees.


Minimal matrix eigenvalue of matrices with the same structure

Question: My problem is to show that $$2\lambda_{min}(PA) \leq  \lambda_{min}((D-M)A) ,$$ where $A$ is arbitrary $nxn$ symmetric positive definite matrix and $P$ is diagonal matrix, which has $\frac{1}{nA_{ii}}$ on the $i$-th element on the diagonal and $D$ is diagonal matrix with $i$-th diagonal element equals to $2\sum_{j = 1}^n\frac{p_{ij}A_{jj}}{Det_{ij}}$ and $M$ is symmetric matrix with $M_{ij} = 2\frac{p_{ij}A_{ij}}{Det_{ij}}$, where $p_{ij}$ are probabilities with $p_{ii} = 0$  for all $i$,  $p_{ij} = \frac{1}{n(n-1)}$ for $i\neq j$, and $Det_{ij} = A_{ii}A_{jj} - A_{ij}^2$ for $i \neq j$, and $Det_{ii} = 1$ for all $i$. $A_{ij}$ corresponds to the element in the $i$-th row and $j$-th column. I tried many experiments and this statement always holds, even with some special cases $2$ can be substituted by arbitrary large constant, but I cannot get any theoretical proof.
Answer: (Edit. The OP has changed the question. This answer is no longer valid.)
The inequality doesn't hold in general. Consider the case where $P=A=I_3,\ p_{12}=p_{21}=\frac12$ and all other $p_{ij}$s are zero. Then $PA=I_3$ but $(D-M)A=$ is singular.
Comment: I edited question just for special case of uniform sampling on which I ran all the experiments. For general case, I only assume proper sampling, which I forgot to mention.


polarization of ordinary light, laser and photons of atomic transition

Question:
The light from thermal sources such as a light bulb is unpolarized but the one from a laser is polarized. Why?
Is a photon emitted in an atomic transition linearly or circularly polarized and a collection of such atoms are polarized in different directions making a beam of light unpolarized as whole?
Comment: I vote to close as too broad. Why ask two questions about very different subjects in the same post? Or is this homework?
Comment: @Pieter Not two questions. 2 is intimately related with 1.  The answer of 1 may be there in the answer of 2. See the answer by user591849
Answer: The fact is that not every lasers beam is substantially polarized.
When polarization occurs, is not intrinsically due to stimulated emission per se, but due to the specific medium and/or configuration. For instance you can pump a crystal which indeed act as a polarizer.
Further details are at https://www.rp-photonics.com/polarization_of_laser_emission.html
edit originally thought to answer to "why is laser polarized?".
I see the Q has been heavily edited. While the answer should fix Q1, for Q2 yes. Look at polarization just for a light beam anf thus as a collective property. (For an individual photon, quantum effects preclude having a well determined polarization, at least in a lasing sense).
 Polarization cannot emerge from an ensemble unless the latter is ordered and optically active.
Answer: In a typical external-cavity laser, the ends of the tube are sealed with Brewster windows, which pass linearly polarized light of one orientation much more efficiently than light of the other orientation.  The light that is passed by the Brewser windows is subsequently reflected back (by the cavity mirrors) into the tube through the same window.  As a result, the light that passes easily through the Brewster windows can be amplified while passing through the excited gas in the tube, so the emitted beam has the corresponding linear polarization.
If a gas laser does not have Brewster windows, but instead just has mirrors sealed directly to the ends of the tube, there is nothing to favor one polarization orientation over another, so light of all polarizations is amplified equally and the output beam is not polarized.  If a circular polarizer were included inside the cavity, the laser would emit circularly polarized light.
Thermal radiation such as that from an incandescent filament is normally not polarized.  Similarly, light emitted by hot gas with no fields present is not polarized.  However, if a magnetic or electric field is present, the field defines a direction.  The atoms or molecules in the hot gas tend to be oriented in the field direction - or sometimes perpendicular to the field direction-; and can then emit polarized light.
It's important to remember that quantum mechanics ensures that the polarization of an individual photon is usually not well determined.  It has a certain probability of having this polarization or that polarization, but both probabilities are usually finite unless something forces the polarization to have a definite state.  A free atom is unconstrained pretty much by definition, so emits light with no definite polarization state.  On the other hand, if there is a magnetic or electric field present, emitted light is likely to be polarized. In a collection of un-oriented atoms, there will be no definite polarization in their emitted light.
Answer:
The thermally excited atoms will emit photons with different phase and polarization. As a result the coherence of such sources is low to none.

The laser has a resonator two mirrors that confine the photons emitted initially as spontaneous emission. When an electron is in excited state and a photon comes the atom emits two photons with identical phases and polarization - stimulated emission. These two photons are reflected back by a mirror and become four.. Thus the beam consists of photons that are in phase mostly and with particular polarization.

The polarization is related to the behavior of the field vectors in the time domain. However single photons can also have polarization. Most natural are the left and right circular polarizations $\pm \hbar$. It is also widespread that photon can have linear polarization or might be a superposition of left and right circular.


What does the word "גֹּשֶׁן" mean?

Question: Reading this week's Torah portion (וַיִּגַּ֨שׁ), amongst the various storylines The Israelites moved and dwelt in the land of Goshen.  What does the name גֹּשֶׁן mean? Is there a connection between that and the name of this particular Parsha, וַיִּגַּ֨שׁ? Todah Rabbah.
Comment: Another approach connecting it to the word גוש https://www.jewishvirtuallibrary.org/goshen
Comment: There is definitely a connection, Yosef says that by settling down in Goshen, his family will be close to him (Ber25:10). Also, note Ber.25:4 when Yosef ask the brothers to get closer to him. This is the parsha of the reunion
Comment: @Eli83 Todah for that angle, I never thought to look at it like that.  I know I inspected the word used for that was קָרַב and I took that as the connection for the Haftarah (Ezekiel and the two sticks drawing near).
Comment: @Kazibácsi todah for that. With that possibility what role does the final Nun play in the meaning?
Answer: Following on from the comments, the parsha of Vayigash is so-called because the brothers "approached" Yosef. It represented the climax of their interaction with the 'grand reveal' of Yosef's identity.
It says in Bereishis 45:4:

וַיֹּ֨אמֶר יוֹסֵ֧ף אֶל־אֶחָ֛יו גְּשׁוּ־נָ֥א אֵלַ֖י וַיִּגָּ֑שׁוּ וַיֹּ֗אמֶר אֲנִי֙ יוֹסֵ֣ף אֲחִיכֶ֔ם אֲשֶׁר־מְכַרְתֶּ֥ם אֹתִ֖י מִצְרָֽיְמָה׃
Then Joseph said to his brothers, "Come forward to me." And when they came forward, he said, "I am your brother Joseph, he whom you sold into Egypt.

This approach was a התקרבות, a coming close to Yosef, as they experience an emotional reunion. It is precisely because they are now all back together, and in light of the famine etc. that Yosef seeks to relocate them to Egypt but specifically in their own locale - the land of Goshen.
It says in Bereishis 45:10:

וְיָשַׁבְתָּ֣ בְאֶֽרֶץ־גֹּ֗שֶׁן וְהָיִ֤יתָ קָרוֹב֙ אֵלַ֔י אַתָּ֕ה וּבָנֶ֖יךָ וּבְנֵ֣י בָנֶ֑יךָ וְצֹאנְךָ֥ וּבְקָרְךָ֖ וְכָל־אֲשֶׁר־לָֽךְ׃
You will dwell in the region of Goshen, where you will be near me—you and your children and your grandchildren, your flocks and herds, and all that is yours.

It is worth noting the Ishbitzer in Mei HaShiloach on the verse in Bereishis 47:27, which whilst speaking in a different context (i.e. that despite leaving the holiness of Eretz Yisroel behind, they were able to transpose a sense of kedusha to Egypt) he specifically translates the name Goshen as stemming from התקרבות - a drawing near:

וזה פירוש וישב ישראל בארץ מצרים בארץ גושן, היינו שאף בארץ מצרים היה קרוב להש"י והיה מקום מקודש, כי גושן היא לשון התקרבות.
And this is the explanation of "And Israel lived in the land of Egypt in the land of Goshen" - this means that even the land of Egypt was close to Hashem and was a sanctified place, because Goshen is an expression of "drawing near".

Indeed, this reunification of the 12 tribes had to happen and work in the societal structure and segregated land of Goshen. The verse in Bereishis 45:11 writes:

וְכִלְכַּלְתִּ֤י אֹֽתְךָ֙ שָׁ֔ם כִּי־ע֛וֹד חָמֵ֥שׁ שָׁנִ֖ים רָעָ֑ב פֶּן־תִּוָּרֵ֛שׁ אַתָּ֥ה וּבֵֽיתְךָ֖ וְכָל־אֲשֶׁר־לָֽךְ׃
There I will provide for you—for there are yet five years of famine to come—that you and your household and all that is yours may not suffer want.'

Rav Shimshon Raphael Hirsch here notes that the family of Yaakov would never have developed into a nation if they had stayed in Canaan. As the families would have grown and expanded, they would have become more scattered amongst the inhabitants, thereby risking assimilation and inter-marriage. However, by forcing them to living in an almost 'ghetto'-like existence in Goshen, they were spiritually and religiously guarded.
So the land of 'Goshen' not only helps to highlight that they drew close it actually was conceivably, the channel through which the combined nation could collectively and closely rise to fruition.
Comment: Can someone please clarify how is the word גושן related to התקרבות?
Comment: The word גשו or ויגש which is of a similar construct to the word גושן means to approach. When you approach someone you draw near to them.

What does the word "גֹּשֶׁן" mean?


Larger MS-DOS Img file?

Question: I am making an operating system based on ms-dos and using a program called win image to edit an  ms-dos .img file, the program only lets me inject at total size of 2.88mb worth of files
and i would like to inject an unlimited amount of files into my ms-dos based OS img file.
Answer: The 2.88 mb comes from a double density diskette. A normal diskette is 1.44 mb.
See if you can change the image type to something other than diskette, such as a Zipdrive disk (100 mb) or a Jazzdrive disk (1 gb).
Do note that msdos likely only can boot from either a harddisk image or a diskdrive image.
Comment: On a PC "double density" usually refers to diskettes up to 720k. 1.4Mb is high density and 2.8Mb is "extended" or "extra-high" density.

Larger MS-DOS Img file?


Symbol to denote a credulous consequence

Question: I have been trying to find the correct symbol to denote a credulous consequence. I've only been successful in finding the symbol for skeptical consequence, does a symbol for credulous consequence exist? If so, what is it?
Comment: Can you put the symbols you know into the answer as a table or chart? I'd be interested in learning more of what you are talking about
Answer: I believe you just use the standard symbol for consequence, the credulity is implied.  This should work, unless you happen to be working in a system that actually requires three differentiable types of consequence (skeptical, credulous, standard).
Answer: If there is no such symbol, one can be easily created by "inversion" of the existing symbol. If skeptical consequence is sc, then credulous consequence would be,-sc.  Or contact the "entity" responsible for the creation and standardization of symbols and request/propose the creation of such symbol.
Answer: You can use the same symbol because skeptical and credulous rely in the same principle: not formal demonstration or proof exist. The "consequences" (sic.) lies on probability heaven :)


GPIO serial Communication between Arduino Mega 2560 and raspi 3 b?

Question: My question is :
I know that GPIO is 3.3v in raspi , and mega IO pins is 5v.
In my case i want to send data serially from raspi to mega
so i will connect tx from raspi as output to rx in arduino as input.
if i do that without other connection just this , can i connect them directly ?
raspi will send 3.3v output and arduino will recieve it so i think no damage will occur in both devices and the arduino should detect it as HIGH ?
and i want to connect common ground between both devices ..
so what do u think ?
Answer: Note that most Arduinos work just fine when powered with 3.3V, although this is technically out of specification use. However, you only need to do something if you want bidirectional communication: sending a signal from a 3.3V device (such as a Pi) to a 5V device (Arduino) is a very common use case, and virtually all modern 5V devices have no trouble understanding 3.3V signals. Arduino has tons of addons featuring 3.3V ICs, and in many cases there are no level shifters on Arduino inputs of such addon boards.
Answer: You can quite safely connect a Pi GPIO output to an Arduino input.
It will probably work, although technically the logic level is marginal.
Level converters are readily available and cheap and can provide reliable bi-directional connection.
Comment: Good points - If you want to ensure that the signals are interpreted correctly and guarantee that no damage occurs (if you decided that to have the 5V Arduino output be sent to the 3.3V Pi input there will likely be hardware damage if you do not properly down-shift the voltage), just use the bi-directional logic level converters --- they are very inexpensive as well.


"Parting shot" origin

Question: Is there a connection betweem "a parting shot at the end of a discussion" and the Parthian horse archer practice of wheeling from the battle line and firing an arrow on the run?
Answer: (Sorry 'bout the wall of text, but this seems like a complicated one!)
tl;dr version: this seems like a sort of convergent evolution, two phrases coming from different roots but ending up close enough that they effectively gravitated together and merged as a single cliché. The key point: parting and Parthian each have earlier uses, quite distinct from each other, which convincingly lead up to parting/Parthian shot respectively.

The OED cites the figurative use of Parthian going back to c.1640, in the sense of fighting somewhat dishonestly, and in particular of attacking while retreating:

…To look upon this Parthian Fight / Of Love, still flying, or in chase, / Never encountering face to face.    —E. Waller, Phillis, 1640.

But the association of this style with the Parthians predates the figurative use:

Or like the Parthian I shall flying fight.    —Shakespeare, Cymbeline, 1518.

On the other hand, parting kiss and parting blow first appear in ?1570 and 1592 respectively, the latter used much like parting shot:

Thus much I must say for a parting blow.    — R. Greene, Quip for Vpstart Courtier. 1592.

Similar uses of parting continue through the 17th and 18th centuries; the earliest use of Parthian they give that directly parallels it is in 1842:

They have probably enough dealt a Parthian shot to British interests, by setting the Nacional once more upon its legs.    — The Times, April 20, 1842.

So it appears that parting blow was used in this sense significantly earlier; but also that Parthian was acquiring these associations independently, in e.g. the Cymbeline quote, well before the wording had converged enough that they would be likely to have influenced each other.  But it looks to me as though the existing parting blow/shot/shaft/etc. might well have influenced the later appearances of Parthian blow, etc.
However, the OED's etymologers themselves suggest an influence in the opposite direction, saying circumspectly (under the etymology of parting):

"In parting shot (see Compounds 1a) perhaps partly influenced by Parthian shot at Parthian adj. 2."

As Cubbi's and Mr. S & N's references show, though, it's possible to make arguments for influences in either direction, or for none at all.
Answer: Dictionaries seem to agree:
American Heritage Dictionary of Idioms: "This idiom apparently originated as a corruption of Parthian shot"
Collins English Dictionary: "Also called: Parthian shot"
Dictionary.com Unabridged based on Random House: "perhaps by folk etymology from Parthian shot"
Also, this post on phrases.org.uk gives a quote from "Fighting Words: From War, Rebellion, and other Combative Capers", saying "Most writers believe that this expression is a distortion of 'Parthian shot,' although there is no firm evidence to support this etymology"
Comment: I'll continue to research this one a bit from home, later. Usually, folk etymologies fail in the end so I'm also very suspicious of "Parthian shot." After all, the practice of hurling something at the enemy during retreat must be as old as combat itself.
Comment: @The Raven: I was very suspicious of it at first as well, for the same reason, but it looks here like it's not quite as erroneous as they sometimes are.
Answer: Wikipedia says that these two terms are distinct and unrelated. The Corpus of Historical American English shows no references to "parthian shot" before 1880 but does show "parting shot" before that.
Answer: I'm reading I, Claudius at the moment, in English, and he uses "Parthian shot". This does not appear to be a translator's choice as the context suggests the parthians.
Comment: Why would a translator be involved if you're reading "I, Claudius" in English?
Comment: The fact that Graves used the term in 1934 does not actually help in tracing a connection between *Parthian shot* and *parting shot.* If the context suggests the Parthians, then using *Partian shot* is natural.
Comment: @TmHart You can read this: https://meta.stackexchange.com/help/merging-accounts to merge https://english.stackexchange.com/users/252940/tmhart and https://english.stackexchange.com/users/252828/tmhart

"Parting shot" origin


switchee and regex

Question: I use in a EE site Structure and Low events. I need to use switchee but I can't find the correct regex for a date format like this: yyyy-mm
I use quit often this switchee regex: {case value="#^P(\d+)$#|''"} for paging but I just can't find it for I need: {case value="yyyy-mm|''"}
Answer: For a not too specific match try:
{case value="#\d{4}-\d{2}#"}

which would match 4 digits ( \d{4} ) then a dash ( - ) then 2 digits ( \d{2} ).
UPDATE:
Forgot about encoding brackets in switchee regex, one of these should work:
{case value="#\d\d\d\d-\d\d#"}

or
{case value="#\d{4|-\d{2|#"}

The second version replaces the brackets with { for { and | for } .
Comment: I'm afraid switchee does not accept this characters, { }, in the regex.
Comment: Thanks Romans, but what I want does work. On my first page with events it's working just perfect but if my URL is .../agenda/2014-11 I get a 404 page. I thought that Structure would work with switchee but it does not. Structure does understand the paging and when it's empty {case value="#^P(\d+)$#|''"} but not with a date yyyy-mm
Comment: What is the exact value of the variable you're using in switchee where it's not working: /agenda/2014-11 ?
Comment: I use Structure and LowEvents.
{exp:switchee variable="{segment_3}" parse="inward"}

{case value="#^P(\d+)$#|''"}

Listing agenda items by month. Structure ignore segment_3 is this one is a paging and I want structure to also ignore segment_3 if this one looks like yyyy-mm

{/case}

{case default="Yes"}

Detail agenda items. If segment_3 is not a paging, not empty and not somethings like yyyy-mm show the detail of one item

{/case}

switchee and regex


Why won't network links open in pdf documents from SharePoint 2016?

Question: We have multiple pdf documents in a SharePoint 2016 document library and we use Office Online Server.  Within the pdf documents are links to network files.  The pdf files open in a web browser (Edge Chromium and Chrome).  Clicking a link (points to a network file, word/excel document) in the pdf from the web browser does nothing.  The document never opens.  No errors.  No information in browser developer tools.  Opening the pdf in Adobe Acrobat Reader and then clicking a link to network files, opens the file.  Is SharePoint preventing the network link from opening the file?  Is Office Online Server preventing the network link from opening the file?  Is this a browser issue?
Answer: Modern browsers do not support the file:// protocol for security and sandboxing reasons. The solution would be to move those documents to cloud storage and re-link them.
Answer: Per my understanding, network links in PDF files are currently not supported to open.


Sound not working in Ubuntu 14.04LTS

Question: I have installed ubuntu 14.04 LTS dual boot with windows 8. Sound doesn't work in ubuntu. I checked all answers for all similar questions but nothing helped me.
I have an asus n-550jk notebook.
In sound settings I can see speakers and analog output.
In PulseAudio Volume Control I can see that the volume bar is changing but there is no sound.
In Output devices tab of PAVUcontrol there are DIgital Stereo HDMI (all unplugged) and Analog Stereo (ports Speakers and Analog Output). The volume bar for analog stereo is also working.
The output for lspci | grep -i 'audio' is:
 00:03.0 Audio device: Intel Corporation Xeon E3-1200 v3/4th Gen Core Processor HD Audio Controller (rev 06)

 00:1b.0 Audio device: Intel Corporation 8 Series/C220 Series Chipset High Definition Audio Controller (rev 05)

The output for aplay -l is:
 **** List of PLAYBACK Hardware Devices ****
 card 0: HDMI [HDA Intel HDMI], device 3: HDMI 0 [HDMI 0]
   Subdevices: 0/1
   Subdevice #0: subdevice #0

 card 0: HDMI [HDA Intel HDMI], device 7: HDMI 1 [HDMI 1]
   Subdevices: 1/1
   Subdevice #0: subdevice #0

 card 1: PCH [HDA Intel PCH], device 0: ALC668 Analog [ALC668 Analog]
   Subdevices: 0/1
   Subdevice #0: subdevice #0

I have alsa and pulseaudio installed.
Please help!
Answer: Since it seems to me that you have a dualboot setup this thread might have an answer to your problem.
Right here: No sound from laptop speakers in Ubuntu 14.04 after booting into Windows 8.1

Sound not working in Ubuntu 14.04LTS


monitor bandwidth on interface with tc or iptables

Question: I would like to log a warning message to /var/log/messages file if either ingress or egress bandwidth on eth0 interface is over a certain threshold. I could do this with a script which reads the value of /sys/devices/virtual/net/eth0/statistics/[rt]x_bytes file, stores the value, sleeps a second, reads those very same values again, calculates the amount of bits per second sent, compares the result with certain threshold and if higher, writes a message to /var/log/messages file. However, is there a smarter method? I mean for example with iptables or tc which could create a log message in case certain bandwidth threshold on interface is exceeded?
Comment: I haven't used it myself but I don't think `iptables -m limit` actually imposes limits by itself. I think it's just used for matching traffic according to rate. You may try to use it with `-j LOG` to see if it lets the activity happen and it just logs to syslog.
Comment: @Martin that was my main suggestion but looking at the man pages, it looks like there's a a "fuzzy logic controller" with a `--lower-limit` option that would allow you to `-j LOG` if traffic gets above a certain PPS. That would likely create a large volume of logs thereafter, though. It might put you in the right direction.
Comment: Are you open to averaging solutions like [`sysstat`/`sa`/`sar`](http://sebastien.godard.pagesperso-orange.fr/)?
Comment: @Bratchley IMHO this can not be achieved with `iptables` `limit` module. `limit` module seems to be suitable for logging relatively infrequent events. For example `iptables -I INPUT -p icmp -m limit --limit 1/s --limit-burst 1 -j LOG` would log all the ingress ICMP messages up to 1 log entry per second, i.e. even if more than one ICMP message per second is received, only one is logged. In a nutshell, `iptables -m limit` does not seem to be a correct tool for this. @Ulrich Schwarz as much as I tested with `sar`, it simply seems to parse `/proc` so this gives no additional value.
Comment: @Bratchley Thanks for this suggestion! However, `fuzzy` counts packets in second(pps) not bits in second(bps) and as I have packets with variable length, then this would not work for me. In addition, the way `fuzzy` module operates is not quite what I need- for example even if I could specify `--lower-limit 1Mbps` and `--upper-limit 10Mbps` and traffic is bit over 1Mbps, then only few of the 1Mbps violations are logged. If traffic peaks to 10Mbps, then almost all the violations are logged. `fuzzy` module seems to be for (D)DOS mitigation.
Answer: You can use vnstat with -tr option, then compare with threshold and write log if exceeded.
-tr time
 Calculate how much traffic goes through the selected interface during the giventimeseconds. Thetimewill be 5 seconds if a number parameter isn't included.

Answer: I finally found the solution which I was looking for. Iptables has rateest module which does exactly that. For example:
# collects all ingress traffic to RATEEST target
iptables -A INPUT -j RATEEST --rateest-name RE1 --rateest-interval 500.0ms --rateest-ewmalog 1s
# creates a log entry(jumps to LOG target) if rate is greater than 10Mbps
iptables -A INPUT -m rateest --rateest RE1 --rateest-gt --rateest-bps 10Mbps -j LOG --log-prefix "Ingress bandwidth >10Mbps "

Answer: netstat -i

Just for starters. Look at the headers for RX-OK and TX-OK. Set this up with cron and that's it.
#!/bin/bash
# Mar 2015
# Get bytes transmitted and received on eth0 and log msg.
echo " "
bytein=`netstat -i | grep eth0 | awk '{print $4 }'`
byteout=`netstat -i | grep eth0 | awk '{print $8 }'`
total=$((${bytein} + ${byteout}))
# echo "IN=$bytein, OUT=$byteout, TOTAL=$total"
max=1000000
outfile=/var/log/messages
msg="Bandwidth has exceeded $max bytes"
if [ $total -gt $max ]; then
    echo "$msg" >> $outfile
    echo $msg
fi

What's the big picture OP? I could see doing this for different users to limit their bandwidth, by why do this for the eth0 interface?
Comment: They're aware of how to get the information through a script, they're asking for a more standard and automatic way of doing it using common OS mechanisms rather than something they made themselves.
Comment: @Bratchley, it's using common OS mechanisms (kernel packet/byte counters) and it's not a particularly complicated script. That's a good use of the tools available. IMO, of course.
Comment: @roaima As **Bratchley** already mentioned, I would like to avoid scripts for this task as I need to keep those running in background in an endless loop. To be honest, I was fairly sure that such functionality is built into NetFilter or at least extensible with NetFilter modules. @user77853 `eth0` interface is dedicated for one VPN tunnel. However, as I mentioned in my initial post/question, I'm not looking for a script to log a warning message if either ingress or egress bandwidth on interface is over a certain threshold.


Harbor Breeze Ceiling fan lights flash after being on for about 10 minutes or so

Question: We have a Harbor Breeze ceiling fan that has been working perfectly for about 2-3 years. Now, whenever we turn the lights on they start to blink after approximately 10 minutes or so. We changed the bulbs to LED bulbs about a year ago, but it just started the "blinking" a couple months ago. Anyone have any suggestions?
Answer: Try changing one of the lamps back to incandescent. Some lamp controllers require a steady drain, and as the LED's or controller aged, it may have gotten more finicky. A low-wattage lamp should be fine, though it does reduce efficiency slightly.


Book last read in 2000 involving a boy named Zeek I think who was training to be a wizard and visits a dimension called the bazaar

Question: I am looking for a book I last read in around the year 2000.  It involved a boy who was training to be a wizard.  his name was Zeek or something like that.  He visits a dimension called the bazaar where people can buy anything for the right price.  He fights a person who uses magic rings.  I want to re-read this and can not remember the title. Any help would be appreciated.  Thank you
Comment: Might the name have been "[Skeeve](https://en.wikipedia.org/wiki/MythAdventures)"?
Comment: Wow!  That is it!  I was googling it and because I had the name wrong nothing would come up.  Glad someone out there knew what I was talking about...lol.  I had not remembered or realized that this book was part of a series.  It had been so long.  I just remembered that I liked the book.  With the answer provided I was able to easily find the book and I see there are a ton of them from the series for sale.  I will definitely be making sure to pick them up.  You made my day.  Thank you thank you!
Answer: If the character's name is Skeeve and his partner is named "Aahz" then you read one of Robert Lynn Asprin's Myth books, possibly Myth Directions which is the book that introduces Massha, another wizard who primarily fights with magic devices and as a result wears a lot of rings:

"You misunderstand me." Massha waved, fanning the air with a massive hand. "What I meant was, take off your disguises."
"Our disguises?" I blurted, swallowing hard.
In reply, she held aloft her left hand, the index finger extended for us to see. The third—no, it was the fourth—ring was blinking a brilliant purple.
"This little toy says you're not only magicians, you're disguised," she grinned. "Now, I'm as sociable as the next person but I like to see who I'm doing business with. In fact, I insist!"
As she spoke, the door behind us slammed shut and locked with an audible click.

Skeeve is Aahz' apprentice after his previous master (Garkin) was killed. In each book he learns a bit more magic, from creating fire, to levitation, disguise spells...

Most of the books involve a trip (or more) to the dimension "Deva" (where "Deevels" come from) where they visit the Bazaar, an endless souk where you can buy anything:

Anyway, there is a year-round, rock-the-clock Bazaar in that dimension where the Deveels meet to trade with each other. Everything imaginable and most things that aren't are available there. All you have to do is bargain with the Deveels. Fortunately, the Bazaar is large enough that there is much duplication, and sometimes you can play the dealers off against each other.
Comment: @FreeMan Ah, nice catch, thanks.  "Her" -> "he"
Comment: Another Q&A about the series  https://scifi.stackexchange.com/questions/147153/identify-a-story-about-a-teen-boy-who-learns-to-use-magic-with-his-lizard-compan?rq=1


Can I publish a piece of software as a research paper?

Question: I am currently working on a Unity 3D FPS game. and I was wondering if I write a detailed paper on what a made in a specific part and steps to replicate it like a documentation .Would it qualify to be a research paper considering I had to research a lot of topics mainly about unity engine to make it? and do I have to publish it in a journal or I just put it in a personal website/Blog?
Comment: An impressive, high-level and thorough tutorial. Well presented and clear. Teaching material perhaps at A-Level/undergraduate level for programmers.
Comment: It doesn't seem at all like a research paper. What would the "research question" be?
Comment: Does this answer your question? [Can open-source software be peer-reviewed and published?](https://academia.stackexchange.com/questions/143873/can-open-source-software-be-peer-reviewed-and-published)
Comment: What would u call this one : https://asawicki.info/Mirror/Car%20Physics%20for%20Games/Car%20Physics%20for%20Games.html
Comment: @Ian, certainly many things get published that aren't _research_. I don't think this question is a duplicate for that reason.
Comment: That's a valid point. I haven't thought of one yet but can it be something like  "How to create a Unity 3D FPS System" and if its not a research paper what can I call it.
Comment: Sounds more like a technical manual. A research paper has a hypothesis, null hypothesis, a model - at least in ideal conditions.
Comment: Ok. Thanks for the help
Comment: Almost perhaps a physics manual. Very useful in the right hands though.
Comment: Dear OP, my apologise for what may look like a very strong edit from my side, but I had to change the title of the question: given the description of your problem, it was misleading.
Comment: This does not seem to address the particular software that you have written, but for readers intrigued by the title, the [Journal of Open Source Software](https://joss.theoj.org/about) seems to be exactly the venue where one would publish software "as a research paper". Their stance is that research papers form the currency of academia, so for people who produce useful software, they need "research papers" and citations of those papers to earn comparable recognition.
Answer: Perhaps an old example will help clarify things. One of my professional interests (before retirement) was languages and compilers. One of the issues in some languages, like C, was, and remains, memory management. Some important programs can require more memory than the architecture provides, so memory needs to be recycled during execution. Some languages avoid the issue by using a run-time feature called garbage collection. This frees the programmer from making sure that memory is used efficiently. But efficiency is relative.
At one time, garbage collectors provided a benefit to the programmer but were very slow. One version resulted in measurable delays in the progress of a computation while the garbage collector took over the processor and returned now-unused memory to the pool of available locations. There was a great need for faster and non-disruptive garbage collectors and it was, for a few years an important research area. Even a small advance was considered enough to earn a student their doctorate.
But, research proceed as follows. A proposal would be made about the possible structure of a more efficient GC scheme. Then, the student would spend a year or so building an implementation and refining it. But that wasn't enough for the awarding of a degree or the publishing of "research papers", though they were clearly conducting research.
What resulted in the degree was the analysis of the behavior and efficiency of that implementation (or, more generally, the underlying algorithm) in a variety of useful cases. If the new software could be shown to be measurably and reliably more efficient than existing approaches, even by a small amount, say 3-5%, then the student would earn their degree, publish the results, and be praised by the language research community.
The dissertation was not the code listing of the garbage collector, though it would include at least some high level description of it (with source possibly available). The important part of the dissertation was the analysis that led one to treat the approach as superior. That was the research contribution.
If the software failed to show an advance, then the student went back to work, even though some valuable things might have been learned. In a few cases, it might have been possible to publish the fact that a certain "interesting" approach actually fails to work, but not a lot of that happened.
Short version: the software had to show a measurable and reliable advance over existing practice to be seen as a worthy contribution.
I'm guessing that what you have done has none of the above characteristics. It might be an interesting "case study" for someone wanting to do something similar and wanting some guidance in how to go about it, but as research it seems to be lacking that "advance over current practice" that is normally expected in software research.
Answer: A "research paper" is a document presenting some novelty to practitioners in a certain topic of a certain fields. (side note: counterintuitively, a review paper is also presenting some novelty: the review itself.)
Your question is if the product you build can be presented as a research paper. Of course, the product itself is a novelty and it can be presented in a scientific way.
However, the fact that it can be presented as a research paper does not automatically mean that it would be interesting to the research community.
The research paper goal is to share research results with researchers that may further build up on the tool itself.
Let's take the Python module called NumPy (Harris et al., 2020): it exists since almost two decades, it has been used intensively in the last two decades, but it has been presented in a research paper only in 2020.
Moreover, it is not even the NumPy itself presented, rather NumPy and its application (the title of the paper is "Array programming with NumPy"). But in the previous two decades there were user's guide, blog entries, technical notes about NumPy.
Try to look for software similar to yours, try to see if anyone published a paper (a research paper about DOOM? that would have been cool!) ... I guess your product can, in the best of the worlds, follow the NumPy way: available, manual published, 20 years later if succesfull finally published as a research paper.
Maybe someone will blend your FPS with a ML-driven robotic proton guns shooting at singular cancer cells, with the surgeon carefully checking the robotic gun job using 3d VR-glasses, who knows?
Ref.:
Harris, C.R., Millman, K.J., van der Walt, S.J. et al. Array programming with NumPy. Nature 585, 357–362 (2020). https://doi.org/10.1038/s41586-020-2649-2


Task Scheduler: Problem attempting to retrieve a task object

Question: I am using/learning the Windows Task Scheduler in win32 C++. I am attempting to retrieve a task object (for a task that exists) but it continually fails & returns the error COR_E_FILENOTFOUND 0x80070002 = The task does not exist
What do you think is going wrong? I know this task exists because I create it (& it does what its supposed to do, open an app at specified time).
Maybe the task name I use to retrieve the ITask object is not correct? The status (priority?) of the task I create is == 3 (if that info helps).
The code I use to create a task is exactly the same as the example code from msdn, the task name is "MyTaskSascha".
Is there anything wrong with my code to retrieve an existing task (I believe the task I am trying to retrieve is not considered "Running" but "Scheduled" so that maybe the problem?):
<code>bool RemoveTask( std::string taskName )
{
// Post:

ITaskScheduler  *taskSched = NULL;
ITask           *task      = NULL;
HRESULT         hr         = S_OK;
HRESULT         taskStatus = NULL;

LPCWSTR wTaskName;
wTaskName = L"MyTestSascha";

/// Initialise COM library & obtain Task Scheduler object

hr = CoInitialize( NULL );

if ( FAILED(hr) )
{
    printf( "Failed to coinitialise hresult \n" );
    return false;
}

hr = CoCreateInstance( CLSID_CTaskScheduler, NULL, CLSCTX_INPROC_SERVER,
                       IID_ITaskScheduler, (void**) &taskSched );

if ( FAILED(hr) )
{
    printf( "Failed to create instance \n" );
    CoUninitialize();
    return false;
}

/// Obtain task object

hr = taskSched -> Activate( wTaskName, IID_ITask, (IUnknown**) &task );
taskSched -> Release();

std::cout <<  wTaskName << std::endl;
printf( "%s \n", wTaskName );

if ( FAILED(hr) )
{
    // COR_E_FILENOTFOUND E_INVALIDARG E_OUTOFMEMORY SCHED_E_UNKNOWN_OBJECT_VERSION
    if      ( hr == 0x80070002 ) { std::cout << "The task does not exist \n"; }
    else if ( hr == 0x80000003 ) { std::cout << "The pwszName parameter is not valid \n"; }
    else if ( hr == 0x80070057 ) { std::cout << "A memory allocation failed \n"; }
    else if ( hr == 0x80041313 ) { std::cout << "The task object version is either unsupported or invalid \n"; }
    printf( "Failed retrieving task object %x \n", hr );
    CoUninitialize();
    return false;
}
</code>
Answer: You are creating the task using the Task Scheduler 2.0 API, but are trying to access it using the older 1.0 API.
The task scheduler and its COM API have been redesigned for Windows Vista, and the Task Scheduler 1.0 API cannot be used to access tasks that use the new interface (presumably because it uses a very different design that allows for a lot of new features). You can create a backward compatible task that can be accessed using this example code by selecting "Configure for: Windows Server 2003, Windows XP, or Windows 2000" when creating the task using the MMC snap-in, or presumably by creating it using the old API (I did not succeed in doing so in a simple test application, though). Tasks in the root folder work for me this way with or without the leading backslash; tasks in sub-folders do not seem to be accessible at all.
If you are not interested in compatibility with older Windows versions, you could just access the task using the new API.
MSDN examples exist for both API versions (note the top/bottom separation) and the new features relevant for developers are also listed there.


How do I fill in this hole in my ceiling around pull light?

Question: I recently had my bathroom done and a new light fitting was added. I have a hole left around it where the new light fitting is smaller than the previous one. How do I fill this in please?
Comment: Clarification - that's just the pull switch isn't it? It's not a translucent cover with a light inside?
Answer: You call the person who did it, and say "fix it". It would have been an easier job if they moved the switch four inches inwards, and then patched in a section of crown molding.
If it has to stay there - just get a load of mud (that's the American term), and smear it into the gap. It'll look ugly, but better than the big holes you have.
Comment: Problem is, once that fixture quits (hopefully in a few years if it is a decent LED, but electronics just sometimes die unexpectedly) mud or caulk or any other filler will be a pain to remove, clean up, repatch.... Far better to get it moved now.


BCrypt vs PBKDF2-SHA256

Question: I read that LastPass uses PBKDF2-SHA256 for storing the Master Password hash, I wonder how this compares to BCrypt and why did they chose this, as SHA256 is a quick hash (probably compensated by PKDF2?).
Comment: This is pretty much an open debate. Everybody has their own horse in the race. Some people recommend Argon2 because it won the PHC. Some people recommend scrypt because it's been around for long. Others love PBKDF2 because it is recommended by NIST and has FIPS implementations. My personal opinion is that with decently chosen parameters, I've never seen such a hash being cracked.
Comment: From what I saw they do 100100 iterations.  So while SHA-256 may be fast, that many iterations it's certainly not as fast.
Comment: Actually, both are bad since they don't have memory expansion like Scrypt and Argon2.
Comment: This discussion also seems relevant: https://security.stackexchange.com/questions/4781/do-any-security-experts-recommend-bcrypt-for-password-storage/6415#6415
Answer: I can tell you why we, 1Password, use PBKDF2 instead of a more modern successor. Quoting from the 1Password Security Design document,

The choice of PBKDF2-HMAC-SHA256 as our slow hash is largely a function
  of there being (reasonably) efficient implementations available for all
  of our clients. While we could have used a more modern password hashing
  scheme, any advantage of doing so would have been lost by how slowly it
  would run within JavaScript in most web browsers.
Because all of our key derivation is performed by the client (so that
  the server never needs to see the password) we are constrained in our
  choices by our least efficient client. The Makwa password hashing
  scheme\autocite{pornin:MAKWA}, however, is a possible road forward
  because it allows some of the computation to be passed to a server
  without revealing any secrets to that server.

Basically, we needed a slow KDF that would run efficiently in all clients, including our web client. And PBKDF2-H256 is the best that web crypto could offer.
I can't speak for LastPass, but I would suspect that their reasons are similar.
Slow hashing offers diminishing returns
While it would be nicer to move to a more modern slow hash, it is important to keep in mind that there are limits on what these can buy us. For example, if you have 100,000 rounds of PBKDF2, then to get the same strength increase to adding a randomly chosen digit to the end of your master password, you'd need to move to 1 million rounds. Maybe you are willing to wait a couple of seconds when unlocking your password manager, but you are also going to be sucking power from your battery on mobile devices.
So it is important to have a slow KDF, but we also reach a point where the effort should go into encouraging stronger master passwords. I wrote about this in Bcrypt is great but ...
I don't want to turn this into a sales pitch, but I should point out that as we've always understood the limits of slow hashing, we designed 1Password so that the data we hold on our servers is not vulnerable to such cracking. Our use of PBKDF2 (and the strength of your master password) is defends you if your encrypted 1Password data is stolen from your machines.
The mysterious future
I can't make any promises, but we are actively looking at WASM to get around these sorts of constraints. It turns out that there are challenges to safely integrating WebAssembly into web-apps and we haven't even begun any sort of performance testing.

BCrypt vs PBKDF2-SHA256


How much Bitcoin is needed to start a Lightning node?

Question: I've never used Lightning but can someone recommend how much Bitcoin I need to fund a Lightning node? I will be using the Eclair client.
Thanks
Answer: When you start using lightning, the minimum bitcoin you need is the cost of opening the channel + anything else you want in the channel.
The cost of opening the channel is equal to the fees you pay to send a transaction.
So as a minimum you will need:
the lowest fees you can get away with to send a transaction + the amount you want to put in the channel.
You can check out the lowest fees required from any number of services, for example earn.com's service is pretty popular - https://bitcoinfees.earn.com/
Answer: It would appear that the cost of funding a Lightning Network channel depends on the channel policy put in place by the Node you are attempting to open the channel with.
Different Nodes will have different minimum channel funding amounts.
You'll need to make sure you meet the minimum amount, and have enough balance left to cover the transaction fee. If you don't meet the minimum amount, you'll need to either increase your balance, or open a channel with a different node.
Heres an example where I try to open a channel for 30,000 Sats:
<code>./cli openchannel -node_key 03c2abfa93eacec04721c019644584424aab2ba4dff3ac9bdab4e9c97007491dda --local_amt 300000 --connect 18.104.22.168:9735
[lncli] rpc error: code = Code(199) desc = chan size of 0.003 BTC is below min chan size of 0.01 BTC
</code>
You can see the channel open request fails because I don't meet the minimum remote node policy. So I try again with a different node, using the same 300,000 Sat initial funding amount:
<code>./cli openchannel --node_key 033e9ce4e8f0e68f7db49ffb6b9eecc10605f3f3fcb3c630545887749ab515b9c7 --local_amt 300000 --connect 18.104.22.168:9735
{
    "funding_txid": "8ee38af1fd4a226e578887272d2ceeff655ab7269lb55b7307ff7b25fd05c5"
}
</code>
Success!


Mobile Device Testing

Question: We are currently testing a new website on device. However I believe we could test by operating system version and Prominent browser instead. Has anyone else tried this approach rather than testing on every device?
Comment: What exactly are you looking to get from the community here? Can you give more details?
Answer: I guess to minimize risks, but limit mobile testing to a limited number of devices.
I would test on something like:

Each different Mobile OS version still in use significantly
Latest major browser versions on those OS's
Most used resolutions of Mobile devices

Still I would wonder how much more confidence I would get when testing with more devices. Maybe a shortlist would be enough.
I would create a shortlist based on last 3 months data from http://gs.statcounter.com/

Screen resolution
Browser version
Operating system
Answer: We tried to base our Android tests on marketing surveys, the results were mixed.
To begin with a marketing name like 'Nokia 6210' is not good enough, you need a specific model ID since hardware and software have significant variations.
Then we found, as expected, that the market is highly segregated- each model has a really small percentage of market share, and it's far from being statistically significant to choose between a 1.12% (of market share) device and 1.43%.
But at the end you don't have another, better, choice. There are hundreds of sub models, sub OS and browser versions putting a huge price tag on testing, even if you use this or that virtual, remote test services
Answer: Testing for all devices is difficult thing. But you can test your app by checking different OS version-wise.
If you looking to test on different devices you use third party service provider for cloud device.
Try for Testdroid/Bitbar, here you can get free devices for Manual Testing too.

Mobile Device Testing


Taxonomy dropdown metabox in the back-end

Question: I've created custom taxonomy called Brands and made it hierarchical so I can add Car brands and models there and keep their relations, like this:

Ford

Mustang
Mondeo
Focus

Problem is, this list might get pretty long and only one brand and one model is needed per post, so checkboxes are misleading.
I'm thinking to split that metabox in to two (one for brand and one for model) and make them dropdowns. So when brand is selected in the first dropdown, second dropdown would show only models related to that brand. But i have no idea how to code it. Maybe anyone could show me an example?
Answer: Here is an example. I have also created a Gist with more generic code.
add_action('add_meta_boxes', 'my_custom_metabox');
function my_custom_metabox() {
    add_meta_box('custom-taxonomy-dropdown','Brands','taxonomy_dropdowns_box','post','side','high');
}

function taxonomy_dropdowns_box( $post ) {
    wp_nonce_field('custom-dropdown', 'dropdown-nonce');
    $terms = get_terms( 'brands', 'hide_empty=0');
    $object_terms = wp_get_object_terms( $post->ID, 'brands', array('fields'=>'ids'));

    // you can move the below java script to admin_head
?>

    <?php
    echo "Brand:";
    echo "<select id='custombrandoptions' name='custombrands[]'>";
    echo "<option value='0'>None</option>";
    foreach ( $terms as $term ) {
        if ( $term->parent == 0) {
            if ( in_array($term->term_id, $object_terms) ) {
                $parent_id = $term->term_id;
                echo "<option value='{$term->term_id}' selected='selected'>{$term->name}</option>";
            } else {
                echo "<option value='{$term->term_id}'>{$term->name}</option>";
            }
        }
    }
    echo "</select>
";
    echo "
";
    echo "Models:";
    echo "<select id='custommodeloptions' name='custombrands[]'>";
    if ( isset( $parent_id)) {
        $models = get_terms( 'brands', 'hide_empty=0&child_of='.$parent_id);
        foreach ( $models as $model ) {
             if ( in_array($model->term_id, $object_terms) ) {
                echo "<option value='{$model->term_id}' selected='selected'>{$model->name}</option>";
            } else {
                echo "<option value='{$model->term_id}'>{$model->name}</option>";
            }
        }
    }
    echo "</select>";
    echo "
";
}

add_action('save_post','save_my_custom_taxonomy');
function save_my_custom_taxonomy( $post_id ) {
    if ( defined('DOING_AUTOSAVE') && DOING_AUTOSAVE )
        return;

    if ( !wp_verify_nonce($_POST['dropdown-nonce'], 'custom-dropdown'))
        return;

    $brands = array_map('intval', $_POST['custombrands']);
    wp_set_object_terms($post_id, $brands, 'brands');
}

add_action('wp_ajax_get_brand_models', 'get_brand_models');
function get_brand_models() {
    check_ajax_referer('custom-dropdown', 'dropdown-nonce');
    if (isset($_POST['custombrand'])) {
        $models = get_terms( 'brands', 'hide_empty=0&child_of='. $_POST['custombrand']);
        echo "<option value='0'>Select one</option>";
        foreach ($models as $model) {
            echo "<option value='{$model->term_id}'>{$model->name}</option>";
        }
    }
    die();
}

Comment: @Hameedullah pretty heavy stuff hameedullah, great job nonetheless. +1
Comment: @Hameedullah very nice. But I have a problem with it. I pasted all this code to my functions.php and when I go to the post back-end, I get this:
**Warning:** _define() expects at least 2 parameters, 1 given in_ (pointing to this line of code: `if ( define('DOING_AUTOSAVE') && DOING_AUTOSAVE )`).
Comment: please change define to defined e.g `if ( defined('DOING_AUTOSAVE') && DOING_AUTOSAVE ))`
Comment: @Hameedullah this is great, thanks for solution :)
Comment: was excited to find this snippet and tried it on site. I am using it on a custom post-type, not posts, but do not see the metabox. are there steps needed to make this work on other post-types? ..I did change the tax name to my custom taxonomy, only using this for single tax, not multi like the original person requested
Comment: have you specified your custom post type in add_meta_box? Its the 4th argument.
Comment: Somehow I missed that one. Thanks. By any chance do you happen to have a version of this that works for a single dropdown choice? I have a simple non-hierarchical taxonomy 'speaker'. I will try editing out what is not needed in this function, though I'm not certain I will be able to nail it. Will try hard though. I could ask it in another question if that is best
Comment: Yes, a another question is the right way if you think you won't be able to do it yourself.
Comment: @Hameedullah Khan
Thank you so much, your code works like a charm! I even could to modify it to work with three levels taxonomy tree (3 drop-downs). I just miss a simple loading indicator beside the field when retrieving the drop-down values, which improves the user experience. Could that be easily added? I would appreciate if you, or anyone else, guided me. Thanks!
Comment: @Mamouneyya Please do not use answers for discussion. You will be able to leave comments when you gain some reputation on site.